diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/rand/rc4_rand.c | 12 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/rand/rc4_rand.c | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/lib/libcrypto/rand/rc4_rand.c b/src/lib/libcrypto/rand/rc4_rand.c index ebfb241d53..47405b0d9a 100644 --- a/src/lib/libcrypto/rand/rc4_rand.c +++ b/src/lib/libcrypto/rand/rc4_rand.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rc4_rand.c,v 1.1 2014/04/15 16:52:50 miod Exp $ */ | 1 | /* $OpenBSD: rc4_rand.c,v 1.2 2014/04/16 13:57:14 reyk Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 2014 Miodrag Vallat. | 4 | * Copyright (c) 2014 Miodrag Vallat. |
| @@ -29,16 +29,24 @@ arc4_rand_bytes(unsigned char *buf, int num) | |||
| 29 | return 1; | 29 | return 1; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | static int | ||
| 33 | arc4_rand_status(void) | ||
| 34 | { | ||
| 35 | /* no possible error condition */ | ||
| 36 | return 1; | ||
| 37 | } | ||
| 38 | |||
| 32 | static RAND_METHOD rand_arc4_meth = { | 39 | static RAND_METHOD rand_arc4_meth = { |
| 33 | .seed = NULL, /* no external seed allowed */ | 40 | .seed = NULL, /* no external seed allowed */ |
| 34 | .bytes = arc4_rand_bytes, | 41 | .bytes = arc4_rand_bytes, |
| 35 | .cleanup = NULL, /* no cleanup necessary */ | 42 | .cleanup = NULL, /* no cleanup necessary */ |
| 36 | .add = NULL, /* no external feed allowed */ | 43 | .add = NULL, /* no external feed allowed */ |
| 37 | .pseudorand = arc4_rand_bytes, | 44 | .pseudorand = arc4_rand_bytes, |
| 38 | .status = NULL /* no possible error condition */ | 45 | .status = arc4_rand_status |
| 39 | }; | 46 | }; |
| 40 | 47 | ||
| 41 | RAND_METHOD *RAND_SSLeay(void) | 48 | RAND_METHOD *RAND_SSLeay(void) |
| 42 | { | 49 | { |
| 43 | return &rand_arc4_meth; | 50 | return &rand_arc4_meth; |
| 44 | } | 51 | } |
| 52 | |||
diff --git a/src/lib/libssl/src/crypto/rand/rc4_rand.c b/src/lib/libssl/src/crypto/rand/rc4_rand.c index ebfb241d53..47405b0d9a 100644 --- a/src/lib/libssl/src/crypto/rand/rc4_rand.c +++ b/src/lib/libssl/src/crypto/rand/rc4_rand.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rc4_rand.c,v 1.1 2014/04/15 16:52:50 miod Exp $ */ | 1 | /* $OpenBSD: rc4_rand.c,v 1.2 2014/04/16 13:57:14 reyk Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 2014 Miodrag Vallat. | 4 | * Copyright (c) 2014 Miodrag Vallat. |
| @@ -29,16 +29,24 @@ arc4_rand_bytes(unsigned char *buf, int num) | |||
| 29 | return 1; | 29 | return 1; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | static int | ||
| 33 | arc4_rand_status(void) | ||
| 34 | { | ||
| 35 | /* no possible error condition */ | ||
| 36 | return 1; | ||
| 37 | } | ||
| 38 | |||
| 32 | static RAND_METHOD rand_arc4_meth = { | 39 | static RAND_METHOD rand_arc4_meth = { |
| 33 | .seed = NULL, /* no external seed allowed */ | 40 | .seed = NULL, /* no external seed allowed */ |
| 34 | .bytes = arc4_rand_bytes, | 41 | .bytes = arc4_rand_bytes, |
| 35 | .cleanup = NULL, /* no cleanup necessary */ | 42 | .cleanup = NULL, /* no cleanup necessary */ |
| 36 | .add = NULL, /* no external feed allowed */ | 43 | .add = NULL, /* no external feed allowed */ |
| 37 | .pseudorand = arc4_rand_bytes, | 44 | .pseudorand = arc4_rand_bytes, |
| 38 | .status = NULL /* no possible error condition */ | 45 | .status = arc4_rand_status |
| 39 | }; | 46 | }; |
| 40 | 47 | ||
| 41 | RAND_METHOD *RAND_SSLeay(void) | 48 | RAND_METHOD *RAND_SSLeay(void) |
| 42 | { | 49 | { |
| 43 | return &rand_arc4_meth; | 50 | return &rand_arc4_meth; |
| 44 | } | 51 | } |
| 52 | |||
