Skip to content

Commit 6263d0d

Browse files
samuel40791765matzbot
authored andcommitted
[ruby/openssl] test_pkcs7.rb: skip AWS-LC's unsupported features
1. AWS-LC has no support for SMIME with PKCS7. That may change in the near future, so I've marked that with "pend" for now. 2. AWS-LC doesn't support printing of PKCS7 contents with PKCS7_print_ctx. 3. OpenSSL traditionally used indefinite-length encoding with ASN1_TFLG_NDEF in its implementation for PKCS7 EncryptedContent. AWS-LC uses explicit OCTET STRING headers to encode instead, which leads to a slight difference in serialized ASN1 contents from the two libraries. ruby/openssl@78c585a9c2
1 parent b995eee commit 6263d0d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/openssl/test_pkcs7.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ def test_set_type_encrypted
239239
end
240240

241241
def test_smime
242+
pend "AWS-LC has no current support for SMIME with PKCS7" if aws_lc?
243+
242244
store = OpenSSL::X509::Store.new
243245
store.add_cert(@ca_cert)
244246
ca_certs = [@ca_cert]
@@ -261,6 +263,8 @@ def test_smime
261263
end
262264

263265
def test_to_text
266+
omit "AWS-LC does not support PKCS7.to_text" if aws_lc?
267+
264268
p7 = OpenSSL::PKCS7.new
265269
p7.type = "signed"
266270
assert_match(/signed/, p7.to_text)
@@ -374,7 +378,12 @@ def test_split_content
374378
store = OpenSSL::X509::Store.new
375379
pki_msg.verify(nil, store, nil, OpenSSL::PKCS7::NOVERIFY)
376380
p7enc = OpenSSL::PKCS7.new(pki_msg.data)
377-
assert_equal(pki_message_content_pem, p7enc.to_pem)
381+
# AWS-LC uses explicit OCTET STRING headers when encoding PKCS7 EncryptedContent,
382+
# while OpenSSL traditionally uses indefinite-length encoding (ASN1_TFLG_NDEF)
383+
# in its PKCS7 implementation.
384+
unless aws_lc?
385+
assert_equal(pki_message_content_pem, p7enc.to_pem)
386+
end
378387
end
379388
end
380389

0 commit comments

Comments
 (0)