$fips_hash=<$sha1_res>;
close $sha1_res;
unlink $fips_target.".sha1";
-chomp $fips_hash;
+$fips_hash =~ s|\R$||; # Better chomp
die "Get hash failure" if $? != 0;
$hashfile = <IN>;
close IN;
$hashval = `$sha1_exe ${fips_libdir}/$filename`;
- chomp $hashfile;
- chomp $hashval;
+ $hashfile =~ s|\R$||; # Better chomp
+ $hashval =~ s|\R$||; # Better chomp
$hashfile =~ s/^.*=\s+//;
$hashval =~ s/^.*=\s+//;
die "Invalid hash syntax in file" if (length($hashfile) != 40);