diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2022-05-29 00:07:04 +0800 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2022-06-02 10:36:56 -0400 |
commit | 48b571fe771f283d547ca2a5999ce5dd9a5509d0 (patch) | |
tree | e7cac67329034896357fa31e3ccfb3b92fd8a44d /crypto/pkcs7 | |
parent | e85bef981c037a6ebc0ca39f61c11bd79ed89fb3 (diff) |
Fix the checks of BIO_get_cipher_status
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/18424)
Diffstat (limited to 'crypto/pkcs7')
-rw-r--r-- | crypto/pkcs7/pk7_smime.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c index 8bc83bc9f4..56891b6efb 100644 --- a/crypto/pkcs7/pk7_smime.c +++ b/crypto/pkcs7/pk7_smime.c @@ -533,7 +533,7 @@ int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags) } ret = SMIME_text(bread, data); if (ret > 0 && BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) { - if (!BIO_get_cipher_status(tmpmem)) + if (BIO_get_cipher_status(tmpmem) <= 0) ret = 0; } BIO_free_all(bread); @@ -548,7 +548,7 @@ int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags) if (i <= 0) { ret = 1; if (BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) { - if (!BIO_get_cipher_status(tmpmem)) + if (BIO_get_cipher_status(tmpmem) <= 0) ret = 0; } |