file delete -force $::test::dir/tc26_cms
file copy -force tc26_cms $::test::dir
cd $::test::dir
+set plain_str [getFile ./tc26_cms/plain/text_decrypted.plain]
start_tests "CMS tests, TC26 examples"
} 0 "Verification successful
"
+test "CMS decrypt, Kuznyechik ACPKM+OMAC, KeyAgreement" {
+ grep "Enveloped" [openssl "cms -decrypt -debug_decrypt -in ./tc26_cms/encrypted_keyagree_a211.pem -inform PEM -inkey ./tc26_cms/recipient512_key.pem -recip ./tc26_cms/recipient512_cert.pem -originator ./tc26_cms/sender512_cert.pem"]
+} 0 $plain_str
+
+test "CMS decrypt, Magma ACPKM, KeyAgreement" {
+ grep "Enveloped" [openssl "cms -decrypt -debug_decrypt -in ./tc26_cms/encrypted_keyagree_a221.pem -inform PEM -inkey ./tc26_cms/recipient256_key.pem -recip ./tc26_cms/recipient256_cert.pem -originator ./tc26_cms/sender256_cert.pem"]
+} 0 $plain_str
+
+test "CMS decrypt, Kuznyechik ACPKM, KeyTrans" {
+ grep "Enveloped" [openssl "cms -decrypt -in ./tc26_cms/encrypted_keytrans_a231.pem -inform PEM -inkey ./tc26_cms/recipient256_key.pem"]
+} 0 $plain_str
+
+test "CMS decrypt, Magma ACPKM+OMAC, KeyTrans" {
+ grep "Enveloped" [openssl "cms -decrypt -debug_decrypt -in ./tc26_cms/encrypted_keytrans_a241.pem -inform PEM -inkey ./tc26_cms/recipient512_key.pem "]
+} 0 $plain_str
+
end_tests
OTHER_DIR=`echo $TESTDIR |sed 's/cryptocom/gost/'`
;;
gost)
- BASE_TESTS="engine dgst mac pkcs8 enc req-genpkey req-newkey ca smime smime2 smimeenc cms cms2 cmsenc pkcs12 nopath ocsp ts ssl smime_io cms_io smimeenc_io cmsenc_io"
+ BASE_TESTS="engine dgst mac pkcs8 enc req-genpkey req-newkey ca smime smime2 smimeenc cms cms2 cmstc262019 cmsenc pkcs12 nopath ocsp ts ssl smime_io cms_io smimeenc_io cmsenc_io"
OTHER_DIR=`echo $TESTDIR |sed 's/gost/cryptocom/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