[hipl-commit] [trunk] Rev 3880: removed ecdsa config option and solved it in the code

  • From: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Tue, 9 Mar 2010 18:45:54 +0200

Committer: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx>
Date: Tue Mar 09 17:45:35 2010 +0100
Revision: 3880
Revision-id: rene.hummen@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  removed ecdsa config option and solved it in the code

Modified:
  M  configure.ac
  M  test/auth_performance.c

=== modified file 'configure.ac'
--- configure.ac        2010-03-09 15:58:14 +0000
+++ configure.ac        2010-03-09 16:45:35 +0000
@@ -325,19 +325,6 @@
     AC_SUBST(GPROF_CFLAGS, "-pg")
 fi
 
-AC_ARG_ENABLE(ecdsa,
-               AC_HELP_STRING([--enable-ecdsa],
-                              [compile in ecdsa support (default is NO)]),
-               [ac_cv_use_ecdsa=$enableval],
-               [ac_cv_use_ecdsa=no])
-AC_CACHE_CHECK([whether to use ecdsa support],
-               [ac_cv_use_ecdsa],
-               [ac_cv_use_ecdsa=no])
-if test x"$ac_cv_use_ecdsa" = x"yes"; then
-    AC_DEFINE(CONFIG_HIP_ECDSA)
-    AH_TEMPLATE(CONFIG_HIP_ECDSA, [Defined to 1 if ECDSA support is enabled.])
-fi
-
 AC_ARG_ENABLE(debug,
                AC_HELP_STRING([--enable-debug],
                               [Enable debug (default is YES)]),

=== modified file 'test/auth_performance.c'
--- test/auth_performance.c     2010-02-18 13:36:05 +0000
+++ test/auth_performance.c     2010-03-09 16:45:35 +0000
@@ -22,9 +22,11 @@
 
 #include "lib/core/hip_statistics.h"
 #include "lib/core/crypto.h"
-#ifdef CONFIG_HIP_ECDSA
+
+// only use ecdsa when available
+#if defined OPENSSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER > 0x0090800fL
 #include <openssl/ecdsa.h>
-#endif /* CONFIG_HIP_ECDSA  */
+#endif
 
 #define PACKET_LENGTH 1280
 
@@ -97,10 +99,10 @@
     DSA *dsa_key_pool[key_pool_size];
     DSA_SIG *dsa_sig_pool[num_measurements];
 
-#ifdef CONFIG_HIP_ECDSA
+#if defined OPENSSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER > 0x0090800fL
     EC_KEY *ecdsa_key_pool[key_pool_size];
     ECDSA_SIG *ecdsa_sig_pool[num_measurements];
-#endif /* CONFIG_HIP_ECDSA  */
+#endif
 
     hip_set_logdebug(LOGDEBUG_NONE);
 
@@ -440,7 +442,7 @@
 #endif
 
 
-#ifdef CONFIG_HIP_ECDSA
+#if defined OPENSSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER > 0x0090800fL
     printf("\n-------------------------------\n"
            "ECDSA performance test\n"
            "-------------------------------\n");
@@ -486,7 +488,8 @@
             printf("%i. ecdsa signature: %.3f ms\n", i + 1, timediff / 1000.0);
         }
     }
-#endif /* CONFIG_HIP_ECDSA  */
+#endif
+
 #if 0
     calc_statistics(&creation_stats, &num_items, &min, &max, &avg, &std_dev,
                     STATS_IN_MSECS);

Other related posts: