summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-08-18 21:38:56 +0200
committerRichard Levitte <levitte@openssl.org>2020-08-20 12:37:35 +0200
commit6e5ccd58c85f05f8d47a1682125a207dbc694768 (patch)
tree505b0058ebf662bbd75ac103b35227175b9c0759 /include
parent2274d22d39fd65b83c9c969cba86c8f03b3e0bec (diff)
PEM: Add more library context aware PEM readers
PEM_read_bio_PUBKEY_ex() and PEM_read_bio_Parameters_ex() are added to complete PEM_read_bio_PrivateKey_ex(). They are all refactored to be wrappers around the same internal function. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12673)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/pem.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/openssl/pem.h b/include/openssl/pem.h
index f4989e3987..6fbc28e0d3 100644
--- a/include/openssl/pem.h
+++ b/include/openssl/pem.h
@@ -356,15 +356,23 @@ DECLARE_PEM_rw(DHparams, DH)
DECLARE_PEM_write(DHxparams, DH)
# endif
DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
-EVP_PKEY *PEM_read_bio_PrivateKey_ex(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
- void *u, OPENSSL_CTX *libctx,
- const char *propq);
+EVP_PKEY *PEM_read_bio_PrivateKey_ex(BIO *bp, EVP_PKEY **x,
+ pem_password_cb *cb, void *u,
+ OPENSSL_CTX *libctx, const char *propq);
# ifndef OPENSSL_NO_STDIO
-EVP_PKEY *PEM_read_PrivateKey_ex(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
- void *u, OPENSSL_CTX *libctx,
- const char *propq);
+EVP_PKEY *PEM_read_PrivateKey_ex(FILE *fp, EVP_PKEY **x,
+ pem_password_cb *cb, void *u,
+ OPENSSL_CTX *libctx, const char *propq);
# endif
DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
+EVP_PKEY *PEM_read_bio_PUBKEY_ex(BIO *bp, EVP_PKEY **x,
+ pem_password_cb *cb, void *u,
+ OPENSSL_CTX *libctx, const char *propq);
+# ifndef OPENSSL_NO_STDIO
+EVP_PKEY *PEM_read_PUBKEY_ex(FILE *fp, EVP_PKEY **x,
+ pem_password_cb *cb, void *u,
+ OPENSSL_CTX *libctx, const char *propq);
+# endif
int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x,
const EVP_CIPHER *enc,
@@ -405,6 +413,8 @@ int PEM_write_PKCS8PrivateKey(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc
const char *kstr, int klen,
pem_password_cb *cd, void *u);
# endif
+EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
+ OPENSSL_CTX *libctx, const char *propq);
EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
int PEM_write_bio_Parameters(BIO *bp, const EVP_PKEY *x);