[openssl] master update

Richard Levitte levitte at openssl.org
Tue Nov 24 10:03:25 UTC 2020


The branch master has been updated
       via  c150a9485772bd4b1bdf144c9fa26043a8a24d65 (commit)
      from  a68eee679a4b85f6846519412e1895c56475959c (commit)


- Log -----------------------------------------------------------------
commit c150a9485772bd4b1bdf144c9fa26043a8a24d65
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Nov 23 02:26:34 2020 +0100

    TEST: Make our test data binary
    
    Our test data (test/data.txt and test/data2.txt) are text files, but
    declaring them binary means that there will be no line ending
    transformation done on them.  This is necessary for testing on
    non-Unix platforms, where certain tests could otherwise give results
    that don't match expected results.
    
    Fixes #13474
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/13477)

-----------------------------------------------------------------------

Summary of changes:
 .gitattributes                 | 1 +
 test/{data.txt => data.bin}    | 0
 test/{data2.txt => data2.bin}  | 0
 test/recipes/20-test_dgst.t    | 8 ++++----
 test/recipes/20-test_pkeyutl.t | 4 ++--
 5 files changed, 7 insertions(+), 6 deletions(-)
 rename test/{data.txt => data.bin} (100%)
 rename test/{data2.txt => data2.bin} (100%)

diff --git a/.gitattributes b/.gitattributes
index 3fbaf1160f..6771355ff7 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,4 @@
+*.bin binary
 *.der binary
 /fuzz/corpora/** binary
 *.pfx binary
diff --git a/test/data.txt b/test/data.bin
similarity index 100%
rename from test/data.txt
rename to test/data.bin
diff --git a/test/data2.txt b/test/data2.bin
similarity index 100%
rename from test/data2.txt
rename to test/data2.bin
diff --git a/test/recipes/20-test_dgst.t b/test/recipes/20-test_dgst.t
index 9dcf6d31a2..4c29877e62 100644
--- a/test/recipes/20-test_dgst.t
+++ b/test/recipes/20-test_dgst.t
@@ -24,8 +24,8 @@ sub tsignverify {
     my $privkey = shift;
     my $pubkey = shift;
 
-    my $data_to_sign = srctop_file('test', 'data.txt');
-    my $other_data = srctop_file('test', 'data2.txt');
+    my $data_to_sign = srctop_file('test', 'data.bin');
+    my $other_data = srctop_file('test', 'data2.bin');
 
     my $sigfile = basename($privkey, '.pem') . '.sig';
     plan tests => 4;
@@ -106,12 +106,12 @@ SKIP: {
 subtest "HMAC generation with `dgst` CLI" => sub {
     plan tests => 2;
 
-    my $testdata = srctop_file('test', 'data.txt');
+    my $testdata = srctop_file('test', 'data.bin');
     #HMAC the data twice to check consistency
     my @hmacdata = run(app(['openssl', 'dgst', '-sha256', '-hmac', '123456',
                             $testdata, $testdata]), capture => 1);
     chomp(@hmacdata);
-    my $expected = qr/HMAC-SHA256\([^\)]*data.txt\)= 6f12484129c4a761747f13d8234a1ff0e074adb34e9e9bf3a155c391b97b9a7c/;
+    my $expected = qr/HMAC-SHA256\([^\)]*data.bin\)= 6f12484129c4a761747f13d8234a1ff0e074adb34e9e9bf3a155c391b97b9a7c/;
     ok($hmacdata[0] =~ $expected, "HMAC: Check HMAC value is as expected ($hmacdata[0]) vs ($expected)");
     ok($hmacdata[1] =~ $expected,
        "HMAC: Check second HMAC value is consistent with the first ($hmacdata[1]) vs ($expected)");
diff --git a/test/recipes/20-test_pkeyutl.t b/test/recipes/20-test_pkeyutl.t
index 19bc327758..8c0614bc42 100644
--- a/test/recipes/20-test_pkeyutl.t
+++ b/test/recipes/20-test_pkeyutl.t
@@ -75,8 +75,8 @@ sub tsignverify {
     my $pubkey = shift;
     my @extraopts = @_;
 
-    my $data_to_sign = srctop_file('test', 'data.txt');
-    my $other_data = srctop_file('test', 'data2.txt');
+    my $data_to_sign = srctop_file('test', 'data.bin');
+    my $other_data = srctop_file('test', 'data2.bin');
     my $sigfile = basename($privkey, '.pem') . '.sig';
 
     my @args = ();


More information about the openssl-commits mailing list