]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Do not depend on the exact exit failure value of dgst app
authorTomas Mraz <tomas@openssl.org>
Thu, 10 Jun 2021 07:58:43 +0000 (09:58 +0200)
committerPauli <pauli@openssl.org>
Fri, 11 Jun 2021 10:09:30 +0000 (20:09 +1000)
On most platforms the EXIT_FAILURE is 1 but on NonStop platform
the EXIT_FAILURE is -1 truncated to 255.

Fixes #15633

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15694)

test/recipes/15-test_rsapss.t

index 5c8340259f04db08478cda955fa6d895cccb510a..f80ce30673277b71a4f22b7ece2ea2f805c99599 100644 (file)
@@ -33,21 +33,21 @@ ok(run(app(['openssl', 'dgst', '-sign', srctop_file('test', 'testrsa.pem'), '-sh
             srctop_file('test', 'testrsa.pem')])),
    "openssl dgst -sign [plain RSA key, PSS padding mode, no PSS restrictions]");
 
-with({ exit_checker => sub { return shift == 1; } },
-     sub { ok(run(app(['openssl', 'dgst', '-sign', srctop_file('test', 'testrsa.pem'), '-sha512',
-                       '-sigopt', 'rsa_padding_mode:pss', '-sigopt', 'rsa_pss_saltlen:max',
-                       '-sigopt', 'rsa_mgf1_md:sha512', srctop_file('test', 'testrsa.pem')])),
-              "openssl dgst -sign, expect to fail gracefully");
-           ok(run(app(['openssl', 'dgst', '-sign', srctop_file('test', 'testrsa.pem'), '-sha512',
-                       '-sigopt', 'rsa_padding_mode:pss', '-sigopt', 'rsa_pss_saltlen:2147483647',
-                       '-sigopt', 'rsa_mgf1_md:sha1', srctop_file('test', 'testrsa.pem')])),
-              "openssl dgst -sign, expect to fail gracefully");
-           ok(run(app(['openssl', 'dgst', '-prverify', srctop_file('test', 'testrsa.pem'), '-sha512',
-                       '-sigopt', 'rsa_padding_mode:pss', '-sigopt', 'rsa_pss_saltlen:max',
-                       '-sigopt', 'rsa_mgf1_md:sha512', '-signature', 'testrsapss.sig',
-                       srctop_file('test', 'testrsa.pem')])),
-              "openssl dgst -prverify, expect to fail gracefully");
-         });
+ok(!run(app(['openssl', 'dgst', '-sign', srctop_file('test', 'testrsa.pem'), '-sha512',
+             '-sigopt', 'rsa_padding_mode:pss', '-sigopt', 'rsa_pss_saltlen:max',
+             '-sigopt', 'rsa_mgf1_md:sha512', srctop_file('test', 'testrsa.pem')])),
+   "openssl dgst -sign, expect to fail gracefully");
+
+ok(!run(app(['openssl', 'dgst', '-sign', srctop_file('test', 'testrsa.pem'), '-sha512',
+             '-sigopt', 'rsa_padding_mode:pss', '-sigopt', 'rsa_pss_saltlen:2147483647',
+             '-sigopt', 'rsa_mgf1_md:sha1', srctop_file('test', 'testrsa.pem')])),
+   "openssl dgst -sign, expect to fail gracefully");
+
+ok(!run(app(['openssl', 'dgst', '-prverify', srctop_file('test', 'testrsa.pem'), '-sha512',
+             '-sigopt', 'rsa_padding_mode:pss', '-sigopt', 'rsa_pss_saltlen:max',
+             '-sigopt', 'rsa_mgf1_md:sha512', '-signature', 'testrsapss.sig',
+             srctop_file('test', 'testrsa.pem')])),
+   "openssl dgst -prverify, expect to fail gracefully");
 
 ok(run(app(['openssl', 'dgst', '-prverify', srctop_file('test', 'testrsa.pem'),
             '-sha1',