diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-04-18 19:30:56 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-05-12 14:47:13 +0100 |
commit | c3a04ea2fdd073e55b57e70e4f17f3ccbaa8c8a6 (patch) | |
tree | 2f9714368d7195d214ac85f5e860629ad9f5af80 /include | |
parent | b6fc2294a1a5bd6053647afea02180147018112b (diff) |
QUIC DISPATCH/APL: Add SSL_stream_reset and status query APIs
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20765)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/quic_ssl.h | 14 | ||||
-rw-r--r-- | include/openssl/ssl.h.in | 32 |
2 files changed, 46 insertions, 0 deletions
diff --git a/include/internal/quic_ssl.h b/include/internal/quic_ssl.h index ed17005843..050bfe9d24 100644 --- a/include/internal/quic_ssl.h +++ b/include/internal/quic_ssl.h @@ -77,6 +77,20 @@ __owur int ossl_quic_set_incoming_stream_reject_policy(SSL *s, int policy, __owur SSL *ossl_quic_accept_stream(SSL *s, uint64_t flags); __owur size_t ossl_quic_get_accept_stream_queue_len(SSL *s); +__owur int ossl_quic_stream_reset(SSL *ssl, + const SSL_STREAM_RESET_ARGS *args, + size_t args_len); + +__owur int ossl_quic_get_stream_read_state(SSL *ssl); +__owur int ossl_quic_get_stream_write_state(SSL *ssl); +__owur int ossl_quic_get_stream_read_error_code(SSL *ssl, + uint64_t *app_error_code); +__owur int ossl_quic_get_stream_write_error_code(SSL *ssl, + uint64_t *app_error_code); +__owur int ossl_quic_get_conn_close_info(SSL *ssl, + SSL_CONN_CLOSE_INFO *info, + size_t info_len); + /* * Used to override ossl_time_now() for debug purposes. Must be called before * connecting. diff --git a/include/openssl/ssl.h.in b/include/openssl/ssl.h.in index dcc7cfdb3a..81d49e6299 100644 --- a/include/openssl/ssl.h.in +++ b/include/openssl/ssl.h.in @@ -2318,6 +2318,38 @@ __owur int SSL_shutdown_ex(SSL *ssl, uint64_t flags, __owur int SSL_stream_conclude(SSL *ssl, uint64_t flags); +typedef struct ssl_stream_reset_args_st { + uint64_t quic_error_code; +} SSL_STREAM_RESET_ARGS; + +__owur int SSL_stream_reset(SSL *ssl, + const SSL_STREAM_RESET_ARGS *args, + size_t args_len); + +#define SSL_STREAM_STATE_NONE 0 +#define SSL_STREAM_STATE_OK 1 +#define SSL_STREAM_STATE_WRONG_DIR 2 +#define SSL_STREAM_STATE_FINISHED 3 +#define SSL_STREAM_STATE_RESET_LOCAL 4 +#define SSL_STREAM_STATE_RESET_REMOTE 5 +#define SSL_STREAM_STATE_CONN_CLOSED 6 +__owur int SSL_get_stream_read_state(SSL *ssl); +__owur int SSL_get_stream_write_state(SSL *ssl); + +__owur int SSL_get_stream_read_error_code(SSL *ssl, uint64_t *app_error_code); +__owur int SSL_get_stream_write_error_code(SSL *ssl, uint64_t *app_error_code); + +typedef struct ssl_conn_close_info_st { + uint64_t error_code; + char *reason; + size_t reason_len; + char is_local, is_transport; +} SSL_CONN_CLOSE_INFO; + +__owur int SSL_get_conn_close_info(SSL *ssl, + SSL_CONN_CLOSE_INFO *info, + size_t info_len); + # ifndef OPENSSL_NO_DEPRECATED_1_1_0 # define SSL_cache_hit(s) SSL_session_reused(s) # endif |