From: Dr. David von Oheimb Date: Tue, 6 May 2025 06:12:00 +0000 (+0200) Subject: 25-test_verify.t: improve variable and test name, add relative {file:,}D:cert test... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc8f51d95fcacb66e68b227794f434a6848d1e09;p=thirdparty%2Fopenssl.git 25-test_verify.t: improve variable and test name, add relative {file:,}D:cert test for Windows Reviewed-by: Eugene Syromiatnikov Reviewed-by: Nikola Pajkovsky MergeDate: Thu Apr 16 16:52:57 2026 (Merged from https://github.com/openssl/openssl/pull/27554) --- diff --git a/test/recipes/25-test_verify.t b/test/recipes/25-test_verify.t index 77b3d05844f..51d3f8ffc60 100644 --- a/test/recipes/25-test_verify.t +++ b/test/recipes/25-test_verify.t @@ -30,7 +30,7 @@ sub verify { run(app([@args])); } -plan tests => 213; +plan tests => 216; # Canonical success ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]), @@ -642,17 +642,26 @@ SKIP: { ok(vfy_root("-CAstore", "file:".$foo_file), "CAstore file:foo:cert.pem"); } -my $file = "cert.pem"; -copy($rootcert, $file); -ok(vfy_root("-CAstore", $file), "CAstore cert.pem"); -ok(vfy_root("-CAstore", "file:".$file), "CAstore file:cert.pem"); - +my $rel_cert = "cert.pem"; +copy($rootcert, $rel_cert); +ok(vfy_root("-CAstore", $rel_cert), "CAstore cert"); +ok(vfy_root("-CAstore", "file:".$rel_cert), "CAstore file:cert"); my $abs_cert = abs_path($rootcert); +SKIP: { + skip "drive letter with relative filename on Windows only", 2 + unless $^O =~ /^MsWin32$/; + my $drive_rel_cert = substr($abs_cert, 0, 2).$rel_cert; + ok(vfy_root("-CAstore", $drive_rel_cert), "CAstore D:cert"); + ok(vfy_root("-CAstore", "file:".$drive_rel_cert), "CAstore file:D:cert"); +} + # Windows file: URIs should have a path part starting with a slash, i.e. -# file://authority/C:/what/ever/foo.pem and file:///C:/what/ever/foo.pem -# file://C:/what/ever/foo.pem is non-standard and may not be accepted. +# file://authority/C:/what/ever/foo.pem and file:///C:/what/ever/foo.pem. +# So file://C:/what/ever/foo.pem is non-standard and may not be accepted. # See RFC 8089 for details. $abs_cert = "/" . $abs_cert if ($^O eq "MSWin32"); + ok(vfy_root("-CAstore", "file://".$abs_cert), "CAstore file:///path"); +ok(vfy_root("-CAstore", "file:".$abs_cert), "CAstore file:/path"); # we allow dropping the "//" before an empty authority part ok(vfy_root("-CAstore", "file://localhost".$abs_cert), "CAstore file://localhost/path"); ok(!vfy_root("-CAstore", "file://otherhost".$abs_cert), "CAstore file://otherhost/path");