fixup! dtls13: move Dtls13NewEpoch into DeriveTls13Keys

pull/8858/head
Marco Oliverio 2025-06-09 16:11:17 +02:00
parent c1c1929e55
commit 59ff71f936
2 changed files with 7 additions and 6 deletions

View File

@ -1471,9 +1471,6 @@ int DeriveTls13Keys(WOLFSSL* ssl, int secret, int side, int store)
byte key_dig[MAX_PRF_DIG];
#endif
int provision;
#ifdef WOLFSSL_DTLS13
w64wrapper epochNumber;
#endif
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
ret = tsip_Tls13DeriveKeys(ssl, secret, side);
@ -1626,6 +1623,7 @@ int DeriveTls13Keys(WOLFSSL* ssl, int secret, int side, int store)
goto end;
if (ssl->options.dtls) {
w64wrapper epochNumber;
ret = Dtls13DeriveSnKeys(ssl, provision);
if (ret != 0)
return ret;
@ -1653,6 +1651,8 @@ int DeriveTls13Keys(WOLFSSL* ssl, int secret, int side, int store)
}
w64Increment(&epochNumber);
break;
default:
return BAD_STATE_E;
}
ret = Dtls13NewEpoch(ssl, epochNumber, side);
if (ret != 0)

View File

@ -1335,7 +1335,7 @@ int test_dtls_rtx_across_epoch_change(void)
ExpectIntEQ(wolfSSL_connect(ssl_c), -1);
ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), SSL_ERROR_WANT_READ);
/* SH */
/* HRR */
wolfSSL_SetLoggingPrefix("server:");
ExpectIntEQ(wolfSSL_accept(ssl_s), -1);
ExpectIntEQ(wolfSSL_get_error(ssl_s, -1), SSL_ERROR_WANT_READ);
@ -1345,6 +1345,7 @@ int test_dtls_rtx_across_epoch_change(void)
ExpectIntEQ(wolfSSL_connect(ssl_c), -1);
ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), SSL_ERROR_WANT_READ);
/* SH ... FINISHED */
wolfSSL_SetLoggingPrefix("server:");
ExpectIntEQ(wolfSSL_accept(ssl_s), -1);
ExpectIntEQ(wolfSSL_get_error(ssl_s, -1), SSL_ERROR_WANT_READ);
@ -1352,7 +1353,7 @@ int test_dtls_rtx_across_epoch_change(void)
/* we should have now SH ... FINISHED messages in the buffer*/
ExpectIntGE(test_ctx.c_msg_count, 2);
/* now let's drop everything but the SH */
/* drop everything but the SH */
while (test_ctx.c_msg_count > 1 && EXPECT_SUCCESS()) {
ExpectIntEQ(test_memio_drop_message(&test_ctx, 1, test_ctx.c_msg_count - 1), 0);
}