gnupg/tests/cms/samplekeys
Werner Koch 7661d2fbc6
sm: Another partly rewrite of minip12.c
* sm/minip12.c (struct tlv_ctx_s): Add origbuffer and origbufsize.
Remove pop_count.  Rename offset to length.
(dump_tag_info, _dump_tag_info): Rewrite.
(dump_tlv_ctx, _dump_tlv_ctx): Rewrite.
(tlv_new): Init origbuffer.
(_tlv_peek): Add arg ti.
(tlv_peek): New.
(tlv_peek_null): New.
(_tlv_push): Rewrite.
(_tlv_pop): Rewrite.
(tlv_next): New macro.  Move old code to ...
(_tlv_next): this.  Add arg lno.  Pop remaining end tags.
(tlv_popped): Remove.
(tlv_expect_object): Handle ndef.
(tlv_expect_octet_string): Ditto.
(parse_bag_encrypted_data): Use nesting level to control the inner
loop.
(parse_shrouded_key_bag): Likewise.
(parse_bag_data): Handle surplus octet strings.
(p12_parse): Ditto.

* sm/minip12.c (decrypt_block): Strip the padding.
(tlv_expect_top_sequence): Remove.  Replace callers by
tlv_expect_sequence.

* tests/cms/samplekeys/t6752-ov-user-ff.p12: New sample key.
* tests/cms/samplekeys/Description-p12: Add its description
--

This patch improves the BER parser by simplifying it.  Now tlv_next
pops off and thus closes all containers regardless on whether they are
length bounded or ndef.  tlv_set_pending is now always used to undo
the effect of a tlv_next in a loop condition which was terminated by a
nesting level change.

Instead of using the length as seen in the decrypted container we now
remove the padding and let the BER parser do its work.  This might
have a negative effect on pkcs#12 objects which are not correctly
padded but we don't have any example of such broken objects.

GnuPG-bug-id: 6752
2023-10-24 09:33:35 +02:00
..
8D6D17B4B94BBE8304926C016D2C5C7805EB6705.key tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
68A638998DFABAC510EA645CE34F9686B2EDF7EA.key tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
32100C27173EF6E9C4E9A25D3D69F86D37A4F939.key tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
Description-p12 sm: Another partly rewrite of minip12.c 2023-10-24 09:33:35 +02:00
README sm: Major rewrite of the PKCS#12 parser 2023-06-28 17:34:19 +02:00
cert-with-117-akas.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
cert_g10code_enconly_1.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
cert_g10code_pete1.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
cert_g10code_test1.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
cert_g10code_test_ca.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
cert_g10code_theo1.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
cryptlib-key.p12 tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
edward.tester@demo.gnupg.com.p12 sm: Improve the octet string cramming for pkcs#12 2023-10-05 10:25:14 +02:00
gte.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
nistp256-openssl-self-signed.p12 sm: Support more HMAC algos in the pkcs#12 parser. 2023-10-06 11:02:19 +02:00
opensc-test.p12 tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
ossl-rentec-user.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
ov-server.p12 tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
ov-user.p12 tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
steed-self-signing-nonthority.pem tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
t5793-openssl.pfx sm: Adding missing stuff to the PKCS#12 parser rewrite. 2023-06-29 17:49:10 +02:00
t5793-test.pfx sm: Adding missing stuff to the PKCS#12 parser rewrite. 2023-06-29 17:49:10 +02:00
t6752-ov-user-ff.p12 sm: Another partly rewrite of minip12.c 2023-10-24 09:33:35 +02:00
webdeca.der tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00
webderoot.der tests: Rename subdir gpgsm to cms and move sample dirs. 2021-05-31 21:51:45 +02:00

README

This is a collection of keys we use with the regression tests.
For the *.p12 files see Description-p12

ossl-rentec-user.pem  An OpenSSL generated user certificate using a
                      bunch of attributes and DC RDNs.

webderoot.der      trust.web.de Root CA certificate [2004-02-17]
webdeca.der        trust.web.de CA certificate [2004-02-17]


gte.pem            GTE CyberTrust Global Root

cert-with-117-akas.pem  A certificate with 117 subjectAltNames.

steed-self-signing-nonthority.pem
                   The STEED Self-Signing Nonthority.
68A638998DFABAC510EA645CE34F9686B2EDF7EA.key
                   The private Key of The STEED Self-Signing Nonthority.