diff --git a/programs/ssl/ssl_server.c b/programs/ssl/ssl_server.c index 070d5347c..7a543d9f7 100644 --- a/programs/ssl/ssl_server.c +++ b/programs/ssl/ssl_server.c @@ -54,14 +54,6 @@ "
Successful connection using: %s
\r\n" -/* - * Computing a "safe" DH prime can take a very - * long time. RFC 5114 provides precomputed and standardized - * values. - */ -char *my_dhm_P = POLARSSL_DHM_RFC5114_MODP_1024_P; -char *my_dhm_G = POLARSSL_DHM_RFC5114_MODP_1024_G; - /* * Sorted by order of preference */ @@ -186,13 +178,14 @@ int main( int argc, char *argv[] ) ssl_context ssl; x509_cert srvcert; rsa_context rsa; +#if defined(POLARSSL_SSL_CACHE_C) + ssl_cache_context cache; +#endif ((void) argc); ((void) argv); #if defined(POLARSSL_SSL_CACHE_C) - ssl_cache_context cache; - ssl_cache_init( &cache ); #endif @@ -294,7 +287,8 @@ int main( int argc, char *argv[] ) ssl_set_ca_chain( &ssl, srvcert.next, NULL, NULL ); ssl_set_own_cert( &ssl, &srvcert, &rsa ); #if defined(POLARSSL_DHM_C) - ssl_set_dh_param( &ssl, my_dhm_P, my_dhm_G ); + ssl_set_dh_param( &ssl, POLARSSL_DHM_RFC5114_MODP_1024_P, + POLARSSL_DHM_RFC5114_MODP_1024_G ); #endif printf( " ok\n" ); diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 6f97de31b..decf31236 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -65,14 +65,6 @@ "Successful connection using: %s
\r\n" -/* - * Computing a "safe" DH prime can take a very - * long time. RFC 5114 provides precomputed and standardized - * values. - */ -char *my_dhm_P = POLARSSL_DHM_RFC5114_MODP_2048_P; -char *my_dhm_G = POLARSSL_DHM_RFC5114_MODP_2048_G; - /* * global options */ @@ -405,7 +397,8 @@ int main( int argc, char *argv[] ) ssl_set_own_cert( &ssl, &srvcert, &rsa ); #if defined(POLARSSL_DHM_C) - ssl_set_dh_param( &ssl, my_dhm_P, my_dhm_G ); + ssl_set_dh_param( &ssl, POLARSSL_DHM_RFC5114_MODP_2048_P, + POLARSSL_DHM_RFC5114_MODP_2048_G ); #endif printf( " ok\n" );