Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108117367
D20318.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D20318.diff
View Options
Index: head/sys/dev/random/fortuna.c
===================================================================
--- head/sys/dev/random/fortuna.c
+++ head/sys/dev/random/fortuna.c
@@ -254,7 +254,6 @@
fortuna_state.fs_pool[pl].fsp_length = MIN(RANDOM_FORTUNA_MAXPOOLSIZE,
fortuna_state.fs_pool[pl].fsp_length +
sizeof(event->he_somecounter) + event->he_size);
- explicit_bzero(event, sizeof(*event));
RANDOM_RESEED_UNLOCK();
}
Index: head/sys/dev/random/random_harvestq.c
===================================================================
--- head/sys/dev/random/random_harvestq.c
+++ head/sys/dev/random/random_harvestq.c
@@ -163,6 +163,7 @@
#if defined(RANDOM_LOADABLE)
RANDOM_CONFIG_S_UNLOCK();
#endif
+ explicit_bzero(event, sizeof(*event));
}
static void
@@ -437,7 +438,6 @@
harvest_context.hc_destination[RANDOM_CACHED]++;
memcpy(event.he_entropy, data + i, sizeof(event.he_entropy));
random_harvestq_fast_process_event(&event);
- explicit_bzero(&event, sizeof(event));
}
explicit_bzero(data, size);
if (bootverbose)
@@ -540,7 +540,6 @@
event.he_destination = harvest_context.hc_destination[origin]++;
memcpy(event.he_entropy, entropy, size);
random_harvestq_fast_process_event(&event);
- explicit_bzero(&event, sizeof(event));
}
void
Index: head/sys/dev/random/randomdev.c
===================================================================
--- head/sys/dev/random/randomdev.c
+++ head/sys/dev/random/randomdev.c
@@ -321,7 +321,6 @@
timestamp = (uint32_t)get_cyclecount();
randomdev_hash_iterate(&hash, ×tamp, sizeof(timestamp));
randomdev_hash_finish(&hash, entropy_data);
- explicit_bzero(&hash, sizeof(hash));
for (i = 0; i < RANDOM_KEYSIZE_WORDS; i += sizeof(event.he_entropy)/sizeof(event.he_entropy[0])) {
event.he_somecounter = (uint32_t)get_cyclecount();
event.he_size = sizeof(event.he_entropy);
@@ -330,6 +329,7 @@
memcpy(event.he_entropy, entropy_data + i, sizeof(event.he_entropy));
p_random_alg_context->ra_event_processor(&event);
}
+ explicit_bzero(&event, sizeof(event));
explicit_bzero(entropy_data, sizeof(entropy_data));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 1:52 PM (7 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16030642
Default Alt Text
D20318.diff (2 KB)
Attached To
Mode
D20318: random(4): deduplicate explicit_bzero() in harvest
Attached
Detach File
Event Timeline
Log In to Comment