summaryrefslogtreecommitdiffstats
path: root/crypto/pem
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-02-11 16:57:37 +0100
committerTomas Mraz <tomas@openssl.org>2021-02-17 15:26:12 +0100
commitfe75766c9c2919f649df7b3ad209df2bc5e56dd0 (patch)
treee7be8f417b0102fffe05865c41a4fbf384993587 /crypto/pem
parente5ac413b2d3d6bcff57446f06f3d05650921f182 (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/pem')
-rw-r--r--crypto/pem/pem_all.c2
-rw-r--r--crypto/pem/pem_local.h58
-rw-r--r--crypto/pem/pem_pk8.c4
-rw-r--r--crypto/pem/pem_pkey.c8
4 files changed, 36 insertions, 36 deletions
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)