]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test/02-mac.t
Making a gost provider - Add the ciphers
[openssl-gost/engine.git] / test / 02-mac.t
index 5713dca51635c3a3825a99f1c26c1e0cca00d709..04a637720ac0e702993809ce6204d6223b276447 100644 (file)
@@ -1,24 +1,22 @@
 #!/usr/bin/perl 
-use Test::More tests => 19;
-use Cwd 'abs_path';
+use Test2::V0;
+skip_all('TODO: add mac support in provider')
+    unless $ARGV[0] eq 'engine';
+plan(19);
 
 # prepare data for 
+my $F;
+open $F,">","testdata.dat";
+print $F "12345670" x 128;
+close $F;
 
-open F,">","testdata.dat";
-print F "12345670" x 128;
-close F;
+open $F,">","testbig.dat";
+print $F ("12345670" x 8 . "\n") x  4096;
+close $F;
 
-open F,">","testbig.dat";
-print F ("12345670" x 8 . "\n") x  4096;
-close F;
-# 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;
 
-$engine=$ENV{'ENGINE_NAME'}||"gost";
+my $engine=$ENV{'ENGINE_NAME'}||"gost";
 
 # Reopen STDERR to eliminate extra output
 open STDERR, ">>","tests.err";
@@ -27,6 +25,7 @@ is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} testdata.dat
 "GOST-MAC-gost-mac(testdata.dat)= 2ee8d13d\n",
 "GOST MAC - default size");
 
+my $i;
 for ($i=1;$i<=8; $i++) {
        is(`openssl dgst -engine ${engine} -mac gost-mac -macopt key:${key} -sigopt size:$i testdata.dat`,
 "GOST-MAC-gost-mac(testdata.dat)= ".substr("2ee8d13dff7f037d",0,$i*2)."\n",