From: igrkir Date: Mon, 7 Jun 2021 10:16:14 +0000 (+0300) Subject: make tests pass through X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=83e1771145d9b9f40cc5edb5af9c9f45ea4ca71a;p=openssl-gost%2Fengine.git make tests pass through --- diff --git a/tcl_tests/cms.try b/tcl_tests/cms.try index 1cc6d02..a877c0b 100644 --- a/tcl_tests/cms.try +++ b/tcl_tests/cms.try @@ -68,12 +68,12 @@ test -skip {![file exists cms_sign_$alg_fn.pem]} "Checking oids in cms struct" { test -skip {![file exists cms_sign_$alg_fn.msg]} "Verifying a message signed with $alg without ca " { grep Veri [openssl "cms -verify -text -in cms_sign_$alg_fn.msg -out cms_verified.txt -noverify -certfile $username/cert.pem"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists cms_sign_$alg_fn.msg]} "Verifying a message signed with $alg with ca" { grep Veri [openssl "cms -verify -text -in cms_sign_$alg_fn.msg -out cms_verified.txt -certfile $username/cert.pem -CAfile $::test::ca/cacert.pem"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists cms_sign_$alg_fn.msg]} -createsfiles [list cms_bad_$alg_fn.msg cms_verified.txt] "Verifying corrupted messages signed with $alg" { @@ -95,12 +95,12 @@ test -skip {![file exist cms_sign_c_$alg_fn.msg]} "Checking micalg param in sign test -skip {![file exists cms_sign_c_$alg_fn.msg]} "Verifying a message signed with $alg having cert inside without ca" { grep Veri [openssl "cms -verify -text -in cms_sign_c_$alg_fn.msg -out cms_verified.txt -noverify"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists cms_sign_c_$alg_fn.msg]} "Verifying a message signed with $alg having cert with ca" { grep Veri [openssl "cms -verify -text -in cms_sign_c_$alg_fn.msg -out cms_verified.txt -CAfile $::test::ca/cacert.pem"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists $username/cert.pem]} -createsfiles {cms_sign.dat cms_sign_op_$alg_fn.msg} "Signing a message by $alg with cert using opaque signing" { @@ -111,12 +111,12 @@ test -skip {![file exists $username/cert.pem]} -createsfiles {cms_sign.dat cms_s test -createsfiles cms_verified.txt -skip {![file exists cms_sign_op_$alg_fn.msg]} "Verifying a message signed by $alg having cert inside without ca" { grep Veri [openssl "cms -verify -text -in cms_sign_op_$alg_fn.msg -out cms_verified.txt -noverify"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -createsfiles cms_verified.txt -skip {![file exists cms_sign_op_$alg_fn.msg]} "Verifying a $alg opaque message with ca" { grep Veri [openssl "cms -verify -text -in cms_sign_op_$alg_fn.msg -out cms_verified.txt -CAfile $::test::ca/cacert.pem"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -createsfiles cms_broken_op_$alg_fn.msg -skip {![file exists cms_sign_op_$alg_fn.msg]} "Verifying broken $alg opaque message" { @@ -159,7 +159,7 @@ test -skip {![file exists cms_sign_$alg_fn.pem]} "Checking oids in cms struct" { test -skip {![file exists cms_sign_det_$alg_fn.pem]} "Verifying detached $alg cms_signature" { grep Veri [openssl "cms -verify -binary -content cms_sign.dat -inform PEM -in cms_sign_det_$alg_fn.pem -out cms_verified.txt -noverify"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists cms_sign_det_$alg_fn.msg]} -createsfiles {bad.dat} "Verifying corrupted $alg detached cms_signature" { diff --git a/tcl_tests/cms2.try b/tcl_tests/cms2.try index c734a6c..884f1ec 100644 --- a/tcl_tests/cms2.try +++ b/tcl_tests/cms2.try @@ -30,7 +30,7 @@ test -createsfiles cms_signed2_2_$length.asn "Signing in DER format with 2nd sig test -createsfiles {was_signed.dat signer.certs} "Verifying signature in DER format" { grep "Verif" [openssl "cms -verify -inform der -in cms_signed2_2_$length.asn -noverify -signer signer.certs -out was_signed.dat"] -} 0 {CMS Verification successful +} 0 {Verification successful } test "Signed data is extracted correctly" { @@ -64,7 +64,7 @@ test -createsfiles cms_signed2_2_$length\_op.msg "Signing opaque in S/MIME forma test -createsfiles {was_signed.dat signer.certs} "Verifying opaque signature in S/MIME format" { grep "Verif" [openssl "cms -verify -in cms_signed2_2_$length\_op.msg -noverify -signer signer.certs -out was_signed.dat"] -} 0 {CMS Verification successful +} 0 {Verification successful } test "Signed data is extracted correctly" { @@ -98,7 +98,7 @@ test -createsfiles cms_signed2_2_$length\_det.asn "Signing detached in DER forma test -createsfiles {was_signed.dat signer.certs} "Verifying detached signature in DER format" { grep "Verif" [openssl "cms -verify -in cms_signed2_2_$length\_det.asn -noverify -signer signer.certs -out was_signed.dat -content signed2.dat -inform der"] -} 0 {CMS Verification successful +} 0 {Verification successful } test "Signed data is extracted correctly" { @@ -131,7 +131,7 @@ test -createsfiles cms_signed2_2_$length.msg "Signing in S/MIME format with 2nd test -createsfiles {was_signed.dat signer.certs} "Verifying signature in S/MIME format" { grep "Verif" [openssl "cms -verify -in cms_signed2_2_$length.msg -noverify -signer signer.certs -out was_signed.dat -inform smime"] -} 0 {CMS Verification successful +} 0 {Verification successful } test "Signed data is extracted correctly" { diff --git a/tcl_tests/cmstc262019.try b/tcl_tests/cmstc262019.try index 7e14026..c2bdb85 100644 --- a/tcl_tests/cmstc262019.try +++ b/tcl_tests/cmstc262019.try @@ -14,12 +14,12 @@ start_tests "CMS tests, TC26 examples" test "Signed data, 512 bits, signed attributes" { grep "Verification successful" [openssl "cms -verify -in tc26_cms/signed_a111.pem -inform PEM -noverify"] -} 0 "CMS Verification successful +} 0 "Verification successful " test "Signed data, 256 bits, no signed attributes" { grep "Verification successful" [openssl "cms -verify -in tc26_cms/signed_a121.pem -inform PEM -noverify"] -} 0 "CMS Verification successful +} 0 "Verification successful " test "Digested data, 256 bits" { diff --git a/tcl_tests/engine.try b/tcl_tests/engine.try index f7ef659..9d1d7e0 100644 --- a/tcl_tests/engine.try +++ b/tcl_tests/engine.try @@ -6,7 +6,7 @@ start_tests "Тесты на команду engine" switch -exact [engine_name] { "ccore" {set list " \[RAND, gost89, gost89-cnt, gost89-cnt-12, gost89-cbc, id-tc26-cipher-gostr3412-2015-magma-ctracpkm, magma-ctr, magma-ofb, magma-cbc, magma-cfb, grasshopper-ecb, grasshopper-cbc, grasshopper-ofb, grasshopper-cfb, grasshopper-ctr, id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm, md_gost94, gost-mac, md_gost12_256, md_gost12_512, gost-mac-12, gost2001, id-GostR3410-2001DH, gost-mac, gost2012_256, gost2012_512, gost-mac-12\]\n"} - "open" {set list "(gost) Reference implementation of GOST engine\n \[gost89, gost89-cnt, gost89-cnt-12, gost89-cbc, kuznyechik-ecb, kuznyechik-cbc, kuznyechik-cfb, kuznyechik-ofb, kuznyechik-ctr, magma-cbc, magma-ctr, magma-ctr-acpkm, magma-ctr-acpkm-omac, kuznyechik-ctr-acpkm, kuznyechik-ctr-acpkm-omac, magma-kexp15, kuznyechik-kexp15, md_gost94, gost-mac, md_gost12_256, md_gost12_512, gost-mac-12, magma-mac, kuznyechik-mac, kuznyechik-ctr-acpkm-omac, gost2001, id-GostR3410-2001DH, gost-mac, gost2012_256, gost2012_512, gost-mac-12, magma-mac, kuznyechik-mac, magma-ctr-acpkm-omac, kuznyechik-ctr-acpkm-omac\]\n"} + "open" {set list "(gost) Reference implementation of GOST engine\n \[gost89, gost89-cnt, gost89-cnt-12, gost89-cbc, kuznyechik-ecb, kuznyechik-cbc, kuznyechik-cfb, kuznyechik-ofb, kuznyechik-ctr, kuznyechik-mgm, magma-cbc, magma-ctr, magma-ctr-acpkm, magma-ctr-acpkm-omac, magma-mgm, kuznyechik-ctr-acpkm, kuznyechik-ctr-acpkm-omac, magma-kexp15, kuznyechik-kexp15, md_gost94, gost-mac, md_gost12_256, md_gost12_512, gost-mac-12, magma-mac, kuznyechik-mac, kuznyechik-ctr-acpkm-omac, gost2001, id-GostR3410-2001DH, gost-mac, gost2012_256, gost2012_512, gost-mac-12, magma-mac, kuznyechik-mac, magma-ctr-acpkm-omac, kuznyechik-ctr-acpkm-omac\]\n"} } diff --git a/tcl_tests/smime_io.try b/tcl_tests/smime_io.try index e0c7235..e4d7666 100644 --- a/tcl_tests/smime_io.try +++ b/tcl_tests/smime_io.try @@ -29,12 +29,12 @@ foreach alg $alg_list { test -skip {![file exists sign_$alg_fn.msg]} "Verifying a message signed with $alg without ca via cms" { grep Veri [openssl "cms -verify -text -in sign_$alg_fn.msg -out verified.txt -noverify -certfile $username/cert.pem"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists sign_$alg_fn.msg]} "Verifying a message signed with $alg with ca via cms" { grep Veri [openssl "cms -verify -text -in sign_$alg_fn.msg -out verified.txt -certfile $username/cert.pem -CAfile $::test::ca/cacert.pem"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists bad_$alg_fn.msg]} -createsfiles verified.txt "Verifying corrupted messages signed with $alg via smime" { @@ -43,22 +43,22 @@ test -skip {![file exists bad_$alg_fn.msg]} -createsfiles verified.txt "Verifyin test -skip {![file exists sign_c_$alg_fn.msg]} "Verifying a message signed with $alg having cert inside without ca via cms" { grep Veri [openssl "cms -verify -text -in sign_c_$alg_fn.msg -out verified.txt -noverify"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists sign_c_$alg_fn.msg]} "Verifying a message signed with $alg having cert with ca via cms" { grep Veri [openssl "cms -verify -text -in sign_c_$alg_fn.msg -out verified.txt -CAfile $::test::ca/cacert.pem"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -createsfiles verified.txt -skip {![file exists sign_op_$alg_fn.msg]} "Verifying a message signed by $alg having cert inside without ca via cms" { grep Veri [openssl "cms -verify -text -in sign_op_$alg_fn.msg -out verified.txt -noverify"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -createsfiles verified.txt -skip {![file exists sign_op_$alg_fn.msg]} "Verifying a $alg opaque message with ca via cms" { grep Veri [openssl "cms -verify -text -in sign_op_$alg_fn.msg -out verified.txt -CAfile $::test::ca/cacert.pem"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists broken_op_$alg_fn.msg]} "Verifying broken $alg opaque message" { @@ -67,7 +67,7 @@ test -skip {![file exists broken_op_$alg_fn.msg]} "Verifying broken $alg opaque test -skip {![file exists sign_det_$alg_fn.pem]} "Verifying detached $alg signature via cms" { grep Veri [openssl "cms -verify -binary -content sign.dat -inform PEM -in sign_det_$alg_fn.pem -out verified.txt -noverify"] -} 0 "CMS Verification successful +} 0 "Verification successful " test -skip {![file exists sign_det_$alg_fn.msg]} -createsfiles {bad.dat} "Verifying corrupted $alg detached signature" { diff --git a/tcl_tests/ssl.try b/tcl_tests/ssl.try index d14a203..a153067 100644 --- a/tcl_tests/ssl.try +++ b/tcl_tests/ssl.try @@ -43,9 +43,9 @@ if {[info exists env(ALG_LIST)]} { array set suites { rsa:1024 {ECDHE-RSA-AES256-SHA@SECLEVEL=0} -gost2001:XA {GOST2001-GOST89-GOST89 GOST2001-NULL-GOST94@SECLEVEL=0 LEGACY-GOST2012-GOST8912-GOST8912 IANA-GOST2012-GOST8912-GOST8912 GOST2012-NULL-GOST12@SECLEVEL=0} -gost2012_256:XA {LEGACY-GOST2012-GOST8912-GOST8912 GOST2012-NULL-GOST12@SECLEVEL=0} -gost2012_512:A {LEGACY-GOST2012-GOST8912-GOST8912 GOST2012-NULL-GOST12@SECLEVEL=0} +gost2001:XA {GOST2001-GOST89-GOST89 GOST2001-NULL-GOST94@SECLEVEL=0 GOST2012-GOST8912-GOST8912 GOST2012-GOST8912-IANA GOST2012-NULL-GOST12@SECLEVEL=0} +gost2012_256:XA {GOST2012-GOST8912-GOST8912 GOST2012-NULL-GOST12@SECLEVEL=0} +gost2012_512:A {GOST2012-GOST8912-GOST8912 GOST2012-NULL-GOST12@SECLEVEL=0} } # @@ -63,14 +63,14 @@ array set defsuite { rsa:1024 ECDHE-RSA-AES256-SHA #gost94:XA GOST94-GOST89-GOST89 gost2001:XA GOST2012-GOST8912-GOST8912 -gost2012_256:XA LEGACY-GOST2012-GOST8912-GOST8912 -gost2012_512:A LEGACY-GOST2012-GOST8912-GOST8912 +gost2012_256:XA GOST2012-GOST8912-GOST8912 +gost2012_512:A GOST2012-GOST8912-GOST8912 } array set defsuite_12 { rsa:1024 ECDHE-RSA-AES256-GCM-SHA384 #gost94:XA GOST94-GOST89-GOST89 -gost2001:XA LEGACY-GOST2012-GOST8912-GOST8912 +gost2001:XA GOST2012-GOST8912-GOST8912 gost2012_256:XA GOST2012-MAGMA-MAGMAOMAC gost2012_512:A GOST2012-MAGMA-MAGMAOMAC } diff --git a/test/00-engine.t b/test/00-engine.t index a09cfe5..d95a958 100644 --- a/test/00-engine.t +++ b/test/00-engine.t @@ -38,7 +38,7 @@ if ( -f $engine . ".info") { $engine_info= <