mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
dtls: Increment sequence number in SendAlert
This commit is contained in:
@ -24894,6 +24894,11 @@ static int SendAlert_ex(WOLFSSL* ssl, int severity, int type)
|
||||
#endif /* WOLFSSL_DTLS13 */
|
||||
{
|
||||
AddRecordHeader(output, ALERT_SIZE, alert, ssl, CUR_ORDER);
|
||||
#ifdef WOLFSSL_DTLS
|
||||
/* AddRecordHeader doesn't increment the seq number */
|
||||
if (ssl->options.dtls)
|
||||
DtlsSEQIncrement(ssl, CUR_ORDER);
|
||||
#endif
|
||||
}
|
||||
|
||||
output += RECORD_HEADER_SZ;
|
||||
|
@ -72699,7 +72699,7 @@ static int test_wolfSSL_SendUserCanceled(void)
|
||||
struct test_memio_ctx test_ctx;
|
||||
WOLFSSL_ALERT_HISTORY h;
|
||||
|
||||
printf("Testing %s", params[i].tls_version);
|
||||
printf("Testing %s\n", params[i].tls_version);
|
||||
|
||||
XMEMSET(&h, 0, sizeof(h));
|
||||
XMEMSET(&test_ctx, 0, sizeof(test_ctx));
|
||||
@ -72719,8 +72719,8 @@ static int test_wolfSSL_SendUserCanceled(void)
|
||||
/* Last alert will be close notify because user_canceled should be
|
||||
* followed by a close_notify */
|
||||
ExpectIntEQ(wolfSSL_get_alert_history(ssl_c, &h), WOLFSSL_SUCCESS);
|
||||
AssertIntEQ(h.last_rx.code, close_notify);
|
||||
AssertIntEQ(h.last_rx.level, alert_warning);
|
||||
ExpectIntEQ(h.last_rx.code, close_notify);
|
||||
ExpectIntEQ(h.last_rx.level, alert_warning);
|
||||
|
||||
wolfSSL_free(ssl_c);
|
||||
wolfSSL_free(ssl_s);
|
||||
|
Reference in New Issue
Block a user