diff options
| author | tb <> | 2022-07-07 13:10:22 +0000 |
|---|---|---|
| committer | tb <> | 2022-07-07 13:10:22 +0000 |
| commit | 367422a363754ff4e6b3a3288f865a9a27d2306b (patch) | |
| tree | 346f19756179999263046d67d5ecdfe25c19bda6 /src | |
| parent | fe3d95b4f679c1b52d2b587ae54f0eaf8c783dcf (diff) | |
| download | openbsd-367422a363754ff4e6b3a3288f865a9a27d2306b.tar.gz openbsd-367422a363754ff4e6b3a3288f865a9a27d2306b.tar.bz2 openbsd-367422a363754ff4e6b3a3288f865a9a27d2306b.zip | |
Make the ssltest security level aware.
From beck
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libssl/ssl/ssltest.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/regress/lib/libssl/ssl/ssltest.c b/src/regress/lib/libssl/ssl/ssltest.c index 0deac3e736..ff5a584d6c 100644 --- a/src/regress/lib/libssl/ssl/ssltest.c +++ b/src/regress/lib/libssl/ssl/ssltest.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssltest.c,v 1.34 2022/07/07 11:40:17 tb Exp $ */ | 1 | /* $OpenBSD: ssltest.c,v 1.35 2022/07/07 13:10:22 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 | * |
| @@ -434,6 +434,7 @@ main(int argc, char *argv[]) | |||
| 434 | const SSL_METHOD *meth = NULL; | 434 | const SSL_METHOD *meth = NULL; |
| 435 | SSL *c_ssl, *s_ssl; | 435 | SSL *c_ssl, *s_ssl; |
| 436 | int number = 1, reuse = 0; | 436 | int number = 1, reuse = 0; |
| 437 | int seclevel = 0; | ||
| 437 | long bytes = 256L; | 438 | long bytes = 256L; |
| 438 | DH *dh; | 439 | DH *dh; |
| 439 | int dhe1024dsa = 0; | 440 | int dhe1024dsa = 0; |
| @@ -494,6 +495,10 @@ main(int argc, char *argv[]) | |||
| 494 | number = atoi(*(++argv)); | 495 | number = atoi(*(++argv)); |
| 495 | if (number == 0) | 496 | if (number == 0) |
| 496 | number = 1; | 497 | number = 1; |
| 498 | } else if (strncmp(*argv, "-seclevel", 9) == 0) { | ||
| 499 | if (--argc < 1) | ||
| 500 | goto bad; | ||
| 501 | seclevel = atoi(*(++argv)); | ||
| 497 | } else if (strcmp(*argv, "-bytes") == 0) { | 502 | } else if (strcmp(*argv, "-bytes") == 0) { |
| 498 | if (--argc < 1) | 503 | if (--argc < 1) |
| 499 | goto bad; | 504 | goto bad; |
| @@ -620,6 +625,9 @@ bad: | |||
| 620 | goto end; | 625 | goto end; |
| 621 | } | 626 | } |
| 622 | 627 | ||
| 628 | SSL_CTX_set_security_level(c_ctx, seclevel); | ||
| 629 | SSL_CTX_set_security_level(s_ctx, seclevel); | ||
| 630 | |||
| 623 | if (cipher != NULL) { | 631 | if (cipher != NULL) { |
| 624 | SSL_CTX_set_cipher_list(c_ctx, cipher); | 632 | SSL_CTX_set_cipher_list(c_ctx, cipher); |
| 625 | SSL_CTX_set_cipher_list(s_ctx, cipher); | 633 | SSL_CTX_set_cipher_list(s_ctx, cipher); |
