diff options
author | tb <> | 2021-12-06 11:06:58 +0000 |
---|---|---|
committer | tb <> | 2021-12-06 11:06:58 +0000 |
commit | 60a6a10467f5b7d56c92fe8e4133a6af9e9bd48f (patch) | |
tree | 55bcc3ded6ebb2898bb541a7b58b36f5c9bc096d /src/usr.bin/openssl/s_server.c | |
parent | f99574add34cb55c0297c6dcad8ed12e9eb18893 (diff) | |
download | openbsd-60a6a10467f5b7d56c92fe8e4133a6af9e9bd48f.tar.gz openbsd-60a6a10467f5b7d56c92fe8e4133a6af9e9bd48f.tar.bz2 openbsd-60a6a10467f5b7d56c92fe8e4133a6af9e9bd48f.zip |
Clean up a bunch of dead code in s_server.c and s_socket.c
jsg's analysis tool flagged a potential double free in do_server().
While this looks like a false positive, we can clean this code up
a little: the host name passed to the callbacks isn't used by either
sv_body() and www_body(), so it can be made local to do_accept()
(an extra variable would not even be needed). Simplify the callbacks'
signatures accordingly. Remove some commented out linger code that
would never be used again anyway.
ok inoguchi jsg
Diffstat (limited to 'src/usr.bin/openssl/s_server.c')
-rw-r--r-- | src/usr.bin/openssl/s_server.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/usr.bin/openssl/s_server.c b/src/usr.bin/openssl/s_server.c index 233b8fdced..9b06856ac9 100644 --- a/src/usr.bin/openssl/s_server.c +++ b/src/usr.bin/openssl/s_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_server.c,v 1.53 2021/10/31 16:47:27 tb Exp $ */ | 1 | /* $OpenBSD: s_server.c,v 1.54 2021/12/06 11:06:58 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -180,13 +180,13 @@ | |||
180 | static void s_server_init(void); | 180 | static void s_server_init(void); |
181 | static void sv_usage(void); | 181 | static void sv_usage(void); |
182 | static void print_stats(BIO *bp, SSL_CTX *ctx); | 182 | static void print_stats(BIO *bp, SSL_CTX *ctx); |
183 | static int sv_body(char *hostname, int s, unsigned char *context); | 183 | static int sv_body(int s, unsigned char *context); |
184 | static void close_accept_socket(void); | 184 | static void close_accept_socket(void); |
185 | static int init_ssl_connection(SSL *s); | 185 | static int init_ssl_connection(SSL *s); |
186 | #ifndef OPENSSL_NO_DH | 186 | #ifndef OPENSSL_NO_DH |
187 | static DH *load_dh_param(const char *dhfile); | 187 | static DH *load_dh_param(const char *dhfile); |
188 | #endif | 188 | #endif |
189 | static int www_body(char *hostname, int s, unsigned char *context); | 189 | static int www_body(int s, unsigned char *context); |
190 | static int generate_session_id(const SSL *ssl, unsigned char *id, | 190 | static int generate_session_id(const SSL *ssl, unsigned char *id, |
191 | unsigned int *id_len); | 191 | unsigned int *id_len); |
192 | static int ssl_servername_cb(SSL *s, int *ad, void *arg); | 192 | static int ssl_servername_cb(SSL *s, int *ad, void *arg); |
@@ -1531,7 +1531,7 @@ print_stats(BIO *bio, SSL_CTX *ssl_ctx) | |||
1531 | } | 1531 | } |
1532 | 1532 | ||
1533 | static int | 1533 | static int |
1534 | sv_body(char *hostname, int s, unsigned char *context) | 1534 | sv_body(int s, unsigned char *context) |
1535 | { | 1535 | { |
1536 | char *buf = NULL; | 1536 | char *buf = NULL; |
1537 | int ret = 1; | 1537 | int ret = 1; |
@@ -1956,7 +1956,7 @@ load_dh_param(const char *dhfile) | |||
1956 | #endif | 1956 | #endif |
1957 | 1957 | ||
1958 | static int | 1958 | static int |
1959 | www_body(char *hostname, int s, unsigned char *context) | 1959 | www_body(int s, unsigned char *context) |
1960 | { | 1960 | { |
1961 | char *buf = NULL; | 1961 | char *buf = NULL; |
1962 | int ret = 1; | 1962 | int ret = 1; |