]> www.wagner.pp.ru Git - openssl-gost/engine.git/blob - tcl_tests/engine.try
2090e59b11a9f5aa915f53de90ec36c1e9f36deb
[openssl-gost/engine.git] / tcl_tests / engine.try
1 #!/usr/bin/tclsh
2 # -*- coding: cp1251 -*-
3 lappend auto_path [file dirname [info script]]
4 package require ossltest
5 cd $::test::dir 
6 start_tests "Тесты на команду engine" 
7
8 switch -exact [engine_name] {
9         "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"}
10         "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"}
11 }
12
13
14 makeFile no_engine.cnf [regsub -all "\n\\s*engines\\s*=\\s*engines_section\[\^\n]*" [getConfig] ""]
15
16 save_env2 {OPENSSL_CONF}
17 set env(OPENSSL_CONF) [file join [pwd] no_engine.cnf]
18
19 test "Проверяем поддержку российских алгоритмов" {
20         grep "gost" [openssl "engine -c $env(ENGINE_NAME)"]
21 } 0 $list
22
23 if {[engine_name] == "ccore"} {
24 test "Получение списка конфигурационных параметров" {
25         openssl "engine -v cryptocom"
26 } 0 "(cryptocom) Cryptocom GOST engine
27      RNG, RNG_PARAMS, CRYPT_PARAMS, CCENGINE_LICENSE, GOST_PBE_HMAC
28 "
29 }
30
31 restore_env2 {OPENSSL_CONF}
32
33 end_tests