From f4274da164c44699f980f5c897bc7f7727233337 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 6 Sep 2009 15:49:46 +0000 Subject: PR: 1644 Submitted by: steve@openssl.org Fix to make DHparams_dup() et al work in C++. For 1.0 fix the final argument to ASN1_dup() so it is void *. Replace some *_dup macros with functions. --- crypto/dh/dh.h | 3 ++- crypto/dh/dh_asn1.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'crypto/dh') diff --git a/crypto/dh/dh.h b/crypto/dh/dh.h index b0332f2c0c..849309a489 100644 --- a/crypto/dh/dh.h +++ b/crypto/dh/dh.h @@ -157,7 +157,6 @@ struct dh_st this for backward compatibility: */ #define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME -#define DHparams_dup(x) ASN1_dup_of_const(DH,i2d_DHparams,d2i_DHparams,x) #define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) #define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ @@ -165,6 +164,8 @@ struct dh_st #define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) #define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) +DH *DHparams_dup(DH *); + const DH_METHOD *DH_OpenSSL(void); void DH_set_default_method(const DH_METHOD *meth); diff --git a/crypto/dh/dh_asn1.c b/crypto/dh/dh_asn1.c index a02b560572..0b4357d605 100644 --- a/crypto/dh/dh_asn1.c +++ b/crypto/dh/dh_asn1.c @@ -86,3 +86,8 @@ ASN1_SEQUENCE_cb(DHparams, dh_cb) = { } ASN1_SEQUENCE_END_cb(DH, DHparams) IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DH, DHparams, DHparams) + +DH *DHparams_dup(DH *dh) + { + return ASN1_item_dup(ASN1_ITEM_rptr(DHparams), dh); + } -- cgit v1.2.3