diff options
author | 2007-11-16 05:08:39 +0000 | |
---|---|---|
committer | 2007-11-16 05:08:39 +0000 | |
commit | ccc90fdead1867eb64036614c19b6e37f4f9d299 (patch) | |
tree | 1e2b878c5ef4b59029a906f3f1b09811dcd22316 /sys/dev/softraid.c | |
parent | something has to go, unfortunately (diff) | |
download | wireguard-openbsd-ccc90fdead1867eb64036614c19b6e37f4f9d299.tar.xz wireguard-openbsd-ccc90fdead1867eb64036614c19b6e37f4f9d299.zip |
use arc4random_bytes() instead of multiple arc4random() calls;
ok deraadt@ dlg@ henric@ mcbride@
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 7 |
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 |