summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-04-16 10:08:38 +0200
committerRichard Levitte <levitte@openssl.org>2021-04-21 10:53:03 +0200
commit7aef200089fbf4b306d13905d55772d646ceef76 (patch)
tree4a7c29809e9a4da778fe66204f6c54678889cd07
parent9cc97ddf3c8c3c6ef30b0505ad2559d3734c685d (diff)
TEST: Adapt the EVP test
The EVP test didn't recognise ERR_R_UNSUPPORTED, now does Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14834)
-rw-r--r--test/evp_test.c12
-rw-r--r--test/recipes/30-test_evp.t2
2 files changed, 8 insertions, 6 deletions
diff --git a/test/evp_test.c b/test/evp_test.c
index 08341e4617..7bfe97f4ae 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -3264,9 +3264,11 @@ static void free_key_list(KEY_LIST *lst)
static int key_unsupported(void)
{
long err = ERR_peek_last_error();
+ int lib = ERR_GET_LIB(err);
+ long reason = ERR_GET_REASON(err);
- if (ERR_GET_LIB(err) == ERR_LIB_EVP
- && (ERR_GET_REASON(err) == EVP_R_UNSUPPORTED_ALGORITHM)) {
+ if ((lib == ERR_LIB_EVP && reason == EVP_R_UNSUPPORTED_ALGORITHM)
+ || reason == ERR_R_UNSUPPORTED) {
ERR_clear_error();
return 1;
}
@@ -3276,9 +3278,9 @@ static int key_unsupported(void)
* hint to an unsupported algorithm/curve (e.g. if binary EC support is
* disabled).
*/
- if (ERR_GET_LIB(err) == ERR_LIB_EC
- && (ERR_GET_REASON(err) == EC_R_UNKNOWN_GROUP
- || ERR_GET_REASON(err) == EC_R_INVALID_CURVE)) {
+ if (lib == ERR_LIB_EC
+ && (reason == EC_R_UNKNOWN_GROUP
+ || reason == EC_R_INVALID_CURVE)) {
ERR_clear_error();
return 1;
}
diff --git a/test/recipes/30-test_evp.t b/test/recipes/30-test_evp.t
index 87bb501095..2cb25478d7 100644
--- a/test/recipes/30-test_evp.t
+++ b/test/recipes/30-test_evp.t
@@ -171,7 +171,7 @@ SKIP: {
ok(test_errors(key => 'server-dsa-pubkey.pem',
out => 'server-dsa-pubkey.err',
args => [ '-pubin' ],
- expected => 'unsupported algorithm'),
+ expected => 'unsupported'),
"expected error loading unsupported dsa public key");
}