summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_linux.c4
-rw-r--r--src/lib/libcrypto/crypto/getentropy_linux.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/arc4random/getentropy_linux.c b/src/lib/libcrypto/arc4random/getentropy_linux.c
index 40ea8a14ad..d5d36da1c5 100644
--- a/src/lib/libcrypto/arc4random/getentropy_linux.c
+++ b/src/lib/libcrypto/arc4random/getentropy_linux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_linux.c,v 1.24 2014/07/13 13:37:38 deraadt Exp $ */ 1/* $OpenBSD: getentropy_linux.c,v 1.25 2014/07/16 14:26:47 kettenis Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> 4 * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@@ -486,6 +486,7 @@ getentropy_fallback(void *buf, size_t len)
486 486
487 HD(cnt); 487 HD(cnt);
488 } 488 }
489#ifdef HAVE_GETAUXVAL
489#ifdef AT_RANDOM 490#ifdef AT_RANDOM
490 /* Not as random as you think but we take what we are given */ 491 /* Not as random as you think but we take what we are given */
491 p = (char *) getauxval(AT_RANDOM); 492 p = (char *) getauxval(AT_RANDOM);
@@ -502,6 +503,7 @@ getentropy_fallback(void *buf, size_t len)
502 if (p) 503 if (p)
503 HD(p); 504 HD(p);
504#endif 505#endif
506#endif
505 507
506 SHA512_Final(results, &ctx); 508 SHA512_Final(results, &ctx);
507 memcpy((char *)buf + i, results, min(sizeof(results), len - i)); 509 memcpy((char *)buf + i, results, min(sizeof(results), len - i));
diff --git a/src/lib/libcrypto/crypto/getentropy_linux.c b/src/lib/libcrypto/crypto/getentropy_linux.c
index 40ea8a14ad..d5d36da1c5 100644
--- a/src/lib/libcrypto/crypto/getentropy_linux.c
+++ b/src/lib/libcrypto/crypto/getentropy_linux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_linux.c,v 1.24 2014/07/13 13:37:38 deraadt Exp $ */ 1/* $OpenBSD: getentropy_linux.c,v 1.25 2014/07/16 14:26:47 kettenis Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> 4 * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@@ -486,6 +486,7 @@ getentropy_fallback(void *buf, size_t len)
486 486
487 HD(cnt); 487 HD(cnt);
488 } 488 }
489#ifdef HAVE_GETAUXVAL
489#ifdef AT_RANDOM 490#ifdef AT_RANDOM
490 /* Not as random as you think but we take what we are given */ 491 /* Not as random as you think but we take what we are given */
491 p = (char *) getauxval(AT_RANDOM); 492 p = (char *) getauxval(AT_RANDOM);
@@ -502,6 +503,7 @@ getentropy_fallback(void *buf, size_t len)
502 if (p) 503 if (p)
503 HD(p); 504 HD(p);
504#endif 505#endif
506#endif
505 507
506 SHA512_Final(results, &ctx); 508 SHA512_Final(results, &ctx);
507 memcpy((char *)buf + i, results, min(sizeof(results), len - i)); 509 memcpy((char *)buf + i, results, min(sizeof(results), len - i));