diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2016-09-04 15:53:04 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2016-09-04 15:53:04 +0000 |
commit | 444dd71e01c3a4e4f5ba569909b3926f680661f2 (patch) | |
tree | 7906318e68706adf41947012fb6dd2f30a0e95eb /lib/libcrypto/pem/pem_pk8.c | |
parent | 9882c7ed4682158ca249e3d8768e0368b6e1f2df (diff) |
Expand IMPLEMENT_PEM macros.
No change in generated assembly.
Diffstat (limited to 'lib/libcrypto/pem/pem_pk8.c')
-rw-r--r-- | lib/libcrypto/pem/pem_pk8.c | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/lib/libcrypto/pem/pem_pk8.c b/lib/libcrypto/pem/pem_pk8.c index d02dec15464..50aafb7655f 100644 --- a/lib/libcrypto/pem/pem_pk8.c +++ b/lib/libcrypto/pem/pem_pk8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pem_pk8.c,v 1.10 2015/09/10 15:56:25 jsing Exp $ */ +/* $OpenBSD: pem_pk8.c,v 1.11 2016/09/04 15:53:03 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -251,6 +251,59 @@ d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u) } -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) + +X509_SIG * +PEM_read_bio_PKCS8(BIO *bp, X509_SIG **x, pem_password_cb *cb, void *u) +{ + return PEM_ASN1_read_bio((d2i_of_void *)d2i_X509_SIG, PEM_STRING_PKCS8, bp, + (void **)x, cb, u); +} + +X509_SIG * +PEM_read_PKCS8(FILE *fp, X509_SIG **x, pem_password_cb *cb, void *u) +{ + return PEM_ASN1_read((d2i_of_void *)d2i_X509_SIG, PEM_STRING_PKCS8, fp, + (void **)x, cb, u); +} + +int +PEM_write_bio_PKCS8(BIO *bp, X509_SIG *x) +{ + return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_SIG, PEM_STRING_PKCS8, bp, + x, NULL, NULL, 0, NULL, NULL); +} + +int +PEM_write_PKCS8(FILE *fp, X509_SIG *x) +{ + return PEM_ASN1_write((i2d_of_void *)i2d_X509_SIG, PEM_STRING_PKCS8, fp, + x, NULL, NULL, 0, NULL, NULL); +} + +PKCS8_PRIV_KEY_INFO * +PEM_read_bio_PKCS8_PRIV_KEY_INFO(BIO *bp, PKCS8_PRIV_KEY_INFO **x, pem_password_cb *cb, void *u) +{ + return PEM_ASN1_read_bio((d2i_of_void *)d2i_PKCS8_PRIV_KEY_INFO, PEM_STRING_PKCS8INF, bp, + (void **)x, cb, u); +} + +PKCS8_PRIV_KEY_INFO * +PEM_read_PKCS8_PRIV_KEY_INFO(FILE *fp, PKCS8_PRIV_KEY_INFO **x, pem_password_cb *cb, void *u) +{ + return PEM_ASN1_read((d2i_of_void *)d2i_PKCS8_PRIV_KEY_INFO, PEM_STRING_PKCS8INF, fp, + (void **)x, cb, u); +} + +int +PEM_write_bio_PKCS8_PRIV_KEY_INFO(BIO *bp, PKCS8_PRIV_KEY_INFO *x) +{ + return PEM_ASN1_write_bio((i2d_of_void *)i2d_PKCS8_PRIV_KEY_INFO, PEM_STRING_PKCS8INF, bp, + x, NULL, NULL, 0, NULL, NULL); +} + +int +PEM_write_PKCS8_PRIV_KEY_INFO(FILE *fp, PKCS8_PRIV_KEY_INFO *x) +{ + return PEM_ASN1_write((i2d_of_void *)i2d_PKCS8_PRIV_KEY_INFO, PEM_STRING_PKCS8INF, fp, + x, NULL, NULL, 0, NULL, NULL); +} |