Merge pull request #6102 from dgarske/non_const

Fix for "expression must have a constant value" in tls13.c
This commit is contained in:
Daniel Pouzzner
2023-02-17 21:07:27 -06:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -8462,7 +8462,7 @@ AM_CONDITIONAL([BUILD_TESTS],[test "x$ENABLED_EXAMPLES" = "xyes"])
AM_CONDITIONAL([BUILD_THREADED_EXAMPLES],[test "x$ENABLED_SINGLETHREADED" = "xno" && test "x$ENABLED_EXAMPLES" = "xyes" && test "x$ENABLED_LEANTLS" = "xno"])
AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS],[test "x$ENABLED_CRYPT_TESTS" = "xyes"])
AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS_LIBS],[test "x$ENABLED_CRYPT_TESTS_LIBS" = "xyes"])
AM_CONDITIONAL([BUILD_LIBZ],[test "x$ENABLED_LIBZ" = "xyes"])
AM_CONDITIONAL([BUILD_LIBZ],[test "x$ENABLED_LIBZ" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
AM_CONDITIONAL([BUILD_PKCS11],[test "x$ENABLED_PKCS11" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
AM_CONDITIONAL([BUILD_PKCS12],[test "x$ENABLED_PKCS12" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
AM_CONDITIONAL([BUILD_PKCS8],[test "x$ENABLED_PKCS8" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])

View File

@@ -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);