Add a copy of OSSL_SELF_TEST_get_callback() to the fips module.
authorShane Lontis <shane.lontis@oracle.com>
Tue, 15 Sep 2020 04:32:40 +0000 (14:32 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Sat, 19 Sep 2020 08:21:09 +0000 (18:21 +1000)
commitf8e747471ebb5e6d65264de91e26fbc439841bc4
tree226e22ff5e49a8807d21e06bb312ef56312741aa
parent80f4fd18f72c0d3faae864da6979b83acc4f89a2
Add a copy of OSSL_SELF_TEST_get_callback() to the fips module.

The user can set up a self test callback that should be activated when a keygen operation (e.g ec) occurs for the fips module.
The callback information is stored inside the applications library context, but this was not being triggered since the
library context used for the key generation operation was the internal library context used by the fips module (which is not
the same as the application's library context). During the keygen operation the OSSL_SELF_TEST_get_callback() function is used
to retrieve the callback info.
By having a seperate copy of OSSL_SELF_TEST_get_callback() for the fips module we can ensure that the parent library context
is used instead.
The core OSSL_SELF_TEST_get_callback() function pointer is passed across the boundary during the fips modules entry point
such that the fips version of the function can call it after changing the libctx.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12877)
crypto/self_test_core.c
providers/fips/fipsprov.c
test/acvp_test.c
test/evp_libctx_test.c