forked from wolfSSL/wolfssl
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 */
|
#endif /* WOLFSSL_DTLS13 */
|
||||||
{
|
{
|
||||||
AddRecordHeader(output, ALERT_SIZE, alert, ssl, CUR_ORDER);
|
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;
|
output += RECORD_HEADER_SZ;
|
||||||
|
@ -72699,7 +72699,7 @@ static int test_wolfSSL_SendUserCanceled(void)
|
|||||||
struct test_memio_ctx test_ctx;
|
struct test_memio_ctx test_ctx;
|
||||||
WOLFSSL_ALERT_HISTORY h;
|
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(&h, 0, sizeof(h));
|
||||||
XMEMSET(&test_ctx, 0, sizeof(test_ctx));
|
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
|
/* Last alert will be close notify because user_canceled should be
|
||||||
* followed by a close_notify */
|
* followed by a close_notify */
|
||||||
ExpectIntEQ(wolfSSL_get_alert_history(ssl_c, &h), WOLFSSL_SUCCESS);
|
ExpectIntEQ(wolfSSL_get_alert_history(ssl_c, &h), WOLFSSL_SUCCESS);
|
||||||
AssertIntEQ(h.last_rx.code, close_notify);
|
ExpectIntEQ(h.last_rx.code, close_notify);
|
||||||
AssertIntEQ(h.last_rx.level, alert_warning);
|
ExpectIntEQ(h.last_rx.level, alert_warning);
|
||||||
|
|
||||||
wolfSSL_free(ssl_c);
|
wolfSSL_free(ssl_c);
|
||||||
wolfSSL_free(ssl_s);
|
wolfSSL_free(ssl_s);
|
||||||
|
Reference in New Issue
Block a user