wolfSSL_SecureResume() should be client only. Return an error if called

form the server.
This commit is contained in:
John Safranek
2019-03-01 11:00:26 -08:00
parent 65c72ddfe1
commit 020b27bab2

View File

@ -2417,6 +2417,8 @@ int wolfSSL_Rehandshake(WOLFSSL* ssl)
}
#ifndef NO_WOLFSSL_CLIENT
/* do a secure resumption handshake, user forced, we discourage */
int wolfSSL_SecureResume(WOLFSSL* ssl)
{
@ -2425,6 +2427,14 @@ int wolfSSL_SecureResume(WOLFSSL* ssl)
WOLFSSL_ENTER("wolfSSL_SecureResume()");
if (ssl == NULL)
return BAD_FUNC_ARG;
if (ssl->options.side == WOLFSSL_SERVER_END) {
ssl->error = SIDE_ERROR;
return SSL_FATAL_ERROR;
}
session = wolfSSL_get_session(ssl);
ret = wolfSSL_set_session(ssl, session);
session = NULL;
@ -2434,6 +2444,8 @@ int wolfSSL_SecureResume(WOLFSSL* ssl)
return ret;
}
#endif /* NO_WOLFSSL_CLIENT */
#endif /* HAVE_SECURE_RENEGOTIATION */
/* Session Ticket */