From: Tomas Mraz Date: Thu, 10 Jun 2021 07:58:43 +0000 (+0200) Subject: Do not depend on the exact exit failure value of dgst app X-Git-Tag: openssl-3.0.0-beta1~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67eacb60a8a46b610b98533c7e8ae5bd199e49d7;p=thirdparty%2Fopenssl.git Do not depend on the exact exit failure value of dgst app 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 Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15694) --- diff --git a/test/recipes/15-test_rsapss.t b/test/recipes/15-test_rsapss.t index 5c8340259f0..f80ce306732 100644 --- a/test/recipes/15-test_rsapss.t +++ b/test/recipes/15-test_rsapss.t @@ -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',