X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fs_server.c;h=5f1bcffb91c098f412f479b57a63f34baa6b3eb9;hp=608f3208dcc09dc60850c562d05d67e9a21c3663;hb=d0595f170c225b918a980f49c5d16ec53545a6ad;hpb=751e26cb9b5ca46d0db4e7d9b71e215ece496223 diff --git a/apps/s_server.c b/apps/s_server.c index 608f3208dc..5f1bcffb91 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -273,6 +273,7 @@ static int s_server_session_id_context = 1; /* anything will do */ static const char *s_cert_file=TEST_CERT,*s_key_file=NULL; #ifndef OPENSSL_NO_TLSEXT static const char *s_cert_file2=TEST_CERT2,*s_key_file2=NULL; +static char *curves=NULL; #endif static char *s_dcert_file=NULL,*s_dkey_file=NULL; #ifdef FIONBIO @@ -437,6 +438,7 @@ static void s_server_init(void) s_cert_file=TEST_CERT; s_key_file=NULL; #ifndef OPENSSL_NO_TLSEXT + curves=NULL; s_cert_file2=TEST_CERT2; s_key_file2=NULL; ctx2=NULL; @@ -1174,6 +1176,11 @@ int MAIN(int argc, char *argv[]) goto bad; } } + else if (strcmp(*argv,"-curves") == 0) + { + if (--argc < 1) goto bad; + curves= *(++argv); + } #endif else if (strcmp(*argv,"-msg") == 0) { s_msg=1; } @@ -1849,6 +1856,23 @@ bad: } #endif } +#ifndef OPENSSL_NO_TLSEXT + if (curves) + { + if(!SSL_CTX_set1_curves_list(ctx,curves)) + { + BIO_printf(bio_err,"error setting curves list\n"); + ERR_print_errors(bio_err); + goto end; + } + if(ctx2 && !SSL_CTX_set1_curves_list(ctx2,curves)) + { + BIO_printf(bio_err,"error setting curves list\n"); + ERR_print_errors(bio_err); + goto end; + } + } +#endif SSL_CTX_set_verify(ctx,s_server_verify,verify_callback); SSL_CTX_set_session_id_context(ctx,(void*)&s_server_session_id_context, sizeof s_server_session_id_context);