Ooops reverse previous patch.
[openssl.git] / crypto / des / read2pwd.c
index b4720c3a9810546c448f3ff1d897bfef100b2eb6..ee6969f76eb5972965530d1cfa51758584174c3a 100644 (file)
 #include <string.h>
 #include <openssl/des.h>
 #include <openssl/ui.h>
+#include <openssl/crypto.h>
 
 int DES_read_password(DES_cblock *key, const char *prompt, int verify)
        {
@@ -120,8 +121,8 @@ int DES_read_password(DES_cblock *key, const char *prompt, int verify)
 
        if ((ok=UI_UTIL_read_pw(buf,buff,BUFSIZ,prompt,verify)) == 0)
                DES_string_to_key(buf,key);
-       memset(buf,0,BUFSIZ);
-       memset(buff,0,BUFSIZ);
+       OPENSSL_cleanse(buf,BUFSIZ);
+       OPENSSL_cleanse(buff,BUFSIZ);
        return(ok);
        }
 
@@ -133,7 +134,7 @@ int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, const char *prompt,
 
        if ((ok=UI_UTIL_read_pw(buf,buff,BUFSIZ,prompt,verify)) == 0)
                DES_string_to_2keys(buf,key1,key2);
-       memset(buf,0,BUFSIZ);
-       memset(buff,0,BUFSIZ);
+       OPENSSL_cleanse(buf,BUFSIZ);
+       OPENSSL_cleanse(buff,BUFSIZ);
        return(ok);
        }