Blame SOURCES/openssl-1.0.2i-enc-fail.patch

450916
diff -up openssl-1.0.2i/crypto/evp/bio_enc.c.enc-fail openssl-1.0.2i/crypto/evp/bio_enc.c
450916
--- openssl-1.0.2i/crypto/evp/bio_enc.c.enc-fail	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/crypto/evp/bio_enc.c	2016-09-22 13:58:24.592381002 +0200
450916
@@ -307,8 +307,9 @@ static long enc_ctrl(BIO *b, int cmd, lo
450916
     case BIO_CTRL_RESET:
450916
         ctx->ok = 1;
450916
         ctx->finished = 0;
450916
-        EVP_CipherInit_ex(&(ctx->cipher), NULL, NULL, NULL, NULL,
450916
-                          ctx->cipher.encrypt);
450916
+        if (!EVP_CipherInit_ex(&(ctx->cipher), NULL, NULL, NULL, NULL,
450916
+                               ctx->cipher.encrypt))
450916
+             ctx->ok = 0;
450916
         ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
450916
         break;
450916
     case BIO_CTRL_EOF:         /* More to read */
450916
@@ -430,7 +431,8 @@ void BIO_set_cipher(BIO *b, const EVP_CI
450916
 
450916
     b->init = 1;
450916
     ctx = (BIO_ENC_CTX *)b->ptr;
450916
-    EVP_CipherInit_ex(&(ctx->cipher), c, NULL, k, i, e);
450916
+    if (!EVP_CipherInit_ex(&(ctx->cipher), c, NULL, k, i, e))
450916
+        ctx->ok = 0;
450916
 
450916
     if (b->callback != NULL)
450916
         b->callback(b, BIO_CB_CTRL, (const char *)c, BIO_CTRL_SET, e, 1L);