From: Hugo Landau Date: Thu, 15 Dec 2022 07:07:35 +0000 (+0000) Subject: QUIC: Use ossl_assert X-Git-Tag: openssl-3.2.0-alpha1~1470 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79534440c5ff2ab0a6233457531e903fbe2968b7;p=thirdparty%2Fopenssl.git QUIC: Use ossl_assert Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/19703) --- diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index df4ea8385dc..346ecde6330 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 47255f61edb..aa4cff9a1db 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;