Skip to content

Commit

Permalink
Check retryability on flush failure
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein committed Oct 28, 2024
1 parent 8b09a84 commit 8def0f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/pkcs7/bio/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ static int enc_flush(BIO *b, BIO *next, BIO_ENC_CTX *ctx) {
while (ctx->ok > 0 && (ctx->buf_len > 0 || !ctx->done)) {
int bytes_written = BIO_write(next, &ctx->buf[ctx->buf_off], ctx->buf_len);
if (ctx->buf_len > 0 && bytes_written <= 0) {
if (bytes_written < 0 && !BIO_should_retry(next)) {
ctx->done = 1;
ctx->ok = 0;
}
BIO_copy_next_retry(b);
return 0;
}
Expand Down

0 comments on commit 8def0f4

Please sign in to comment.