summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2007-11-16 05:08:40 +0000
committerDamien Miller <djm@cvs.openbsd.org>2007-11-16 05:08:40 +0000
commit64b2ea406a218d1075510d5fdbb6bd30b2c0825f (patch)
treebae36432224b34feb677620e8af46ca10cc9b85a /sys/dev
parent58f36b90b0592c0c12ad394e861611431eb4db5d (diff)
use arc4random_bytes() instead of multiple arc4random() calls;
ok deraadt@ dlg@ henric@ mcbride@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/softraid.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 8f209fdb8d7..23f99ef80cf 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.84 2007/09/11 13:39:33 gilles Exp $ */
+/* $OpenBSD: softraid.c,v 1.85 2007/11/16 05:08:39 djm Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -1754,10 +1754,7 @@ sr_checksum(char *s, u_int32_t *p, u_int32_t size)
void
sr_get_uuid(struct sr_uuid *uuid)
{
- int i;
-
- for (i = 0; i < SR_UUID_MAX; i++)
- uuid->sui_id[i] = arc4random();
+ arc4random_bytes(uuid->sui_id, sizeof(uuid->sui_id));
}
void