diff options
author | deraadt <> | 2013-10-21 20:33:23 +0000 |
---|---|---|
committer | deraadt <> | 2013-10-21 20:33:23 +0000 |
commit | 390e9177b6abd61dc70c43919a1ef0ec18aeda32 (patch) | |
tree | 13eebb874a399a3b218ec0e8f4a27008d3c1e547 /src/lib/libc/crypt | |
parent | 03858cd345c362a21ad724eaac2dd220970d68c6 (diff) | |
download | openbsd-390e9177b6abd61dc70c43919a1ef0ec18aeda32.tar.gz openbsd-390e9177b6abd61dc70c43919a1ef0ec18aeda32.tar.bz2 openbsd-390e9177b6abd61dc70c43919a1ef0ec18aeda32.zip |
Remove arc4random_stir() and arc4random_addrandom(), which none should
be using directly. Well, a few rare people cloned it upstream and it
will take a bit of time for them to learn.
ok various
Diffstat (limited to 'src/lib/libc/crypt')
-rw-r--r-- | src/lib/libc/crypt/Makefile.inc | 3 | ||||
-rw-r--r-- | src/lib/libc/crypt/arc4random.c | 27 |
2 files changed, 2 insertions, 28 deletions
diff --git a/src/lib/libc/crypt/Makefile.inc b/src/lib/libc/crypt/Makefile.inc index 5dbd240bf5..c852523372 100644 --- a/src/lib/libc/crypt/Makefile.inc +++ b/src/lib/libc/crypt/Makefile.inc | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile.inc,v 1.18 2010/10/28 08:34:37 mikeb Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.19 2013/10/21 20:33:23 deraadt Exp $ |
2 | 2 | ||
3 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/crypt ${LIBCSRCDIR}/crypt | 3 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/crypt ${LIBCSRCDIR}/crypt |
4 | 4 | ||
@@ -11,5 +11,4 @@ MLINKS+=crypt.3 des_setkey.3 blowfish.3 blf_key.3 blowfish.3 blf_enc.3 | |||
11 | MLINKS+=blowfish.3 blf_dec.3 blowfish.3 blf_ecb_encrypt.3 | 11 | MLINKS+=blowfish.3 blf_dec.3 blowfish.3 blf_ecb_encrypt.3 |
12 | MLINKS+=blowfish.3 blf_ecb_decrypt.3 blowfish.3 blf_cbc_encrypt.3 | 12 | MLINKS+=blowfish.3 blf_ecb_decrypt.3 blowfish.3 blf_cbc_encrypt.3 |
13 | MLINKS+=blowfish.3 blf_cbc_decrypt.3 | 13 | MLINKS+=blowfish.3 blf_cbc_decrypt.3 |
14 | MLINKS+=arc4random.3 arc4random_stir.3 arc4random.3 arc4random_addrandom.3 | ||
15 | MLINKS+=arc4random.3 arc4random_buf.3 arc4random.3 arc4random_uniform.3 | 14 | MLINKS+=arc4random.3 arc4random_buf.3 arc4random.3 arc4random_uniform.3 |
diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c index 356e231815..e836395803 100644 --- a/src/lib/libc/crypt/arc4random.c +++ b/src/lib/libc/crypt/arc4random.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random.c,v 1.25 2013/10/01 18:34:57 markus Exp $ */ | 1 | /* $OpenBSD: arc4random.c,v 1.26 2013/10/21 20:33:23 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -158,31 +158,6 @@ _rs_random_u32(u_int32_t *val) | |||
158 | return; | 158 | return; |
159 | } | 159 | } |
160 | 160 | ||
161 | void | ||
162 | arc4random_stir(void) | ||
163 | { | ||
164 | _ARC4_LOCK(); | ||
165 | _rs_stir(); | ||
166 | _ARC4_UNLOCK(); | ||
167 | } | ||
168 | |||
169 | void | ||
170 | arc4random_addrandom(u_char *dat, int datlen) | ||
171 | { | ||
172 | int m; | ||
173 | |||
174 | _ARC4_LOCK(); | ||
175 | if (!rs_initialized) | ||
176 | _rs_stir(); | ||
177 | while (datlen > 0) { | ||
178 | m = MIN(datlen, KEYSZ + IVSZ); | ||
179 | _rs_rekey(dat, m); | ||
180 | dat += m; | ||
181 | datlen -= m; | ||
182 | } | ||
183 | _ARC4_UNLOCK(); | ||
184 | } | ||
185 | |||
186 | u_int32_t | 161 | u_int32_t |
187 | arc4random(void) | 162 | arc4random(void) |
188 | { | 163 | { |