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

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