aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_tortls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-05-02 08:18:48 -0400
committerNick Mathewson <nickm@torproject.org>2018-05-02 08:22:05 -0400
commit75f3fbaa3c7316fcef3509ef1e3813b94d8c4c8a (patch)
tree4546aa6dc9ae1f1d47431535d0569832b260df06 /src/test/test_tortls.c
parent34e7dca9c9e902a58fe8942cef666f1d99d06030 (diff)
downloadtor-75f3fbaa3c7316fcef3509ef1e3813b94d8c4c8a.tar.gz
tor-75f3fbaa3c7316fcef3509ef1e3813b94d8c4c8a.zip
LibreSSL compatibility fixes.
LibreSSL, despite not having the OpenSSL 1.1 API, does define OPENSSL_VERSION in crypto.h. Additionally, it apparently annotates some functions as returning NULL, so that our unit tests need to be more careful about checking for NULL so they don't get compilation warnings. Closes ticket 26006.
Diffstat (limited to 'src/test/test_tortls.c')
-rw-r--r--src/test/test_tortls.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index 47455cff83..5028a95400 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -840,8 +840,10 @@ test_tortls_classify_client_ciphers(void *ignored)
sk_SSL_CIPHER_zero(ciphers);
one = get_cipher_by_name("ECDHE-RSA-AES256-GCM-SHA384");
+ tt_assert(one);
one->id = 0x00ff;
two = get_cipher_by_name("ECDHE-RSA-AES128-GCM-SHA256");
+ tt_assert(two);
two->id = 0x0000;
sk_SSL_CIPHER_push(ciphers, one);
tls->client_cipher_list_type = 0;
@@ -912,6 +914,7 @@ test_tortls_client_is_using_v2_ciphers(void *ignored)
ciphers = sk_SSL_CIPHER_new_null();
SSL_CIPHER *one = get_cipher_by_name("ECDHE-RSA-AES256-GCM-SHA384");
+ tt_assert(one);
one->id = 0x00ff;
sk_SSL_CIPHER_push(ciphers, one);
sess->ciphers = ciphers;