summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/ciphers.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/usr.bin/openssl/ciphers.c b/src/usr.bin/openssl/ciphers.c
index c16a4a637b..fd9e839064 100644
--- a/src/usr.bin/openssl/ciphers.c
+++ b/src/usr.bin/openssl/ciphers.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ciphers.c,v 1.4 2015/03/02 07:51:25 bcook Exp $ */ 1/* $OpenBSD: ciphers.c,v 1.5 2015/07/17 16:04:09 doug Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -24,7 +24,6 @@
24#include "apps.h" 24#include "apps.h"
25 25
26struct { 26struct {
27 int ssl_version;
28 int usage; 27 int usage;
29 int verbose; 28 int verbose;
30} ciphers_config; 29} ciphers_config;
@@ -41,18 +40,9 @@ struct option ciphers_options[] = {
41 .opt.flag = &ciphers_config.usage, 40 .opt.flag = &ciphers_config.usage,
42 }, 41 },
43 { 42 {
44 .name = "ssl3",
45 .desc = "Only include SSLv3 ciphers",
46 .type = OPTION_VALUE,
47 .opt.value = &ciphers_config.ssl_version,
48 .value = SSL3_VERSION,
49 },
50 {
51 .name = "tls1", 43 .name = "tls1",
52 .desc = "Only include TLSv1 ciphers", 44 .desc = "This option is deprecated since it is the default",
53 .type = OPTION_VALUE, 45 .type = OPTION_DISCARD,
54 .opt.value = &ciphers_config.ssl_version,
55 .value = TLS1_VERSION,
56 }, 46 },
57 { 47 {
58 .name = "v", 48 .name = "v",
@@ -74,7 +64,7 @@ struct option ciphers_options[] = {
74static void 64static void
75ciphers_usage(void) 65ciphers_usage(void)
76{ 66{
77 fprintf(stderr, "usage: ciphers [-hVv] [-ssl3 | -tls1] [cipherlist]\n"); 67 fprintf(stderr, "usage: ciphers [-hVv] [-tls1] [cipherlist]\n");
78 options_usage(ciphers_options); 68 options_usage(ciphers_options);
79} 69}
80 70
@@ -83,7 +73,6 @@ ciphers_main(int argc, char **argv)
83{ 73{
84 char *cipherlist = NULL; 74 char *cipherlist = NULL;
85 STACK_OF(SSL_CIPHER) *ciphers; 75 STACK_OF(SSL_CIPHER) *ciphers;
86 const SSL_METHOD *ssl_method;
87 const SSL_CIPHER *cipher; 76 const SSL_CIPHER *cipher;
88 SSL_CTX *ssl_ctx = NULL; 77 SSL_CTX *ssl_ctx = NULL;
89 SSL *ssl = NULL; 78 SSL *ssl = NULL;
@@ -104,18 +93,7 @@ ciphers_main(int argc, char **argv)
104 return (1); 93 return (1);
105 } 94 }
106 95
107 switch (ciphers_config.ssl_version) { 96 if ((ssl_ctx = SSL_CTX_new(TLSv1_client_method())) == NULL)
108 case SSL3_VERSION:
109 ssl_method = SSLv3_client_method();
110 break;
111 case TLS1_VERSION:
112 ssl_method = TLSv1_client_method();
113 break;
114 default:
115 ssl_method = SSLv3_server_method();
116 }
117
118 if ((ssl_ctx = SSL_CTX_new(ssl_method)) == NULL)
119 goto err; 97 goto err;
120 98
121 if (cipherlist != NULL) { 99 if (cipherlist != NULL) {