Loading crypto/rand/drbg_lib.c +7 −7 Original line number Original line Diff line number Diff line Loading @@ -557,11 +557,11 @@ int rand_drbg_restart(RAND_DRBG *drbg, const unsigned char *adin = NULL; const unsigned char *adin = NULL; size_t adinlen = 0; size_t adinlen = 0; if (drbg->pool != NULL) { if (drbg->seed_pool != NULL) { RANDerr(RAND_F_RAND_DRBG_RESTART, ERR_R_INTERNAL_ERROR); RANDerr(RAND_F_RAND_DRBG_RESTART, ERR_R_INTERNAL_ERROR); drbg->state = DRBG_ERROR; drbg->state = DRBG_ERROR; rand_pool_free(drbg->pool); rand_pool_free(drbg->seed_pool); drbg->pool = NULL; drbg->seed_pool = NULL; return 0; return 0; } } Loading @@ -581,8 +581,8 @@ int rand_drbg_restart(RAND_DRBG *drbg, } } /* will be picked up by the rand_drbg_get_entropy() callback */ /* will be picked up by the rand_drbg_get_entropy() callback */ drbg->pool = rand_pool_attach(buffer, len, entropy); drbg->seed_pool = rand_pool_attach(buffer, len, entropy); if (drbg->pool == NULL) if (drbg->seed_pool == NULL) return 0; return 0; } else { } else { if (drbg->max_adinlen < len) { if (drbg->max_adinlen < len) { Loading Loading @@ -628,8 +628,8 @@ int rand_drbg_restart(RAND_DRBG *drbg, } } } } rand_pool_free(drbg->pool); rand_pool_free(drbg->seed_pool); drbg->pool = NULL; drbg->seed_pool = NULL; return drbg->state == DRBG_READY; return drbg->state == DRBG_READY; } } Loading crypto/rand/rand_lcl.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -203,7 +203,7 @@ struct rand_drbg_st { * with respect to how randomness is added to the RNG during reseeding * with respect to how randomness is added to the RNG during reseeding * (see PR #4328). * (see PR #4328). */ */ struct rand_pool_st *pool; struct rand_pool_st *seed_pool; /* /* * Auxiliary pool for additional data. * Auxiliary pool for additional data. Loading crypto/rand/rand_lib.c +4 −4 Original line number Original line Diff line number Diff line Loading @@ -146,8 +146,8 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg, return 0; return 0; } } if (drbg->pool != NULL) { if (drbg->seed_pool != NULL) { pool = drbg->pool; pool = drbg->seed_pool; pool->entropy_requested = entropy; pool->entropy_requested = entropy; } else { } else { pool = rand_pool_new(entropy, min_len, max_len); pool = rand_pool_new(entropy, min_len, max_len); Loading Loading @@ -204,7 +204,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg, } } err: err: if (drbg->pool == NULL) if (drbg->seed_pool == NULL) rand_pool_free(pool); rand_pool_free(pool); return ret; return ret; } } Loading @@ -216,7 +216,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg, void rand_drbg_cleanup_entropy(RAND_DRBG *drbg, void rand_drbg_cleanup_entropy(RAND_DRBG *drbg, unsigned char *out, size_t outlen) unsigned char *out, size_t outlen) { { if (drbg->pool == NULL) if (drbg->seed_pool == NULL) OPENSSL_secure_clear_free(out, outlen); OPENSSL_secure_clear_free(out, outlen); } } Loading Loading
crypto/rand/drbg_lib.c +7 −7 Original line number Original line Diff line number Diff line Loading @@ -557,11 +557,11 @@ int rand_drbg_restart(RAND_DRBG *drbg, const unsigned char *adin = NULL; const unsigned char *adin = NULL; size_t adinlen = 0; size_t adinlen = 0; if (drbg->pool != NULL) { if (drbg->seed_pool != NULL) { RANDerr(RAND_F_RAND_DRBG_RESTART, ERR_R_INTERNAL_ERROR); RANDerr(RAND_F_RAND_DRBG_RESTART, ERR_R_INTERNAL_ERROR); drbg->state = DRBG_ERROR; drbg->state = DRBG_ERROR; rand_pool_free(drbg->pool); rand_pool_free(drbg->seed_pool); drbg->pool = NULL; drbg->seed_pool = NULL; return 0; return 0; } } Loading @@ -581,8 +581,8 @@ int rand_drbg_restart(RAND_DRBG *drbg, } } /* will be picked up by the rand_drbg_get_entropy() callback */ /* will be picked up by the rand_drbg_get_entropy() callback */ drbg->pool = rand_pool_attach(buffer, len, entropy); drbg->seed_pool = rand_pool_attach(buffer, len, entropy); if (drbg->pool == NULL) if (drbg->seed_pool == NULL) return 0; return 0; } else { } else { if (drbg->max_adinlen < len) { if (drbg->max_adinlen < len) { Loading Loading @@ -628,8 +628,8 @@ int rand_drbg_restart(RAND_DRBG *drbg, } } } } rand_pool_free(drbg->pool); rand_pool_free(drbg->seed_pool); drbg->pool = NULL; drbg->seed_pool = NULL; return drbg->state == DRBG_READY; return drbg->state == DRBG_READY; } } Loading
crypto/rand/rand_lcl.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -203,7 +203,7 @@ struct rand_drbg_st { * with respect to how randomness is added to the RNG during reseeding * with respect to how randomness is added to the RNG during reseeding * (see PR #4328). * (see PR #4328). */ */ struct rand_pool_st *pool; struct rand_pool_st *seed_pool; /* /* * Auxiliary pool for additional data. * Auxiliary pool for additional data. Loading
crypto/rand/rand_lib.c +4 −4 Original line number Original line Diff line number Diff line Loading @@ -146,8 +146,8 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg, return 0; return 0; } } if (drbg->pool != NULL) { if (drbg->seed_pool != NULL) { pool = drbg->pool; pool = drbg->seed_pool; pool->entropy_requested = entropy; pool->entropy_requested = entropy; } else { } else { pool = rand_pool_new(entropy, min_len, max_len); pool = rand_pool_new(entropy, min_len, max_len); Loading Loading @@ -204,7 +204,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg, } } err: err: if (drbg->pool == NULL) if (drbg->seed_pool == NULL) rand_pool_free(pool); rand_pool_free(pool); return ret; return ret; } } Loading @@ -216,7 +216,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg, void rand_drbg_cleanup_entropy(RAND_DRBG *drbg, void rand_drbg_cleanup_entropy(RAND_DRBG *drbg, unsigned char *out, size_t outlen) unsigned char *out, size_t outlen) { { if (drbg->pool == NULL) if (drbg->seed_pool == NULL) OPENSSL_secure_clear_free(out, outlen); OPENSSL_secure_clear_free(out, outlen); } } Loading