diff options
author | jsing <> | 2016-11-04 18:35:30 +0000 |
---|---|---|
committer | jsing <> | 2016-11-04 18:35:30 +0000 |
commit | f1bfac5c0c9b216325ace4860e9de46713ed5a5c (patch) | |
tree | 41f976be7b68c4759d7cf5c7c84fbbfda018a16c /src/lib/libcrypto/dh | |
parent | 817ad1345229aa439c24508d4db10738c0825797 (diff) | |
download | openbsd-f1bfac5c0c9b216325ace4860e9de46713ed5a5c.tar.gz openbsd-f1bfac5c0c9b216325ace4860e9de46713ed5a5c.tar.bz2 openbsd-f1bfac5c0c9b216325ace4860e9de46713ed5a5c.zip |
Kill a bunch of OLD_ASN1 usage by replacing ASN1_{d2i,i2d}_* with
ASN1_item_{d2i,i2d}_* equivalents.
ok guenther@ miod@
Diffstat (limited to 'src/lib/libcrypto/dh')
-rw-r--r-- | src/lib/libcrypto/dh/dh.h | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_asn1.c | 26 |
2 files changed, 30 insertions, 8 deletions
diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h index 631cd5c685..920af3b92d 100644 --- a/src/lib/libcrypto/dh/dh.h +++ b/src/lib/libcrypto/dh/dh.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh.h,v 1.17 2016/06/30 02:02:06 bcook Exp $ */ | 1 | /* $OpenBSD: dh.h,v 1.18 2016/11/04 18:35:30 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -165,12 +165,10 @@ struct dh_st | |||
165 | this for backward compatibility: */ | 165 | this for backward compatibility: */ |
166 | #define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME | 166 | #define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME |
167 | 167 | ||
168 | #define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ | 168 | DH *d2i_DHparams_bio(BIO *bp, DH **a); |
169 | (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) | 169 | int i2d_DHparams_bio(BIO *bp, DH *a); |
170 | #define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ | 170 | DH *d2i_DHparams_fp(FILE *fp, DH **a); |
171 | (unsigned char *)(x)) | 171 | int i2d_DHparams_fp(FILE *fp, DH *a); |
172 | #define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) | ||
173 | #define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) | ||
174 | 172 | ||
175 | DH *DHparams_dup(DH *); | 173 | DH *DHparams_dup(DH *); |
176 | 174 | ||
diff --git a/src/lib/libcrypto/dh/dh_asn1.c b/src/lib/libcrypto/dh/dh_asn1.c index 7060130ed8..d7fd4f7d88 100644 --- a/src/lib/libcrypto/dh/dh_asn1.c +++ b/src/lib/libcrypto/dh/dh_asn1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_asn1.c,v 1.8 2015/02/14 15:06:55 jsing Exp $ */ | 1 | /* $OpenBSD: dh_asn1.c,v 1.9 2016/11/04 18:35:30 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -137,6 +137,30 @@ i2d_DHparams(const DH *a, unsigned char **out) | |||
137 | } | 137 | } |
138 | 138 | ||
139 | DH * | 139 | DH * |
140 | d2i_DHparams_bio(BIO *bp, DH **a) | ||
141 | { | ||
142 | return ASN1_item_d2i_bio(&DHparams_it, bp, a); | ||
143 | } | ||
144 | |||
145 | int | ||
146 | i2d_DHparams_bio(BIO *bp, DH *a) | ||
147 | { | ||
148 | return ASN1_item_i2d_bio(&DHparams_it, bp, a); | ||
149 | } | ||
150 | |||
151 | DH * | ||
152 | d2i_DHparams_fp(FILE *fp, DH **a) | ||
153 | { | ||
154 | return ASN1_item_d2i_fp(&DHparams_it, fp, a); | ||
155 | } | ||
156 | |||
157 | int | ||
158 | i2d_DHparams_fp(FILE *fp, DH *a) | ||
159 | { | ||
160 | return ASN1_item_i2d_fp(&DHparams_it, fp, a); | ||
161 | } | ||
162 | |||
163 | DH * | ||
140 | DHparams_dup(DH *dh) | 164 | DHparams_dup(DH *dh) |
141 | { | 165 | { |
142 | return ASN1_item_dup(ASN1_ITEM_rptr(DHparams), dh); | 166 | return ASN1_item_dup(ASN1_ITEM_rptr(DHparams), dh); |