forked from wolfSSL/wolfssl
Fix for session ticket handling with error cases. Session ticket callback return code failures were still trying to do resumption. Behavior broken in PR #3827.
This commit is contained in:
@ -3589,7 +3589,7 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
|
||||
inputHelloSz - bindersLen + HANDSHAKE_HEADER_SZ);
|
||||
|
||||
/* call to decrypt session ticket */
|
||||
if (DoClientTicket(ssl, identity, idLen) != 0) {
|
||||
if (DoClientTicket(ssl, identity, idLen) != WOLFSSL_TICKET_RET_OK) {
|
||||
/* we aren't decrypting the resumption, since we know the master secret */
|
||||
/* ignore errors */
|
||||
}
|
||||
|
10
src/tls13.c
10
src/tls13.c
@ -4202,12 +4202,12 @@ static int CheckPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
|
||||
RefineSuites(ssl, clSuites);
|
||||
|
||||
#ifndef WOLFSSL_PSK_ONE_ID
|
||||
if (!usingPSK)
|
||||
if (usingPSK == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (!ssl->options.useClientOrder) {
|
||||
/* Server order - server list has only common suites from refining. */
|
||||
for (i = 0; !*usingPSK && i < ssl->suites->suiteSz; i += 2) {
|
||||
for (i = 0; !(*usingPSK) && i < ssl->suites->suiteSz; i += 2) {
|
||||
ret = DoPreSharedKeys(ssl, ssl->suites->suites + i, usingPSK,
|
||||
&first);
|
||||
if (ret != 0) {
|
||||
@ -4217,8 +4217,8 @@ static int CheckPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
|
||||
}
|
||||
else {
|
||||
/* Client order */
|
||||
for (j = 0; !*usingPSK && j < clSuites->suiteSz; j += 2) {
|
||||
for (i = 0; !*usingPSK && i < ssl->suites->suiteSz; i += 2) {
|
||||
for (j = 0; !(*usingPSK) && j < clSuites->suiteSz; j += 2) {
|
||||
for (i = 0; !(*usingPSK) && i < ssl->suites->suiteSz; i += 2) {
|
||||
ret = DoPreSharedKeys(ssl, ssl->suites->suites + i, usingPSK,
|
||||
&first);
|
||||
if (ret != 0)
|
||||
@ -4237,7 +4237,7 @@ static int CheckPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
if (usingPSK) {
|
||||
if (*usingPSK != 0) {
|
||||
word16 modes;
|
||||
#ifdef WOLFSSL_EARLY_DATA
|
||||
TLSX* extEarlyData;
|
||||
|
Reference in New Issue
Block a user