diff --git a/ChangeLog b/ChangeLog index 93aa882516..8b06418eb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue May 27 18:46:23 2014 SHIBATA Hiroshi + + * test/openssl/test_pkcs7.rb: Add tests for PKCS7#type= and add_data. + [Feature #7399][ruby-core:49565] + Tue May 27 17:45:09 2014 SHIBATA Hiroshi * test/openssl/test_hmac.rb (test_binary_update): Added Test for diff --git a/test/openssl/test_pkcs7.rb b/test/openssl/test_pkcs7.rb index 4a6692a74c..0b0d808a90 100644 --- a/test/openssl/test_pkcs7.rb +++ b/test/openssl/test_pkcs7.rb @@ -151,6 +151,147 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase contents = File.read(__FILE__) assert_raise(ArgumentError) { OpenSSL::PKCS7.new(contents) } end + + def test_set_type_signed + p7 = OpenSSL::PKCS7.new + p7.type = "signed" + assert_equal(p7.type, :signed) + end + + def test_set_type_data + p7 = OpenSSL::PKCS7.new + p7.type = "data" + assert_equal(p7.type, :data) + end + + def test_set_type_signed_and_enveloped + p7 = OpenSSL::PKCS7.new + p7.type = "signedAndEnveloped" + assert_equal(p7.type, :signedAndEnveloped) + end + + def test_set_type_enveloped + p7 = OpenSSL::PKCS7.new + p7.type = "enveloped" + assert_equal(p7.type, :enveloped) + end + + def test_set_type_encrypted + p7 = OpenSSL::PKCS7.new + p7.type = "encrypted" + assert_equal(p7.type, :encrypted) + end + + def test_degenerate_pkcs7 + ca_cert_pem = <