diff --git a/src/internal.c b/src/internal.c index a60d8bde7..3620954ff 100644 --- a/src/internal.c +++ b/src/internal.c @@ -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; diff --git a/tests/api.c b/tests/api.c index 3f49cba91..102511630 100644 --- a/tests/api.c +++ b/tests/api.c @@ -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);