return 1;
if (!EVP_DigestInit_ex(ctx, type, e))
return 0;
+ if (ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_DIGEST_CUSTOM) {
+ /*
+ * This indicates the current algorithm requires
+ * special treatment before hashing the tbs-message.
+ */
+ if (ctx->pctx->pmeth->digest_custom)
+ return ctx->pctx->pmeth->digest_custom(ctx->pctx, ctx);
+ }
return 1;
}
pmeth->param_check = check;
}
+void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth,
+ int (*digest_custom) (EVP_PKEY_CTX *ctx,
+ EVP_MD_CTX *mctx))
+{
+ pmeth->digest_custom = digest_custom;
+}
+
void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth,
int (**pinit) (EVP_PKEY_CTX *ctx))
{
if (*pcheck)
*pcheck = pmeth->param_check;
}
+
+void EVP_PKEY_meth_get_digest_custom(EVP_PKEY_METHOD *pmeth,
+ int (**pdigest_custom) (EVP_PKEY_CTX *ctx,
+ EVP_MD_CTX *mctx))
+{
+ if (*pdigest_custom)
+ *pdigest_custom = pmeth->digest_custom;
+}
int (*check) (EVP_PKEY *pkey);
int (*public_check) (EVP_PKEY *pkey);
int (*param_check) (EVP_PKEY *pkey);
+
+ int (*digest_custom) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
} /* EVP_PKEY_METHOD */ ;
DEFINE_STACK_OF_CONST(EVP_PKEY_METHOD)
* Method handles all operations: don't assume any digest related defaults.
*/
# define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4
+/* Do a customized hashing process */
+# define EVP_PKEY_FLAG_DIGEST_CUSTOM 8
const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags);
void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth,
int (*check) (EVP_PKEY *pkey));
+void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth,
+ int (*digest_custom) (EVP_PKEY_CTX *ctx,
+ EVP_MD_CTX *mctx));
+
void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth,
int (**pinit) (EVP_PKEY_CTX *ctx));
void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth,
int (**pcheck) (EVP_PKEY *pkey));
+void EVP_PKEY_meth_get_digest_custom(EVP_PKEY_METHOD *pmeth,
+ int (**pdigest_custom) (EVP_PKEY_CTX *ctx,
+ EVP_MD_CTX *mctx));
void EVP_add_alg_module(void);
OCSP_resp_get0_tbs_sigalg 4529 1_1_0j EXIST::FUNCTION:OCSP
OCSP_resp_get0_respdata 4530 1_1_0j EXIST::FUNCTION:OCSP
EVP_MD_CTX_set_pkey_ctx 4531 1_1_1 EXIST::FUNCTION:
+EVP_PKEY_meth_set_digest_custom 4532 1_1_1 EXIST::FUNCTION:
+EVP_PKEY_meth_get_digest_custom 4533 1_1_1 EXIST::FUNCTION: