diff options
author | djm <djm> | 2008-05-19 04:50:00 +0000 |
---|---|---|
committer | djm <djm> | 2008-05-19 04:50:00 +0000 |
commit | a1e37c5fac57353ca7637c0dd6d3deaf4ce24452 (patch) | |
tree | c86070babcddeb3d6e8dcb696318c7152dd9fc8a /dh.c | |
parent | f690d624665500312faee3becf0de7f302d77d2d (diff) | |
download | openssh-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |