diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-05-26 15:54:56 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-07-07 15:13:29 +0200 |
commit | 5c3474ea563ed95bb7c86c08867139613655276b (patch) | |
tree | b85a2fd2bdbe7eebf00a5311b6acea26dd2c7a89 /ssl/quic/quic_impl.c | |
parent | 76696a5413db0a93e374f9f0f55e5694f93ecc0e (diff) |
QUIC err handling: Properly report network errors
We return SSL_ERROR_SYSCALL when network error is encountered.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21087)
Diffstat (limited to 'ssl/quic/quic_impl.c')
-rw-r--r-- | ssl/quic/quic_impl.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 4866f52562..c0f65c2138 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -1664,11 +1664,20 @@ SSL *ossl_quic_conn_stream_new(SSL *s, uint64_t flags) int ossl_quic_get_error(const SSL *s, int i) { QCTX ctx; + int net_error, last_error; if (!expect_quic(s, &ctx)) return 0; - return ctx.is_stream ? ctx.xso->last_error : ctx.qc->last_error; + quic_lock(ctx.qc); + net_error = ossl_quic_channel_net_error(ctx.qc->ch); + last_error = ctx.is_stream ? ctx.xso->last_error : ctx.qc->last_error; + quic_unlock(ctx.qc); + + if (net_error) + return SSL_ERROR_SYSCALL; + + return last_error; } /* |