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

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