From 82d65481bb8fe4643af9adb9e0f5845a9df69103 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 16 Feb 2023 13:58:48 -0800 Subject: [PATCH] Fix for "expression must have a constant value" in tls13.c with GreenHills compiler. --- src/tls13.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tls13.c b/src/tls13.c index c5c59a245..6d2223982 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -3655,7 +3655,10 @@ static int SetupPskKey(WOLFSSL* ssl, PreSharedKey* psk, int clientHello) ssl->options.cipherSuite = psk->cipherSuite; } else { - byte pskCS[2] = { psk->cipherSuite0, psk->cipherSuite }; + byte pskCS[2]; + pskCS[0] = psk->cipherSuite0; + pskCS[1] = psk->cipherSuite; + /* Ensure PSK and negotiated cipher suites have same hash. */ if (SuiteMac(pskCS) != SuiteMac(suite)) { WOLFSSL_ERROR_VERBOSE(PSK_KEY_ERROR);