Remove some redundant code from test helper BIOs
authorMatt Caswell <matt@openssl.org>
Wed, 20 Sep 2023 12:25:42 +0000 (13:25 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 22 Sep 2023 12:56:43 +0000 (13:56 +0100)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22157)

test/helpers/noisydgrambio.c
test/helpers/pktsplitbio.c

index 7dc6a9cf35f40b7d41024a0ec8d1c649672db20b..c93b6961ecd182823912568e642e0019d3fc0f90 100644 (file)
@@ -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)
index a3c01b9506f28e537a8a2c3fa2a80d02ef23965e..536e62f8a0030d1951e16807a7553befa7f0d11b 100644 (file)
 #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)