EVP_MD *md;
EVP_MD_CTX *mdctx;
- /*
- * This indicates that KAT (CAVS) test is running. Externally an app will
- * override the random callback such that the generated private key and k
- * are known.
- * Normal operation will loop to choose a new k if the signature is not
- * valid - but for this mode of operation it forces a failure instead.
- */
- unsigned int kattest;
/*
* Internally used to cache the results of calling the EC group
* sign_setup() methods which are then passed to the sign operation.
*/
BIGNUM *kinv;
BIGNUM *r;
+#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
+ /*
+ * This indicates that KAT (CAVS) test is running. Externally an app will
+ * override the random callback such that the generated private key and k
+ * are known.
+ * Normal operation will loop to choose a new k if the signature is not
+ * valid - but for this mode of operation it forces a failure instead.
+ */
+ unsigned int kattest;
+#endif
} PROV_ECDSA_CTX;
static void *ecdsa_newctx(void *provctx, const char *propq)
return 1;
}
+#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
if (ctx->kattest && !ECDSA_sign_setup(ctx->ec, NULL, &ctx->kinv, &ctx->r))
return 0;
+#endif
if (sigsize < (size_t)ecsize)
return 0;
static void free_md(PROV_ECDSA_CTX *ctx)
{
+ OPENSSL_free(ctx->propq);
EVP_MD_CTX_free(ctx->mdctx);
EVP_MD_free(ctx->md);
+ ctx->propq = NULL;
ctx->mdctx = NULL;
ctx->md = NULL;
ctx->mdsize = 0;
*/
return 1;
}
-
+#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_KAT);
if (p != NULL && !OSSL_PARAM_get_uint(p, &ctx->kattest))
return 0;
+#endif
p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DIGEST_SIZE);
if (p != NULL && !OSSL_PARAM_get_size_t(p, &ctx->mdsize))