diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-04-18 19:30:55 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-05-12 14:47:12 +0100 |
commit | 8b7be3aa7e90d85441f5012624cece4dca33291e (patch) | |
tree | b3ae474bb1d4c54264b7cf2e11f10a3e9c13f682 /include | |
parent | 19cb0887722b66e5db7ec0d339526608444a11ef (diff) |
QUIC DISPATCH/APL: Implement SSL_set_default_stream_mode, default XSO refactor
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_channel.h | 13 | ||||
-rw-r--r-- | include/internal/quic_ssl.h | 3 | ||||
-rw-r--r-- | include/openssl/ssl.h.in | 8 | ||||
-rw-r--r-- | include/openssl/sslerr.h | 2 |
4 files changed, 26 insertions, 0 deletions
diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h index 084c465c3a..74b3473782 100644 --- a/include/internal/quic_channel.h +++ b/include/internal/quic_channel.h @@ -84,6 +84,19 @@ */ # define QUIC_TAKES_LOCK +/* + * The function acquires the channel mutex and leaves it acquired + * when returning success. + * + * Any function tagged with this has the following precondition and + * postcondition: + * + * Precondition: must not hold channel mutex (unchecked) + * Postcondition: channel mutex is held by calling thread + * or function returned failure + */ +# define QUIC_ACQUIRES_LOCK + # define QUIC_TODO_LOCK # define QUIC_CHANNEL_STATE_IDLE 0 diff --git a/include/internal/quic_ssl.h b/include/internal/quic_ssl.h index 0ccb1c5526..986cd0e0d0 100644 --- a/include/internal/quic_ssl.h +++ b/include/internal/quic_ssl.h @@ -69,6 +69,9 @@ __owur SSL *ossl_quic_conn_stream_new(SSL *s, uint64_t flags); __owur SSL *ossl_quic_get0_connection(SSL *s); __owur int ossl_quic_get_stream_type(SSL *s); __owur uint64_t ossl_quic_get_stream_id(SSL *s); +__owur int ossl_quic_set_default_stream_mode(SSL *s, uint32_t mode); +__owur SSL *ossl_quic_detach_stream(SSL *s); +__owur int ossl_quic_attach_stream(SSL *conn, SSL *stream); /* * Used to override ossl_time_now() for debug purposes. Must be called before diff --git a/include/openssl/ssl.h.in b/include/openssl/ssl.h.in index 8d82bf6b5a..c5ab105816 100644 --- a/include/openssl/ssl.h.in +++ b/include/openssl/ssl.h.in @@ -2277,6 +2277,14 @@ __owur int SSL_get_stream_type(SSL *s); __owur uint64_t SSL_get_stream_id(SSL *s); +#define SSL_DEFAULT_STREAM_MODE_NONE 0 +#define SSL_DEFAULT_STREAM_MODE_AUTO_BIDI 1 +#define SSL_DEFAULT_STREAM_MODE_AUTO_UNI 2 +__owur int SSL_set_default_stream_mode(SSL *s, uint32_t mode); + +__owur SSL *SSL_detach_stream(SSL *s); +__owur int SSL_attach_stream(SSL *conn, SSL *stream); + #define SSL_STREAM_FLAG_UNI (1U << 0) __owur SSL *SSL_new_stream(SSL *s, uint64_t flags); diff --git a/include/openssl/sslerr.h b/include/openssl/sslerr.h index 94cb60f8be..d8c97c7666 100644 --- a/include/openssl/sslerr.h +++ b/include/openssl/sslerr.h @@ -202,6 +202,7 @@ # define SSL_R_NO_SHARED_GROUPS 410 # define SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS 376 # define SSL_R_NO_SRTP_PROFILES 359 +# define SSL_R_NO_STREAM 355 # define SSL_R_NO_SUITABLE_DIGEST_ALGORITHM 297 # define SSL_R_NO_SUITABLE_GROUPS 295 # define SSL_R_NO_SUITABLE_KEY_SHARE 101 @@ -353,5 +354,6 @@ # define SSL_R_WRONG_VERSION_NUMBER 267 # define SSL_R_X509_LIB 268 # define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 +# define SSL_R_CONN_USE_ONLY 411 #endif |