case EVP_PKEY_OP_PARAMGEN:
ctx->op.keymgmt.genctx =
evp_keymgmt_gen_init(ctx->keymgmt,
- OSSL_KEYMGMT_SELECT_ALL_PARAMETERS);
+ OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, NULL);
break;
case EVP_PKEY_OP_KEYGEN:
ctx->op.keymgmt.genctx =
- evp_keymgmt_gen_init(ctx->keymgmt, OSSL_KEYMGMT_SELECT_KEYPAIR);
+ evp_keymgmt_gen_init(ctx->keymgmt, OSSL_KEYMGMT_SELECT_KEYPAIR,
+ NULL);
break;
}
ret = -2;
goto end;
not_initialized:
- ERR_raise(ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED);
+ ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
ret = -1;
goto end;
#ifndef FIPS_MODULE
int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
{
if (ctx->operation != EVP_PKEY_OP_PARAMGEN) {
- ERR_raise(ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED);
+ ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
return -1;
}
return EVP_PKEY_gen(ctx, ppkey);
int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
{
if (ctx->operation != EVP_PKEY_OP_KEYGEN) {
- ERR_raise(ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED);
+ ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
return -1;
}
return EVP_PKEY_gen(ctx, ppkey);
return evp_keymgmt_import_types(ctx->keymgmt, selection);
return NULL;
}
+
+static OSSL_CALLBACK ossl_pkey_todata_cb;
+
+static int ossl_pkey_todata_cb(const OSSL_PARAM params[], void *arg)
+{
+ OSSL_PARAM **ret = arg;
+
+ *ret = OSSL_PARAM_dup(params);
+ return 1;
+}
+
+int EVP_PKEY_todata(const EVP_PKEY *pkey, int selection, OSSL_PARAM **params)
+{
+ if (params == NULL)
+ return 0;
+ return EVP_PKEY_export(pkey, selection, ossl_pkey_todata_cb, params);
+}
+
+int EVP_PKEY_export(const EVP_PKEY *pkey, int selection,
+ OSSL_CALLBACK *export_cb, void *export_cbarg)
+{
+ return evp_keymgmt_util_export(pkey, selection, export_cb, export_cbarg);
+}