]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Enabling TC26 CMS tests
authorDmitry Belyavskiy <beldmit@gmail.com>
Sat, 9 May 2020 16:36:12 +0000 (19:36 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Sat, 9 May 2020 16:36:12 +0000 (19:36 +0300)
tcl_tests/cmstc262019.try
tcl_tests/runtest.sh
tcl_tests/tc26_cms/encrypted_keytrans_a241.pem
tcl_tests/tc26_cms/plain/text_decrypted.plain [new file with mode: 0644]

index 478298e04bfca049e162eaeff9fd5073353e6e47..c2bdb8552c28714511279d22990eca19e061c53f 100644 (file)
@@ -5,6 +5,7 @@ package require ossltest
 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"
 
@@ -31,4 +32,20 @@ test "Digested data, 512 bits" {
 } 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
index 9e0dead1b7abc96194803b2cbd43eb4015badb09..abee488e128c2f4f344cdfbd92c84030637d0405 100644 (file)
@@ -95,7 +95,7 @@ case "$ENGINE_NAME" in
                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/'`
                ;;
        *)
index f34056128ba6cc3481dbbdc85b138cf0ca95088f..541d2875a87abc66aa4176818720d15dbd2eb3b9 100644 (file)
@@ -1,13 +1,13 @@
 -----BEGIN CMS-----
 MIIB7wYJKoZIhvcNAQcDoIIB4DCCAdwCAQAxggFfMIIBWwIBADBAMDgxDTALBgNV
 BAoTBFRLMjYxJzAlBgNVBAMTHkNBIFRLMjY6IEdPU1QgMzQuMTAtMTIgMjU2LWJp
-dAIEAYy6hTAXBgkqhQMHAQEHAQEwCgYIKoUDBwEBBgIEgfowgfcEMIjuwfzfONBU
-93ktK8OrTr22Q/1IMWaVc2JZxzxoQP5nzT4fq5aUBsY44bEdPhYgRzCBoDAXBggq
-hQMHAQEBAjALBgkqhQMHAQIBAgEDgYQABIGAcaoBV0T9iLYdvUbyw2g6E/mIXerg
-AUAHwAOoXu88GUsTclujKTRgBUDWoRQkEZTPVvPZ58Tx3JWsy2JxJQppwbr9KaoE
-PhnxivZJ2PYG0cK8B/OHiq30I9KwHyGArA3RK4SD2HqoIxeSRWa5IyhoAxSfg5YY
-5LWTXxsNiX+lH9cEIIwDwI/cy7SphgEFu76rkjirn2JHdWiXLTKk4SdG/R+wMFkG
-CSqGSIb3DQEHATAbBgkqhQMHAQEFAQIwDgQM1k2BxkeBXYCEsGMvgC9qSqe1z1h4
-3DHBdQRofT56xVOZCi+JxzUbPqKNzU3vjU2W/LlYgOLGuTJwEzw7GaEZMBcGCSqF
-AwcBAAYBATEKBAgvK0+i46xDsw==
+dAIEAYy6hTAXBgkqhQMHAQEHAgEwCgYIKoUDBwEBBgIEgfowgfcEMPvAcitO3fYI
+4spTrluMWJkMP0hYJKeHPXCd12Qusu5ajFvfG8qCLGFKFIJTeFoiUjCBoDAXBggq
+hQMHAQEBAjALBgkqhQMHAQIBAgEDgYQABIGAqPNz+Pd8mddju80lzoXb6ZFVfz8G
+2ftc+4/az2BXxN9p7O8MgtIvklnXi1ugYYDxgJfGLTB2khPeIQkBOcozznG/eaN2
+TnwUX3uy/EEsu3Oh1L0sPHBchMU86pa/Jc6CCXj9t/wuOuvWJexfdP/uZiygfqwS
+ZdgdJg8RWVLPGg4EIHiz9dVnb+GJiuxJzLDdQIi56+gNy3XkRNwMfRcpwZ+UMFkG
+CSqGSIb3DQEHATAbBgkqhQMHAQEFAQIwDgQMgzPtk7gv3Pk+NYEugC+PxP/HyOQt
+b8Ry/fcFIQzcjNHzH8JkfM9wEFBfpl/R1SyO5Qg55VcfAc4ETj0246EZMBcGCSqF
+AwcBAAYBATEKBAhVf+jhWVm0Jw==
 -----END CMS-----
diff --git a/tcl_tests/tc26_cms/plain/text_decrypted.plain b/tcl_tests/tc26_cms/plain/text_decrypted.plain
new file mode 100644 (file)
index 0000000..5ee95f7
--- /dev/null
@@ -0,0 +1 @@
+Êîíòðîëüíûé ïðèìåð äëÿ ñòðóêòóðû EnvelopedData.