提交 580139bd 编写于 作者: R Rich Salz 提交者: Rich Salz

RT3841: memset() cipher_data when allocated

If an EVP implementation (such as an engine) fails out early, it's
possible to call EVP_CIPHER_CTX_cleanup() which will call
ctx->cipher->cleanup() before the cipher_data has been initialized
via ctx->cipher->init().  Guarantee it's all-bytes-zero as soon as
it is allocated.
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 c490a551
......@@ -165,6 +165,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
EVPerr(EVP_F_EVP_CIPHERINIT_EX, ERR_R_MALLOC_FAILURE);
return 0;
}
memset(ctx->cipher_data, 0, ctx->cipher->ctx_size);
} else {
ctx->cipher_data = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册