summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa
diff options
context:
space:
mode:
authorjsing <>2016-11-04 18:35:30 +0000
committerjsing <>2016-11-04 18:35:30 +0000
commitf1bfac5c0c9b216325ace4860e9de46713ed5a5c (patch)
tree41f976be7b68c4759d7cf5c7c84fbbfda018a16c /src/lib/libcrypto/dsa
parent817ad1345229aa439c24508d4db10738c0825797 (diff)
downloadopenbsd-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/dsa')
-rw-r--r--src/lib/libcrypto/dsa/dsa.h13
-rw-r--r--src/lib/libcrypto/dsa/dsa_asn1.c26
2 files changed, 30 insertions, 9 deletions
diff --git a/src/lib/libcrypto/dsa/dsa.h b/src/lib/libcrypto/dsa/dsa.h
index b4d7c1ff0f..6ddd4c35d5 100644
--- a/src/lib/libcrypto/dsa/dsa.h
+++ b/src/lib/libcrypto/dsa/dsa.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa.h,v 1.21 2016/06/30 02:02:06 bcook Exp $ */ 1/* $OpenBSD: dsa.h,v 1.22 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 *
@@ -173,13 +173,10 @@ struct dsa_st
173 ENGINE *engine; 173 ENGINE *engine;
174 }; 174 };
175 175
176#define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ 176DSA *d2i_DSAparams_bio(BIO *bp, DSA **a);
177 (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x)) 177int i2d_DSAparams_bio(BIO *bp, DSA *a);
178#define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \ 178DSA *d2i_DSAparams_fp(FILE *fp, DSA **a);
179 (unsigned char *)(x)) 179int i2d_DSAparams_fp(FILE *fp, DSA *a);
180#define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x)
181#define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)
182
183 180
184DSA *DSAparams_dup(DSA *x); 181DSA *DSAparams_dup(DSA *x);
185DSA_SIG * DSA_SIG_new(void); 182DSA_SIG * DSA_SIG_new(void);
diff --git a/src/lib/libcrypto/dsa/dsa_asn1.c b/src/lib/libcrypto/dsa/dsa_asn1.c
index 8c5d93105c..6366acdd79 100644
--- a/src/lib/libcrypto/dsa/dsa_asn1.c
+++ b/src/lib/libcrypto/dsa/dsa_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_asn1.c,v 1.16 2015/02/14 15:06:55 jsing Exp $ */ 1/* $OpenBSD: dsa_asn1.c,v 1.17 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 */
@@ -283,6 +283,30 @@ i2d_DSAparams(const DSA *a, unsigned char **out)
283 return ASN1_item_i2d((ASN1_VALUE *)a, out, &DSAparams_it); 283 return ASN1_item_i2d((ASN1_VALUE *)a, out, &DSAparams_it);
284} 284}
285 285
286DSA *
287d2i_DSAparams_bio(BIO *bp, DSA **a)
288{
289 return ASN1_item_d2i_bio(&DSAparams_it, bp, a);
290}
291
292int
293i2d_DSAparams_bio(BIO *bp, DSA *a)
294{
295 return ASN1_item_i2d_bio(&DSAparams_it, bp, a);
296}
297
298DSA *
299d2i_DSAparams_fp(FILE *fp, DSA **a)
300{
301 return ASN1_item_d2i_fp(&DSAparams_it, fp, a);
302}
303
304int
305i2d_DSAparams_fp(FILE *fp, DSA *a)
306{
307 return ASN1_item_i2d_fp(&DSAparams_it, fp, a);
308}
309
286/* 310/*
287 * DSA public key is a bit trickier... its effectively a CHOICE type 311 * DSA public key is a bit trickier... its effectively a CHOICE type
288 * decided by a field called write_params which can either write out 312 * decided by a field called write_params which can either write out