summaryrefslogtreecommitdiffstats
path: root/crypto/core_algorithm.c
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2020-09-01 14:50:03 -0400
committerBenjamin Kaduk <bkaduk@akamai.com>2020-09-02 15:21:11 -0700
commit1010e4ac9743a273d12e4f7c49959607aa4f6403 (patch)
tree176b0049adbb262d5905bc9a9e4e8b78f1e8361e /crypto/core_algorithm.c
parent2b748d722b6ac560d122ea2dcf8d09fe6f03124b (diff)
Fix post-condition in algorithm_do_this
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/12760)
Diffstat (limited to 'crypto/core_algorithm.c')
-rw-r--r--crypto/core_algorithm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/core_algorithm.c b/crypto/core_algorithm.c
index f4a20cb2d1..68d6129598 100644
--- a/crypto/core_algorithm.c
+++ b/crypto/core_algorithm.c
@@ -31,7 +31,7 @@ static int algorithm_do_this(OSSL_PROVIDER *provider, void *cbdata)
int first_operation = 1;
int last_operation = OSSL_OP__HIGHEST;
int cur_operation;
- int ok = 0;
+ int ok = 1;
if (data->operation_id != 0)
first_operation = last_operation = data->operation_id;
@@ -77,9 +77,9 @@ static int algorithm_do_this(OSSL_PROVIDER *provider, void *cbdata)
return 0;
}
- /* If post-condition fulfilled, set general success */
- if (ret)
- ok = 1;
+ /* If post-condition not fulfilled, set general failure */
+ if (!ret)
+ ok = 0;
}
return ok;