Fix resumption code around when not available

Can't set a ticket if the encryption callback is NULL.
If no useable pre-shared key is found then we won't do PSK.
pull/1385/head
Sean Parkinson 2018-02-21 17:45:13 +10:00
parent 7a2aa6bc13
commit d1f19e8ecc
2 changed files with 4 additions and 1 deletions

View File

@ -8062,7 +8062,7 @@ int TLSX_PopulateExtensions(WOLFSSL* ssl, byte isServer)
}
#if defined(HAVE_SESSION_TICKET)
if (ssl->options.resuming) {
if (ssl->options.resuming && ssl->ctx->ticketEncCb != NULL) {
WOLFSSL_SESSION* sess = &ssl->session;
word32 milli;

View File

@ -3173,6 +3173,9 @@ static int DoPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
break;
}
if (current == NULL)
return 0;
/* Hash the rest of the ClientHello. */
ret = HashInputRaw(ssl, input + helloSz - bindersLen, bindersLen);
if (ret != 0)