evp/e_aes_cbc_hmac_sha256.c: enable is on all AES-NI platforms, not only on AVX.
[openssl.git] / crypto / des / read2pwd.c
index f0eef23d8d0bc40781120d48b759501272c50d8d..ee6969f76eb5972965530d1cfa51758584174c3a 100644 (file)
  * [including the GNU Public Licence.]
  */
 
+#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)
        {
@@ -119,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);
        }
 
@@ -132,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);
        }