]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
25-test_pkcs8.t: Make text comparison ignore extra CR characters
authorTomas Mraz <tomas@openssl.org>
Thu, 22 Dec 2022 10:26:14 +0000 (11:26 +0100)
committerTomas Mraz <tomas@openssl.org>
Wed, 4 Jan 2023 15:36:08 +0000 (16:36 +0100)
This is needed to pass the test on MinGW.

Fixes #19921

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19957)

test/recipes/25-test_pkcs8.t

index 7e1758645bd70e0eb3a1392d73dda374b98eabec..299a56b85222af350ee29974f8b6e42afdafc37a 100644 (file)
@@ -35,6 +35,12 @@ SKIP: {
                       '-v2', 'sm4', '-v2prf', 'hmacWithSM3']))),
                       "Convert from PKCS#5 v2.0 format to PKCS#8 unencrypted format");
 
-    is_nofips(compare_text(srctop_file('test', 'certs', 'sm2.key'), 'sm2.key'), 0,
-              "compare test/certs/sm2.key to sm2.key")
+    is_nofips(compare_text(srctop_file('test', 'certs', 'sm2.key'), 'sm2.key',
+        sub {
+            my $in1 = $_[0];
+            my $in2 = $_[1];
+            $in1 =~ s/\r\n/\n/g;
+            $in2 =~ s/\r\n/\n/g;
+            $in1 ne $in2
+        }), 0, "compare test/certs/sm2.key to sm2.key")
 }