Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein committed Sep 30, 2024
1 parent 43af6b7 commit 974506f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crypto/pkcs7/bio/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ static int enc_new(BIO *b) {
GUARD_PTR(b);

if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) {
OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE);
return 0;
}

Expand Down Expand Up @@ -228,8 +227,9 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr) {
ctx->ok = 1;
ctx->flushed = 0;
if (!EVP_CipherInit_ex(ctx->cipher, NULL, NULL, NULL, NULL,
EVP_CIPHER_CTX_encrypting(ctx->cipher)))
EVP_CIPHER_CTX_encrypting(ctx->cipher))) {
return 0;
}
ret = BIO_ctrl(next, cmd, num, ptr);
break;
case BIO_CTRL_EOF:
Expand All @@ -249,7 +249,10 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr) {
}
break;
case BIO_CTRL_FLUSH:
enc_flush(b, next, ctx, /*do_final*/ 1);
ret = enc_flush(b, next, ctx, /*do_final*/ 1);
if (ret < 0) {
break;
}
// Finally flush the underlying BIO
ret = BIO_ctrl(next, cmd, num, ptr);
BIO_copy_next_retry(b);
Expand Down

0 comments on commit 974506f

Please sign in to comment.