From b6181aefc8d1b76652c12b6da3c15321b069257d Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Wed, 6 May 2020 20:47:27 +0300 Subject: [PATCH] -debug_decrypt option --- tcl_tests/cmsenc.try | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tcl_tests/cmsenc.try b/tcl_tests/cmsenc.try index 3203765..f9e6666 100644 --- a/tcl_tests/cmsenc.try +++ b/tcl_tests/cmsenc.try @@ -4,7 +4,7 @@ package require ossltest cd $::test::dir set testname [file rootname [file tail $::argv0]] -start_tests "Тесты на cms -encrypt" +start_tests "Тесты на cms -encrypt" proc make_fn {alg} { return [string map {":" "_"} $alg] } @@ -16,9 +16,9 @@ proc map {str list} { } return $result } - + if {![file exist encrypt.dat]} { - makeFile encrypt.dat [string repeat "Test data to encrypt.\n" 100] + makeFile encrypt.dat [string repeat "Test data to encrypt.\n" 100] } if {![info exist env(NO_RSA)]} { @@ -34,7 +34,7 @@ test "Make registered user $user" { test -createsfiles cms_enc_rsa.msg "RSA User 1 encrypts message for RSA user 2" { - openssl "cms -encrypt -in encrypt.dat -des -out cms_enc_rsa.msg U_cms_enc_rsa_2/cert.pem" + openssl "cms -encrypt -in encrypt.dat -aes-128-cbc -out cms_enc_rsa.msg U_cms_enc_rsa_2/cert.pem" file isfile cms_enc_rsa.msg } 0 1 @@ -95,7 +95,7 @@ test "Creating user $username with key $alg" { if {![file exists $username/req.pem]&&[file exists $username/cert.pem]} { file delete $username/cert.pem - } + } file exists $username/cert.pem } 0 1 @@ -122,7 +122,7 @@ test -skip {![file exists cms_enc_$alg_fn.pem]} "Checking oids in pkcs7 structur test -createsfiles cms_decrypt.$alg_fn "Decrypting file encrypted for $username" { set expected [getFile encrypt.dat] - openssl "cms -decrypt -in cms_enc_$alg_fn.msg -recip U_cms_enc_$alg_fn/cert.pem -inkey U_cms_enc_$alg_fn/seckey.pem -out cms_decrypt.$alg_fn" + openssl "cms -decrypt -debug_decrypt -in cms_enc_$alg_fn.msg -recip U_cms_enc_$alg_fn/cert.pem -inkey U_cms_enc_$alg_fn/seckey.pem -out cms_decrypt.$alg_fn" set result [getFile cms_decrypt.$alg_fn] string eq $expected $result } 0 1 @@ -141,14 +141,14 @@ if {[info exists env(CRYPT_PARAMS)]} {unset env(CRYPT_PARAMS)} test -createsfiles cms_decrypt_t.$alg_fn "Decrypting file text-encrypted for $username" { set expected [getFile encrypt.dat] - openssl "cms -decrypt -text -in cms_enc_t_$alg_fn.msg -recip U_cms_enc_$alg_fn/cert.pem -inkey U_cms_enc_$alg_fn/seckey.pem -out cms_decrypt_t.$alg_fn" + openssl "cms -decrypt -debug_decrypt -text -in cms_enc_t_$alg_fn.msg -recip U_cms_enc_$alg_fn/cert.pem -inkey U_cms_enc_$alg_fn/seckey.pem -out cms_decrypt_t.$alg_fn" set result [getFile cms_decrypt_t.$alg_fn] string eq $expected $result } 0 1 test -createsfiles cms_decrypt_t_nocert.$alg_fn "Decrypting file text-encrypted for $username without cert" { set expected [getFile encrypt.dat] - openssl "cms -decrypt -text -in cms_enc_t_$alg_fn.msg -inkey U_cms_enc_$alg_fn/seckey.pem -out cms_decrypt_t_nocert.$alg_fn" + openssl "cms -decrypt -debug_decrypt -text -in cms_enc_t_$alg_fn.msg -inkey U_cms_enc_$alg_fn/seckey.pem -out cms_decrypt_t_nocert.$alg_fn" set result [getFile cms_decrypt_t_nocert.$alg_fn] string eq $expected $result } 0 1 @@ -167,7 +167,7 @@ foreach enc_tuple $enc_list { } set alg_fn [make_fn $enc_tuple] set username U_cms_enc_$alg_fn - + test -skip {![file exists cms_enc_4all.msg]} -createsfiles cms_decrypt_4all.$alg_fn "Decrypting gost-encrypted file, recipient $alg_fn" { set expected [getFile encrypt.dat] openssl "cms -decrypt -in cms_enc_4all.msg -recip $username/cert.pem -inkey $username/seckey.pem -out cms_decrypt_4all.$alg_fn" @@ -177,7 +177,7 @@ test -skip {![file exists cms_enc_4all.msg]} -createsfiles cms_decrypt_4all.$alg test -skip {![file exists cms_enc_4all.msg]} -createsfiles cms_decrypt_4all_nocert.$alg_fn "Decrypting gost-encrypted file without cert, recipient $alg_fn" { set expected [getFile encrypt.dat] - openssl "cms -decrypt -in cms_enc_4all.msg -inkey $username/seckey.pem -out cms_decrypt_4all_nocert.$alg_fn" + openssl "cms -decrypt -debug_decrypt -in cms_enc_4all.msg -inkey $username/seckey.pem -out cms_decrypt_4all_nocert.$alg_fn" set result [getFile cms_decrypt_4all_nocert.$alg_fn] string eq $expected $result } 0 1 -- 2.39.5