]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
TESTS: drop explicit quotes from empty command line arguments
authorRichard Levitte <levitte@openssl.org>
Fri, 18 Jun 2021 06:16:13 +0000 (08:16 +0200)
committerPauli <pauli@openssl.org>
Sun, 20 Jun 2021 02:53:43 +0000 (12:53 +1000)
Depending on circumstances, something like this:

    ok(run(app(['openssl', 'whatever', '-config', '""', ...])))

might end up with a command like this:

    ./util/wrap.pl apps/openssl whatever -config '""'

Simply use an empty string (i.e. '' instead of '""') and let the
command line fixup functions do their job.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15822)

test/recipes/25-test_req.t
test/recipes/81-test_cmp_cli.t

index 5781f26a9ab84b79fc6d837206b1e4b7d12771b2..5f3598c71d52eed2d66cf5f1fe51a5b9091aa4c3 100644 (file)
@@ -373,7 +373,7 @@ sub generate_cert {
     my $cn = $is_ca ? "CA" : "EE";
     my $ca_key = srctop_file(@certs, "ca-key.pem");
     my $key = $is_ca ? $ca_key : srctop_file(@certs, "ee-key.pem");
-    my @cmd = ("openssl", "req", "-config", "\"\"", "-x509",
+    my @cmd = ("openssl", "req", "-config", "", "-x509",
                "-key", $key, "-subj", "/CN=$cn", @_, "-out", $cert);
     push(@cmd, ("-CA", $ca_cert, "-CAkey", $ca_key)) unless $ss;
     ok(run(app([@cmd])), "generate $cert");
index e5c19a17458415f4b036194df6c67918dd58506d..8cf787cb260b4c85a7397a856095a7cdc74fbd07 100644 (file)
@@ -53,7 +53,7 @@ foreach (@cmp_basic_tests) {
     my $title = $$_[0];
     my $params = $$_[1];
     my $expected = $$_[2];
-    ok($expected == run(cmd([$app, "-config", '""', @$params])),
+    ok($expected == run(cmd([$app, "-config", '', @$params])),
        $title);
 }
 
@@ -66,7 +66,7 @@ foreach (@cmp_server_tests) {
     my $rsp_cert = srctop_file('test',  'certs', 'ee-cert-1024.pem');
     my $outfile = result_file("test.certout.pem");
     ok($expected ==
-       run(cmd([$app, "-config", '""', @$extra_args,
+       run(cmd([$app, "-config", '', @$extra_args,
                 "-use_mock_srv", "-srv_ref", "mock server",
                 "-srv_secret", $secret,
                 "-rsp_cert", $rsp_cert,