diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-05-10 22:13:03 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-05-10 22:53:39 +0100 |
commit | 1480b8a9ec3a75220da11dbbb336f3c03aa91053 (patch) | |
tree | c94e377a6d2e0baca989007f574d7d873e0f5492 /apps | |
parent | bfcdd4d098d12aa621fc5fc92030423f8df053ab (diff) |
Add -srp option to ciphers command.
RT#4224
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/ciphers.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/ciphers.c b/apps/ciphers.c index 924c0153b3..44f4216363 100644 --- a/apps/ciphers.c +++ b/apps/ciphers.c @@ -70,6 +70,7 @@ typedef enum OPTION_choice { OPT_TLS1_1, OPT_TLS1_2, OPT_PSK, + OPT_SRP, OPT_V, OPT_UPPER_V, OPT_S } OPTION_CHOICE; @@ -96,6 +97,9 @@ OPTIONS ciphers_options[] = { #ifndef OPENSSL_NO_PSK {"psk", OPT_PSK, '-', "include ciphersuites requiring PSK"}, #endif +#ifndef OPENSSL_NO_SRP + {"srp", OPT_SRP, '-', "include ciphersuites requiring SRP"}, +#endif {NULL} }; @@ -108,6 +112,12 @@ static unsigned int dummy_psk(SSL *ssl, const char *hint, char *identity, return 0; } #endif +#ifndef OPENSSL_NO_SRP +static char *dummy_srp(SSL *ssl, void *arg) +{ + return ""; +} +#endif int ciphers_main(int argc, char **argv) { @@ -122,6 +132,9 @@ int ciphers_main(int argc, char **argv) #ifndef OPENSSL_NO_PSK int psk = 0; #endif +#ifndef OPENSSL_NO_SRP + int srp = 0; +#endif const char *p; char *ciphers = NULL, *prog; char buf[512]; @@ -174,6 +187,10 @@ int ciphers_main(int argc, char **argv) #ifndef OPENSSL_NO_PSK psk = 1; #endif + case OPT_SRP: +#ifndef OPENSSL_NO_SRP + srp = 1; +#endif break; } } @@ -197,6 +214,10 @@ int ciphers_main(int argc, char **argv) if (psk) SSL_CTX_set_psk_client_callback(ctx, dummy_psk); #endif +#ifndef OPENSSL_NO_SRP + if (srp) + SSL_CTX_set_srp_client_pwd_callback(ctx, dummy_srp); +#endif if (ciphers != NULL) { if (!SSL_CTX_set_cipher_list(ctx, ciphers)) { BIO_printf(bio_err, "Error in cipher list\n"); |