diff options
author | tb <> | 2021-01-12 17:53:18 +0000 |
---|---|---|
committer | tb <> | 2021-01-12 17:53:18 +0000 |
commit | 4f375cd7c6652350830e386787ddf80aedd74b45 (patch) | |
tree | efa72611f926947b22062e0c9a664ac8e7063e1f /src/regress/lib | |
parent | 7dc7837889af010b174d8e0b2c64d1d8d41c7749 (diff) | |
download | openbsd-4f375cd7c6652350830e386787ddf80aedd74b45.tar.gz openbsd-4f375cd7c6652350830e386787ddf80aedd74b45.tar.bz2 openbsd-4f375cd7c6652350830e386787ddf80aedd74b45.zip |
A few minor tweaks to make my OCD happy.
Sort headers, unwrap a line, fix grammar in spelling and simplify
the check for test failure.
Diffstat (limited to 'src/regress/lib')
-rw-r--r-- | src/regress/lib/libssl/unit/ssl_get_shared_ciphers.c | 21 |
1 files changed, 9 insertions, 12 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 cc5b876ab3..2501f328bb 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.6 2021/01/11 18:33:43 tb Exp $ */ | 1 | /* $OpenBSD: ssl_get_shared_ciphers.c,v 1.7 2021/01/12 17:53:18 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2021 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2021 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
@@ -21,8 +21,8 @@ | |||
21 | #include <string.h> | 21 | #include <string.h> |
22 | 22 | ||
23 | #include <openssl/bio.h> | 23 | #include <openssl/bio.h> |
24 | #include <openssl/err.h> | ||
25 | #include <openssl/crypto.h> | 24 | #include <openssl/crypto.h> |
25 | #include <openssl/err.h> | ||
26 | #include <openssl/ssl.h> | 26 | #include <openssl/ssl.h> |
27 | 27 | ||
28 | struct peer_config { | 28 | struct peer_config { |
@@ -219,8 +219,7 @@ peer_config_to_ssl_ctx(const struct peer_config *config) | |||
219 | goto err; | 219 | goto err; |
220 | } | 220 | } |
221 | if (!SSL_CTX_set_cipher_list(ctx, config->ciphers)) { | 221 | if (!SSL_CTX_set_cipher_list(ctx, config->ciphers)) { |
222 | fprintf(stderr, "set_cipher_list(%s) failed\n", | 222 | fprintf(stderr, "set_cipher_list(%s) failed\n", config->name); |
223 | config->name); | ||
224 | goto err; | 223 | goto err; |
225 | } | 224 | } |
226 | 225 | ||
@@ -329,8 +328,8 @@ push_data_to_peer(SSL *ssl, int *ret, int (*func)(SSL *), const char *func_name, | |||
329 | /* | 328 | /* |
330 | * Alternate between loops of SSL_connect() and SSL_accept() as long as only | 329 | * Alternate between loops of SSL_connect() and SSL_accept() as long as only |
331 | * WANT_READ and WANT_WRITE situations are encountered. A function is repeated | 330 | * WANT_READ and WANT_WRITE situations are encountered. A function is repeated |
332 | * until WANT_READ is returned or it succeeds, then it's the other functions | 331 | * until WANT_READ is returned or it succeeds, then it's the other function's |
333 | * turn to make progress. Success: both functions returned 1. | 332 | * turn to make progress. Succeeds if SSL_connect() and SSL_accept() return 1. |
334 | */ | 333 | */ |
335 | static int | 334 | static int |
336 | handshake(SSL *client_ssl, SSL *server_ssl, const char *description) | 335 | handshake(SSL *client_ssl, SSL *server_ssl, const char *description) |
@@ -396,13 +395,11 @@ check_shared_ciphers(const struct ssl_shared_ciphers_test_data *test, | |||
396 | const char *want = test->shared_ciphers; | 395 | const char *want = test->shared_ciphers; |
397 | int failed; | 396 | int failed; |
398 | 397 | ||
399 | failed = strcmp(want, got); | 398 | if (!ssl_aes_is_accelerated() && |
400 | 399 | test->shared_ciphers_without_aesni != NULL) | |
401 | if (failed && !ssl_aes_is_accelerated() && | ||
402 | test->shared_ciphers_without_aesni != NULL) { | ||
403 | want = test->shared_ciphers_without_aesni; | 400 | want = test->shared_ciphers_without_aesni; |
404 | failed = strcmp(want, got); | 401 | |
405 | } | 402 | failed = strcmp(want, got); |
406 | 403 | ||
407 | if (failed) | 404 | if (failed) |
408 | fprintf(stderr, "%s: want \"%s\", got \"%s\"\n", | 405 | fprintf(stderr, "%s: want \"%s\", got \"%s\"\n", |