[test suite] slurp openssl HMAC from file into single string (it may be binary data)
authorMichael Rash <mbr@cipherdyne.org>
Sat, 18 May 2013 20:39:08 +0000 (16:39 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Sat, 18 May 2013 20:39:08 +0000 (16:39 -0400)
test/test-fwknop.pl

index 7b085cb..42310d6 100755 (executable)
@@ -4483,12 +4483,12 @@ sub openssl_hmac_verification() {
 
     ### for HMAC SHA512 this output will span two lines
     my $openssl_hmac_line = '';
-    open F, "< $openssl_cmd_tmp" or die $!;
-    while (<F>) {
-        $openssl_hmac_line .= $_;
-        chomp $openssl_hmac_line;
+    {
+        local $/ = undef;
+        open F, "< $openssl_cmd_tmp" or die $!;
+        $openssl_hmac_line = <F>;
+        close F;
     }
-    close F;
 
     if ($base64_path) {
         $openssl_hmac = $openssl_hmac_line;