diff options
author | Werner Koch <wk@gnupg.org> | 2021-06-02 11:03:55 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2021-06-02 11:03:55 +0200 |
commit | 4980fb3c6dde8c1dda975e8a36d6086c8456a631 (patch) | |
tree | d5a1dd07d15256549159f8a20b1617fc6ee7122a /tests | |
parent | tests: Rename subdir gpgsm to cms and move sample dirs. (diff) | |
download | gnupg2-4980fb3c6dde8c1dda975e8a36d6086c8456a631.tar.xz gnupg2-4980fb3c6dde8c1dda975e8a36d6086c8456a631.zip |
sm: Support AES-GCM decryption.
* tests/cms/samplemsgs/: Add sample messages.
* sm/gpgsm.c (main): Use gpgrt_fcancel on decryption error.
* sm/decrypt.c (decrypt_gcm_filter): New.
(gpgsm_decrypt): Use this filter if requested. Check authtag.
--
Note that the sample message pwri-sample.gcm.p7m is broken: The
authtag is duplicated to the authEncryptedContentInfo. I used a
temporary code during testing hack to that test message out.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cms/Makefile.am | 4 | ||||
-rw-r--r-- | tests/cms/samplemsgs/README | 6 | ||||
-rw-r--r-- | tests/cms/samplemsgs/pwri-sample.cbc-2.p7m | bin | 0 -> 346 bytes | |||
-rw-r--r-- | tests/cms/samplemsgs/pwri-sample.cbc.p7m | bin | 0 -> 350 bytes | |||
-rw-r--r-- | tests/cms/samplemsgs/pwri-sample.gcm.p7m | bin | 0 -> 375 bytes |
5 files changed, 10 insertions, 0 deletions
diff --git a/tests/cms/Makefile.am b/tests/cms/Makefile.am index 03c7d8d21..bc86acba2 100644 --- a/tests/cms/Makefile.am +++ b/tests/cms/Makefile.am @@ -86,6 +86,10 @@ EXTRA_DIST = $(XTESTS) $(KEYS) $(CERTS) $(TEST_FILES) \ samplekeys/cert_g10code_pete1.pem \ samplekeys/cert_g10code_test1.pem \ samplekeys/cert_g10code_theo1.pem \ + samplemsgs/README \ + samplemsgs/pwri-sample.cbc.p7m \ + samplemsgs/pwri-sample.cbc-2.p7m \ + samplemsgs/pwri-sample.gcm.p7m \ text-1.txt text-2.txt text-3.txt \ text-1.osig.pem text-1.dsig.pem text-1.osig-bad.pem \ text-2.osig.pem text-2.osig-bad.pem \ diff --git a/tests/cms/samplemsgs/README b/tests/cms/samplemsgs/README new file mode 100644 index 000000000..a76b9457a --- /dev/null +++ b/tests/cms/samplemsgs/README @@ -0,0 +1,6 @@ +Sample messages for CMS symmetric encryption. +Password is "abc". + +pwri-sample.cbc.p7m - Using CBC Mode +pwri-sample.cbc-2.p7m - Using CBC with a different iteration count +pwri-sample.gcm.p7m - Using GCM (from a broken implementation) diff --git a/tests/cms/samplemsgs/pwri-sample.cbc-2.p7m b/tests/cms/samplemsgs/pwri-sample.cbc-2.p7m Binary files differnew file mode 100644 index 000000000..a417b7aca --- /dev/null +++ b/tests/cms/samplemsgs/pwri-sample.cbc-2.p7m diff --git a/tests/cms/samplemsgs/pwri-sample.cbc.p7m b/tests/cms/samplemsgs/pwri-sample.cbc.p7m Binary files differnew file mode 100644 index 000000000..ba208d2e3 --- /dev/null +++ b/tests/cms/samplemsgs/pwri-sample.cbc.p7m diff --git a/tests/cms/samplemsgs/pwri-sample.gcm.p7m b/tests/cms/samplemsgs/pwri-sample.gcm.p7m Binary files differnew file mode 100644 index 000000000..7cf1f8542 --- /dev/null +++ b/tests/cms/samplemsgs/pwri-sample.gcm.p7m |