[coreboot-gerrit] Change in coreboot[master]: tint: Use the current time as random seed
Nicola Corna (Code Review)
gerrit at coreboot.org
Sun Aug 13 15:43:17 CEST 2017
Nicola Corna has uploaded this change for review. ( https://review.coreboot.org/20980
Change subject: tint: Use the current time as random seed
......................................................................
tint: Use the current time as random seed
Previously the random seed was fixed, which led to the same sequence of
blocks for each run.
Change-Id: I2e482bbb9d33cdbbf3c15916458329f99fbc4450
Signed-off-by: Nicola Corna <nicola at corna.info>
---
M payloads/external/tint/libpayload_tint.patch
1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/20980/1
diff --git a/payloads/external/tint/libpayload_tint.patch b/payloads/external/tint/libpayload_tint.patch
index b5592dd..21b93a3 100644
--- a/payloads/external/tint/libpayload_tint.patch
+++ b/payloads/external/tint/libpayload_tint.patch
@@ -939,19 +939,22 @@
/*
* Initialize random number generator
-@@ -41,8 +43,11 @@ void rand_init ()
+@@ -41,8 +43,14 @@ void rand_init ()
#ifdef USE_RAND
srand (time (NULL));
#else
+#if 0
srandom (time (NULL));
#endif
-+ srandom (123);
++ struct timeval tp;
++
++ gettimeofday (&tp, NULL);
++ srandom (tp.tv_sec);
+#endif
}
/*
-@@ -61,6 +66,7 @@ int rand_value (int range)
+@@ -61,6 +69,7 @@ int rand_value (int range)
* Convert an str to long. Returns TRUE if successful,
* FALSE otherwise.
*/
@@ -959,7 +962,7 @@
bool str2int (int *i,const char *str)
{
char *endptr;
-@@ -69,3 +75,4 @@ bool str2int (int *i,const char *str)
+@@ -69,3 +78,4 @@ bool str2int (int *i,const char *str)
return TRUE;
}
--
To view, visit https://review.coreboot.org/20980
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e482bbb9d33cdbbf3c15916458329f99fbc4450
Gerrit-Change-Number: 20980
Gerrit-PatchSet: 1
Gerrit-Owner: Nicola Corna <nicola at corna.info>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170813/779cecc2/attachment.html>
More information about the coreboot-gerrit
mailing list