mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
sessionSecretCb should only be called when a ticket is present
This commit is contained in:
@@ -24636,8 +24636,12 @@ static int HashSkeData(WOLFSSL* ssl, enum wc_HashType hashType,
|
||||
|
||||
#ifdef HAVE_SECRET_CALLBACK
|
||||
/* If a session secret callback exists, we are using that
|
||||
* key instead of the saved session key. */
|
||||
ret = ret || (ssl->sessionSecretCb != NULL);
|
||||
* key instead of the saved session key. Requires a ticket. */
|
||||
ret = ret || (ssl->sessionSecretCb != NULL
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
&& ssl->session->ticketLen > 0
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
@@ -24984,7 +24988,11 @@ static int HashSkeData(WOLFSSL* ssl, enum wc_HashType hashType,
|
||||
}
|
||||
|
||||
#ifdef HAVE_SECRET_CALLBACK
|
||||
if (ssl->sessionSecretCb != NULL) {
|
||||
if (ssl->sessionSecretCb != NULL
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
&& ssl->session->ticketLen > 0
|
||||
#endif
|
||||
) {
|
||||
int secretSz = SECRET_LEN;
|
||||
ret = ssl->sessionSecretCb(ssl, ssl->session->masterSecret,
|
||||
&secretSz, ssl->sessionSecretCtx);
|
||||
|
@@ -3921,7 +3921,11 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
||||
ssl->options.serverState = SERVER_HELLO_COMPLETE;
|
||||
|
||||
#ifdef HAVE_SECRET_CALLBACK
|
||||
if (ssl->sessionSecretCb != NULL) {
|
||||
if (ssl->sessionSecretCb != NULL
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
&& ssl->session->ticketLen > 0
|
||||
#endif
|
||||
) {
|
||||
int secretSz = SECRET_LEN;
|
||||
ret = ssl->sessionSecretCb(ssl, ssl->session->masterSecret,
|
||||
&secretSz, ssl->sessionSecretCtx);
|
||||
|
Reference in New Issue
Block a user