Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108570076
D17047.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
980 B
Referenced Files
None
Subscribers
None
D17047.diff
View Options
Index: head/sys/dev/random/fortuna.c
===================================================================
--- head/sys/dev/random/fortuna.c
+++ head/sys/dev/random/fortuna.c
@@ -39,6 +39,7 @@
#ifdef _KERNEL
#include <sys/param.h>
+#include <sys/fail.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
@@ -385,6 +386,18 @@
}
#ifdef _KERNEL
+ /*
+ * When set, pretend we do not have enough entropy to reseed yet.
+ */
+ KFAIL_POINT_CODE(DEBUG_FP, random_fortuna_pre_read, {
+ if (RETURN_VALUE != 0) {
+ RANDOM_RESEED_UNLOCK();
+ return;
+ }
+ });
+#endif
+
+#ifdef _KERNEL
fortuna_state.fs_lasttime = now;
#endif
@@ -441,6 +454,14 @@
bool
random_fortuna_seeded(void)
{
+
+#ifdef _KERNEL
+ /* When set, act as if we are not seeded. */
+ KFAIL_POINT_CODE(DEBUG_FP, random_fortuna_seeded, {
+ if (RETURN_VALUE != 0)
+ fortuna_state.fs_counter = UINT128_ZERO;
+ });
+#endif
return (!uint128_is_zero(fortuna_state.fs_counter));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 11:32 AM (4 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16195090
Default Alt Text
D17047.diff (980 B)
Attached To
Mode
D17047: Fortuna: Add failpoints to simulate initial seeding conditions
Attached
Detach File
Event Timeline
Log In to Comment