Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/openssl/ossl_pkcs7.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,10 @@ ossl_pkcs7_initialize(int argc, VALUE *argv, VALUE self)
}
BIO_free(in);
if (!p7)
ossl_raise(rb_eArgError, "Could not parse the PKCS7");
ossl_raise(ePKCS7Error, "Could not parse the PKCS7");
if (!p7->d.ptr) {
PKCS7_free(p7);
ossl_raise(rb_eArgError, "No content in PKCS7");
ossl_raise(ePKCS7Error, "No content in PKCS7");
}

RTYPEDDATA_DATA(self) = p7;
Expand Down
4 changes: 2 additions & 2 deletions test/openssl/test_pkcs7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def test_data

def test_empty_signed_data_ruby_bug_19974
data = "-----BEGIN PKCS7-----\nMAsGCSqGSIb3DQEHAg==\n-----END PKCS7-----\n"
assert_raise(ArgumentError) { OpenSSL::PKCS7.new(data) }
assert_raise(OpenSSL::PKCS7::PKCS7Error) { OpenSSL::PKCS7.new(data) }

data = <<END
MIME-Version: 1.0
Expand All @@ -319,7 +319,7 @@ def test_empty_signed_data_ruby_bug_19974

def test_graceful_parsing_failure #[ruby-core:43250]
contents = "not a valid PKCS #7 PEM block"
assert_raise(ArgumentError) { OpenSSL::PKCS7.new(contents) }
assert_raise(OpenSSL::PKCS7::PKCS7Error) { OpenSSL::PKCS7.new(contents) }
end

def test_set_type_signed
Expand Down