test/namemap_internal_test.c: use "cookie" instead of "foo"...
authorRichard Levitte <levitte@openssl.org>
Tue, 10 Dec 2019 19:38:09 +0000 (20:38 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 13 Dec 2019 09:03:57 +0000 (10:03 +0100)
... in test_namemap()

Because tests may sometimes run in random order (subject of the
environment variable OPENSSL_TEST_RAND_ORDER being defined), and we're
dealing with the global namemap, each test must use names that are
globally unique for that test.  Unfortunately, we used "foo" in two of
them, which might lead to surprising results.

Fixes #10401

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10601)

test/namemap_internal_test.c

index 0b67cb1d3fe39344bffb55c3ae180c203c3cae91..263364adbd6bc31a0437b4c556017dfba77ceb77 100644 (file)
@@ -26,7 +26,7 @@ static int test_namemap(OSSL_NAMEMAP *nm)
     int check2 = ossl_namemap_name2num(nm, NAME2);
     int check3 = ossl_namemap_name2num(nm, ALIAS1);
     int check4 = ossl_namemap_name2num(nm, ALIAS1_UC);
-    int false1 = ossl_namemap_name2num(nm, "foo");
+    int false1 = ossl_namemap_name2num(nm, "cookie");
 
     return TEST_int_ne(num1, 0)
         && TEST_int_ne(num2, 0)