os/security/crypto/weakcryptospi/test/tcryptospi/testdata/hashhmac/hashgensha2.pl
First public contribution.
     2 # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
 
     4 # This component and the accompanying materials are made available
 
     5 # under the terms of the License "Eclipse Public License v1.0"
 
     6 # which accompanies this distribution, and is available
 
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
 
     9 # Initial Contributors:
 
    10 # Nokia Corporation - initial contribution.
 
    17 my $numArgs = $#ARGV + 1;
 
    20 my $origkey = @ARGV[1];
 
    22 print "key is: $origkey\n";
 
    23 print "File is: $file\n";
 
    27 substr($outfile,length($file)-4,length($file),"_SHA2HASHDATA.txt");
 
    31 open(MARKER, ">$outfile");
 
    32 print MARKER "****** HASH SHA224/SHA256/SHA384/SHA512 ******\n\n";
 
    35 my $failed = system("openssl dgst -sha224 $file >> $outfile");
 
    36 if ($failed) { print "openssl failed because $!"};
 
    38 my $failed = system("openssl dgst -sha256 $file >> $outfile");
 
    39 if ($failed) { print " openssl failed because $!"};
 
    41 my $failed = system("openssl dgst -sha384 $file >> $outfile");
 
    42 if ($failed) { print " openssl failed because $!"};
 
    44 my $failed = system("openssl dgst -sha512 $file >> $outfile");
 
    45 if ($failed) { print " openssl failed because $!"};
 
    47 open(MARKER, ">>$outfile");
 
    48 print MARKER "\n\n****** HMAC SHA224/SHA256/SHA384/SHA512 ******\n\n";
 
    51 my $failed = system("openssl dgst -hmac CryptoSpiValidKey -sha224 $file >> $outfile");
 
    52 if ($failed) { print " openssl failed because $!"};
 
    54 my $failed = system("openssl dgst -hmac CryptoSpiValidKey -sha256 $file >> $outfile");
 
    55 if ($failed) { print " openssl failed because $!"};
 
    57 my $failed = system("openssl dgst -hmac CryptoSpiValidKey -sha384 $file >> $outfile");
 
    58 if ($failed) { print " openssl failed because $!"};
 
    60 my $failed = system("openssl dgst -hmac CryptoSpiValidKey -sha512 $file >> $outfile");
 
    61 if ($failed) { print " openssl failed because $!"};