forked from wolfSSL/wolfssl
wolfSSL_SecureResume() should be client only. Return an error if called
form the server.
This commit is contained in:
12
src/ssl.c
12
src/ssl.c
@ -2417,6 +2417,8 @@ int wolfSSL_Rehandshake(WOLFSSL* ssl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NO_WOLFSSL_CLIENT
|
||||||
|
|
||||||
/* do a secure resumption handshake, user forced, we discourage */
|
/* do a secure resumption handshake, user forced, we discourage */
|
||||||
int wolfSSL_SecureResume(WOLFSSL* ssl)
|
int wolfSSL_SecureResume(WOLFSSL* ssl)
|
||||||
{
|
{
|
||||||
@ -2425,6 +2427,14 @@ int wolfSSL_SecureResume(WOLFSSL* ssl)
|
|||||||
|
|
||||||
WOLFSSL_ENTER("wolfSSL_SecureResume()");
|
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);
|
session = wolfSSL_get_session(ssl);
|
||||||
ret = wolfSSL_set_session(ssl, session);
|
ret = wolfSSL_set_session(ssl, session);
|
||||||
session = NULL;
|
session = NULL;
|
||||||
@ -2434,6 +2444,8 @@ int wolfSSL_SecureResume(WOLFSSL* ssl)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* NO_WOLFSSL_CLIENT */
|
||||||
|
|
||||||
#endif /* HAVE_SECURE_RENEGOTIATION */
|
#endif /* HAVE_SECURE_RENEGOTIATION */
|
||||||
|
|
||||||
/* Session Ticket */
|
/* Session Ticket */
|
||||||
|
Reference in New Issue
Block a user