version 1.19, 2013/06/24 00:56:21 |
version 1.20, 2013/06/24 04:21:20 |
Line 132 cprng_strong_create(const char *name, in |
|
Line 132 cprng_strong_create(const char *name, in |
|
/* XXX Fix nist_ctr_drbg API so this can't happen. */ |
/* XXX Fix nist_ctr_drbg API so this can't happen. */ |
panic("cprng %s: NIST CTR_DRBG instantiation failed", |
panic("cprng %s: NIST CTR_DRBG instantiation failed", |
cprng->cs_name); |
cprng->cs_name); |
explicit_bzero(seed, sizeof(seed)); |
explicit_memset(seed, 0, sizeof(seed)); |
|
|
if (!cprng->cs_ready && !ISSET(flags, CPRNG_INIT_ANY)) |
if (!cprng->cs_ready && !ISSET(flags, CPRNG_INIT_ANY)) |
printf("cprng %s: creating with partial entropy\n", |
printf("cprng %s: creating with partial entropy\n", |
Line 160 cprng_strong_destroy(struct cprng_strong |
|
Line 160 cprng_strong_destroy(struct cprng_strong |
|
cv_destroy(&cprng->cs_cv); |
cv_destroy(&cprng->cs_cv); |
mutex_destroy(&cprng->cs_lock); |
mutex_destroy(&cprng->cs_lock); |
|
|
explicit_bzero(cprng, sizeof(*cprng)); /* paranoia */ |
explicit_memset(cprng, 0, sizeof(*cprng)); /* paranoia */ |
kmem_free(cprng, sizeof(*cprng)); |
kmem_free(cprng, sizeof(*cprng)); |
} |
} |
|
|
Line 366 cprng_strong_reseed(struct cprng_strong |
|
Line 366 cprng_strong_reseed(struct cprng_strong |
|
const bool full_entropy = rndsink_request(cprng->cs_rndsink, seed, |
const bool full_entropy = rndsink_request(cprng->cs_rndsink, seed, |
sizeof(seed)); |
sizeof(seed)); |
cprng_strong_reseed_from(cprng, seed, sizeof(seed), full_entropy); |
cprng_strong_reseed_from(cprng, seed, sizeof(seed), full_entropy); |
explicit_bzero(seed, sizeof(seed)); |
explicit_memset(seed, 0, sizeof(seed)); |
} |
} |
|
|
/* |
/* |
Line 446 cprng_strong_rngtest(struct cprng_strong |
|
Line 446 cprng_strong_rngtest(struct cprng_strong |
|
rndsink_schedule(cprng->cs_rndsink); |
rndsink_schedule(cprng->cs_rndsink); |
} |
} |
|
|
explicit_bzero(rt, sizeof(*rt)); /* paranoia */ |
explicit_memset(rt, 0, sizeof(*rt)); /* paranoia */ |
kmem_intr_free(rt, sizeof(*rt)); |
kmem_intr_free(rt, sizeof(*rt)); |
} |
} |
#endif |
#endif |