diff options
author | Petr Gotthard <petr.gotthard@centrum.cz> | 2020-12-26 21:32:14 +0100 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-02-05 10:24:04 +1000 |
commit | 7dc67708c8ae6ec06c7fec34781225ed60b5e68d (patch) | |
tree | c48ecd0e6c3a24a5837a09a7e7497c458052d4c6 /test | |
parent | 88444854affe31ce08a5daaf4b6afc86e6972c63 (diff) |
apps/openssl: add -propquery command line option
Fixes #13656. Right now all openssl commands use a NULL propq. This
patch adds a possibility to specify a custom propq.
The implementation follows the example of set_nameopt/get_nameopt.
Various tools had to be modified to call app_get0_propq after it has
been populated. Otherwise the -propquery has no effect.
The tests then verify the -propquery affects the tool behaviour by
requesting a non-existing property.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13707)
Diffstat (limited to 'test')
-rw-r--r-- | test/recipes/15-test_genrsa.t | 5 | ||||
-rw-r--r-- | test/recipes/20-test_mac.t | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/test/recipes/15-test_genrsa.t b/test/recipes/15-test_genrsa.t index ffa334f15e..16bad16d65 100644 --- a/test/recipes/15-test_genrsa.t +++ b/test/recipes/15-test_genrsa.t @@ -26,7 +26,7 @@ my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0); plan tests => ($no_fips ? 0 : 2) # FIPS install test + fips related test - + 12; + + 13; # We want to know that an absurdly small number of bits isn't support if (disabled("deprecated-3.0")) { @@ -101,6 +101,9 @@ ok(!run(app([ 'openssl', 'genpkey', '-algorithm', 'RSA', '-pkeyopt', 'e:65538', '-out', 'genrsatest.pem' ])), "genpkey with a even public exponent should fail"); +ok(!run(app([ 'openssl', 'genpkey', '-propquery', 'unknown', + '-algorithm', 'RSA' ])), + "genpkey requesting unknown=yes property should fail"); SKIP: { diff --git a/test/recipes/20-test_mac.t b/test/recipes/20-test_mac.t index e34381c025..61f6161b0c 100644 --- a/test/recipes/20-test_mac.t +++ b/test/recipes/20-test_mac.t @@ -78,6 +78,11 @@ my @mac_fail_tests = ( input => '00', err => 'EVP_MAC_Init', desc => 'KMAC128 Fail no key' }, + { cmd => [qw{openssl mac -propquery unknown -macopt hexkey:404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F}], + type => 'KMAC128', + input => '00', + err => 'Invalid MAC name KMAC128', + desc => 'KMAC128 Fail unknown property' }, ); my @siphash_fail_tests = ( |