Skip to content

Commit

Permalink
Merge pull request #6102 from dgarske/non_const
Browse files Browse the repository at this point in the history
Fix for "expression must have a constant value" in tls13.c
  • Loading branch information
douzzer authored Feb 18, 2023
2 parents 1bae1ef + d488693 commit 6cc5c1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
5 changes: 4 additions & 1 deletion src/tls13.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6cc5c1a

Please sign in to comment.