diff options
author | jsing <> | 2020-07-14 18:11:16 +0000 |
---|---|---|
committer | jsing <> | 2020-07-14 18:11:16 +0000 |
commit | 307bb197e7ac1d6f63a8847f065f376be91a0b92 (patch) | |
tree | 2b54abb65b5970f19e22f62b4d96cc4bfa8d64e3 /src/regress/lib/libssl/ssl/ssltest.c | |
parent | 4f1ef9d80a0607a37ef931241c14ed2da153094f (diff) | |
download | openbsd-307bb197e7ac1d6f63a8847f065f376be91a0b92.tar.gz openbsd-307bb197e7ac1d6f63a8847f065f376be91a0b92.tar.bz2 openbsd-307bb197e7ac1d6f63a8847f065f376be91a0b92.zip |
Add a -tls1_2 option so we can force TLSv1.2 for testing.
Diffstat (limited to 'src/regress/lib/libssl/ssl/ssltest.c')
-rw-r--r-- | src/regress/lib/libssl/ssl/ssltest.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/regress/lib/libssl/ssl/ssltest.c b/src/regress/lib/libssl/ssl/ssltest.c index 837622816a..f405741887 100644 --- a/src/regress/lib/libssl/ssl/ssltest.c +++ b/src/regress/lib/libssl/ssl/ssltest.c | |||
@@ -348,6 +348,7 @@ sv_usage(void) | |||
348 | fprintf(stderr, " -no_ecdhe - disable ECDHE\n"); | 348 | fprintf(stderr, " -no_ecdhe - disable ECDHE\n"); |
349 | fprintf(stderr, " -dtls1 - use DTLSv1\n"); | 349 | fprintf(stderr, " -dtls1 - use DTLSv1\n"); |
350 | fprintf(stderr, " -tls1 - use TLSv1\n"); | 350 | fprintf(stderr, " -tls1 - use TLSv1\n"); |
351 | fprintf(stderr, " -tls1_2 - use TLSv1.2\n"); | ||
351 | fprintf(stderr, " -CApath arg - PEM format directory of CA's\n"); | 352 | fprintf(stderr, " -CApath arg - PEM format directory of CA's\n"); |
352 | fprintf(stderr, " -CAfile arg - PEM format file of CA's\n"); | 353 | fprintf(stderr, " -CAfile arg - PEM format file of CA's\n"); |
353 | fprintf(stderr, " -cert arg - Server certificate file\n"); | 354 | fprintf(stderr, " -cert arg - Server certificate file\n"); |
@@ -408,7 +409,7 @@ main(int argc, char *argv[]) | |||
408 | int badop = 0; | 409 | int badop = 0; |
409 | int bio_pair = 0; | 410 | int bio_pair = 0; |
410 | int force = 0; | 411 | int force = 0; |
411 | int tls1 = 0, dtls1 = 0, ret = 1; | 412 | int tls1 = 0, tls1_2 = 0, dtls1 = 0, ret = 1; |
412 | int client_auth = 0; | 413 | int client_auth = 0; |
413 | int server_auth = 0, i; | 414 | int server_auth = 0, i; |
414 | struct app_verify_arg app_verify_arg = | 415 | struct app_verify_arg app_verify_arg = |
@@ -476,6 +477,8 @@ main(int argc, char *argv[]) | |||
476 | dtls1 = 1; | 477 | dtls1 = 1; |
477 | else if (strcmp(*argv, "-tls1") == 0) | 478 | else if (strcmp(*argv, "-tls1") == 0) |
478 | tls1 = 1; | 479 | tls1 = 1; |
480 | else if (strcmp(*argv, "-tls1_2") == 0) | ||
481 | tls1_2 = 1; | ||
479 | else if (strncmp(*argv, "-num", 4) == 0) { | 482 | else if (strncmp(*argv, "-num", 4) == 0) { |
480 | if (--argc < 1) | 483 | if (--argc < 1) |
481 | goto bad; | 484 | goto bad; |
@@ -579,12 +582,11 @@ bad: | |||
579 | goto end; | 582 | goto end; |
580 | } | 583 | } |
581 | 584 | ||
582 | if (!dtls1 && !tls1 && | 585 | if (!dtls1 && !tls1 && !tls1_2 && number > 1 && !reuse && !force) { |
583 | number > 1 && !reuse && !force) { | ||
584 | fprintf(stderr, | 586 | fprintf(stderr, |
585 | "This case cannot work. Use -f to perform " | 587 | "This case cannot work. Use -f to perform " |
586 | "the test anyway (and\n-d to see what happens), " | 588 | "the test anyway (and\n-d to see what happens), " |
587 | "or add one of -dtls1, -tls1, -reuse\n" | 589 | "or add one of -dtls1, -tls1, -tls1_2, -reuse\n" |
588 | "to avoid protocol mismatch.\n"); | 590 | "to avoid protocol mismatch.\n"); |
589 | exit(1); | 591 | exit(1); |
590 | } | 592 | } |
@@ -607,8 +609,10 @@ bad: | |||
607 | meth = DTLSv1_method(); | 609 | meth = DTLSv1_method(); |
608 | else if (tls1) | 610 | else if (tls1) |
609 | meth = TLSv1_method(); | 611 | meth = TLSv1_method(); |
612 | else if (tls1_2) | ||
613 | meth = TLSv1_2_method(); | ||
610 | else | 614 | else |
611 | meth = SSLv23_method(); | 615 | meth = TLS_method(); |
612 | 616 | ||
613 | c_ctx = SSL_CTX_new(meth); | 617 | c_ctx = SSL_CTX_new(meth); |
614 | s_ctx = SSL_CTX_new(meth); | 618 | s_ctx = SSL_CTX_new(meth); |