From: Matt Caswell Date: Wed, 20 Sep 2023 12:25:42 +0000 (+0100) Subject: Remove some redundant code from test helper BIOs X-Git-Tag: openssl-3.2.0-alpha2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c29b13a7356432a0f177dd838afbec963f1d6212;p=thirdparty%2Fopenssl.git Remove some redundant code from test helper BIOs Reviewed-by: Tim Hudson Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/22157) --- diff --git a/test/helpers/noisydgrambio.c b/test/helpers/noisydgrambio.c index 7dc6a9cf35f..c93b6961ecd 100644 --- a/test/helpers/noisydgrambio.c +++ b/test/helpers/noisydgrambio.c @@ -19,18 +19,6 @@ struct noisy_dgram_st { uint64_t delayed_dgram; }; -static int noisy_dgram_read(BIO *bio, char *out, int outl) -{ - /* We don't support this - not needed anyway */ - return -1; -} - -static int noisy_dgram_write(BIO *bio, const char *in, int inl) -{ - /* We don't support this - not needed anyway */ - return -1; -} - static long noisy_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr) { long ret; @@ -50,18 +38,6 @@ static long noisy_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr) return ret; } -static int noisy_dgram_gets(BIO *bio, char *buf, int size) -{ - /* We don't support this - not needed anyway */ - return -1; -} - -static int noisy_dgram_puts(BIO *bio, const char *str) -{ - /* We don't support this - not needed anyway */ - return -1; -} - static int noisy_dgram_sendmmsg(BIO *bio, BIO_MSG *msg, size_t stride, size_t num_msg, uint64_t flags, size_t *msgs_processed) @@ -298,10 +274,6 @@ const BIO_METHOD *bio_f_noisy_dgram_filter(void) method_noisy_dgram = BIO_meth_new(BIO_TYPE_NOISY_DGRAM_FILTER, "Nosiy datagram filter"); if (method_noisy_dgram == NULL - || !BIO_meth_set_write(method_noisy_dgram, noisy_dgram_write) - || !BIO_meth_set_read(method_noisy_dgram, noisy_dgram_read) - || !BIO_meth_set_puts(method_noisy_dgram, noisy_dgram_puts) - || !BIO_meth_set_gets(method_noisy_dgram, noisy_dgram_gets) || !BIO_meth_set_ctrl(method_noisy_dgram, noisy_dgram_ctrl) || !BIO_meth_set_sendmmsg(method_noisy_dgram, noisy_dgram_sendmmsg) || !BIO_meth_set_recvmmsg(method_noisy_dgram, noisy_dgram_recvmmsg) diff --git a/test/helpers/pktsplitbio.c b/test/helpers/pktsplitbio.c index a3c01b9506f..536e62f8a00 100644 --- a/test/helpers/pktsplitbio.c +++ b/test/helpers/pktsplitbio.c @@ -11,18 +11,6 @@ #include "quictestlib.h" #include "../testutil.h" -static int pkt_split_dgram_read(BIO *bio, char *out, int outl) -{ - /* We don't support this - not needed anyway */ - return -1; -} - -static int pkt_split_dgram_write(BIO *bio, const char *in, int inl) -{ - /* We don't support this - not needed anyway */ - return -1; -} - static long pkt_split_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr) { long ret; @@ -42,18 +30,6 @@ static long pkt_split_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr) return ret; } -static int pkt_split_dgram_gets(BIO *bio, char *buf, int size) -{ - /* We don't support this - not needed anyway */ - return -1; -} - -static int pkt_split_dgram_puts(BIO *bio, const char *str) -{ - /* We don't support this - not needed anyway */ - return -1; -} - static int pkt_split_dgram_sendmmsg(BIO *bio, BIO_MSG *msg, size_t stride, size_t num_msg, uint64_t flags, size_t *msgs_processed) @@ -149,10 +125,6 @@ const BIO_METHOD *bio_f_pkt_split_dgram_filter(void) method_pkt_split_dgram = BIO_meth_new(BIO_TYPE_PKT_SPLIT_DGRAM_FILTER, "Packet splitting datagram filter"); if (method_pkt_split_dgram == NULL - || !BIO_meth_set_write(method_pkt_split_dgram, pkt_split_dgram_write) - || !BIO_meth_set_read(method_pkt_split_dgram, pkt_split_dgram_read) - || !BIO_meth_set_puts(method_pkt_split_dgram, pkt_split_dgram_puts) - || !BIO_meth_set_gets(method_pkt_split_dgram, pkt_split_dgram_gets) || !BIO_meth_set_ctrl(method_pkt_split_dgram, pkt_split_dgram_ctrl) || !BIO_meth_set_sendmmsg(method_pkt_split_dgram, pkt_split_dgram_sendmmsg)