summaryrefslogtreecommitdiffstats
path: root/ssl/quic
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2024-02-15 08:55:36 +0000
committerHugo Landau <hlandau@openssl.org>2024-03-07 23:48:49 +0000
commit4b4b9c9eb3e677de6276c94758cb554c8f560697 (patch)
treeb2781d797fb0126a913e435944d947305682eb54 /ssl/quic
parent02f5ab77854647e4f34cdd340d57bb071afb997d (diff)
QUIC: Uniform changes for QUIC error code definitions rename
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23598)
Diffstat (limited to 'ssl/quic')
-rw-r--r--ssl/quic/qlog_event_helpers.c36
-rw-r--r--ssl/quic/quic_channel.c58
-rw-r--r--ssl/quic/quic_fc.c6
-rw-r--r--ssl/quic/quic_local.h5
-rw-r--r--ssl/quic/quic_rx_depack.c136
-rw-r--r--ssl/quic/quic_tls.c6
-rw-r--r--ssl/quic/quic_txp.c2
-rw-r--r--ssl/quic/quic_wire.c2
8 files changed, 126 insertions, 125 deletions
diff --git a/ssl/quic/qlog_event_helpers.c b/ssl/quic/qlog_event_helpers.c
index 662e7b123f..2cb6b836cb 100644
--- a/ssl/quic/qlog_event_helpers.c
+++ b/ssl/quic/qlog_event_helpers.c
@@ -78,37 +78,37 @@ void ossl_qlog_event_connectivity_connection_state_updated(QLOG *qlog,
static const char *quic_err_to_qlog(uint64_t error_code)
{
switch (error_code) {
- case QUIC_ERR_INTERNAL_ERROR:
+ case OSSL_QUIC_ERR_INTERNAL_ERROR:
return "internal_error";
- case QUIC_ERR_CONNECTION_REFUSED:
+ case OSSL_QUIC_ERR_CONNECTION_REFUSED:
return "connection_refused";
- case QUIC_ERR_FLOW_CONTROL_ERROR:
+ case OSSL_QUIC_ERR_FLOW_CONTROL_ERROR:
return "flow_control_error";
- case QUIC_ERR_STREAM_LIMIT_ERROR:
+ case OSSL_QUIC_ERR_STREAM_LIMIT_ERROR:
return "stream_limit_error";
- case QUIC_ERR_STREAM_STATE_ERROR:
+ case OSSL_QUIC_ERR_STREAM_STATE_ERROR:
return "stream_state_error";
- case QUIC_ERR_FINAL_SIZE_ERROR:
+ case OSSL_QUIC_ERR_FINAL_SIZE_ERROR:
return "final_size_error";
- case QUIC_ERR_FRAME_ENCODING_ERROR:
+ case OSSL_QUIC_ERR_FRAME_ENCODING_ERROR:
return "frame_encoding_error";
- case QUIC_ERR_TRANSPORT_PARAMETER_ERROR:
+ case OSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROR:
return "transport_parameter_error";
- case QUIC_ERR_CONNECTION_ID_LIMIT_ERROR:
+ case OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR:
return "connection_id_limit_error";
- case QUIC_ERR_PROTOCOL_VIOLATION:
+ case OSSL_QUIC_ERR_PROTOCOL_VIOLATION:
return "protocol_violation";
- case QUIC_ERR_INVALID_TOKEN:
+ case OSSL_QUIC_ERR_INVALID_TOKEN:
return "invalid_token";
- case QUIC_ERR_APPLICATION_ERROR:
+ case OSSL_QUIC_ERR_APPLICATION_ERROR:
return "application_error";
- case QUIC_ERR_CRYPTO_BUFFER_EXCEEDED:
+ case OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED:
return "crypto_buffer_exceeded";
- case QUIC_ERR_KEY_UPDATE_ERROR:
+ case OSSL_QUIC_ERR_KEY_UPDATE_ERROR:
return "key_update_error";
- case QUIC_ERR_AEAD_LIMIT_REACHED:
+ case OSSL_QUIC_ERR_AEAD_LIMIT_REACHED:
return "aead_limit_reached";
- case QUIC_ERR_NO_VIABLE_PATH:
+ case OSSL_QUIC_ERR_NO_VIABLE_PATH:
return "no_viable_path";
default:
return NULL;
@@ -128,8 +128,8 @@ void ossl_qlog_event_connectivity_connection_closed(QLOG *qlog,
const char *m = quic_err_to_qlog(tcause->error_code);
char ce[32];
- if (tcause->error_code >= QUIC_ERR_CRYPTO_ERR_BEGIN
- && tcause->error_code <= QUIC_ERR_CRYPTO_ERR_END) {
+ if (tcause->error_code >= OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN
+ && tcause->error_code <= OSSL_QUIC_ERR_CRYPTO_ERR_END) {
BIO_snprintf(ce, sizeof(ce), "crypto_error_0x%03llx",
(unsigned long long)tcause->error_code);
m = ce;
diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c
index aa0a67bd35..9bab5d005b 100644
--- a/ssl/quic/quic_channel.c
+++ b/ssl/quic/quic_channel.c
@@ -637,7 +637,7 @@ static void ch_trigger_txku(QUIC_CHANNEL *ch)
if (!ossl_quic_pn_valid(next_pn)
|| !ossl_qtx_trigger_key_update(ch->qtx)) {
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_INTERNAL_ERROR, 0,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
"key update");
return;
}
@@ -785,7 +785,7 @@ static void rxku_detected(QUIC_PN pn, void *arg)
decision = DECISION_SOLICITED_TXKU;
if (decision == DECISION_PROTOCOL_VIOLATION) {
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_KEY_UPDATE_ERROR,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_KEY_UPDATE_ERROR,
0, "RX key update again too soon");
return;
}
@@ -833,7 +833,7 @@ static void ch_rxku_tick(QUIC_CHANNEL *ch)
ch->rxku_in_progress = 0;
if (!ossl_qrx_key_update_timeout(ch->qrx, /*normal=*/1))
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_INTERNAL_ERROR, 0,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
"RXKU cooldown internal error");
}
@@ -913,7 +913,7 @@ static int ch_on_crypto_recv_record(const unsigned char **buf,
if (i != QUIC_ENC_LEVEL_0RTT &&
!crypto_ensure_empty(ch->crypto_recv[ossl_quic_enc_level_to_pn_space(i)])) {
/* Protocol violation (RFC 9001 s. 4.1.3) */
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_PROTOCOL_VIOLATION,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
OSSL_QUIC_FRAME_TYPE_CRYPTO,
"crypto stream data in wrong EL");
return 0;
@@ -991,7 +991,7 @@ static int ch_on_handshake_yield_secret(uint32_t enc_level, int direction,
for (i = QUIC_ENC_LEVEL_INITIAL; i < enc_level; ++i)
if (!crypto_ensure_empty(ch->crypto_recv[ossl_quic_enc_level_to_pn_space(i)])) {
/* Protocol violation (RFC 9001 s. 4.1.3) */
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_PROTOCOL_VIOLATION,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
OSSL_QUIC_FRAME_TYPE_CRYPTO,
"crypto stream data in wrong EL");
return 0;
@@ -1024,7 +1024,7 @@ static int ch_on_handshake_complete(void *arg)
* Was not a valid QUIC handshake if we did not get valid transport
* params.
*/
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_CRYPTO_MISSING_EXT,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_CRYPTO_MISSING_EXT,
OSSL_QUIC_FRAME_TYPE_CRYPTO,
"no transport parameters received");
return 0;
@@ -1068,7 +1068,7 @@ static int ch_on_handshake_alert(void *arg, unsigned char alert_code)
&& ch->handshake_complete
&& ossl_quic_tls_is_cert_request(ch->qtls))
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_PROTOCOL_VIOLATION,
+ OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
0,
"Post-handshake TLS "
"CertificateRequest received");
@@ -1083,12 +1083,12 @@ static int ch_on_handshake_alert(void *arg, unsigned char alert_code)
&& ch->handshake_complete
&& ossl_quic_tls_has_bad_max_early_data(ch->qtls))
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_PROTOCOL_VIOLATION,
+ OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
0,
"Bad max_early_data received");
else
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_CRYPTO_ERR_BEGIN
+ OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN
+ alert_code,
0, "handshake alert");
@@ -1193,7 +1193,7 @@ static int ch_on_transport_params(const unsigned char *params,
}
if (!PACKET_buf_init(&pkt, params, params_len)) {
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_INTERNAL_ERROR, 0,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
"internal error (packet buf init)");
return 0;
}
@@ -1683,7 +1683,7 @@ static int ch_on_transport_params(const unsigned char *params,
/* If we are a server, we now generate our own transport parameters. */
if (ch->is_server && !ch_generate_transport_params(ch)) {
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_INTERNAL_ERROR, 0,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
"internal error");
return 0;
}
@@ -1691,7 +1691,7 @@ static int ch_on_transport_params(const unsigned char *params,
return 1;
malformed:
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_TRANSPORT_PARAMETER_ERROR,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROR,
0, reason);
return 0;
}
@@ -2030,7 +2030,7 @@ static void ch_rx_check_forged_pkt_limit(QUIC_CHANNEL *ch)
if (ossl_qrx_get_cur_forged_pkt_count(ch->qrx) < limit)
return;
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_AEAD_LIMIT_REACHED, 0,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_AEAD_LIMIT_REACHED, 0,
"forgery limit");
}
@@ -2201,7 +2201,7 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch, int channel_only)
*/
if (ossl_quic_pkt_type_is_encrypted(ch->qrx_pkt->hdr->type)
&& ch->qrx_pkt->hdr->reserved != 0) {
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_PROTOCOL_VIOLATION,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
0, "packet header reserved bits");
return;
}
@@ -2253,7 +2253,7 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch, int channel_only)
if (!ch_retry(ch, ch->qrx_pkt->hdr->data,
ch->qrx_pkt->hdr->len - QUIC_RETRY_INTEGRITY_TAG_LEN,
&ch->qrx_pkt->hdr->src_conn_id))
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_INTERNAL_ERROR,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR,
0, "handling retry packet");
break;
@@ -2291,7 +2291,7 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch, int channel_only)
* were used for packets with lower packet numbers MUST treat this
* as a connection error of type KEY_UPDATE_ERROR.
*/
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_KEY_UPDATE_ERROR,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_KEY_UPDATE_ERROR,
0, "new packet with old keys");
break;
}
@@ -2316,7 +2316,7 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch, int channel_only)
* packets that lack authentication.
* I.e. should we drop this packet instead of closing the connection?
*/
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_PROTOCOL_VIOLATION,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
0, "client received initial token");
break;
}
@@ -2375,7 +2375,7 @@ static void ch_raise_version_neg_failure(QUIC_CHANNEL *ch)
{
QUIC_TERMINATE_CAUSE tcause = {0};
- tcause.error_code = QUIC_ERR_CONNECTION_REFUSED;
+ tcause.error_code = OSSL_QUIC_ERR_CONNECTION_REFUSED;
tcause.reason = "version negotiation failure";
tcause.reason_len = strlen(tcause.reason);
@@ -2475,7 +2475,7 @@ static int ch_tx(QUIC_CHANNEL *ch)
* to schedule a CONNECTION_CLOSE frame will not actually cause a
* packet to be transmitted for this reason.
*/
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_INTERNAL_ERROR,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR,
0,
"internal error (txp generate)");
break;
@@ -2675,7 +2675,7 @@ static int ch_retry(QUIC_CHANNEL *ch,
* This may fail if the token we receive is too big for us to ever be
* able to transmit in an outgoing Initial packet.
*/
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_INVALID_TOKEN, 0,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INVALID_TOKEN, 0,
"received oversize token");
OPENSSL_free(buf);
return 0;
@@ -2761,7 +2761,7 @@ int ossl_quic_channel_on_handshake_confirmed(QUIC_CHANNEL *ch)
* Does not make sense for handshake to be confirmed before it is
* completed.
*/
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_PROTOCOL_VIOLATION,
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
OSSL_QUIC_FRAME_TYPE_HANDSHAKE_DONE,
"handshake cannot be confirmed "
"before it is completed");
@@ -2997,7 +2997,7 @@ static int ch_enqueue_retire_conn_id(QUIC_CHANNEL *ch, uint64_t seq_num)
err:
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
OSSL_QUIC_FRAME_TYPE_NEW_CONN_ID,
"internal error enqueueing retire conn id");
BUF_MEM_free(buf_mem);
@@ -3017,7 +3017,7 @@ void ossl_quic_channel_on_new_conn_id(QUIC_CHANNEL *ch,
if (ch->cur_remote_dcid.id_len == 0) {
/* Changing from 0 length connection id is disallowed */
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_PROTOCOL_VIOLATION,
+ OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
OSSL_QUIC_FRAME_TYPE_NEW_CONN_ID,
"zero length connection id in use");
@@ -3041,7 +3041,7 @@ void ossl_quic_channel_on_new_conn_id(QUIC_CHANNEL *ch,
*/
if (new_remote_seq_num - new_retire_prior_to > 1) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_CONNECTION_ID_LIMIT_ERROR,
+ OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR,
OSSL_QUIC_FRAME_TYPE_NEW_CONN_ID,
"active_connection_id limit violated");
return;
@@ -3064,7 +3064,7 @@ void ossl_quic_channel_on_new_conn_id(QUIC_CHANNEL *ch,
*/
if (new_retire_prior_to - ch->cur_retire_prior_to > 10) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_CONNECTION_ID_LIMIT_ERROR,
+ OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR,
OSSL_QUIC_FRAME_TYPE_NEW_CONN_ID,
"retiring connection id limit violated");
@@ -3076,7 +3076,7 @@ void ossl_quic_channel_on_new_conn_id(QUIC_CHANNEL *ch,
if (!ossl_quic_srtm_add(ch->srtm, ch, new_remote_seq_num,
&f->stateless_reset)) {
ossl_quic_channel_raise_protocol_error(
- ch, QUIC_ERR_CONNECTION_ID_LIMIT_ERROR,
+ ch, OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR,
OSSL_QUIC_FRAME_TYPE_NEW_CONN_ID,
"unable to store stateless reset token");
@@ -3134,7 +3134,7 @@ void ossl_quic_channel_on_stateless_reset(QUIC_CHANNEL *ch)
{
QUIC_TERMINATE_CAUSE tcause = {0};
- tcause.error_code = QUIC_ERR_NO_ERROR;
+ tcause.error_code = OSSL_QUIC_ERR_NO_ERROR;
tcause.remote = 1;
ch_start_terminating(ch, &tcause, 0);
}
@@ -3148,7 +3148,7 @@ void ossl_quic_channel_raise_net_error(QUIC_CHANNEL *ch)
ch->net_error = 1;
- tcause.error_code = QUIC_ERR_INTERNAL_ERROR;
+ tcause.error_code = OSSL_QUIC_ERR_INTERNAL_ERROR;
tcause.reason = "network BIO I/O error";
tcause.reason_len = strlen(tcause.reason);
@@ -3185,7 +3185,7 @@ void ossl_quic_channel_raise_protocol_error_loc(QUIC_CHANNEL *ch,
const char *src_func)
{
QUIC_TERMINATE_CAUSE tcause = {0};
- int err_reason = error_code == QUIC_ERR_INTERNAL_ERROR
+ int err_reason = error_code == OSSL_QUIC_ERR_INTERNAL_ERROR
? ERR_R_INTERNAL_ERROR : SSL_R_QUIC_PROTOCOL_ERROR;
const char *err_str = ossl_quic_err_to_string(error_code);
const char *err_str_pfx = " (", *err_str_sfx = ")";
diff --git a/ssl/quic/quic_fc.c b/ssl/quic/quic_fc.c
index 7e36aab09e..709cd91132 100644
--- a/ssl/quic/quic_fc.c
+++ b/ssl/quic/quic_fc.c
@@ -189,7 +189,7 @@ static int on_rx_controlled_bytes(QUIC_RXFC *rxfc, uint64_t num_bytes)
if (num_bytes > credit) {
ok = 0;
num_bytes = credit;
- rxfc->error_code = QUIC_ERR_FLOW_CONTROL_ERROR;
+ rxfc->error_code = OSSL_QUIC_ERR_FLOW_CONTROL_ERROR;
}
rxfc->swm += num_bytes;
@@ -205,7 +205,7 @@ int ossl_quic_rxfc_on_rx_stream_frame(QUIC_RXFC *rxfc, uint64_t end, int is_fin)
if (rxfc->is_fin && ((is_fin && rxfc->hwm != end) || end > rxfc->hwm)) {
/* Stream size cannot change after the stream is finished */
- rxfc->error_code = QUIC_ERR_FINAL_SIZE_ERROR;
+ rxfc->error_code = OSSL_QUIC_ERR_FINAL_SIZE_ERROR;
return 1; /* not a caller error */
}
@@ -220,7 +220,7 @@ int ossl_quic_rxfc_on_rx_stream_frame(QUIC_RXFC *rxfc, uint64_t end, int is_fin)
if (rxfc->parent != NULL)
on_rx_controlled_bytes(rxfc->parent, delta); /* result ignored */
} else if (end < rxfc->hwm && is_fin) {
- rxfc->error_code = QUIC_ERR_FINAL_SIZE_ERROR;
+ rxfc->error_code = OSSL_QUIC_ERR_FINAL_SIZE_ERROR;
return 1; /* not a caller error */
}
diff --git a/ssl/quic/quic_local.h b/ssl/quic/quic_local.h
index a5376320d8..ff7f4719ab 100644
--- a/ssl/quic/quic_local.h
+++ b/ssl/quic/quic_local.h
@@ -250,8 +250,9 @@ int ossl_quic_conn_on_handshake_confirmed(QUIC_CONNECTION *qc);
/*
* To be called when a protocol violation occurs. The connection is torn down
- * with the given error code, which should be a QUIC_ERR_* value. Reason string
- * is optional and copied if provided. frame_type should be 0 if not applicable.
+ * with the given error code, which should be a OSSL_QUIC_ERR_* value. Reason
+ * string is optional and copied if provided. frame_type should be 0 if not
+ * applicable.
*/
void ossl_quic_conn_raise_protocol_error(QUIC_CONNECTION *qc,
uint64_t error_code,
diff --git a/ssl/quic/quic_rx_depack.c b/ssl/quic/quic_rx_depack.c
index 97c6d6095d..3059831063 100644
--- a/ssl/quic/quic_rx_depack.c
+++ b/ssl/quic/quic_rx_depack.c
@@ -48,7 +48,7 @@ static int depack_do_frame_ping(PACKET *pkt, QUIC_CHANNEL *ch,
/* We ignore this frame, apart from eliciting an ACK */
if (!ossl_quic_wire_decode_frame_ping(pkt)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_PING,
"decode error");
return 0;
@@ -115,7 +115,7 @@ static int depack_do_frame_ack(PACKET *pkt, QUIC_CHANNEL *ch,
* epoch has not incremented and ch->rxku_expected is still 1.
*/
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_KEY_UPDATE_ERROR,
+ OSSL_QUIC_ERR_KEY_UPDATE_ERROR,
frame_type,
"acked packet which initiated a "
"key update without a "
@@ -132,7 +132,7 @@ static int depack_do_frame_ack(PACKET *pkt, QUIC_CHANNEL *ch,
malformed:
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
frame_type,
"decode error");
return 0;
@@ -148,7 +148,7 @@ static int depack_do_frame_reset_stream(PACKET *pkt,
if (!ossl_quic_wire_decode_frame_reset_stream(pkt, &frame_data)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_RESET_STREAM,
"decode error");
return 0;
@@ -164,7 +164,7 @@ static int depack_do_frame_reset_stream(PACKET *pkt,
if (!ossl_quic_stream_has_recv(stream)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_STREAM_STATE_ERROR,
+ OSSL_QUIC_ERR_STREAM_STATE_ERROR,
OSSL_QUIC_FRAME_TYPE_RESET_STREAM,
"RESET_STREAM frame for "
"TX only stream");
@@ -184,7 +184,7 @@ static int depack_do_frame_reset_stream(PACKET *pkt,
if (!ossl_quic_rxfc_on_rx_stream_frame(&stream->rxfc,
frame_data.final_size, /*is_fin=*/1)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
OSSL_QUIC_FRAME_TYPE_RESET_STREAM,
"internal error (flow control)");
return 0;
@@ -192,7 +192,7 @@ static int depack_do_frame_reset_stream(PACKET *pkt,
/* Has a flow control error occurred? */
fce = ossl_quic_rxfc_get_error(&stream->rxfc, 0);
- if (fce != QUIC_ERR_NO_ERROR) {
+ if (fce != OSSL_QUIC_ERR_NO_ERROR) {
ossl_quic_channel_raise_protocol_error(ch,
fce,
OSSL_QUIC_FRAME_TYPE_RESET_STREAM,
@@ -223,7 +223,7 @@ static int depack_do_frame_stop_sending(PACKET *pkt,
if (!ossl_quic_wire_decode_frame_stop_sending(pkt, &frame_data)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_STOP_SENDING,
"decode error");
return 0;
@@ -239,7 +239,7 @@ static int depack_do_frame_stop_sending(PACKET *pkt,
if (!ossl_quic_stream_has_send(stream)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_STREAM_STATE_ERROR,
+ OSSL_QUIC_ERR_STREAM_STATE_ERROR,
OSSL_QUIC_FRAME_TYPE_STOP_SENDING,
"STOP_SENDING frame for "
"RX only stream");
@@ -272,7 +272,7 @@ static int depack_do_frame_crypto(PACKET *pkt, QUIC_CHANNEL *ch,
if (!ossl_quic_wire_decode_frame_crypto(pkt, 0, &f)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_CRYPTO,
"decode error");
return 0;
@@ -295,14 +295,14 @@ static int depack_do_frame_crypto(PACKET *pkt, QUIC_CHANNEL *ch,
if (!ossl_quic_rxfc_on_rx_stream_frame(rxfc, f.offset + f.len,
/*is_fin=*/0)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
OSSL_QUIC_FRAME_TYPE_CRYPTO,
"internal error (crypto RXFC)");
return 0;
}
- if (ossl_quic_rxfc_get_error(rxfc, 0) != QUIC_ERR_NO_ERROR) {
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_CRYPTO_BUFFER_EXCEEDED,
+ if (ossl_quic_rxfc_get_error(rxfc, 0) != OSSL_QUIC_ERR_NO_ERROR) {
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED,
OSSL_QUIC_FRAME_TYPE_CRYPTO,
"exceeded maximum crypto buffer");
return 0;
@@ -311,7 +311,7 @@ static int depack_do_frame_crypto(PACKET *pkt, QUIC_CHANNEL *ch,
if (!ossl_quic_rstream_queue_data(rstream, parent_pkt,
f.offset, f.data, f.len, 0)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
OSSL_QUIC_FRAME_TYPE_CRYPTO,
"internal error (rstream queue)");
return 0;
@@ -331,7 +331,7 @@ static int depack_do_frame_new_token(PACKET *pkt, QUIC_CHANNEL *ch,
if (!ossl_quic_wire_decode_frame_new_token(pkt, &token, &token_len)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_NEW_TOKEN,
"decode error");
return 0;
@@ -344,7 +344,7 @@ static int depack_do_frame_new_token(PACKET *pkt, QUIC_CHANNEL *ch,
* FRAME_ENCODING_ERROR."
*/
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_NEW_TOKEN,
"zero-length NEW_TOKEN");
return 0;
@@ -425,14 +425,14 @@ static int depack_do_implicit_stream_create(QUIC_CHANNEL *ch,
stream_ordinal + 1,
/*is_fin=*/0)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
frame_type,
"internal error (stream count RXFC)");
return 0;
}
- if (ossl_quic_rxfc_get_error(max_streams_fc, 0) != QUIC_ERR_NO_ERROR) {
- ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_STREAM_LIMIT_ERROR,
+ if (ossl_quic_rxfc_get_error(max_streams_fc, 0) != OSSL_QUIC_ERR_NO_ERROR) {
+ ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_STREAM_LIMIT_ERROR,
frame_type,
"exceeded maximum allowed streams");
return 0;
@@ -450,7 +450,7 @@ static int depack_do_implicit_stream_create(QUIC_CHANNEL *ch,
stream = ossl_quic_channel_new_stream_remote(ch, cur_stream_id);
if (stream == NULL) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
frame_type,
"internal error (stream allocation)");
return 0;
@@ -472,7 +472,7 @@ static int depack_do_implicit_stream_create(QUIC_CHANNEL *ch,
* violation.
*/
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_STREAM_STATE_ERROR,
+ OSSL_QUIC_ERR_STREAM_STATE_ERROR,
frame_type,
"STREAM frame for nonexistent "
"stream");
@@ -507,7 +507,7 @@ static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch,
if (!ossl_quic_wire_decode_frame_stream(pkt, 0, &frame_data)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
frame_type,
"decode error");
return 0;
@@ -526,7 +526,7 @@ static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch,
if (!ossl_quic_stream_has_recv(stream)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_STREAM_STATE_ERROR,
+ OSSL_QUIC_ERR_STREAM_STATE_ERROR,
frame_type,
"STREAM frame for TX only "
"stream");
@@ -538,7 +538,7 @@ static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch,
frame_data.offset + frame_data.len,
frame_data.is_fin)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
frame_type,
"internal error (flow control)");
return 0;
@@ -546,7 +546,7 @@ static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch,
/* Has a flow control error occurred? */
fce = ossl_quic_rxfc_get_error(&stream->rxfc, 0);
- if (fce != QUIC_ERR_NO_ERROR) {
+ if (fce != OSSL_QUIC_ERR_NO_ERROR) {
ossl_quic_channel_raise_protocol_error(ch,
fce,
frame_type,
@@ -610,7 +610,7 @@ static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch,
frame_data.len,
frame_data.is_fin)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
frame_type,
"internal error (rstream queue)");
return 0;
@@ -625,7 +625,7 @@ static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch,
if (stream->recv_state == QUIC_RSTREAM_STATE_SIZE_KNOWN
&& !ossl_quic_rstream_available(stream->rstream, &rs_avail, &rs_fin)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_INTERNAL_ERROR,
+ OSSL_QUIC_ERR_INTERNAL_ERROR,
frame_type,
"internal error (rstream available)");
return 0;
@@ -673,7 +673,7 @@ static int depack_do_frame_max_data(PACKET *pkt, QUIC_CHANNEL *ch,
if (!ossl_quic_wire_decode_frame_max_data(pkt, &max_data)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_MAX_DATA,
"decode error");
return 0;
@@ -695,7 +695,7 @@ static int depack_do_frame_max_stream_data(PACKET *pkt,
if (!ossl_quic_wire_decode_frame_max_stream_data(pkt, &stream_id,
&max_stream_data)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_MAX_STREAM_DATA,
"decode error");
return 0;
@@ -711,7 +711,7 @@ static int depack_do_frame_max_stream_data(PACKET *pkt,
if (!ossl_quic_stream_has_send(stream)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_STREAM_STATE_ERROR,
+ OSSL_QUIC_ERR_STREAM_STATE_ERROR,
OSSL_QUIC_FRAME_TYPE_MAX_STREAM_DATA,
"MAX_STREAM_DATA for TX only "
"stream");
@@ -732,7 +732,7 @@ static int depack_do_frame_max_streams(PACKET *pkt,
if (!ossl_quic_wire_decode_frame_max_streams(pkt, &max_streams)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
frame_type,
"decode error");
return 0;
@@ -740,7 +740,7 @@ static int depack_do_frame_max_streams(PACKET *pkt,
if (max_streams > (((uint64_t)1) << 60)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
frame_type,
"invalid max streams value");
return 0;
@@ -763,7 +763,7 @@ static int depack_do_frame_max_streams(PACKET *pkt,
break;
default:
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
frame_type,
"decode error");
return 0;
@@ -780,7 +780,7 @@ static int depack_do_frame_data_blocked(PACKET *pkt,
if (!ossl_quic_wire_decode_frame_data_blocked(pkt, &max_data)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_DATA_BLOCKED,
"decode error");
return 0;
@@ -801,7 +801,7 @@ static int depack_do_frame_stream_data_blocked(PACKET *pkt,
if (!ossl_quic_wire_decode_frame_stream_data_blocked(pkt, &stream_id,
&max_data)) {
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_FRAME_ENCODING_ERROR,
+ OSSL_QUIC_ERR_FRAME_ENCODING_ERROR,
OSSL_QUIC_FRAME_TYPE_STREAM_DATA_BLOCKED,
"decode error");
return 0;
@@ -826,7 +826,7 @@ static int depack_do_frame_stream_data_blocked(PACKET *pkt,
* STREAM_STATE_ERROR."
*/
ossl_quic_channel_raise_protocol_error(ch,
- QUIC_ERR_STREAM_STATE_ERROR,
+ OSSL_QUIC_ERR_STREAM_STATE_ERROR,
OSSL_QUIC_FRAME_TYPE_STREAM_DATA_BLOCKED,
"STREAM_DATA_BLOCKED frame for "
"TX only stream");
@@ -846,7 +846,7 @@ static int depack_do_frame_streams