]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Bug 19406: Fix the unit tests to work with OpenSSL 1.1.x
authorYawning Angel <yawning@schwanenlied.me>
Tue, 14 Jun 2016 06:24:13 +0000 (06:24 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 14 Jun 2016 16:13:09 +0000 (12:13 -0400)
Just as it says on the tin.  Don't need to fully disable any tests and
reduce coverage either.  Yay me.

src/test/test_tortls.c

index 973e727b46d948fccbbc6a110256cb9a293250ad..b9b74a1e967877b642331b6a66715f9b1e063aa4 100644 (file)
@@ -385,10 +385,12 @@ test_tortls_log_one_error(void *ignored)
                         LOG_WARN, 0, NULL);
   expect_log_severity(LOG_INFO);
 
+#ifndef OPENSSL_1_1_API
   mock_clean_saved_logs();
   tor_tls_log_one_error(tls, ERR_PACK(1, 2, SSL_R_RECORD_TOO_LARGE),
                         LOG_WARN, 0, NULL);
   expect_log_severity(LOG_INFO);
+#endif
 
   mock_clean_saved_logs();
   tor_tls_log_one_error(tls, ERR_PACK(1, 2, SSL_R_UNKNOWN_PROTOCOL),
@@ -683,7 +685,7 @@ test_tortls_get_my_client_auth_key(void *ignored)
   crypto_pk_t *ret;
   crypto_pk_t *expected;
   tor_tls_context_t *ctx;
-  RSA *k = tor_malloc_zero(sizeof(RSA));
+  RSA *k = RSA_new();
 
   ctx = tor_malloc_zero(sizeof(tor_tls_context_t));
   expected = crypto_new_pk_from_rsa_(k);
@@ -698,8 +700,8 @@ test_tortls_get_my_client_auth_key(void *ignored)
   tt_assert(ret == expected);
 
  done:
+  RSA_free(k);
   tor_free(expected);
-  tor_free(k);
   tor_free(ctx);
 }