summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_pkcs7.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_pkcs7.c')
-rw-r--r--ext/openssl/ossl_pkcs7.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index e25c8bc5c1..889071c265 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -320,8 +320,10 @@ ossl_pkcs7_initialize(int argc, VALUE *argv, VALUE self)
p7 = PEM_read_bio_PKCS7(in, &pkcs, NULL, NULL);
DATA_PTR(self) = pkcs;
if (!p7) {
- (void)BIO_reset(in);
+ OSSL_BIO_reset(in);
p7 = d2i_PKCS7_bio(in, &pkcs);
+ if (!p7)
+ ossl_raise(rb_eArgError, "Could not parse the PKCS7");
DATA_PTR(self) = pkcs;
}
BIO_free(in);