forked from wolfSSL/wolfssl
Merge pull request #4509 from dgarske/fix_sesstick
Fix for session ticket handling with error cases
This commit is contained in:
@@ -3621,7 +3621,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
@@ -4138,12 +4138,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) {
|
||||
@@ -4153,8 +4153,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)
|
||||
@@ -4173,7 +4173,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