Browse Source

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
OPENBSD_5_5
deraadt 11 years ago
parent
commit
0fc3ded4b5
3 changed files with 3 additions and 32 deletions
  1. +1
    -4
      src/include/stdlib.h
  2. +1
    -2
      src/lib/libc/crypt/Makefile.inc
  3. +1
    -26
      src/lib/libc/crypt/arc4random.c

+ 1
- 4
src/include/stdlib.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: stdlib.h,v 1.52 2013/05/31 20:59:24 ajacoutot Exp $ */
/* $OpenBSD: stdlib.h,v 1.53 2013/10/21 20:33:24 deraadt Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
@ -305,9 +305,6 @@ quad_t strtoq(const char *, char **, int);
u_quad_t strtouq(const char *, char **, int);
u_int32_t arc4random(void);
void arc4random_stir(void);
void arc4random_addrandom(unsigned char *, int)
__attribute__((__bounded__ (__string__,1,2)));
u_int32_t arc4random_uniform(u_int32_t);
void arc4random_buf(void *, size_t)
__attribute__((__bounded__ (__string__,1,2)));


+ 1
- 2
src/lib/libc/crypt/Makefile.inc View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile.inc,v 1.18 2010/10/28 08:34:37 mikeb Exp $
# $OpenBSD: Makefile.inc,v 1.19 2013/10/21 20:33:23 deraadt Exp $
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/crypt ${LIBCSRCDIR}/crypt
@ -11,5 +11,4 @@ MLINKS+=crypt.3 des_setkey.3 blowfish.3 blf_key.3 blowfish.3 blf_enc.3
MLINKS+=blowfish.3 blf_dec.3 blowfish.3 blf_ecb_encrypt.3
MLINKS+=blowfish.3 blf_ecb_decrypt.3 blowfish.3 blf_cbc_encrypt.3
MLINKS+=blowfish.3 blf_cbc_decrypt.3
MLINKS+=arc4random.3 arc4random_stir.3 arc4random.3 arc4random_addrandom.3
MLINKS+=arc4random.3 arc4random_buf.3 arc4random.3 arc4random_uniform.3

+ 1
- 26
src/lib/libc/crypt/arc4random.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random.c,v 1.25 2013/10/01 18:34:57 markus Exp $ */
/* $OpenBSD: arc4random.c,v 1.26 2013/10/21 20:33:23 deraadt Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -158,31 +158,6 @@ _rs_random_u32(u_int32_t *val)
return;
}
void
arc4random_stir(void)
{
_ARC4_LOCK();
_rs_stir();
_ARC4_UNLOCK();
}
void
arc4random_addrandom(u_char *dat, int datlen)
{
int m;
_ARC4_LOCK();
if (!rs_initialized)
_rs_stir();
while (datlen > 0) {
m = MIN(datlen, KEYSZ + IVSZ);
_rs_rekey(dat, m);
dat += m;
datlen -= m;
}
_ARC4_UNLOCK();
}
u_int32_t
arc4random(void)
{


Loading…
Cancel
Save