summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-12-15 07:07:35 +0000
committerHugo Landau <hlandau@openssl.org>2023-01-13 13:20:22 +0000
commit79534440c5ff2ab0a6233457531e903fbe2968b7 (patch)
treea00077c4f727ec546e55796645f8b6bae0c4ae23 /ssl
parent2d2fd151d4e699da269e586713e785a758f45157 (diff)
QUIC: Use ossl_assert
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_channel.c5
-rw-r--r--ssl/quic/quic_reactor.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c
index df4ea8385d..346ecde633 100644
--- a/ssl/quic/quic_channel.c
+++ b/ssl/quic/quic_channel.c
@@ -1481,8 +1481,9 @@ static int ch_discard_el(QUIC_CHANNEL *ch,
ossl_ackm_on_pkt_space_discarded(ch->ackm, pn_space);
/* We should still have crypto streams at this point. */
- assert(ch->crypto_send[pn_space] != NULL);
- assert(ch->crypto_recv[pn_space] != NULL);
+ if (!ossl_assert(ch->crypto_send[pn_space] != NULL)
+ || !ossl_assert(ch->crypto_recv[pn_space] != NULL))
+ return 0;
/* Get rid of the crypto stream state for the EL. */
ossl_quic_sstream_free(ch->crypto_send[pn_space]);
diff --git a/ssl/quic/quic_reactor.c b/ssl/quic/quic_reactor.c
index 47255f61ed..aa4cff9a1d 100644
--- a/ssl/quic/quic_reactor.c
+++ b/ssl/quic/quic_reactor.c
@@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/
#include "internal/quic_reactor.h"
+#include "internal/common.h"
/*
* Core I/O Reactor Framework
@@ -159,7 +160,8 @@ static int poll_two_fds(int rfd, int rfd_want_read,
if (wfd > maxfd)
maxfd = wfd;
- if (rfd == -1 && wfd == -1 && ossl_time_is_infinite(deadline))
+ if (!ossl_assert(rfd != -1 || wfd != -1
+ || !ossl_time_is_infinite(deadline)))
/* Do not block forever; should not happen. */
return 0;
@@ -210,7 +212,7 @@ static int poll_two_fds(int rfd, int rfd_want_read,
++npfd;
}
- if (npfd == 0 && ossl_time_is_infinite(deadline))
+ if (!ossl_assert(npfd != 0 || !ossl_time_is_infinite(deadline)))
/* Do not block forever; should not happen. */
return 0;