summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rc4
diff options
context:
space:
mode:
authormarkus <>2003-05-11 21:36:59 +0000
committermarkus <>2003-05-11 21:36:59 +0000
commit9cea7b85baecb1a02a3ea617de73d9693a9792eb (patch)
treeb0ca83a03e35572831c5818cd2011868d462a5d1 /src/lib/libcrypto/rc4
parentf8f1d7fabf136ce9810602509c477d2c42bf6d1c (diff)
downloadopenbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.tar.gz
openbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.tar.bz2
openbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.zip
import 0.9.7b (without idea and rc5)
Diffstat (limited to 'src/lib/libcrypto/rc4')
-rw-r--r--src/lib/libcrypto/rc4/rc4.c4
-rw-r--r--src/lib/libcrypto/rc4/rc4test.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rc4/rc4.c b/src/lib/libcrypto/rc4/rc4.c
index c2165b0b75..b39c070292 100644
--- a/src/lib/libcrypto/rc4/rc4.c
+++ b/src/lib/libcrypto/rc4/rc4.c
@@ -155,7 +155,7 @@ bad:
155 i=EVP_read_pw_string(buf,BUFSIZ,"Enter RC4 password:",0); 155 i=EVP_read_pw_string(buf,BUFSIZ,"Enter RC4 password:",0);
156 if (i != 0) 156 if (i != 0)
157 { 157 {
158 memset(buf,0,BUFSIZ); 158 OPENSSL_cleanse(buf,BUFSIZ);
159 fprintf(stderr,"bad password read\n"); 159 fprintf(stderr,"bad password read\n");
160 exit(1); 160 exit(1);
161 } 161 }
@@ -163,7 +163,7 @@ bad:
163 } 163 }
164 164
165 EVP_Digest((unsigned char *)keystr,(unsigned long)strlen(keystr),md,NULL,EVP_md5()); 165 EVP_Digest((unsigned char *)keystr,(unsigned long)strlen(keystr),md,NULL,EVP_md5());
166 memset(keystr,0,strlen(keystr)); 166 OPENSSL_cleanse(keystr,strlen(keystr));
167 RC4_set_key(&key,MD5_DIGEST_LENGTH,md); 167 RC4_set_key(&key,MD5_DIGEST_LENGTH,md);
168 168
169 for(;;) 169 for(;;)
diff --git a/src/lib/libcrypto/rc4/rc4test.c b/src/lib/libcrypto/rc4/rc4test.c
index a28d457c8d..b9d8f20975 100644
--- a/src/lib/libcrypto/rc4/rc4test.c
+++ b/src/lib/libcrypto/rc4/rc4test.c
@@ -60,6 +60,8 @@
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "../e_os.h"
64
63#ifdef OPENSSL_NO_RC4 65#ifdef OPENSSL_NO_RC4
64int main(int argc, char *argv[]) 66int main(int argc, char *argv[])
65{ 67{
@@ -195,7 +197,7 @@ int main(int argc, char *argv[])
195 } 197 }
196 } 198 }
197 printf("done\n"); 199 printf("done\n");
198 exit(err); 200 EXIT(err);
199 return(0); 201 return(0);
200 } 202 }
201#endif 203#endif