summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/bsd-arc4random.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-03-17 06:13:53 +0100
committerDamien Miller <djm@mindrot.org>2003-03-17 06:13:53 +0100
commitcafbcc73349f4e14afed5207b81a1205afc2cee2 (patch)
tree5cca4638acb6fbaa67f84e1ac2a9f45d872e579b /openbsd-compat/bsd-arc4random.c
parent - markus@cvs.openbsd.org 2003/03/13 11:44:50 (diff)
downloadopenssh-cafbcc73349f4e14afed5207b81a1205afc2cee2.tar.xz
openssh-cafbcc73349f4e14afed5207b81a1205afc2cee2.zip
- (djm) Fix return value checks for RAND_bytes. Report from
Steve G <linux_4ever@yahoo.com>
Diffstat (limited to 'openbsd-compat/bsd-arc4random.c')
-rw-r--r--openbsd-compat/bsd-arc4random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd-compat/bsd-arc4random.c b/openbsd-compat/bsd-arc4random.c
index ab4e1431e..dd08130d5 100644
--- a/openbsd-compat/bsd-arc4random.c
+++ b/openbsd-compat/bsd-arc4random.c
@@ -25,7 +25,7 @@
#include "includes.h"
#include "log.h"
-RCSID("$Id: bsd-arc4random.c,v 1.5 2002/05/08 22:57:18 tim Exp $");
+RCSID("$Id: bsd-arc4random.c,v 1.6 2003/03/17 05:13:53 djm Exp $");
#ifndef HAVE_ARC4RANDOM
@@ -66,7 +66,7 @@ void arc4random_stir(void)
unsigned char rand_buf[SEED_SIZE];
memset(&rc4, 0, sizeof(rc4));
- if (!RAND_bytes(rand_buf, sizeof(rand_buf)))
+ if (RAND_bytes(rand_buf, sizeof(rand_buf)) <= 0)
fatal("Couldn't obtain random bytes (error %ld)",
ERR_get_error());
RC4_set_key(&rc4, sizeof(rand_buf), rand_buf);