summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rand/rc4_rand.c
diff options
context:
space:
mode:
authortedu <>2014-04-18 13:19:03 +0000
committertedu <>2014-04-18 13:19:03 +0000
commitd96b82c0a9ec4585ac1f50f617bb0ee79c7b96f7 (patch)
tree3b966b1e6478816bc9e673717596fca44b3c34de /src/lib/libcrypto/rand/rc4_rand.c
parent48839e33a53ed2d6e54cb31ec1a93635e0a4dc60 (diff)
downloadopenbsd-d96b82c0a9ec4585ac1f50f617bb0ee79c7b96f7.tar.gz
openbsd-d96b82c0a9ec4585ac1f50f617bb0ee79c7b96f7.tar.bz2
openbsd-d96b82c0a9ec4585ac1f50f617bb0ee79c7b96f7.zip
another round of chemo for the RAND code to provide clarity.
ok deraadt
Diffstat (limited to 'src/lib/libcrypto/rand/rc4_rand.c')
-rw-r--r--src/lib/libcrypto/rand/rc4_rand.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/lib/libcrypto/rand/rc4_rand.c b/src/lib/libcrypto/rand/rc4_rand.c
deleted file mode 100644
index 47405b0d9a..0000000000
--- a/src/lib/libcrypto/rand/rc4_rand.c
+++ /dev/null
@@ -1,52 +0,0 @@
1/* $OpenBSD: rc4_rand.c,v 1.2 2014/04/16 13:57:14 reyk Exp $ */
2
3/*
4 * Copyright (c) 2014 Miodrag Vallat.
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#include <stdlib.h>
20
21#include <openssl/rand.h>
22
23static int
24arc4_rand_bytes(unsigned char *buf, int num)
25{
26 if (num > 0)
27 arc4random_buf(buf, (size_t)num);
28
29 return 1;
30}
31
32static int
33arc4_rand_status(void)
34{
35 /* no possible error condition */
36 return 1;
37}
38
39static RAND_METHOD rand_arc4_meth = {
40 .seed = NULL, /* no external seed allowed */
41 .bytes = arc4_rand_bytes,
42 .cleanup = NULL, /* no cleanup necessary */
43 .add = NULL, /* no external feed allowed */
44 .pseudorand = arc4_rand_bytes,
45 .status = arc4_rand_status
46};
47
48RAND_METHOD *RAND_SSLeay(void)
49{
50 return &rand_arc4_meth;
51}
52