X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=crypto%2Frc4%2Frc4.c;h=c900b260554a394107031c708951a02d6d203d92;hb=16760a3089da372d5cf181f127542f0082dc2aa9;hp=709b7aff35aeead1e3f49977490317e028d12686;hpb=ec577822f95a8bca0023c5c77cef1a4916822d4a;p=openssl.git diff --git a/crypto/rc4/rc4.c b/crypto/rc4/rc4.c index 709b7aff35..c900b26055 100644 --- a/crypto/rc4/rc4.c +++ b/crypto/rc4/rc4.c @@ -60,6 +60,7 @@ #include #include #include +#include char *usage[]={ "usage: rc4 args\n", @@ -113,7 +114,7 @@ int main(int argc, char *argv[]) { bad: for (pp=usage; (*pp != NULL); pp++) - fprintf(stderr,*pp); + fprintf(stderr,"%s",*pp); exit(1); } @@ -141,7 +142,7 @@ bad: } } -#ifdef MSDOS +#ifdef OPENSSL_SYS_MSDOS /* This should set the file to binary mode. */ { #include @@ -155,15 +156,15 @@ bad: i=EVP_read_pw_string(buf,BUFSIZ,"Enter RC4 password:",0); if (i != 0) { - memset(buf,0,BUFSIZ); + OPENSSL_cleanse(buf,BUFSIZ); fprintf(stderr,"bad password read\n"); exit(1); } keystr=buf; } - MD5((unsigned char *)keystr,(unsigned long)strlen(keystr),md); - memset(keystr,0,strlen(keystr)); + EVP_Digest((unsigned char *)keystr,strlen(keystr),md,NULL,EVP_md5(),NULL); + OPENSSL_cleanse(keystr,strlen(keystr)); RC4_set_key(&key,MD5_DIGEST_LENGTH,md); for(;;)