]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Survive fedora's openssl in our benchmarks
authorNick Mathewson <nickm@torproject.org>
Fri, 7 Feb 2014 22:36:11 +0000 (17:36 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 7 Feb 2014 22:36:11 +0000 (17:36 -0500)
Apparently fedora currently has ECDH but not P224. This isn't a huge
deal, since we no longer use OpenSSL's P224 ever (see #9780 and
72c1e5acfe1c6). But we shouldn't have segfaulting benchmarks really.

Fixes bug 10835; bugfix on 0.2.4.8-alpha.

changes/bug10835 [new file with mode: 0644]
src/test/bench.c

diff --git a/changes/bug10835 b/changes/bug10835
new file mode 100644 (file)
index 0000000..9df7bdd
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (testing):
+    - Fix a segmentation fault in our benchmark code when running with
+      Fedora's OpenSSL package, or any other OpenSSL that provides
+      ECDH but not P224. Fixes bug 10835; bugfix on 0.2.4.8-alpha.
index 5a8d21d1739a83f47e7bea5d610fda65ec1b588a..706b8bc7fb67d9f0aaae5914f97f43fde9ae97b0 100644 (file)
@@ -440,6 +440,10 @@ bench_ecdh_impl(int nid, const char *name)
     ssize_t slen_a, slen_b;
     EC_KEY *dh_a = EC_KEY_new_by_curve_name(nid);
     EC_KEY *dh_b = EC_KEY_new_by_curve_name(nid);
+    if (!dh_a || !dh_b) {
+      puts("Skipping.  (No implementation?)");
+      return;
+    }
 
     EC_KEY_generate_key(dh_a);
     EC_KEY_generate_key(dh_b);