X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=test%2F04-pkey.t;h=c202b2e8561e57e036aeccd92a8d004447d0c225;hb=28e0ece4de8a6d5988b96ec08849ee1737633f9c;hp=84ae81e0b51c516a6f97fe55fc39252a006c004e;hpb=af0cdae35ebe75209d45928404141d37ffd684ef;p=openssl-gost%2Fengine.git diff --git a/test/04-pkey.t b/test/04-pkey.t index 84ae81e..c202b2e 100644 --- a/test/04-pkey.t +++ b/test/04-pkey.t @@ -1,12 +1,13 @@ #!/usr/bin/perl -use Test::More tests => 15; +use Test2::V0; +plan(15); use Cwd 'abs_path'; # # If this variable is set, engine would be loaded via configuration # file. Otherwise - via command line # -$use_config = 1; +my $use_config = 1; # prepare data for @@ -16,17 +17,19 @@ if(!defined $ENV{'OPENSSL_ENGINES'}){ $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs"); } -$engine=$ENV{'ENGINE_NAME'}||"gost"; +my $engine=$ENV{'ENGINE_NAME'}||"gost"; # Reopen STDERR to eliminate extra output open STDERR, ">>","tests.err"; +my $F; +my $eng_param; -open F,">","test.cnf"; +open $F,">","test.cnf"; if (defined($use_config) && $use_config) { $eng_param = ""; - open F,">","test.cnf"; - print F <","test.cnf"; + print $F <",'tmp.pem'; - print F $seckey; - close F; + open $F,">",'tmp.pem'; + print $F $seckey; + close $F; #1. Прочитать секретный ключ и напечатать публичный и секретный ключи is(`openssl pkey -noout -text -in tmp.pem`,$sectext . $pubtext, "Print key pair $alg:$paramset"); #2. Прочитать секретный ключ и вывести публичный (все алгоритмы) is(`openssl pkey -pubout -in tmp.pem`,$pubkey, "Compute public key $alg:$paramset"); - open F,">","tmp.pem"; - print F $pubkey; - close F; + open $F,">","tmp.pem"; + print $F $pubkey; + close $F; #3. Прочитать публичный и напечать его в виде текста is(`openssl pkey -pubin -noout -in tmp.pem -text`,$pubtext, "Read and print public key $alg:paramset");