X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=crypto%2Fdes%2Fread2pwd.c;h=ee6969f76eb5972965530d1cfa51758584174c3a;hb=d674bb4bc84e6e8cf510adfe7049cb19a2c29cf8;hp=f0eef23d8d0bc40781120d48b759501272c50d8d;hpb=44bdb056d4c7c72494d5d4b702bbad5cc869df03;p=openssl.git diff --git a/crypto/des/read2pwd.c b/crypto/des/read2pwd.c index f0eef23d8d..ee6969f76e 100644 --- a/crypto/des/read2pwd.c +++ b/crypto/des/read2pwd.c @@ -109,8 +109,10 @@ * [including the GNU Public Licence.] */ +#include #include #include +#include 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); }