forked from pool/pesign-obs-integration
- switch gen-hmac to use fipscheck instead of sha256hmac OBS-URL: https://build.opensuse.org/request/show/244346 OBS-URL: https://build.opensuse.org/package/show/Base:System/pesign-obs-integration?expand=0&rev=33
36 lines
615 B
Perl
36 lines
615 B
Perl
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use Getopt::Long;
|
|
|
|
my $USAGE = "Usage: $0 [-r <build root>] <file>\n";
|
|
|
|
my $buildroot = "";
|
|
GetOptions("r|root=s" => \$buildroot) or die $USAGE;
|
|
if (scalar(@ARGV) != 1) {
|
|
die $USAGE;
|
|
}
|
|
if ($buildroot) {
|
|
$buildroot .= "/";
|
|
}
|
|
|
|
my $fn = shift @ARGV;
|
|
|
|
system("fipshmac $buildroot$fn");
|
|
|
|
#my $out = `sha512hmac "$buildroot$fn"`;
|
|
#if ($?) {
|
|
# exit 1;
|
|
#}
|
|
#my @t = split(" ", $out);
|
|
#my $hmac = $t[0];
|
|
|
|
#(my $hmacfn = "$buildroot$fn") =~ s|([^/]*)$|.$1.hmac|;
|
|
#open(my $fd, '>', $hmacfn) or die "$0: Cannot open $hmacfn: $!\n";
|
|
#print $fd "$hmac $fn\n";
|
|
#close($fd);
|
|
|
|
exit 0;
|