From 5dcd533a7f0987d81f4b74e85e0057397b108837 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 29 Mar 2017 12:13:30 -0400 Subject: [PATCH] ensure positive random numbers Change-Id: I993a2b90b8ae56ac263597c5a107be9c1f92d001 --- daemon/aux.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/aux.h b/daemon/aux.h index 3d45afb5d..d0d0af3e5 100644 --- a/daemon/aux.h +++ b/daemon/aux.h @@ -188,8 +188,8 @@ INLINE int strmemcmp(const void *mem, int len, const char *str) { INLINE void random_string(unsigned char *buf, int len) { assert(RAND_bytes(buf, len) == 1); } -INLINE long int ssl_random() { - long int ret; +INLINE long unsigned int ssl_random() { + long unsigned int ret; random_string((void *) &ret, sizeof(ret)); return ret; }