aboutsummaryrefslogtreecommitdiff
path: root/providers
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-06-18 11:39:13 +0200
committerRichard Levitte <levitte@openssl.org>2019-07-02 17:02:02 +0200
commit6592ab81d21fc01e05a01cd5b96c84b069bf8acf (patch)
treeefb7a610a218317721da6ba4123fc396b33db6cd /providers
parent6ebc2f56f04ac2738d3b9bfc732063ad8f51e75d (diff)
downloadopenssl-6592ab81d21fc01e05a01cd5b96c84b069bf8acf.zip
openssl-6592ab81d21fc01e05a01cd5b96c84b069bf8acf.tar.gz
openssl-6592ab81d21fc01e05a01cd5b96c84b069bf8acf.tar.bz2
FIPS module: adapt for the changed error reporting methods
The FIPS module inner provider doesn't need to deal with error reason strings or error library number, since it uses the outer provider's error reporting upcalls. We therefore disable that code in crypto/provider_core.c when building the FIPS module. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9174)
Diffstat (limited to 'providers')
-rw-r--r--providers/fips/fipsprov.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c
index b0196f0..eb2a0c4 100644
--- a/providers/fips/fipsprov.c
+++ b/providers/fips/fipsprov.c
@@ -378,12 +378,11 @@ int fips_intern_provider_init(const OSSL_PROVIDER *provider,
void ERR_put_error(int lib, int func, int reason, const char *file, int line)
{
/*
- * TODO(3.0): This works for the FIPS module because we're going to be
- * using lib/func/reason codes that libcrypto already knows about. This
- * won't work for third party providers that have their own error mechanisms,
- * so we'll need to come up with something else for them.
+ * TODO(3.0) the first argument is currently NULL but is expected to
+ * be passed something else in the future, either an OSSL_PROVIDER or
+ * a OPENSSL_CTX pointer.
*/
- c_put_error(lib, func, reason, file, line);
+ c_put_error(NULL, ERR_PACK(lib, func, reason), file, line);
ERR_add_error_data(1, "(in the FIPS module)");
}
@@ -398,7 +397,7 @@ void ERR_add_error_data(int num, ...)
void ERR_add_error_vdata(int num, va_list args)
{
- c_add_error_vdata(num, args);
+ c_add_error_vdata(NULL, num, args);
}
const OSSL_PROVIDER *FIPS_get_provider(OPENSSL_CTX *ctx)