diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-12-15 06:42:43 +0000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-01-13 13:20:21 +0000 |
commit | dfc227bd245c356aea11dfdec9fe0f3d66bca16e (patch) | |
tree | 0cc78731e2046349fdcc011e8e55bf296e264de1 /ssl | |
parent | 0651e0547490af29b33ce9fd55eb20b2f1499c51 (diff) |
QUIC Front End I/O API: Don't allow EPW to be enabled during AON
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_impl.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index ac78ba87f1..e59e6d8537 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -492,13 +492,6 @@ int ossl_quic_shutdown(SSL *s) } /* SSL_ctrl */ -static void fixup_mode_change(QUIC_CONNECTION *qc) -{ - /* If enabling EPW mode, cancel any AON write */ - if ((qc->ssl_mode & SSL_MODE_ENABLE_PARTIAL_WRITE) != 0) - aon_write_finish(qc); -} - long ossl_quic_ctrl(SSL *s, int cmd, long larg, void *parg) { QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(s); @@ -508,12 +501,14 @@ long ossl_quic_ctrl(SSL *s, int cmd, long larg, void *parg) switch (cmd) { case SSL_CTRL_MODE: + /* Cannot enable EPW while AON write in progress. */ + if (qc->aon_write_in_progress) + larg &= ~SSL_MODE_ENABLE_PARTIAL_WRITE; + qc->ssl_mode |= (uint32_t)larg; - fixup_mode_change(qc); return qc->ssl_mode; case SSL_CTRL_CLEAR_MODE: qc->ssl_mode &= ~(uint32_t)larg; - fixup_mode_change(qc); return qc->ssl_mode; default: return 0; |