Implement EVP_CIPH_CTRL_INIT

This commit is contained in:
Nicolas Williams
2016-04-13 11:48:52 -05:00
parent 8033eb298b
commit 6bbe7f0ffa

View File

@@ -800,6 +800,10 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *c, ENGINE *engine,
/* assume block size is a multiple of 2 */
ctx->block_mask = EVP_CIPHER_block_size(c) - 1;
if ((ctx->cipher->flags & EVP_CIPH_CTRL_INIT) &&
!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL))
return 0;
} else if (ctx->cipher == NULL) {
/* reuse of cipher, but not any cipher ever set! */
return 0;