diff options
author | Werner Koch <wk@gnupg.org> | 2023-10-05 10:02:59 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2023-10-05 10:25:14 +0200 |
commit | c1f78634ec3927ddcfdc4687bc6e408c658a0ece (patch) | |
tree | 2edb7f0d8d0e11e2d4e601b282ff6fb48c1dea90 /tests | |
parent | agent: Fix agent_update_private_key. (diff) | |
download | gnupg2-c1f78634ec3927ddcfdc4687bc6e408c658a0ece.tar.xz gnupg2-c1f78634ec3927ddcfdc4687bc6e408c658a0ece.zip |
sm: Improve the octet string cramming for pkcs#12
* sm/minip12.c (need_octet_string_cramming): New.
(tlv_expect_object, tlv_expect_octet_string): Run the test before
cramming.
* sm/minip12.c (ENABLE_DER_STRUCT_DUMPING): New but undefined macro
for debug purposes.
(bag_decrypted_data_p, bag_data_p): Use macro to allow dumping.
--
This bug was exhibited by importing a gpgsm exported EC certificate.
We use an extra test instead of retrying to allow retruning an error
from malloc failure. And well, for easier reading of the code.
GnuPG-bug-id: 6536
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cms/Makefile.am | 1 | ||||
-rw-r--r-- | tests/cms/samplekeys/Description-p12 | 10 | ||||
-rw-r--r-- | tests/cms/samplekeys/edward.tester@demo.gnupg.com.p12 | bin | 0 -> 1561 bytes |
3 files changed, 11 insertions, 0 deletions
diff --git a/tests/cms/Makefile.am b/tests/cms/Makefile.am index 7efdf37b1..d5d753902 100644 --- a/tests/cms/Makefile.am +++ b/tests/cms/Makefile.am @@ -99,6 +99,7 @@ EXTRA_DIST = $(XTESTS) $(KEYS) $(CERTS) $(TEST_FILES) \ samplekeys/opensc-test.p12 \ samplekeys/t5793-openssl.pfx \ samplekeys/t5793-test.pfx \ + samplekeys/edward.tester@demo.gnupg.com.p12 \ samplemsgs/pwri-sample.cbc.p7m \ samplemsgs/pwri-sample.cbc-2.p7m \ samplemsgs/pwri-sample.gcm.p7m \ diff --git a/tests/cms/samplekeys/Description-p12 b/tests/cms/samplekeys/Description-p12 index f882de9ea..6fbbd82cf 100644 --- a/tests/cms/samplekeys/Description-p12 +++ b/tests/cms/samplekeys/Description-p12 @@ -1,4 +1,6 @@ # Description-p12 - Machine readable description of our P12 test vectors +# The Cert line gives the SHA1 fingerprint of the certificate +# The Key line gives a hash of the key parameters as returned by minip12.c Name: ov-user.p12 Desc: Private test key from www.openvalidation.org @@ -30,3 +32,11 @@ Desc: QuaVadis format of t5793-openssl Pass: test Cert: 80348a438e4b803b99e708da0b7fdd0659dedd15 Key: c271e44ab4fb19ca1aae71102ea4d7292ccc981d + +Name: edward.tester@demo.gnupg.com.p12 +Desc: GnuPG exported Brainpool certificate +Pass: abc,123456 +Cert: ff810b9281a43c394aa138e9c7fd4c0193216fa6 +Key: 94c6d0b067370a8f2a09ae43cfe8d700bbd61e75 + +# eof # diff --git a/tests/cms/samplekeys/edward.tester@demo.gnupg.com.p12 b/tests/cms/samplekeys/edward.tester@demo.gnupg.com.p12 Binary files differnew file mode 100644 index 000000000..a6f983780 --- /dev/null +++ b/tests/cms/samplekeys/edward.tester@demo.gnupg.com.p12 |