* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
#include <openssl/crypto.h>
#include <openssl/core_dispatch.h>
return dstctx;
}
+#ifdef FIPS_MODULE
+{- produce_param_decoder('ecx_get_ctx_params',
+ (['ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int'],
+ )); -}
+#endif
+
static const OSSL_PARAM *ecx_gettable_ctx_params(ossl_unused void *vctx,
ossl_unused void *provctx)
{
- static const OSSL_PARAM known_gettable_ctx_params[] = {
- OSSL_FIPS_IND_GETTABLE_CTX_PARAM()
- OSSL_PARAM_END
- };
- return known_gettable_ctx_params;
+#ifdef FIPS_MODULE
+ return ecx_get_ctx_params_list;
+#else
+ static OSSL_PARAM params[] = { OSSL_PARAM_END };
+
+ return params;
+#endif
}
static int ecx_get_ctx_params(ossl_unused void *vctx, OSSL_PARAM params[])
{
#ifdef FIPS_MODULE
int approved = 0;
- OSSL_PARAM *p = OSSL_PARAM_locate(params,
- OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR);
+ struct ecx_get_ctx_params_st p;
+
+ if (vctx == NULL || !ecx_get_ctx_params_decoder(params, &p))
+ return 0;
- if (p != NULL && !OSSL_PARAM_set_int(p, approved))
+ if (p.ind != NULL && !OSSL_PARAM_set_int(p.ind, approved))
return 0;
#endif
return 1;