X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=test%2F03-encrypt.t;h=408278ac9d4c736631aa5d286a43516e16eafdf7;hb=a42d467935d3ce859e288f3934df2e25073f9ba9;hp=d5b56c463595a0aa97eb02fc1d0e93cce11c03b1;hpb=daa886bfcc06d02a3d48967693d110db335429a6;p=openssl-gost%2Fengine.git diff --git a/test/03-encrypt.t b/test/03-encrypt.t index d5b56c4..408278a 100644 --- a/test/03-encrypt.t +++ b/test/03-encrypt.t @@ -1,27 +1,22 @@ #!/usr/bin/perl -use Test::More tests => 48; +use Test2::V0; +plan(48); 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 - -# Set OPENSSL_ENGINES environment variable to just built engine -if(!defined $ENV{'OPENSSL_ENGINES'}){ - $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs"); -} - -$key='0123456789abcdef' x 2; +my $key='0123456789abcdef' x 2; # # You can redefine engine to use using ENGINE_NAME environment variable # -$engine=$ENV{'ENGINE_NAME'}||"gost"; +my $engine=$ENV{'ENGINE_NAME'}||"gost"; # Reopen STDERR to eliminate extra output open STDERR, ">>","tests.err"; @@ -35,12 +30,14 @@ our $count=0; # -key - key (hex-encoded) # -iv - IV (hex-encoded) # +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 <", "test$count.enc"; + open $f, ">", "test$count.enc"; print $f $ctext; close $f; my $otext = `openssl enc ${eng_param} -d -$p{-alg} -K $p{-key} -iv $p{-iv} -in test$count.enc`; @@ -79,8 +76,8 @@ sub crypt_test { } $key = '0123456789ABCDEF' x 4; -$iv = '0000000000000000'; -$clear1 = "The quick brown fox jumps over the lazy dog\n"; +my $iv = '0000000000000000'; +my $clear1 = "The quick brown fox jumps over the lazy dog\n"; crypt_test(-paramset=> "1.2.643.2.2.31.1", -key => $key, -iv => $iv, -cleartext => $clear1,