From 75a29aff7e93987e4d69a00ff02242cb0571b848 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 10 Jan 2021 23:59:32 +0000 Subject: Merge handshake_loop() into handshake(). There's no benefit in having this factored into a separate function. --- .../lib/libssl/unit/ssl_get_shared_ciphers.c | 25 ++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/regress/lib/libssl/unit/ssl_get_shared_ciphers.c b/src/regress/lib/libssl/unit/ssl_get_shared_ciphers.c index e8026217ce..ad46e210e2 100644 --- a/src/regress/lib/libssl/unit/ssl_get_shared_ciphers.c +++ b/src/regress/lib/libssl/unit/ssl_get_shared_ciphers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_get_shared_ciphers.c,v 1.2 2021/01/10 09:28:30 tb Exp $ */ +/* $OpenBSD: ssl_get_shared_ciphers.c,v 1.3 2021/01/10 23:59:32 tb Exp $ */ /* * Copyright (c) 2021 Theo Buehler * @@ -316,21 +316,6 @@ push_data_to_peer(SSL *ssl, int *ret, int (*func)(SSL *), const char *func_name, return 1; } -static int -handshake_loop(SSL *client_ssl, int *client_ret, SSL *server_ssl, - int *server_ret, const char *description) -{ - if (!push_data_to_peer(client_ssl, client_ret, SSL_connect, - "SSL_connect", description)) - return 0; - - if (!push_data_to_peer(server_ssl, server_ret, SSL_accept, - "SSL_accept", description)) - return 0; - - return 1; -} - /* * Alternate between loops of SSL_connect() and SSL_accept() as long as only * WANT_READ and WANT_WRITE situations are encountered. A function is repeated @@ -343,8 +328,12 @@ handshake(SSL *client_ssl, SSL *server_ssl, const char *description) int loops = 0, client_ret = 0, server_ret = 0; while (loops++ < 10 && (client_ret <= 0 || server_ret <= 0)) { - if (!handshake_loop(client_ssl, &client_ret, server_ssl, - &server_ret, description)) + if (!push_data_to_peer(client_ssl, &client_ret, SSL_connect, + "SSL_connect", description)) + return 0; + + if (!push_data_to_peer(server_ssl, &server_ret, SSL_accept, + "SSL_accept", description)) return 0; } -- cgit v1.2.3-55-g6feb