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

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