-/* $OpenBSD: tls13_quic.c,v 1.7 2022/11/26 16:08:56 tb Exp $ */
+/* $OpenBSD: tls13_quic.c,v 1.8 2024/09/09 03:55:55 tb Exp $ */
/*
* Copyright (c) 2022 Joel Sing <jsing@openbsd.org>
*
{
struct tls13_ctx *ctx = arg;
SSL *ssl = ctx->ssl;
+ uint8_t alert_level = TLS13_ALERT_LEVEL_FATAL;
+ int ret = TLS13_IO_ALERT;
if (!ssl->quic_method->send_alert(ssl, ctx->hs->tls13.quic_write_level,
alert_desc)) {
return TLS13_IO_FAILURE;
}
- return TLS13_IO_SUCCESS;
+ if (alert_desc == TLS13_ALERT_CLOSE_NOTIFY ||
+ alert_desc == TLS13_ALERT_USER_CANCELED) {
+ alert_level = TLS13_ALERT_LEVEL_WARNING;
+ ret = TLS13_IO_SUCCESS;
+ }
+
+ tls13_record_layer_alert_sent(ctx->rl, alert_level, alert_desc);
+
+ return ret;
}
static const struct tls13_record_layer_callbacks quic_rl_callbacks = {