From ada5ff876a7e9ecee27941491f8eb9247669edda Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 29 Apr 2015 17:06:57 -0700 Subject: [PATCH] allow example client to do resume with scr --- examples/client/client.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 92aa658d9..cc49afe85 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -774,13 +774,6 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) printf("not doing secure renegotiation on example with" " nonblocking yet"); } else { - #ifndef NO_SESSION_CACHE - if (resumeSession) { - session = wolfSSL_get_session(ssl); - wolfSSL_set_session(ssl, session); - resumeSession = 0; /* only resume once */ - } - #endif if (wolfSSL_Rehandshake(ssl) != SSL_SUCCESS) { int err = wolfSSL_get_error(ssl, 0); char buffer[WOLFSSL_MAX_ERROR_SZ]; @@ -862,6 +855,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) tcp_connect(&sockfd, host, port, 0); } wolfSSL_set_fd(sslResume, sockfd); +#ifdef HAVE_SECURE_RENEGOTIATION + if (scr) { + if (wolfSSL_UseSecureRenegotiation(sslResume) != SSL_SUCCESS) + err_sys("can't enable secure renegotiation"); + } +#endif wolfSSL_set_session(sslResume, session); #ifdef HAVE_SESSION_TICKET wolfSSL_set_SessionTicket_cb(sslResume, sessionTicketCB,