]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: fix hash unit test for NSS
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 19 Mar 2018 12:07:58 +0000 (13:07 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 28 Mar 2018 14:57:48 +0000 (16:57 +0200)
Some hash functions in the freebl3 library ignore the length of the
output buffer and always return the length of the digest.

test/unit/hash.c

index 8aab74f82b919d52a2b0e2909138bf51ed802009..2275473e700b5736764e60ec5b9f5384188f9ad9 100644 (file)
@@ -106,7 +106,7 @@ test_unit(void)
       if (j >= tests[i].length)
         TEST_CHECK(length == tests[i].length);
       else
-        TEST_CHECK(length == 0 || length == j);
+        TEST_CHECK(length == 0 || length == j || length == tests[i].length);
 
       TEST_CHECK(!memcmp(out, tests[i].out, length));
     }