From 769b5575d157aca77b78e44d94ea40ad08e3975e Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Thu, 4 Jan 2018 18:26:41 +0900 Subject: pkcs7: allow recipient's certificate to be omitted for PKCS7#decrypt The recipient's certificate is not mandatory for PKCS7_decrypt(). Make it possible to call OpenSSL::PKCS7#decrypt with only the private key to match the functionality. Reference: https://github.com/ruby/openssl/issues/182 --- test/test_pkcs7.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/test_pkcs7.rb b/test/test_pkcs7.rb index 149d3b9b..6437112b 100644 --- a/test/test_pkcs7.rb +++ b/test/test_pkcs7.rb @@ -133,6 +133,8 @@ class OpenSSL::TestPKCS7 < OpenSSL::TestCase assert_equal(@ca_cert.subject.to_s, recip[1].issuer.to_s) assert_equal(3, recip[1].serial) assert_equal(data, p7.decrypt(@rsa1024, @ee2_cert)) + + assert_equal(data, p7.decrypt(@rsa1024)) end def test_graceful_parsing_failure #[ruby-core:43250] -- cgit v1.2.3