From: Nan Xiao Date: Mon, 29 Mar 2021 09:24:01 +0000 (+0800) Subject: Remove unnecessary BIO_do_handshake()s X-Git-Tag: openssl-3.0.0-alpha14~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=975e37cd016f86985d16f1ee646e88213494854a;p=thirdparty%2Fopenssl.git Remove unnecessary BIO_do_handshake()s Since BIO_do_connect() and BIO_do_handshake() are same, no need to invoke BIO_do_handshake() once more after BIO_do_connect(). Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14725) --- diff --git a/demos/bio/client-arg.c b/demos/bio/client-arg.c index 976fefff5da..27c4c98f966 100644 --- a/demos/bio/client-arg.c +++ b/demos/bio/client-arg.c @@ -94,12 +94,6 @@ int main(int argc, char **argv) goto end; } - if (BIO_do_handshake(sbio) <= 0) { - fprintf(stderr, "Error establishing SSL connection\n"); - ERR_print_errors_fp(stderr); - goto end; - } - /* Could examine ssl here to get connection info */ BIO_puts(sbio, "GET / HTTP/1.0\n\n"); diff --git a/demos/bio/client-conf.c b/demos/bio/client-conf.c index 84edc796dcf..270df377e7d 100644 --- a/demos/bio/client-conf.c +++ b/demos/bio/client-conf.c @@ -102,12 +102,6 @@ int main(int argc, char **argv) goto end; } - if (BIO_do_handshake(sbio) <= 0) { - fprintf(stderr, "Error establishing SSL connection\n"); - ERR_print_errors_fp(stderr); - goto end; - } - /* Could examine ssl here to get connection info */ BIO_puts(sbio, "GET / HTTP/1.0\n\n"); diff --git a/doc/man3/BIO_f_ssl.pod b/doc/man3/BIO_f_ssl.pod index 6a21e0c41cd..8eee317c7ad 100644 --- a/doc/man3/BIO_f_ssl.pod +++ b/doc/man3/BIO_f_ssl.pod @@ -188,11 +188,6 @@ unencrypted example in L. ERR_print_errors_fp(stderr); exit(1); } - if (BIO_do_handshake(sbio) <= 0) { - fprintf(stderr, "Error establishing SSL connection\n"); - ERR_print_errors_fp(stderr); - exit(1); - } /* XXX Could examine ssl here to get connection info */