Remove references to RSAref. The glue library is but a memory to fade
[openssl.git] / ssl / ssltest.c
index dde35794f54a6744191db41a24c7c0c0168e0e15..4763f2a6d78f3a22d643fcd19dc241fb7705dea6 100644 (file)
@@ -88,6 +88,7 @@
 static int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
 #ifndef NO_RSA
 static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export,int keylength);
+static void free_tmp_rsa(void);
 #endif
 #ifndef NO_DH
 static DH *get_dh512(void);
@@ -528,6 +529,9 @@ end:
 
        if (bio_stdout != NULL) BIO_free(bio_stdout);
 
+#ifndef NO_RSA
+       free_tmp_rsa();
+#endif
        ERR_free_strings();
        ERR_remove_state(0);
        EVP_cleanup();
@@ -1189,7 +1193,7 @@ int doit(SSL *s_ssl, SSL *c_ssl, long count)
        ret=0;
 err:
        /* We have to set the BIO's to NULL otherwise they will be
-        * Free()ed twice.  Once when th s_ssl is SSL_free()ed and
+        * OPENSSL_free()ed twice.  Once when th s_ssl is SSL_free()ed and
         * again when c_ssl is SSL_free()ed.
         * This is a hack required because s_ssl and c_ssl are sharing the same
         * 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)
        }
 
 #ifndef NO_RSA
+static RSA *rsa_tmp=NULL;
+
 static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
        {
-       static RSA *rsa_tmp=NULL;
-
        if (rsa_tmp == NULL)
                {
                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)
                }
        return(rsa_tmp);
        }
+
+static void free_tmp_rsa(void)
+       {
+       if (rsa_tmp != NULL)
+               {
+               RSA_free(rsa_tmp);
+               rsa_tmp = NULL;
+               }
+       }
 #endif
 
 #ifndef NO_DH
@@ -1265,7 +1278,7 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength)
  *    $ openssl dhparam -C -noout -dsaparam 1024
  * (The third function has been renamed to avoid name conflicts.)
  */
-DH *get_dh512()
+static DH *get_dh512()
        {
        static unsigned char dh512_p[]={
                0xCB,0xC8,0xE1,0x86,0xD0,0x1F,0x94,0x17,0xA6,0x99,0xF0,0xC6,
@@ -1288,7 +1301,7 @@ DH *get_dh512()
        return(dh);
        }
 
-DH *get_dh1024()
+static DH *get_dh1024()
        {
        static unsigned char dh1024_p[]={
                0xF8,0x81,0x89,0x7D,0x14,0x24,0xC5,0xD1,0xE6,0xF7,0xBF,0x3A,
@@ -1316,7 +1329,7 @@ DH *get_dh1024()
        return(dh);
        }
 
-DH *get_dh1024dsa()
+static DH *get_dh1024dsa()
        {
        static unsigned char dh1024_p[]={
                0xC8,0x00,0xF7,0x08,0x07,0x89,0x4D,0x90,0x53,0xF3,0xD5,0x00,