Commit 68bc6b7a authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Note cipher BIO write errors too.



Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(cherry picked from commit 976ef6ad)

Conflicts:
	crypto/evp/bio_enc.c
parent 97a7b2eb
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -265,9 +265,13 @@ static int enc_write(BIO *b, const char *in, int inl)
    ctx->buf_off = 0;
    while (inl > 0) {
        n = (inl > ENC_BLOCK_SIZE) ? ENC_BLOCK_SIZE : inl;
        EVP_CipherUpdate(&(ctx->cipher),
        if (!EVP_CipherUpdate(&ctx->cipher,
                              (unsigned char *)ctx->buf, &ctx->buf_len,
                         (unsigned char *)in, n);
                              (unsigned char *)in, n)) {
            BIO_clear_retry_flags(b);
            ctx->ok = 0;
            return 0;
        }
        inl -= n;
        in += n;