summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-05-30 22:14:58 +0200
committerTomas Mraz <tomas@openssl.org>2023-07-07 15:13:29 +0200
commit9c3ea4e1d7580fc061dfb754b620adb3439e683f (patch)
treee87832dee0de7a0e5a1f0da4a71e59ac89f3345d /include
parent5c3474ea563ed95bb7c86c08867139613655276b (diff)
QUIC err handling: Save and restore error state
We save the error state from the thread that encountered a permanent error condition caused by system or internal error to the QUIC_CHANNEL. Then we restore it whenever we are returning to a user call when protocol is shutdown. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21087)
Diffstat (limited to 'include')
-rw-r--r--include/internal/quic_channel.h3
-rw-r--r--include/openssl/err.h.in5
2 files changed, 8 insertions, 0 deletions
diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h
index bfa5818574..0606a11698 100644
--- a/include/internal/quic_channel.h
+++ b/include/internal/quic_channel.h
@@ -222,6 +222,9 @@ void ossl_quic_channel_raise_protocol_error(QUIC_CHANNEL *ch,
*/
int ossl_quic_channel_net_error(QUIC_CHANNEL *ch);
+/* Restore saved error state (best effort) */
+void ossl_quic_channel_restore_err_state(QUIC_CHANNEL *ch);
+
/* For RXDP use. */
void ossl_quic_channel_on_remote_conn_close(QUIC_CHANNEL *ch,
OSSL_QUIC_FRAME_CONN_CLOSE *f);
diff --git a/include/openssl/err.h.in b/include/openssl/err.h.in
index 26b98800f9..075d683f8d 100644
--- a/include/openssl/err.h.in
+++ b/include/openssl/err.h.in
@@ -486,6 +486,11 @@ int ERR_set_mark(void);
int ERR_pop_to_mark(void);
int ERR_clear_last_mark(void);
+ERR_STATE *OSSL_ERR_STATE_new(void);
+void OSSL_ERR_STATE_save(ERR_STATE *es);
+void OSSL_ERR_STATE_restore(const ERR_STATE *es);
+void OSSL_ERR_STATE_free(ERR_STATE *es);
+
#ifdef __cplusplus
}
#endif