diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-02-11 16:57:37 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-02-17 15:26:12 +0100 |
commit | fe75766c9c2919f649df7b3ad209df2bc5e56dd0 (patch) | |
tree | e7be8f417b0102fffe05865c41a4fbf384993587 /crypto | |
parent | e5ac413b2d3d6bcff57446f06f3d05650921f182 (diff) |
Rename OSSL_ENCODER_CTX_new_by_EVP_PKEY and OSSL_DECODER_CTX_new_by_EVP_PKEY
Additional renames done in encoder and decoder implementation
to follow the style.
Fixes #13622
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14155)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asn1/i2d_evp.c | 4 | ||||
-rw-r--r-- | crypto/cms/cms_ec.c | 4 | ||||
-rw-r--r-- | crypto/encode_decode/decoder_pkey.c | 46 | ||||
-rw-r--r-- | crypto/encode_decode/encoder_pkey.c | 32 | ||||
-rw-r--r-- | crypto/evp/evp_pkey.c | 6 | ||||
-rw-r--r-- | crypto/evp/p_lib.c | 4 | ||||
-rw-r--r-- | crypto/pem/pem_all.c | 2 | ||||
-rw-r--r-- | crypto/pem/pem_local.h | 58 | ||||
-rw-r--r-- | crypto/pem/pem_pk8.c | 4 | ||||
-rw-r--r-- | crypto/pem/pem_pkey.c | 8 | ||||
-rw-r--r-- | crypto/store/store_result.c | 4 | ||||
-rw-r--r-- | crypto/x509/x_pubkey.c | 12 |
12 files changed, 92 insertions, 92 deletions
diff --git a/crypto/asn1/i2d_evp.c b/crypto/asn1/i2d_evp.c index 599c512901..515a81d18c 100644 --- a/crypto/asn1/i2d_evp.c +++ b/crypto/asn1/i2d_evp.c @@ -42,8 +42,8 @@ static int i2d_provided(const EVP_PKEY *a, int selection, */ size_t len = INT_MAX; - ctx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(a, selection, "DER", - *output_structures, NULL); + ctx = OSSL_ENCODER_CTX_new_for_pkey(a, selection, "DER", + *output_structures, NULL); if (ctx == NULL) return -1; if (OSSL_ENCODER_to_data(ctx, pp, &len)) diff --git a/crypto/cms/cms_ec.c b/crypto/cms/cms_ec.c index 8ae912c9c3..79b96f596c 100644 --- a/crypto/cms/cms_ec.c +++ b/crypto/cms/cms_ec.c @@ -27,8 +27,8 @@ static EVP_PKEY *pkey_type2param(int ptype, const void *pval, OSSL_DECODER_CTX *ctx = NULL; int selection = OSSL_KEYMGMT_SELECT_ALL_PARAMETERS; - ctx = OSSL_DECODER_CTX_new_by_EVP_PKEY(&pkey, "DER", NULL, "EC", - selection, libctx, propq); + ctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, "DER", NULL, "EC", + selection, libctx, propq); if (ctx == NULL) goto err; diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c index c515cb6d44..3a97afbcb0 100644 --- a/crypto/encode_decode/decoder_pkey.c +++ b/crypto/encode_decode/decoder_pkey.c @@ -48,13 +48,13 @@ int OSSL_DECODER_CTX_set_passphrase_cb(OSSL_DECODER_CTX *ctx, } /* - * Support for OSSL_DECODER_CTX_new_by_EVP_PKEY: + * Support for OSSL_DECODER_CTX_new_for_pkey: * The construct data, and collecting keymgmt information for it */ DEFINE_STACK_OF(EVP_KEYMGMT) -struct decoder_EVP_PKEY_data_st { +struct decoder_pkey_data_st { OSSL_LIB_CTX *libctx; char *propq; @@ -62,11 +62,11 @@ struct decoder_EVP_PKEY_data_st { void **object; /* Where the result should end up */ }; -static int decoder_construct_EVP_PKEY(OSSL_DECODER_INSTANCE *decoder_inst, - const OSSL_PARAM *params, - void *construct_data) +static int decoder_construct_pkey(OSSL_DECODER_INSTANCE *decoder_inst, + const OSSL_PARAM *params, + void *construct_data) { - struct decoder_EVP_PKEY_data_st *data = construct_data; + struct decoder_pkey_data_st *data = construct_data; OSSL_DECODER *decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst); void *decoderctx = OSSL_DECODER_INSTANCE_get_decoder_ctx(decoder_inst); EVP_KEYMGMT *keymgmt = NULL; @@ -159,9 +159,9 @@ static int decoder_construct_EVP_PKEY(OSSL_DECODER_INSTANCE *decoder_inst, return (*data->object != NULL); } -static void decoder_clean_EVP_PKEY_construct_arg(void *construct_data) +static void decoder_clean_pkey_construct_arg(void *construct_data) { - struct decoder_EVP_PKEY_data_st *data = construct_data; + struct decoder_pkey_data_st *data = construct_data; if (data != NULL) { OPENSSL_free(data->propq); @@ -269,12 +269,12 @@ static void collect_decoder(OSSL_DECODER *decoder, void *arg) data->error_occured = 0; /* All is good now */ } -int ossl_decoder_ctx_setup_for_EVP_PKEY(OSSL_DECODER_CTX *ctx, - EVP_PKEY **pkey, const char *keytype, - OSSL_LIB_CTX *libctx, - const char *propquery) +int ossl_decoder_ctx_setup_for_pkey(OSSL_DECODER_CTX *ctx, + EVP_PKEY **pkey, const char *keytype, + OSSL_LIB_CTX *libctx, + const char *propquery) { - struct decoder_EVP_PKEY_data_st *process_data = NULL; + struct decoder_pkey_data_st *process_data = NULL; STACK_OF(EVP_KEYMGMT) *keymgmts = NULL; STACK_OF(OPENSSL_CSTRING) *names = NULL; int ok = 0; @@ -327,10 +327,10 @@ int ossl_decoder_ctx_setup_for_EVP_PKEY(OSSL_DECODER_CTX *ctx, } if (OSSL_DECODER_CTX_get_num_decoders(ctx) != 0) { - if (!OSSL_DECODER_CTX_set_construct(ctx, decoder_construct_EVP_PKEY) + if (!OSSL_DECODER_CTX_set_construct(ctx, decoder_construct_pkey) || !OSSL_DECODER_CTX_set_construct_data(ctx, process_data) || !OSSL_DECODER_CTX_set_cleanup(ctx, - decoder_clean_EVP_PKEY_construct_arg)) + decoder_clean_pkey_construct_arg)) goto err; process_data = NULL; /* Avoid it being freed */ @@ -338,16 +338,16 @@ int ossl_decoder_ctx_setup_for_EVP_PKEY(OSSL_DECODER_CTX *ctx, ok = 1; err: - decoder_clean_EVP_PKEY_construct_arg(process_data); + decoder_clean_pkey_construct_arg(process_data); return ok; } OSSL_DECODER_CTX * -OSSL_DECODER_CTX_new_by_EVP_PKEY(EVP_PKEY **pkey, - const char *input_type, - const char *input_structure, - const char *keytype, int selection, - OSSL_LIB_CTX *libctx, const char *propquery) +OSSL_DECODER_CTX_new_for_pkey(EVP_PKEY **pkey, + const char *input_type, + const char *input_structure, + const char *keytype, int selection, + OSSL_LIB_CTX *libctx, const char *propquery) { OSSL_DECODER_CTX *ctx = NULL; @@ -367,8 +367,8 @@ OSSL_DECODER_CTX_new_by_EVP_PKEY(EVP_PKEY **pkey, if (OSSL_DECODER_CTX_set_input_type(ctx, input_type) && OSSL_DECODER_CTX_set_input_structure(ctx, input_structure) && OSSL_DECODER_CTX_set_selection(ctx, selection) - && ossl_decoder_ctx_setup_for_EVP_PKEY(ctx, pkey, keytype, - libctx, propquery) + && ossl_decoder_ctx_setup_for_pkey(ctx, pkey, keytype, + libctx, propquery) && OSSL_DECODER_CTX_add_extra(ctx, libctx, propquery)) { OSSL_TRACE_BEGIN(DECODER) { BIO_printf(trc_out, "(ctx %p) Got %d decoders\n", diff --git a/crypto/encode_decode/encoder_pkey.c b/crypto/encode_decode/encoder_pkey.c index e8e1c77b5f..9604ae56bd 100644 --- a/crypto/encode_decode/encoder_pkey.c +++ b/crypto/encode_decode/encoder_pkey.c @@ -67,7 +67,7 @@ int OSSL_ENCODER_CTX_set_passphrase_cb(OSSL_ENCODER_CTX *ctx, } /* - * Support for OSSL_ENCODER_CTX_new_by_TYPE: + * Support for OSSL_ENCODER_CTX_new_for_type: * finding a suitable encoder */ @@ -162,7 +162,7 @@ static int encoder_import_cb(const OSSL_PARAM params[], void *arg) } static const void * -encoder_construct_EVP_PKEY(OSSL_ENCODER_INSTANCE *encoder_inst, void *arg) +encoder_construct_pkey(OSSL_ENCODER_INSTANCE *encoder_inst, void *arg) { struct construct_data_st *data = arg; @@ -188,7 +188,7 @@ encoder_construct_EVP_PKEY(OSSL_ENCODER_INSTANCE *encoder_inst, void *arg) return data->obj; } -static void encoder_destruct_EVP_PKEY(void *arg) +static void encoder_destruct_pkey(void *arg) { struct construct_data_st *data = arg; @@ -202,15 +202,15 @@ static void encoder_destruct_EVP_PKEY(void *arg) } /* - * OSSL_ENCODER_CTX_new_by_EVP_PKEY() returns a ctx with no encoder if + * OSSL_ENCODER_CTX_new_for_pkey() returns a ctx with no encoder if * it couldn't find a suitable encoder. This allows a caller to detect if * a suitable encoder was found, with OSSL_ENCODER_CTX_get_num_encoder(), * and to use fallback methods if the result is NULL. */ -static int ossl_encoder_ctx_setup_for_EVP_PKEY(OSSL_ENCODER_CTX *ctx, - const EVP_PKEY *pkey, - int selection, - const char *propquery) +static int ossl_encoder_ctx_setup_for_pkey(OSSL_ENCODER_CTX *ctx, + const EVP_PKEY *pkey, + int selection, + const char *propquery) { struct construct_data_st *data = NULL; OSSL_LIB_CTX *libctx = NULL; @@ -262,9 +262,9 @@ static int ossl_encoder_ctx_setup_for_EVP_PKEY(OSSL_ENCODER_CTX *ctx, } if (OSSL_ENCODER_CTX_get_num_encoders(ctx) != 0) { - if (!OSSL_ENCODER_CTX_set_construct(ctx, encoder_construct_EVP_PKEY) + if (!OSSL_ENCODER_CTX_set_construct(ctx, encoder_construct_pkey) || !OSSL_ENCODER_CTX_set_construct_data(ctx, data) - || !OSSL_ENCODER_CTX_set_cleanup(ctx, encoder_destruct_EVP_PKEY)) + || !OSSL_ENCODER_CTX_set_cleanup(ctx, encoder_destruct_pkey)) goto err; data->pk = pkey; @@ -282,11 +282,11 @@ static int ossl_encoder_ctx_setup_for_EVP_PKEY(OSSL_ENCODER_CTX *ctx, return ok; } -OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey, - int selection, - const char *output_type, - const char *output_struct, - const char *propquery) +OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_for_pkey(const EVP_PKEY *pkey, + int selection, + const char *output_type, + const char *output_struct, + const char *propquery) { OSSL_ENCODER_CTX *ctx = NULL; OSSL_LIB_CTX *libctx = NULL; @@ -325,7 +325,7 @@ OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey, && (output_struct == NULL || OSSL_ENCODER_CTX_set_output_structure(ctx, output_struct)) && OSSL_ENCODER_CTX_set_selection(ctx, selection) - && ossl_encoder_ctx_setup_for_EVP_PKEY(ctx, pkey, selection, propquery) + && ossl_encoder_ctx_setup_for_pkey(ctx, pkey, selection, propquery) && OSSL_ENCODER_CTX_add_extra(ctx, libctx, propquery)) { OSSL_TRACE_BEGIN(ENCODER) { BIO_printf(trc_out, "(ctx %p) Got %d encoders\n", diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c index dd20a52e7a..87091cf16b 100644 --- a/crypto/evp/evp_pkey.c +++ b/crypto/evp/evp_pkey.c @@ -85,9 +85,9 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey) size_t derlen = 0; const unsigned char *pp; - if ((ctx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(pkey, selection, - "DER", "pkcs8", - NULL)) == NULL + if ((ctx = OSSL_ENCODER_CTX_new_for_pkey(pkey, selection, + "DER", "pkcs8", + NULL)) == NULL || !OSSL_ENCODER_to_data(ctx, &der, &derlen)) goto error; diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 8cf65d6a34..e655adde05 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -1093,8 +1093,8 @@ static int print_pkey(const EVP_PKEY *pkey, BIO *out, int indent, if (!print_set_indent(&out, &pop_f_prefix, &saved_indent, indent)) return 0; - ctx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(pkey, selection, "TEXT", NULL, - propquery); + ctx = OSSL_ENCODER_CTX_new_for_pkey(pkey, selection, "TEXT", NULL, + propquery); if (OSSL_ENCODER_CTX_get_num_encoders(ctx) != 0) ret = OSSL_ENCODER_to_bio(ctx, out); OSSL_ENCODER_CTX_free(ctx); diff --git a/crypto/pem/pem_all.c b/crypto/pem/pem_all.c index 8766395051..222af64397 100644 --- a/crypto/pem/pem_all.c +++ b/crypto/pem/pem_all.c @@ -223,4 +223,4 @@ DH *PEM_read_DHparams(FILE *fp, DH **x, pem_password_cb *cb, void *u) # endif #endif -IMPLEMENT_PEM_provided_write(PUBKEY, EVP_PKEY, PEM_STRING_PUBLIC, PUBKEY) +IMPLEMENT_PEM_provided_write(PUBKEY, EVP_PKEY, pkey, PEM_STRING_PUBLIC, PUBKEY) diff --git a/crypto/pem/pem_local.h b/crypto/pem/pem_local.h index 3f54644e89..732825c03c 100644 --- a/crypto/pem/pem_local.h +++ b/crypto/pem/pem_local.h @@ -47,7 +47,7 @@ # define IMPLEMENT_PEM_provided_write_body_vars(type, asn1, pq) \ int ret = 0; \ OSSL_ENCODER_CTX *ctx = \ - OSSL_ENCODER_CTX_new_by_##type(x, PEM_SELECTION_##asn1, \ + OSSL_ENCODER_CTX_new_for_##type(x, PEM_SELECTION_##asn1, \ "PEM", PEM_STRUCTURE_##asn1, \ (pq)); \ \ @@ -98,16 +98,16 @@ return PEM_ASN1_##writename##((i2d_of_void *)i2d_##asn1, str, out, \ x, enc, kstr, klen, cb, u) -# define IMPLEMENT_PEM_provided_write_to(name, type, str, asn1, \ +# define IMPLEMENT_PEM_provided_write_to(name, TYPE, type, str, asn1, \ OUTTYPE, outtype, writename) \ - PEM_write_fnsig(name, type, OUTTYPE, writename) \ + PEM_write_fnsig(name, TYPE, OUTTYPE, writename) \ { \ IMPLEMENT_PEM_provided_write_body_vars(type, asn1, NULL); \ IMPLEMENT_PEM_provided_write_body_main(type, outtype); \ IMPLEMENT_PEM_provided_write_body_fallback(str, asn1, \ writename); \ } \ - PEM_write_ex_fnsig(name, type, OUTTYPE, writename) \ + PEM_write_ex_fnsig(name, TYPE, OUTTYPE, writename) \ { \ IMPLEMENT_PEM_provided_write_body_vars(type, asn1, propq); \ IMPLEMENT_PEM_provided_write_body_main(type, outtype); \ @@ -116,9 +116,9 @@ } -# define IMPLEMENT_PEM_provided_write_cb_to(name, type, str, asn1, \ +# define IMPLEMENT_PEM_provided_write_cb_to(name, TYPE, type, str, asn1, \ OUTTYPE, outtype, writename) \ - PEM_write_cb_fnsig(name, type, OUTTYPE, writename) \ + PEM_write_cb_fnsig(name, TYPE, OUTTYPE, writename) \ { \ IMPLEMENT_PEM_provided_write_body_vars(type, asn1, NULL); \ IMPLEMENT_PEM_provided_write_body_pass(); \ @@ -126,7 +126,7 @@ IMPLEMENT_PEM_provided_write_body_fallback_cb(str, asn1, \ writename); \ } \ - PEM_write_ex_cb_fnsig(name, type, OUTTYPE, writename) \ + PEM_write_ex_cb_fnsig(name, TYPE, OUTTYPE, writename) \ { \ IMPLEMENT_PEM_provided_write_body_vars(type, asn1, propq); \ IMPLEMENT_PEM_provided_write_body_pass(); \ @@ -137,36 +137,36 @@ # ifdef OPENSSL_NO_STDIO -# define IMPLEMENT_PEM_provided_write_fp(name, type, str, asn1) -# define IMPLEMENT_PEM_provided_write_cb_fp(name, type, str, asn1) +# define IMPLEMENT_PEM_provided_write_fp(name, TYPE, type, str, asn1) +# define IMPLEMENT_PEM_provided_write_cb_fp(name, TYPE, type, str, asn1) # else -# define IMPLEMENT_PEM_provided_write_fp(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_to(name, type, str, asn1, FILE, fp, write) -# define IMPLEMENT_PEM_provided_write_cb_fp(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_cb_to(name, type, str, asn1, FILE, fp, write) +# define IMPLEMENT_PEM_provided_write_fp(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_provided_write_to(name, TYPE, type, str, asn1, FILE, fp, write) +# define IMPLEMENT_PEM_provided_write_cb_fp(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_provided_write_cb_to(name, TYPE, type, str, asn1, FILE, fp, write) # endif -# define IMPLEMENT_PEM_provided_write_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_to(name, type, str, asn1, BIO, bio, write_bio) -# define IMPLEMENT_PEM_provided_write_cb_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_cb_to(name, type, str, asn1, BIO, bio, write_bio) +# define IMPLEMENT_PEM_provided_write_bio(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_provided_write_to(name, TYPE, type, str, asn1, BIO, bio, write_bio) +# define IMPLEMENT_PEM_provided_write_cb_bio(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_provided_write_cb_to(name, TYPE, type, str, asn1, BIO, bio, write_bio) -# define IMPLEMENT_PEM_provided_write(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_fp(name, type, str, asn1) +# define IMPLEMENT_PEM_provided_write(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_provided_write_bio(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_provided_write_fp(name, TYPE, type, str, asn1) -# define IMPLEMENT_PEM_provided_write_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_cb_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_cb_fp(name, type, str, asn1) +# define IMPLEMENT_PEM_provided_write_cb(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_provided_write_cb_bio(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_provided_write_cb_fp(name, TYPE, type, str, asn1) -# define IMPLEMENT_PEM_provided_rw(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write(name, type, str, asn1) +# define IMPLEMENT_PEM_provided_rw(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_read(name, TYPE, str, asn1) \ + IMPLEMENT_PEM_provided_write(name, TYPE, type, str, asn1) -# define IMPLEMENT_PEM_provided_rw_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_provided_write_cb(name, type, str, asn1) +# define IMPLEMENT_PEM_provided_rw_cb(name, TYPE, type, str, asn1) \ + IMPLEMENT_PEM_read(name, TYPE, str, asn1) \ + IMPLEMENT_PEM_provided_write_cb(name, TYPE, type, str, asn1) diff --git a/crypto/pem/pem_pk8.c b/crypto/pem/pem_pk8.c index 09d38855b6..62fa45f13d 100644 --- a/crypto/pem/pem_pk8.c +++ b/crypto/pem/pem_pk8.c @@ -73,8 +73,8 @@ static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid, int ret = 0; const char *outtype = isder ? "DER" : "PEM"; OSSL_ENCODER_CTX *ctx = - OSSL_ENCODER_CTX_new_by_EVP_PKEY(x, OSSL_KEYMGMT_SELECT_ALL, - outtype, "pkcs8", propq); + OSSL_ENCODER_CTX_new_for_pkey(x, OSSL_KEYMGMT_SELECT_ALL, + outtype, "pkcs8", propq); if (ctx == NULL) return 0; diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index c71bc24bb2..f7cc7b88c6 100644 --- a/crypto/pem/pem_pkey.c +++ b/crypto/pem/pem_pkey.c @@ -153,10 +153,10 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, PEM_write_cb_ex_fnsig(PrivateKey, EVP_PKEY, BIO, write_bio) { - IMPLEMENT_PEM_provided_write_body_vars(EVP_PKEY, PrivateKey, propq); + IMPLEMENT_PEM_provided_write_body_vars(pkey, PrivateKey, propq); IMPLEMENT_PEM_provided_write_body_pass(); - IMPLEMENT_PEM_provided_write_body_main(EVP_PKEY, bio); + IMPLEMENT_PEM_provided_write_body_main(pkey, bio); legacy: if (x->ameth == NULL || x->ameth->priv_encode != NULL) @@ -218,9 +218,9 @@ EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x) PEM_write_fnsig(Parameters, EVP_PKEY, BIO, write_bio) { char pem_str[80]; - IMPLEMENT_PEM_provided_write_body_vars(EVP_PKEY, Parameters, NULL); + IMPLEMENT_PEM_provided_write_body_vars(pkey, Parameters, NULL); - IMPLEMENT_PEM_provided_write_body_main(EVP_PKEY, bio); + IMPLEMENT_PEM_provided_write_body_main(pkey, bio); legacy: if (!x->ameth || !x->ameth->param_encode) diff --git a/crypto/store/store_result.c b/crypto/store/store_result.c index e0c0532152..6ac77b77dd 100644 --- a/crypto/store/store_result.c +++ b/crypto/store/store_result.c @@ -274,8 +274,8 @@ static EVP_PKEY *try_key_value(struct extracted_param_data_st *data, } decoderctx = - OSSL_DECODER_CTX_new_by_EVP_PKEY(&pk, "DER", NULL, data->data_type, - selection, libctx, propq); + OSSL_DECODER_CTX_new_for_pkey(&pk, "DER", NULL, data->data_type, + selection, libctx, propq); (void)OSSL_DECODER_CTX_set_passphrase_cb(decoderctx, cb, cbarg); /* No error if this couldn't be decoded */ diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c index 740702d730..5d500f0690 100644 --- a/crypto/x509/x_pubkey.c +++ b/crypto/x509/x_pubkey.c @@ -122,9 +122,9 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) unsigned char *der = NULL; size_t derlen = 0; OSSL_ENCODER_CTX *ectx = - OSSL_ENCODER_CTX_new_by_EVP_PKEY(pkey, EVP_PKEY_PUBLIC_KEY, - "DER", "SubjectPublicKeyInfo", - NULL); + OSSL_ENCODER_CTX_new_for_pkey(pkey, EVP_PKEY_PUBLIC_KEY, + "DER", "SubjectPublicKeyInfo", + NULL); if (OSSL_ENCODER_to_data(ectx, &der, &derlen)) { const unsigned char *pder = der; @@ -325,9 +325,9 @@ int i2d_PUBKEY(const EVP_PKEY *a, unsigned char **pp) X509_PUBKEY_free(xpk); } else if (a->keymgmt != NULL) { OSSL_ENCODER_CTX *ctx = - OSSL_ENCODER_CTX_new_by_EVP_PKEY(a, EVP_PKEY_PUBLIC_KEY, - "DER", "SubjectPublicKeyInfo", - NULL); + OSSL_ENCODER_CTX_new_for_pkey(a, EVP_PKEY_PUBLIC_KEY, + "DER", "SubjectPublicKeyInfo", + NULL); BIO *out = BIO_new(BIO_s_mem()); BUF_MEM *buf = NULL; |