diff options
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_channel.c | 20 | ||||
-rw-r--r-- | ssl/quic/quic_channel_local.h | 6 |
2 files changed, 26 insertions, 0 deletions
diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index 86eed313ab..efe8ca6def 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -115,6 +115,10 @@ static int ch_init(QUIC_CHANNEL *ch) qtx_args.mdpl = QUIC_MIN_INITIAL_DGRAM_LEN; ch->rx_max_udp_payload_size = qtx_args.mdpl; + ch->mutex = CRYPTO_THREAD_lock_new(); + if (ch->mutex == NULL) + goto err; + ch->qtx = ossl_qtx_new(&qtx_args); if (ch->qtx == NULL) goto err; @@ -318,6 +322,7 @@ static void ch_cleanup(QUIC_CHANNEL *ch) ossl_qrx_free(ch->qrx); ossl_quic_demux_free(ch->demux); OPENSSL_free(ch->local_transport_params); + CRYPTO_THREAD_lock_free(ch->mutex); } QUIC_CHANNEL *ossl_quic_channel_new(const QUIC_CHANNEL_ARGS *args) @@ -443,6 +448,21 @@ QUIC_DEMUX *ossl_quic_channel_get0_demux(QUIC_CHANNEL *ch) return ch->demux; } +CRYPTO_MUTEX *ossl_quic_channel_get_mutex(QUIC_CHANNEL *ch) +{ + return ch->mutex; +} + +int ossl_quic_channel_lock(QUIC_CHANNEL *ch) +{ + return ossl_crypto_mutex_lock(ch->mutex); +} + +void ossl_quic_channel_unlock(QUIC_CHANNEL *ch) +{ + ossl_crypto_mutex_unlock(ch->mutex); +} + /* * QUIC Channel: Callbacks from Miscellaneous Subsidiary Components * ================================================================ diff --git a/ssl/quic/quic_channel_local.h b/ssl/quic/quic_channel_local.h index fa2618bce5..2f63119cef 100644 --- a/ssl/quic/quic_channel_local.h +++ b/ssl/quic/quic_channel_local.h @@ -26,6 +26,12 @@ struct quic_channel_st { const char *propq; /* + * Master synchronisation mutex used for thread assisted mode + * synchronisation. + */ + CRYPTO_RWLOCK *mutex; + + /* * The associated TLS 1.3 connection data. Used to provide the handshake * layer; its 'network' side is plugged into the crypto stream for each EL * (other than the 0-RTT EL). |