Cleanse memory using the new OPENSSL_cleanse() function.
[openssl.git] / crypto / rsa / rsa_sign.c
index c53ca739149b6b78f76f37f15d96bc53ae30945a..4ac2de34079090b1d45e0c4378faba2db9824dfb 100644 (file)
@@ -136,7 +136,7 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
                *siglen=i;
 
        if(type != NID_md5_sha1) {
-               memset(tmps,0,(unsigned int)j+1);
+               OPENSSL_cleanse(tmps,(unsigned int)j+1);
                OPENSSL_free(tmps);
        }
        return(ret);
@@ -221,7 +221,7 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len,
        }
 err:
        if (sig != NULL) X509_SIG_free(sig);
-       memset(s,0,(unsigned int)siglen);
+       OPENSSL_cleanse(s,(unsigned int)siglen);
        OPENSSL_free(s);
        return(ret);
        }