From 6bbe7f0ffa65251b02cfcc64839775b200d3d0de Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Wed, 13 Apr 2016 11:48:52 -0500 Subject: [PATCH] Implement EVP_CIPH_CTRL_INIT --- lib/hcrypto/evp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/hcrypto/evp.c b/lib/hcrypto/evp.c index 22885d6fd..a8aeb53bf 100644 --- a/lib/hcrypto/evp.c +++ b/lib/hcrypto/evp.c @@ -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;