Skip to content

Commit

Permalink
QUIC DISPATCH/APL: Implement SSL_set_default_stream_mode, default XSO…
Browse files Browse the repository at this point in the history
… refactor

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #20765)
  • Loading branch information
hlandau committed May 12, 2023
1 parent 19cb088 commit 8b7be3a
Show file tree
Hide file tree
Showing 10 changed files with 339 additions and 56 deletions.
1 change: 1 addition & 0 deletions crypto/err/openssl.txt
Expand Up @@ -1465,6 +1465,7 @@ SSL_R_NO_SHARED_CIPHER:193:no shared cipher
SSL_R_NO_SHARED_GROUPS:410:no shared groups
SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS:376:no shared signature algorithms
SSL_R_NO_SRTP_PROFILES:359:no srtp profiles
SSL_R_NO_STREAM:355:no stream
SSL_R_NO_SUITABLE_DIGEST_ALGORITHM:297:no suitable digest algorithm
SSL_R_NO_SUITABLE_GROUPS:295:no suitable groups
SSL_R_NO_SUITABLE_KEY_SHARE:101:no suitable key share
Expand Down
13 changes: 13 additions & 0 deletions include/internal/quic_channel.h
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions include/internal/quic_ssl.h
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions include/openssl/ssl.h.in
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions include/openssl/sslerr.h
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 8b7be3a

Please sign in to comment.