diff options
author | Richard Levitte <levitte@openssl.org> | 2018-12-12 23:57:48 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-03-06 11:15:13 +0100 |
commit | 77359d22c97d1636eccf1fa583dc295228835144 (patch) | |
tree | 00edc17ddeb1ceca9828151e89c009d9863b14fd /ssl/statem | |
parent | Adapt SSL_DEBUG to the new generic trace API (diff) | |
download | openssl-77359d22c97d1636eccf1fa583dc295228835144.tar.xz openssl-77359d22c97d1636eccf1fa583dc295228835144.zip |
Adapt CIPHER_DEBUG to the new generic trace API
Co-authored-by: Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8198)
Diffstat (limited to 'ssl/statem')
-rw-r--r-- | ssl/statem/statem_srvr.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index bf1819d356..e482e2d074 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -23,6 +23,7 @@ #include <openssl/dh.h> #include <openssl/bn.h> #include <openssl/md5.h> +#include <openssl/trace.h> #define TICKET_NONCE_SIZE 8 @@ -1835,15 +1836,15 @@ static int tls_early_post_process_client_hello(SSL *s) j = 0; id = s->session->cipher->id; -#ifdef CIPHER_DEBUG - fprintf(stderr, "client sent %d ciphers\n", sk_SSL_CIPHER_num(ciphers)); -#endif + OSSL_TRACE_BEGIN(TLS_CIPHER) { + BIO_printf(trc_out, "client sent %d ciphers\n", + sk_SSL_CIPHER_num(ciphers)); + } for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++) { c = sk_SSL_CIPHER_value(ciphers, i); -#ifdef CIPHER_DEBUG - fprintf(stderr, "client [%2d of %2d]:%s\n", - i, sk_SSL_CIPHER_num(ciphers), SSL_CIPHER_get_name(c)); -#endif + if (trc_out != NULL) + BIO_printf(trc_out, "client [%2d of %2d]:%s\n", i, + sk_SSL_CIPHER_num(ciphers), SSL_CIPHER_get_name(c)); if (c->id == id) { j = 1; break; @@ -1857,8 +1858,10 @@ static int tls_early_post_process_client_hello(SSL *s) SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, SSL_R_REQUIRED_CIPHER_MISSING); + OSSL_TRACE_CANCEL(TLS_CIPHER); goto err; } + OSSL_TRACE_END(TLS_CIPHER); } for (loop = 0; loop < clienthello->compressions_len; loop++) { |