summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/ssl/ssltest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/src/ssl/ssltest.c')
-rw-r--r--src/lib/libssl/src/ssl/ssltest.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/lib/libssl/src/ssl/ssltest.c b/src/lib/libssl/src/ssl/ssltest.c
index dde35794f5..2ef8a50785 100644
--- a/src/lib/libssl/src/ssl/ssltest.c
+++ b/src/lib/libssl/src/ssl/ssltest.c
@@ -88,6 +88,7 @@
88static int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx); 88static int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
89#ifndef NO_RSA 89#ifndef NO_RSA
90static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export,int keylength); 90static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export,int keylength);
91static void free_tmp_rsa(void);
91#endif 92#endif
92#ifndef NO_DH 93#ifndef NO_DH
93static DH *get_dh512(void); 94static DH *get_dh512(void);
@@ -528,6 +529,9 @@ end:
528 529
529 if (bio_stdout != NULL) BIO_free(bio_stdout); 530 if (bio_stdout != NULL) BIO_free(bio_stdout);
530 531
532#ifndef NO_RSA
533 free_tmp_rsa();
534#endif
531 ERR_free_strings(); 535 ERR_free_strings();
532 ERR_remove_state(0); 536 ERR_remove_state(0);
533 EVP_cleanup(); 537 EVP_cleanup();
@@ -1189,7 +1193,7 @@ int doit(SSL *s_ssl, SSL *c_ssl, long count)
1189 ret=0; 1193 ret=0;
1190err: 1194err:
1191 /* We have to set the BIO's to NULL otherwise they will be 1195 /* We have to set the BIO's to NULL otherwise they will be
1192 * Free()ed twice. Once when th s_ssl is SSL_free()ed and 1196 * OPENSSL_free()ed twice. Once when th s_ssl is SSL_free()ed and
1193 * again when c_ssl is SSL_free()ed. 1197 * again when c_ssl is SSL_free()ed.
1194 * This is a hack required because s_ssl and c_ssl are sharing the same 1198 * This is a hack required because s_ssl and c_ssl are sharing the same
1195 * BIO structure and SSL_set_bio() and SSL_free() automatically 1199 * BIO structure and SSL_set_bio() and SSL_free() automatically
@@ -1242,10 +1246,10 @@ static int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
1242 } 1246 }
1243 1247
1244#ifndef NO_RSA 1248#ifndef NO_RSA
1249static RSA *rsa_tmp=NULL;
1250
1245static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength) 1251static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
1246 { 1252 {
1247 static RSA *rsa_tmp=NULL;
1248
1249 if (rsa_tmp == NULL) 1253 if (rsa_tmp == NULL)
1250 { 1254 {
1251 BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength); 1255 BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength);
@@ -1256,6 +1260,15 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
1256 } 1260 }
1257 return(rsa_tmp); 1261 return(rsa_tmp);
1258 } 1262 }
1263
1264static void free_tmp_rsa(void)
1265 {
1266 if (rsa_tmp != NULL)
1267 {
1268 RSA_free(rsa_tmp);
1269 rsa_tmp = NULL;
1270 }
1271 }
1259#endif 1272#endif
1260 1273
1261#ifndef NO_DH 1274#ifndef NO_DH