From: Dmitry Belyavskiy Date: Sat, 9 May 2020 16:36:12 +0000 (+0300) Subject: Enabling TC26 CMS tests X-Git-Tag: v3.0.0~127 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=9465f47596fb0ca5db8ea89c69ba07990e682ced;p=openssl-gost%2Fengine.git Enabling TC26 CMS tests --- diff --git a/tcl_tests/cmstc262019.try b/tcl_tests/cmstc262019.try index 478298e..c2bdb85 100644 --- a/tcl_tests/cmstc262019.try +++ b/tcl_tests/cmstc262019.try @@ -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 diff --git a/tcl_tests/runtest.sh b/tcl_tests/runtest.sh index 9e0dead..abee488 100644 --- a/tcl_tests/runtest.sh +++ b/tcl_tests/runtest.sh @@ -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/'` ;; *) diff --git a/tcl_tests/tc26_cms/encrypted_keytrans_a241.pem b/tcl_tests/tc26_cms/encrypted_keytrans_a241.pem index f340561..541d287 100644 --- a/tcl_tests/tc26_cms/encrypted_keytrans_a241.pem +++ b/tcl_tests/tc26_cms/encrypted_keytrans_a241.pem @@ -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 index 0000000..5ee95f7 --- /dev/null +++ b/tcl_tests/tc26_cms/plain/text_decrypted.plain @@ -0,0 +1 @@ +Êîíòðîëüíûé ïðèìåð äëÿ ñòðóêòóðû EnvelopedData.