diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-02-01 10:39:59 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-02-01 10:39:59 -0500 |
commit | 24551d64ad98f88977b81fd8df26837772f2902c (patch) | |
tree | 01e95166cfec7df9da38cbc6477074eea611e002 /src | |
parent | f1530d0e5a66f61c1d9f287cf0ae79f377b7d026 (diff) | |
parent | b928095afc757ab8616642b48e3f22a0b39520b9 (diff) | |
download | tor-24551d64ad98f88977b81fd8df26837772f2902c.tar.gz tor-24551d64ad98f88977b81fd8df26837772f2902c.zip |
Merge branch 'maint-0.2.9'
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test_tortls.c | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c index e2fee813bf..4bfcea211d 100644 --- a/src/test/test_tortls.c +++ b/src/test/test_tortls.c @@ -38,9 +38,11 @@ ENABLE_GCC_WARNING(redundant-decls) #include "log_test_helpers.h" #define NS_MODULE tortls -#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0) \ - && !defined(LIBRESSL_VERSION_NUMBER) +#ifndef HAVE_SSL_STATE #define OPENSSL_OPAQUE +#endif + +#if defined(OPENSSL_OPAQUE) && !defined(LIBRESSL_VERSION_NUMBER) #define SSL_STATE_STR "before SSL initialization" #else #define SSL_STATE_STR "before/accept initialization" @@ -723,6 +725,26 @@ test_tortls_get_my_certs(void *ignored) (void)1; } +#ifndef HAVE_SSL_GET_CLIENT_CIPHERS +static SSL_CIPHER * +get_cipher_by_name(const char *name) +{ + int i; + const SSL_METHOD *method = SSLv23_method(); + int num = method->num_ciphers(); + + for (i = 0; i < num; ++i) { + const SSL_CIPHER *cipher = method->get_cipher(i); + const char *ciphername = SSL_CIPHER_get_name(cipher); + if (!strcmp(ciphername, name)) { + return (SSL_CIPHER *)cipher; + } + } + + return NULL; +} +#endif + #ifndef OPENSSL_OPAQUE static void test_tortls_get_ciphersuite_name(void *ignored) @@ -742,23 +764,6 @@ test_tortls_get_ciphersuite_name(void *ignored) } static SSL_CIPHER * -get_cipher_by_name(const char *name) -{ - int i; - const SSL_METHOD *method = SSLv23_method(); - int num = method->num_ciphers(); - for (i = 0; i < num; ++i) { - const SSL_CIPHER *cipher = method->get_cipher(i); - const char *ciphername = SSL_CIPHER_get_name(cipher); - if (!strcmp(ciphername, name)) { - return (SSL_CIPHER *)cipher; - } - } - - return NULL; -} - -static SSL_CIPHER * get_cipher_by_id(uint16_t id) { int i; |