diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2008-06-09 07:07:18 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2008-06-09 07:07:18 +0000 |
commit | dbc8994d667f55793aa0ca89944b34e9b027ccad (patch) | |
tree | 9190acdfd8ec27a88a4b4e9caa9cf6963eb7b419 | |
parent | 4c1ad4a6cb68b98b13b7a966950ddb4ed17ce8a0 (diff) |
rename arc4random_bytes => arc4random_buf to match libc's nicer name;
ok deraadt@
-rw-r--r-- | sys/arch/i386/i386/via.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/pci/glxsb.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/machdep.c | 4 | ||||
-rw-r--r-- | sys/crypto/cryptosoft.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/hifn7751.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_ix.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/noct.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/safe.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/ubsec.c | 4 | ||||
-rw-r--r-- | sys/dev/rnd.c | 10 | ||||
-rw-r--r-- | sys/dev/rndvar.h | 6 | ||||
-rw-r--r-- | sys/dev/softraid.c | 4 | ||||
-rw-r--r-- | sys/kern/init_main.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 | ||||
-rw-r--r-- | sys/net/if_spppsubr.c | 4 | ||||
-rw-r--r-- | sys/net/pf.c | 4 | ||||
-rw-r--r-- | sys/net80211/ieee80211_input.c | 4 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 8 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_carp.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_esp.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_id.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 |
23 files changed, 52 insertions, 52 deletions
diff --git a/sys/arch/i386/i386/via.c b/sys/arch/i386/i386/via.c index aa2264fd4d5..df4d40547d5 100644 --- a/sys/arch/i386/i386/via.c +++ b/sys/arch/i386/i386/via.c @@ -1,4 +1,4 @@ -/* $OpenBSD: via.c,v 1.18 2007/12/09 21:30:24 hshoexer Exp $ */ +/* $OpenBSD: via.c,v 1.19 2008/06/09 07:07:15 djm Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -194,7 +194,7 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri) cw0 |= C3_CRYPT_CWLO_ALG_AES | C3_CRYPT_CWLO_KEYGEN_SW | C3_CRYPT_CWLO_NORMAL; - arc4random_bytes(ses->ses_iv, sizeof(ses->ses_iv)); + arc4random_buf(ses->ses_iv, sizeof(ses->ses_iv)); ses->ses_klen = c->cri_klen; ses->ses_cw0 = cw0; diff --git a/sys/arch/i386/pci/glxsb.c b/sys/arch/i386/pci/glxsb.c index ef5bc2082ed..93cc40e0582 100644 --- a/sys/arch/i386/pci/glxsb.c +++ b/sys/arch/i386/pci/glxsb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glxsb.c,v 1.13 2007/12/09 21:30:24 hshoexer Exp $ */ +/* $OpenBSD: glxsb.c,v 1.14 2008/06/09 07:07:15 djm Exp $ */ /* * Copyright (c) 2006 Tom Cosgrove <tom@openbsd.org> @@ -379,7 +379,7 @@ glxsb_crypto_newsession(uint32_t *sidp, struct cryptoini *cri) return (EINVAL); } - arc4random_bytes(ses->ses_iv, sizeof(ses->ses_iv)); + arc4random_buf(ses->ses_iv, sizeof(ses->ses_iv)); ses->ses_klen = c->cri_klen; /* Copy the key (Geode LX wants the primary key only) */ diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 8cccef8b9ae..e48dbd1f4eb 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.109 2008/04/20 10:35:57 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.110 2008/06/09 07:07:15 djm Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -332,7 +332,7 @@ setregs(p, pack, stack, retval) * Setup the process StackGhost cookie which will be XORed into * the return pointer as register windows are over/underflowed. */ - arc4random_bytes(&p->p_addr->u_pcb.pcb_wcookie, + arc4random_buf(&p->p_addr->u_pcb.pcb_wcookie, sizeof(p->p_addr->u_pcb.pcb_wcookie)); /* The cookie needs to guarantee invalid alignment after the XOR. */ diff --git a/sys/crypto/cryptosoft.c b/sys/crypto/cryptosoft.c index 7510096cd2e..9d084bd6f66 100644 --- a/sys/crypto/cryptosoft.c +++ b/sys/crypto/cryptosoft.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptosoft.c,v 1.49 2007/09/15 11:00:51 hshoexer Exp $ */ +/* $OpenBSD: cryptosoft.c,v 1.50 2008/06/09 07:07:15 djm Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -105,7 +105,7 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data *sw, caddr_t buf, if (crd->crd_flags & CRD_F_IV_EXPLICIT) bcopy(crd->crd_iv, iv, ivlen); else - arc4random_bytes(iv, ivlen); + arc4random_buf(iv, ivlen); /* Do we need to write the IV */ if (!(crd->crd_flags & CRD_F_IV_PRESENT)) { 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 diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index fd0409870d0..d50617150d1 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.149 2008/05/06 17:19:40 thib Exp $ */ +/* $OpenBSD: init_main.c,v 1.150 2008/06/09 07:07:16 djm Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -396,7 +396,7 @@ main(void *framep) { volatile long newguard[8]; - arc4random_bytes((long *)newguard, sizeof(newguard)); + arc4random_buf((long *)newguard, sizeof(newguard)); for (i = sizeof(__guard)/sizeof(__guard[0]) - 1; i; i--) __guard[i] = newguard[i]; diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 0063a736d1e..1a0a15f00eb 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.160 2008/02/09 15:10:58 kettenis Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.161 2008/06/09 07:07:16 djm Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -387,7 +387,7 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, if (*oldlenp > sizeof(buf)) *oldlenp = sizeof(buf); if (oldp) { - arc4random_bytes(buf, *oldlenp); + arc4random_buf(buf, *oldlenp); if ((error = copyout(buf, oldp, *oldlenp))) return (error); } diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index a2886a8f261..73565670bd1 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.69 2008/06/08 15:06:26 claudio Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.70 2008/06/09 07:07:16 djm Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. * Keepalive protocol implemented in both Cisco and PPP modes. @@ -4067,7 +4067,7 @@ sppp_chap_scr(struct sppp *sp) u_char clen; /* Compute random challenge. */ - arc4random_bytes(sp->myauth.challenge, sizeof(sp->myauth.challenge)); + arc4random_buf(sp->myauth.challenge, sizeof(sp->myauth.challenge)); clen = AUTHKEYLEN; sp->confid[IDX_CHAP] = ++sp->pp_seq; diff --git a/sys/net/pf.c b/sys/net/pf.c index 4ee915b2e83..ad18ee0e632 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.581 2008/06/08 21:30:44 henning Exp $ */ +/* $OpenBSD: pf.c,v 1.582 2008/06/09 07:07:16 djm Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -2947,7 +2947,7 @@ pf_tcp_iss(struct pf_pdesc *pd) u_int32_t digest[4]; if (pf_tcp_secret_init == 0) { - arc4random_bytes(pf_tcp_secret, sizeof(pf_tcp_secret)); + arc4random_buf(pf_tcp_secret, sizeof(pf_tcp_secret)); MD5Init(&pf_tcp_secret_ctx); MD5Update(&pf_tcp_secret_ctx, pf_tcp_secret, sizeof(pf_tcp_secret)); diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 712488d5ac3..07775a0ad9a 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,5 +1,5 @@ /* $NetBSD: ieee80211_input.c,v 1.24 2004/05/31 11:12:24 dyoung Exp $ */ -/* $OpenBSD: ieee80211_input.c,v 1.79 2008/04/26 19:57:49 damien Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.80 2008/06/09 07:07:16 djm Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -1960,7 +1960,7 @@ ieee80211_recv_4way_msg1(struct ieee80211com *ic, return; /* generate a new supplicant's nonce (SNonce) */ - arc4random_bytes(ic->ic_nonce, EAPOL_KEY_NONCE_LEN); + arc4random_buf(ic->ic_nonce, EAPOL_KEY_NONCE_LEN); /* retrieve PMK and derive TPTK */ if ((pmk = ieee80211_get_pmk(ic, ni, pmkid)) == NULL) { diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 19699d7a9d5..8e4c3775205 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.c,v 1.33 2008/04/21 20:16:34 damien Exp $ */ +/* $OpenBSD: ieee80211_node.c,v 1.34 2008/06/09 07:07:16 djm Exp $ */ /* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */ /*- @@ -307,7 +307,7 @@ ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan) u_int8_t gtk[IEEE80211_PMK_LEN]; /* initialize 256-bit global key counter to a random value */ - arc4random_bytes(ic->ic_globalcnt, EAPOL_KEY_NONCE_LEN); + arc4random_buf(ic->ic_globalcnt, EAPOL_KEY_NONCE_LEN); ni->ni_rsnprotos = ic->ic_rsnprotos; ni->ni_rsnakms = ic->ic_rsnakms; @@ -317,7 +317,7 @@ ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan) ic->ic_def_txkey = 1; k = &ic->ic_nw_keys[ic->ic_def_txkey]; - arc4random_bytes(gtk, sizeof(gtk)); + arc4random_buf(gtk, sizeof(gtk)); ieee80211_map_gtk(gtk, ni->ni_rsngroupcipher, ic->ic_def_txkey, 1, 0, k); (*ic->ic_set_key)(ic, ni, k); /* XXX */ @@ -1094,7 +1094,7 @@ ieee80211_node_join_rsn(struct ieee80211com *ic, struct ieee80211_node *ni) ni->ni_rsn_state = RSNA_AUTHENTICATION_2; /* generate a new authenticator nonce (ANonce) */ - arc4random_bytes(ni->ni_nonce, EAPOL_KEY_NONCE_LEN); + arc4random_buf(ni->ni_nonce, EAPOL_KEY_NONCE_LEN); /* initiate 4-way handshake */ if (ni->ni_rsnakms == IEEE80211_AKM_PSK) diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 771cbc20e5b..eb349fa7b73 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.23 2008/04/21 19:37:18 damien Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.24 2008/06/09 07:07:16 djm Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -391,7 +391,7 @@ ieee80211_setkeys(struct ieee80211com *ic) /* Swap(GM, GN) */ kid = (ic->ic_def_txkey == 1) ? 2 : 1; - arc4random_bytes(gtk, sizeof(gtk)); + arc4random_buf(gtk, sizeof(gtk)); ieee80211_map_gtk(gtk, ic->ic_bss->ni_rsngroupcipher, kid, 1, 0, &ic->ic_nw_keys[kid]); diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 293ddc65718..186431bf273 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.164 2008/05/07 05:14:21 claudio Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.165 2008/06/09 07:07:16 djm Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -1009,7 +1009,7 @@ carp_prepare_ad(struct mbuf *m, struct carp_vhost_entry *vhe, struct carp_header *ch) { if (!vhe->vhe_replay_cookie) { - arc4random_bytes(&vhe->vhe_replay_cookie, + arc4random_buf(&vhe->vhe_replay_cookie, sizeof(vhe->vhe_replay_cookie)); } diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index d4ab426bcff..c5d179518b7 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.104 2007/11/19 11:03:21 mpf Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.105 2008/06/09 07:07:17 djm Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -904,7 +904,7 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, for (ilen = 0; ilen < padding - 2; ilen++) pad[ilen] = ilen + 1; else - arc4random_bytes((void *) pad, padding - 2); + arc4random_buf((void *) pad, padding - 2); /* Fix padding length and Next Protocol in padding itself. */ pad[padding - 2] = padding - 2; diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c index 84195ebbb4c..4b1b6c7634d 100644 --- a/sys/netinet/ip_id.c +++ b/sys/netinet/ip_id.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_id.c,v 1.21 2008/03/15 04:55:25 djm Exp $ */ +/* $OpenBSD: ip_id.c,v 1.22 2008/06/09 07:07:17 djm Exp $ */ /* * Copyright (c) 2008 Theo de Raadt, Ryan McBride @@ -67,7 +67,7 @@ ip_randomid(void) } do { - arc4random_bytes(&si, sizeof(si)); + arc4random_buf(&si, sizeof(si)); i = isindex & 0xFFFF; i2 = (isindex - (si & 0x7FFF)) & 0xFFFF; r = ip_shuffle[i]; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 7492a2232a8..5b482b0ce9d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.104 2008/05/06 08:47:36 markus Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.105 2008/06/09 07:07:17 djm Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -986,7 +986,7 @@ tcp_set_iss_tsm(struct tcpcb *tp) u_int32_t digest[4]; if (tcp_secret_init == 0) { - arc4random_bytes(tcp_secret, sizeof(tcp_secret)); + arc4random_buf(tcp_secret, sizeof(tcp_secret)); MD5Init(&tcp_secret_ctx); MD5Update(&tcp_secret_ctx, tcp_secret, sizeof(tcp_secret)); tcp_secret_init = 1; |