diff options
author | Dmitry Belyavskiy <beldmit@gmail.com> | 2019-11-10 04:30:14 +0300 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@users.noreply.github.com> | 2020-01-12 00:20:37 +0300 |
commit | 3b8ddfe2f303b8931842e52bdb5c07c97042f651 (patch) | |
tree | bfebf3f9306a4064f35a2510100623d8577e1dfb /tcl_tests/engine.try | |
parent | e09d5a86fe1cb876b3c7cf5eb0d890f557b466d0 (diff) | |
download | gost-engine-3b8ddfe2f303b8931842e52bdb5c07c97042f651.zip gost-engine-3b8ddfe2f303b8931842e52bdb5c07c97042f651.tar.gz gost-engine-3b8ddfe2f303b8931842e52bdb5c07c97042f651.tar.bz2 |
tcl_tests: Add TCL tests files
All source files are converted from cp1251 to utf-8.
Diffstat (limited to 'tcl_tests/engine.try')
-rw-r--r-- | tcl_tests/engine.try | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tcl_tests/engine.try b/tcl_tests/engine.try new file mode 100644 index 0000000..2090e59 --- /dev/null +++ b/tcl_tests/engine.try @@ -0,0 +1,33 @@ +#!/usr/bin/tclsh +# -*- coding: cp1251 -*- +lappend auto_path [file dirname [info script]] +package require ossltest +cd $::test::dir +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, md_gost94, gost-mac, md_gost12_256, md_gost12_512, gost-mac-12, gost2001, gost-mac, gost2012_256, gost2012_512, gost-mac-12\]\n"} +} + + +makeFile no_engine.cnf [regsub -all "\n\\s*engines\\s*=\\s*engines_section\[\^\n]*" [getConfig] ""] + +save_env2 {OPENSSL_CONF} +set env(OPENSSL_CONF) [file join [pwd] no_engine.cnf] + +test "Проверяем поддержку российских алгоритмов" { + grep "gost" [openssl "engine -c $env(ENGINE_NAME)"] +} 0 $list + +if {[engine_name] == "ccore"} { +test "Получение списка конфигурационных параметров" { + openssl "engine -v cryptocom" +} 0 "(cryptocom) Cryptocom GOST engine + RNG, RNG_PARAMS, CRYPT_PARAMS, CCENGINE_LICENSE, GOST_PBE_HMAC +" +} + +restore_env2 {OPENSSL_CONF} + +end_tests |