Skip to content

Commit e70a63f

Browse files
committed
pkcs7: fix error check of PKCS7_RECIP_INFO_set()
This function actually returns a value <=0 on error, but it is not documented as such. Example from OpenSSL code [1] and implementation [2] indicate as such. [1] https://github.com/openssl/openssl/blob/4b8ddae690d6449005e474bfdfe73106d4d6c5ea/crypto/pkcs7/pk7_lib.c#L578 [2] https://github.com/openssl/openssl/blob/4b8ddae690d6449005e474bfdfe73106d4d6c5ea/crypto/pkcs7/pk7_lib.c#L625
1 parent 3bd8833 commit e70a63f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/openssl/ossl_pkcs7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ ossl_pkcs7ri_initialize(VALUE self, VALUE cert)
10551055

10561056
x509 = GetX509CertPtr(cert); /* NO NEED TO DUP */
10571057
GetPKCS7ri(self, p7ri);
1058-
if (!PKCS7_RECIP_INFO_set(p7ri, x509)) {
1058+
if (PKCS7_RECIP_INFO_set(p7ri, x509) <= 0) {
10591059
ossl_raise(ePKCS7Error, NULL);
10601060
}
10611061

0 commit comments

Comments
 (0)