summaryrefslogtreecommitdiffstats
path: root/crypto/pem/pem_pk8.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-08-16 21:25:08 +0200
committerRichard Levitte <levitte@openssl.org>2020-08-21 09:23:58 +0200
commitece9304c96f71277ca95696d9bc49fdec51e9f17 (patch)
tree7038f8760e1538754bc67371cb5a466a83935dad /crypto/pem/pem_pk8.c
parentf650993f1de3dbb5eda9009ad0c4895a7b1b7fe2 (diff)
Rename OSSL_SERIALIZER / OSSL_DESERIALIZER to OSSL_ENCODE / OSSL_DECODE
Fixes #12455 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12660)
Diffstat (limited to 'crypto/pem/pem_pk8.c')
-rw-r--r--crypto/pem/pem_pk8.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/crypto/pem/pem_pk8.c b/crypto/pem/pem_pk8.c
index 12a25b7a82..84d431820b 100644
--- a/crypto/pem/pem_pk8.c
+++ b/crypto/pem/pem_pk8.c
@@ -15,7 +15,7 @@
#include <openssl/x509.h>
#include <openssl/pkcs12.h>
#include <openssl/pem.h>
-#include <openssl/serializer.h>
+#include <openssl/encoder.h>
static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder,
int nid, const EVP_CIPHER *enc,
@@ -69,9 +69,9 @@ static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid,
{
int ret = 0;
const char *pq = isder
- ? OSSL_SERIALIZER_PrivateKey_TO_DER_PQ
- : OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ;
- OSSL_SERIALIZER_CTX *ctx = OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(x, pq);
+ ? OSSL_ENCODER_PrivateKey_TO_DER_PQ
+ : OSSL_ENCODER_PrivateKey_TO_PEM_PQ;
+ OSSL_ENCODER_CTX *ctx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(x, pq);
if (ctx == NULL)
return 0;
@@ -90,12 +90,11 @@ static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid,
}
}
- if (OSSL_SERIALIZER_CTX_get_serializer(ctx) != NULL) {
+ if (OSSL_ENCODER_CTX_get_encoder(ctx) != NULL) {
ret = 1;
if (enc != NULL) {
ret = 0;
- if (OSSL_SERIALIZER_CTX_set_cipher(ctx, EVP_CIPHER_name(enc),
- NULL)) {
+ if (OSSL_ENCODER_CTX_set_cipher(ctx, EVP_CIPHER_name(enc), NULL)) {
const unsigned char *ukstr = (const unsigned char *)kstr;
/*
@@ -106,14 +105,14 @@ static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid,
*/
ret = 1;
if (kstr != NULL
- && !OSSL_SERIALIZER_CTX_set_passphrase(ctx, ukstr, klen))
+ && !OSSL_ENCODER_CTX_set_passphrase(ctx, ukstr, klen))
ret = 0;
else if (cb != NULL
- && !OSSL_SERIALIZER_CTX_set_passphrase_cb(ctx, cb, u))
+ && !OSSL_ENCODER_CTX_set_passphrase_cb(ctx, cb, u))
ret = 0;
}
}
- ret = ret && OSSL_SERIALIZER_to_bio(ctx, bp);
+ ret = ret && OSSL_ENCODER_to_bio(ctx, bp);
} else {
X509_SIG *p8;
PKCS8_PRIV_KEY_INFO *p8inf;
@@ -153,7 +152,7 @@ static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid,
legacy_end:
PKCS8_PRIV_KEY_INFO_free(p8inf);
}
- OSSL_SERIALIZER_CTX_free(ctx);
+ OSSL_ENCODER_CTX_free(ctx);
return ret;
}
@@ -261,4 +260,4 @@ IMPLEMENT_PEM_rw(PKCS8, X509_SIG, PEM_STRING_PKCS8, X509_SIG)
IMPLEMENT_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO, PEM_STRING_PKCS8INF,
- PKCS8_PRIV_KEY_INFO)
+ PKCS8_PRIV_KEY_INFO)