From 8094b54eb12a7f87058830bf59fd0e124ed0b145 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Tue, 8 May 2018 18:59:58 -0400 Subject: [PATCH] Add BIO versions of i2d_DHparams and d2i_DHparams. Change-Id: Ie643aaaa44aef67932b107d31ef92c2649738051 Reviewed-on: https://boringssl-review.googlesource.com/28269 Commit-Queue: David Benjamin Commit-Queue: Adam Langley Reviewed-by: Adam Langley CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/x509/x_all.c | 10 ++++++++++ include/openssl/x509.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c index c430a7d3..2a93b873 100644 --- a/crypto/x509/x_all.c +++ b/crypto/x509/x_all.c @@ -499,3 +499,13 @@ EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a) { return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_PUBKEY, bp, a); } + +DH *d2i_DHparams_bio(BIO *bp, DH **dh) +{ + return ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, dh); +} + +int i2d_DHparams_bio(BIO *bp, const DH *dh) +{ + return ASN1_i2d_bio_of_const(DH, i2d_DHparams, bp, dh); +} diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 65d68c4b..a0f7645b 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -671,6 +671,8 @@ OPENSSL_EXPORT int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); OPENSSL_EXPORT int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); +OPENSSL_EXPORT DH *d2i_DHparams_bio(BIO *bp, DH **dh); +OPENSSL_EXPORT int i2d_DHparams_bio(BIO *bp, const DH *dh); OPENSSL_EXPORT X509 *X509_dup(X509 *x509); OPENSSL_EXPORT X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);