summaryrefslogtreecommitdiff
path: root/dh.c
diff options
context:
space:
mode:
authordjm <djm>2008-05-19 04:50:00 +0000
committerdjm <djm>2008-05-19 04:50:00 +0000
commita1e37c5fac57353ca7637c0dd6d3deaf4ce24452 (patch)
treec86070babcddeb3d6e8dcb696318c7152dd9fc8a /dh.c
parentf690d624665500312faee3becf0de7f302d77d2d (diff)
downloadopenssh-a1e37c5fac57353ca7637c0dd6d3deaf4ce24452.tar.gz
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2008/04/13 00:22:17 [dh.c sshd.c] Use arc4random_buf() when requesting more than a single word of output Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
Diffstat (limited to 'dh.c')
-rw-r--r--dh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dh.c b/dh.c
index 66858104..0908fcf1 100644
--- a/dh.c
+++ b/dh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.c,v 1.45 2007/09/27 00:15:57 ray Exp $ */
+/* $OpenBSD: dh.c,v 1.46 2008/04/13 00:22:17 djm Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
*
@@ -153,7 +153,7 @@ choose_dh(int min, int wantbits, int max)
}
linenum = 0;
- which = arc4random() % bestcount;
+ which = arc4random_uniform(bestcount);
while (fgets(line, sizeof(line), f)) {
if (!parse_prime(linenum, line, &dhg))
continue;