diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libssl/unit/ssl_get_shared_ciphers.c | 25 |
1 files changed, 7 insertions, 18 deletions
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 @@ | |||
| 1 | /* $OpenBSD: ssl_get_shared_ciphers.c,v 1.2 2021/01/10 09:28:30 tb Exp $ */ | 1 | /* $OpenBSD: ssl_get_shared_ciphers.c,v 1.3 2021/01/10 23:59:32 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2021 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2021 Theo Buehler <tb@openbsd.org> |
| 4 | * | 4 | * |
| @@ -316,21 +316,6 @@ push_data_to_peer(SSL *ssl, int *ret, int (*func)(SSL *), const char *func_name, | |||
| 316 | return 1; | 316 | return 1; |
| 317 | } | 317 | } |
| 318 | 318 | ||
| 319 | static int | ||
| 320 | handshake_loop(SSL *client_ssl, int *client_ret, SSL *server_ssl, | ||
| 321 | int *server_ret, const char *description) | ||
| 322 | { | ||
| 323 | if (!push_data_to_peer(client_ssl, client_ret, SSL_connect, | ||
| 324 | "SSL_connect", description)) | ||
| 325 | return 0; | ||
| 326 | |||
| 327 | if (!push_data_to_peer(server_ssl, server_ret, SSL_accept, | ||
| 328 | "SSL_accept", description)) | ||
| 329 | return 0; | ||
| 330 | |||
| 331 | return 1; | ||
| 332 | } | ||
| 333 | |||
| 334 | /* | 319 | /* |
| 335 | * Alternate between loops of SSL_connect() and SSL_accept() as long as only | 320 | * Alternate between loops of SSL_connect() and SSL_accept() as long as only |
| 336 | * WANT_READ and WANT_WRITE situations are encountered. A function is repeated | 321 | * 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) | |||
| 343 | int loops = 0, client_ret = 0, server_ret = 0; | 328 | int loops = 0, client_ret = 0, server_ret = 0; |
| 344 | 329 | ||
| 345 | while (loops++ < 10 && (client_ret <= 0 || server_ret <= 0)) { | 330 | while (loops++ < 10 && (client_ret <= 0 || server_ret <= 0)) { |
| 346 | if (!handshake_loop(client_ssl, &client_ret, server_ssl, | 331 | if (!push_data_to_peer(client_ssl, &client_ret, SSL_connect, |
| 347 | &server_ret, description)) | 332 | "SSL_connect", description)) |
| 333 | return 0; | ||
| 334 | |||
| 335 | if (!push_data_to_peer(server_ssl, &server_ret, SSL_accept, | ||
| 336 | "SSL_accept", description)) | ||
| 348 | return 0; | 337 | return 0; |
| 349 | } | 338 | } |
| 350 | 339 | ||
