crypto/weakcryptospi/test/tcryptospi/testdata/hashhmac/hashgensha2.pl
changeset 8 35751d3474b7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/crypto/weakcryptospi/test/tcryptospi/testdata/hashhmac/hashgensha2.pl	Thu Sep 10 14:01:51 2009 +0300
@@ -0,0 +1,61 @@
+#
+# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+my $numArgs = $#ARGV + 1;
+
+my $file = @ARGV[0];
+my $origkey = @ARGV[1];
+my $key = $origkey;
+print "key is: $origkey\n";
+print "File is: $file\n";
+
+
+my $outfile = $file;
+substr($outfile,length($file)-4,length($file),"_SHA2HASHDATA.txt");
+print $outfile;
+print "\n";
+
+open(MARKER, ">$outfile");
+print MARKER "****** HASH SHA224/SHA256/SHA384/SHA512 ******\n\n";
+close (MARKER);
+
+my $failed = system("openssl dgst -sha224 $file >> $outfile");
+if ($failed) { print "openssl failed because $!"};
+
+my $failed = system("openssl dgst -sha256 $file >> $outfile");
+if ($failed) { print " openssl failed because $!"};
+
+my $failed = system("openssl dgst -sha384 $file >> $outfile");
+if ($failed) { print " openssl failed because $!"};
+
+my $failed = system("openssl dgst -sha512 $file >> $outfile");
+if ($failed) { print " openssl failed because $!"};
+
+open(MARKER, ">>$outfile");
+print MARKER "\n\n****** HMAC SHA224/SHA256/SHA384/SHA512 ******\n\n";
+close (MARKER);
+
+my $failed = system("openssl dgst -hmac CryptoSpiValidKey -sha224 $file >> $outfile");
+if ($failed) { print " openssl failed because $!"};
+
+my $failed = system("openssl dgst -hmac CryptoSpiValidKey -sha256 $file >> $outfile");
+if ($failed) { print " openssl failed because $!"};
+
+my $failed = system("openssl dgst -hmac CryptoSpiValidKey -sha384 $file >> $outfile");
+if ($failed) { print " openssl failed because $!"};
+
+my $failed = system("openssl dgst -hmac CryptoSpiValidKey -sha512 $file >> $outfile");
+if ($failed) { print " openssl failed because $!"};