projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97a7b2e
)
Note cipher BIO write errors too.
author
Dr. Stephen Henson
<steve@openssl.org>
Tue, 26 Jul 2016 19:22:49 +0000
(20:22 +0100)
committer
Dr. Stephen Henson
<steve@openssl.org>
Tue, 26 Jul 2016 21:45:04 +0000
(22:45 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit
976ef6adcc157233fb641ca99e2424630ef1814f
)
Conflicts:
crypto/evp/bio_enc.c
crypto/evp/bio_enc.c
patch
|
blob
|
history
diff --git
a/crypto/evp/bio_enc.c
b/crypto/evp/bio_enc.c
index 590f236e8f117dd8bd313e4f9a5f77213c72a6e6..0806f233b67d0c5b5834ccdf01db757a3e0ab28a 100644
(file)
--- a/
crypto/evp/bio_enc.c
+++ b/
crypto/evp/bio_enc.c
@@
-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),
- (unsigned char *)ctx->buf, &ctx->buf_len,
- (unsigned char *)in, n);
+ if (!EVP_CipherUpdate(&ctx->cipher,
+ (unsigned char *)ctx->buf, &ctx->buf_len,
+ (unsigned char *)in, n)) {
+ BIO_clear_retry_flags(b);
+ ctx->ok = 0;
+ return 0;
+ }
inl -= n;
in += n;