From ce1e44d5e84a155cdbbc948b0f35aacff28b8c70 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Fri, 20 Oct 2023 10:32:45 +1000 Subject: [PATCH] TLS 1.3: compiling with WOLFSSL_PSK_ONE_ID fix Move use of 'suites' into non-WOLFSSL_PSK_ONE_ID path as variable declared and used only in that case. --- src/tls13.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tls13.c b/src/tls13.c index 1c4919e4c..f4028615b 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -6129,12 +6129,12 @@ static int CheckPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz, /* Refine list for PSK processing. */ RefineSuites(ssl, clSuites); - /* set after refineSuites, to avoid taking a stale ptr to ctx->Suites */ - suites = WOLFSSL_SUITES(ssl); #ifndef WOLFSSL_PSK_ONE_ID if (usingPSK == NULL) return BAD_FUNC_ARG; + /* set after refineSuites, to avoid taking a stale ptr to ctx->Suites */ + suites = WOLFSSL_SUITES(ssl); /* Server list has only common suites from refining in server or client * order. */ for (i = 0; !(*usingPSK) && i < suites->suiteSz; i += 2) {