From: Tomas Mraz Date: Thu, 22 Dec 2022 10:26:14 +0000 (+0100) Subject: 25-test_pkcs8.t: Make text comparison ignore extra CR characters X-Git-Tag: openssl-3.2.0-alpha1~1552 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a78a7917aef5134cc6efd77e7dbf7d18bbaec528;p=thirdparty%2Fopenssl.git 25-test_pkcs8.t: Make text comparison ignore extra CR characters This is needed to pass the test on MinGW. Fixes #19921 Reviewed-by: Dmitry Belyavskiy Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/19957) --- diff --git a/test/recipes/25-test_pkcs8.t b/test/recipes/25-test_pkcs8.t index 7e1758645bd..299a56b8522 100644 --- a/test/recipes/25-test_pkcs8.t +++ b/test/recipes/25-test_pkcs8.t @@ -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") }