summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2008-06-09 07:07:18 +0000
committerDamien Miller <djm@cvs.openbsd.org>2008-06-09 07:07:18 +0000
commitdbc8994d667f55793aa0ca89944b34e9b027ccad (patch)
tree9190acdfd8ec27a88a4b4e9caa9cf6963eb7b419 /sys/dev
parent4c1ad4a6cb68b98b13b7a966950ddb4ed17ce8a0 (diff)
rename arc4random_bytes => arc4random_buf to match libc's nicer name;
ok deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/hifn7751.c4
-rw-r--r--sys/dev/pci/if_ix.c4
-rw-r--r--sys/dev/pci/noct.c4
-rw-r--r--sys/dev/pci/safe.c4
-rw-r--r--sys/dev/pci/ubsec.c4
-rw-r--r--sys/dev/rnd.c10
-rw-r--r--sys/dev/rndvar.h6
-rw-r--r--sys/dev/softraid.c4
8 files changed, 20 insertions, 20 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index a53bc113a88..a29f6ed29a8 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.154 2007/10/01 15:34:48 krw Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.155 2008/06/09 07:07:16 djm Exp $ */
/*
* Invertex AEON / Hifn 7751 driver
@@ -1868,7 +1868,7 @@ hifn_newsession(u_int32_t *sidp, struct cryptoini *cri)
case CRYPTO_DES_CBC:
case CRYPTO_3DES_CBC:
case CRYPTO_AES_CBC:
- arc4random_bytes(ses->hs_iv,
+ arc4random_buf(ses->hs_iv,
(c->cri_alg == CRYPTO_AES_CBC ?
HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH));
/*FALLTHROUGH*/
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c
index 05ba2f072a5..b90f1aebda3 100644
--- a/sys/dev/pci/if_ix.c
+++ b/sys/dev/pci/if_ix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ix.c,v 1.5 2008/06/08 21:15:34 reyk Exp $ */
+/* $OpenBSD: if_ix.c,v 1.6 2008/06/09 07:07:16 djm Exp $ */
/******************************************************************************
@@ -2587,7 +2587,7 @@ ixgbe_initialize_receive_units(struct ix_softc *sc)
if (sc->num_rx_queues > 1) {
/* set up random bits */
- arc4random_bytes(&random, sizeof(random));
+ arc4random_buf(&random, sizeof(random));
switch (sc->num_rx_queues) {
case 8:
case 4:
diff --git a/sys/dev/pci/noct.c b/sys/dev/pci/noct.c
index 2bb89fdac1b..e2fab9763c5 100644
--- a/sys/dev/pci/noct.c
+++ b/sys/dev/pci/noct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: noct.c,v 1.19 2008/01/02 04:48:37 brad Exp $ */
+/* $OpenBSD: noct.c,v 1.20 2008/06/09 07:07:16 djm Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -1139,7 +1139,7 @@ noct_ea_start_des(sc, q, crp, crd)
if (crd->crd_flags & CRD_F_IV_EXPLICIT)
bcopy(crd->crd_iv, iv, 8);
else
- arc4random_bytes(iv, sizeof(iv));
+ arc4random_buf(iv, sizeof(iv));
if (!(crd->crd_flags & CRD_F_IV_PRESENT)) {
if (crp->crp_flags & CRYPTO_F_IMBUF)
diff --git a/sys/dev/pci/safe.c b/sys/dev/pci/safe.c
index 40538cb322c..3795b067655 100644
--- a/sys/dev/pci/safe.c
+++ b/sys/dev/pci/safe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: safe.c,v 1.22 2007/09/18 22:02:18 djm Exp $ */
+/* $OpenBSD: safe.c,v 1.23 2008/06/09 07:07:16 djm Exp $ */
/*-
* Copyright (c) 2003 Sam Leffler, Errno Consulting
@@ -1358,7 +1358,7 @@ safe_newsession(u_int32_t *sidp, struct cryptoini *cri)
if (encini) {
/* get an IV */
- arc4random_bytes(ses->ses_iv, sizeof(ses->ses_iv));
+ arc4random_buf(ses->ses_iv, sizeof(ses->ses_iv));
ses->ses_klen = encini->cri_klen;
bcopy(encini->cri_key, ses->ses_key, ses->ses_klen / 8);
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index f0716d8dd32..c1381990bf4 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsec.c,v 1.140 2007/10/01 15:34:48 krw Exp $ */
+/* $OpenBSD: ubsec.c,v 1.141 2008/06/09 07:07:16 djm Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -620,7 +620,7 @@ ubsec_newsession(u_int32_t *sidp, struct cryptoini *cri)
ses->ses_used = 1;
if (encini) {
/* get an IV, network byte order */
- arc4random_bytes(ses->ses_iv, sizeof(ses->ses_iv));
+ arc4random_buf(ses->ses_iv, sizeof(ses->ses_iv));
/* Go ahead and compute key in ubsec's byte order */
if (encini->cri_alg == CRYPTO_DES_CBC) {
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index c2692c62305..328919de450 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rnd.c,v 1.88 2008/06/04 00:50:23 djm Exp $ */
+/* $OpenBSD: rnd.c,v 1.89 2008/06/09 07:07:16 djm Exp $ */
/*
* rnd.c -- A strong random number generator
@@ -564,7 +564,7 @@ arc4random(void)
}
static void
-arc4random_bytes_large(void *buf, size_t n)
+arc4random_buf_large(void *buf, size_t n)
{
u_char lbuf[ARC4_SUB_KEY_BYTES];
struct rc4_ctx lctx;
@@ -583,13 +583,13 @@ arc4random_bytes_large(void *buf, size_t n)
}
void
-arc4random_bytes(void *buf, size_t n)
+arc4random_buf(void *buf, size_t n)
{
arc4maybeinit();
/* Satisfy large requests via an independent ARC4 instance */
if (n > ARC4_MAIN_MAX_BYTES) {
- arc4random_bytes_large(buf, n);
+ arc4random_buf_large(buf, n);
return;
}
@@ -1035,7 +1035,7 @@ randomread(dev_t dev, struct uio *uio, int ioflag)
buf[i] = random() << 16 | (random() & 0xFFFF);
break;
case RND_ARND:
- arc4random_bytes(buf, n);
+ arc4random_buf(buf, n);
break;
default:
ret = ENXIO;
diff --git a/sys/dev/rndvar.h b/sys/dev/rndvar.h
index c6831502c0b..4e58b342736 100644
--- a/sys/dev/rndvar.h
+++ b/sys/dev/rndvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rndvar.h,v 1.20 2008/03/02 21:29:07 djm Exp $ */
+/* $OpenBSD: rndvar.h,v 1.21 2008/06/09 07:07:16 djm Exp $ */
/*
* Copyright (c) 1996,2000 Michael Shalayeff.
@@ -31,7 +31,7 @@
#ifndef __RNDVAR_H__
#define __RNDVAR_H__
-#define POOLWORDS 1024 /* Power of 2 - note that this is 32-bit words */
+#define POOLWORDS 2048 /* Power of 2 - note that this is 32-bit words */
#define RND_RND 0 /* real randomness like nuclear chips */
#define RND_SRND 1 /* strong random source */
@@ -85,7 +85,7 @@ extern struct rndstats rndstats;
void enqueue_randomness(int, int);
void get_random_bytes(void *, size_t);
-void arc4random_bytes(void *, size_t);
+void arc4random_buf(void *, size_t);
u_int32_t arc4random(void);
u_int32_t arc4random_uniform(u_int32_t);
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index f63acdc2575..a9bae38c9b1 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.105 2008/04/02 21:32:03 martin Exp $ */
+/* $OpenBSD: softraid.c,v 1.106 2008/06/09 07:07:16 djm Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -1597,7 +1597,7 @@ sr_checksum(char *s, u_int32_t *p, u_int32_t size)
void
sr_get_uuid(struct sr_uuid *uuid)
{
- arc4random_bytes(uuid->sui_id, sizeof(uuid->sui_id));
+ arc4random_buf(uuid->sui_id, sizeof(uuid->sui_id));
}
void