diff --git a/sys/dev/random/fortuna.c b/sys/dev/random/fortuna.c index e0991d411df3..b0ab6e88c69e 100644 --- a/sys/dev/random/fortuna.c +++ b/sys/dev/random/fortuna.c @@ -254,7 +254,6 @@ random_fortuna_process_event(struct harvest_event *event) 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(); } diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index b88d98bb845f..eb8d300cc3d2 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -163,6 +163,7 @@ random_harvestq_fast_process_event(struct harvest_event *event) #if defined(RANDOM_LOADABLE) RANDOM_CONFIG_S_UNLOCK(); #endif + explicit_bzero(event, sizeof(*event)); } static void @@ -437,7 +438,6 @@ random_harvestq_prime(void *unused __unused) 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 @@ random_harvest_direct_(const void *entropy, u_int size, enum random_entropy_sour 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 diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c index 9e2ddb29ce0b..e20669b3c207 100644 --- a/sys/dev/random/randomdev.c +++ b/sys/dev/random/randomdev.c @@ -321,7 +321,6 @@ randomdev_accumulate(uint8_t *buf, u_int count) 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 @@ randomdev_accumulate(uint8_t *buf, u_int count) 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)); }