]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Check that openssl has ECC support during configure
authorSebastian Hahn <sebastian@torproject.org>
Sat, 19 Sep 2015 14:36:55 +0000 (16:36 +0200)
committerNick Mathewson <nickm@torproject.org>
Tue, 22 Sep 2015 12:36:28 +0000 (08:36 -0400)
This allows builds on machines with a crippled openssl to fail early
during configure. Bugfix on 0.2.7.1-alpha, which introduced the
requirement for ECC support. Fixes bug 17109.

changes/bug17109 [new file with mode: 0644]
configure.ac

diff --git a/changes/bug17109 b/changes/bug17109
new file mode 100644 (file)
index 0000000..9f80f6e
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Fail during configure if we're trying to build against an OpenSSL
+      built without ECC support. Fixes bug 17109, bugfix on
+      0.2.7.1-alpha which started requiring ECC.
index bf818ac4eb137ec441d88421d374d6e21dcf07f6..2220c18fdb6db686c875192ab3aac28b6abf2efe 100644 (file)
@@ -642,6 +642,19 @@ AC_TRY_COMPILE([
    [ : ],
    [ AC_ERROR([OpenSSL is too old. We require 1.0.0 or later. You can specify a path to a newer one with --with-openssl-dir.]) ])
 
+AC_TRY_COMPILE([
+#include <openssl/opensslv.h>
+#include <openssl/evp.h>
+#if defined(OPENSSL_NO_EC) || defined(OPENSSL_NO_ECDH) || defined(OPENSSL_NO_ECDSA)
+#error "no ECC"
+#endif
+#if !defined(NID_X9_62_prime256v1) || !defined(NID_secp224r1)
+#error "curves unavailable"
+#endif
+   ], [],
+   [ : ],
+   [ AC_ERROR([OpenSSL is built without full ECC support, including curves P256 and P224. You can specify a path to one with ECC support with --with-openssl-dir.]) ])
+
 AC_CHECK_MEMBERS([struct ssl_method_st.get_cipher_by_char], , ,
 [#include <openssl/ssl.h>
 ])