summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1')
-rw-r--r--src/lib/libcrypto/asn1/a_bitstr.c4
-rw-r--r--src/lib/libcrypto/asn1/a_bool.c5
-rw-r--r--src/lib/libcrypto/asn1/a_bytes.c5
-rw-r--r--src/lib/libcrypto/asn1/a_d2i_fp.c9
-rw-r--r--src/lib/libcrypto/asn1/a_digest.c10
-rw-r--r--src/lib/libcrypto/asn1/a_dup.c5
-rw-r--r--src/lib/libcrypto/asn1/a_enum.c5
-rw-r--r--src/lib/libcrypto/asn1/a_gentm.c7
-rw-r--r--src/lib/libcrypto/asn1/a_i2d_fp.c7
-rw-r--r--src/lib/libcrypto/asn1/a_int.c4
-rw-r--r--src/lib/libcrypto/asn1/a_mbstr.c5
-rw-r--r--src/lib/libcrypto/asn1/a_object.c8
-rw-r--r--src/lib/libcrypto/asn1/a_octet.c4
-rw-r--r--src/lib/libcrypto/asn1/a_print.c4
-rw-r--r--src/lib/libcrypto/asn1/a_set.c4
-rw-r--r--src/lib/libcrypto/asn1/a_sign.c14
-rw-r--r--src/lib/libcrypto/asn1/a_strex.c7
-rw-r--r--src/lib/libcrypto/asn1/a_strnid.c5
-rw-r--r--src/lib/libcrypto/asn1/a_time.c8
-rw-r--r--src/lib/libcrypto/asn1/a_type.c4
-rw-r--r--src/lib/libcrypto/asn1/a_utctm.c7
-rw-r--r--src/lib/libcrypto/asn1/a_utf8.c6
-rw-r--r--src/lib/libcrypto/asn1/a_verify.c16
-rw-r--r--src/lib/libcrypto/asn1/ameth_lib.c5
-rw-r--r--src/lib/libcrypto/asn1/asn1_gen.c4
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c4
-rw-r--r--src/lib/libcrypto/asn1/asn1_par.c6
-rw-r--r--src/lib/libcrypto/asn1/asn_mime.c9
-rw-r--r--src/lib/libcrypto/asn1/asn_moid.c6
-rw-r--r--src/lib/libcrypto/asn1/asn_pack.c5
-rw-r--r--src/lib/libcrypto/asn1/d2i_pr.c9
-rw-r--r--src/lib/libcrypto/asn1/d2i_pu.c13
-rw-r--r--src/lib/libcrypto/asn1/evp_asn1.c4
-rw-r--r--src/lib/libcrypto/asn1/f_enum.c7
-rw-r--r--src/lib/libcrypto/asn1/f_int.c7
-rw-r--r--src/lib/libcrypto/asn1/f_string.c7
-rw-r--r--src/lib/libcrypto/asn1/i2d_pr.c6
-rw-r--r--src/lib/libcrypto/asn1/i2d_pu.c11
-rw-r--r--src/lib/libcrypto/asn1/n_pkey.c9
-rw-r--r--src/lib/libcrypto/asn1/p5_pbe.c6
-rw-r--r--src/lib/libcrypto/asn1/p5_pbev2.c6
-rw-r--r--src/lib/libcrypto/asn1/p8_pkey.c4
-rw-r--r--src/lib/libcrypto/asn1/t_bitst.c3
-rw-r--r--src/lib/libcrypto/asn1/t_crl.c7
-rw-r--r--src/lib/libcrypto/asn1/t_pkey.c8
-rw-r--r--src/lib/libcrypto/asn1/t_req.c13
-rw-r--r--src/lib/libcrypto/asn1/t_spki.c14
-rw-r--r--src/lib/libcrypto/asn1/t_x509.c20
-rw-r--r--src/lib/libcrypto/asn1/t_x509a.c6
-rw-r--r--src/lib/libcrypto/asn1/tasn_enc.c4
-rw-r--r--src/lib/libcrypto/asn1/tasn_prn.c7
-rw-r--r--src/lib/libcrypto/asn1/x_attrib.c6
-rw-r--r--src/lib/libcrypto/asn1/x_bignum.c4
-rw-r--r--src/lib/libcrypto/asn1/x_crl.c7
-rw-r--r--src/lib/libcrypto/asn1/x_info.c7
-rw-r--r--src/lib/libcrypto/asn1/x_long.c4
-rw-r--r--src/lib/libcrypto/asn1/x_name.c5
-rw-r--r--src/lib/libcrypto/asn1/x_pkey.c6
-rw-r--r--src/lib/libcrypto/asn1/x_pubkey.c14
-rw-r--r--src/lib/libcrypto/asn1/x_req.c4
-rw-r--r--src/lib/libcrypto/asn1/x_sig.c4
-rw-r--r--src/lib/libcrypto/asn1/x_spki.c4
-rw-r--r--src/lib/libcrypto/asn1/x_val.c4
-rw-r--r--src/lib/libcrypto/asn1/x_x509.c5
-rw-r--r--src/lib/libcrypto/asn1/x_x509a.c6
65 files changed, 234 insertions, 209 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c
index a90eadef28..473a945e09 100644
--- a/src/lib/libcrypto/asn1/a_bitstr.c
+++ b/src/lib/libcrypto/asn1/a_bitstr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_bitstr.c,v 1.19 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_bitstr.c,v 1.20 2014/07/11 08:44:47 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 *
@@ -59,8 +59,8 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/err.h>
64 64
65int 65int
66ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) 66ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
diff --git a/src/lib/libcrypto/asn1/a_bool.c b/src/lib/libcrypto/asn1/a_bool.c
index dd1ef9b015..d5a0c0c8a4 100644
--- a/src/lib/libcrypto/asn1/a_bool.c
+++ b/src/lib/libcrypto/asn1/a_bool.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_bool.c,v 1.6 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_bool.c,v 1.7 2014/07/11 08:44:47 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 *
@@ -57,8 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/err.h>
62 63
63int 64int
64i2d_ASN1_BOOLEAN(int a, unsigned char **pp) 65i2d_ASN1_BOOLEAN(int a, unsigned char **pp)
diff --git a/src/lib/libcrypto/asn1/a_bytes.c b/src/lib/libcrypto/asn1/a_bytes.c
index c8d1a5a1e9..727ad3ed9b 100644
--- a/src/lib/libcrypto/asn1/a_bytes.c
+++ b/src/lib/libcrypto/asn1/a_bytes.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_bytes.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_bytes.c,v 1.18 2014/07/11 08:44:47 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 *
@@ -59,8 +59,9 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/buffer.h>
64#include <openssl/err.h>
64 65
65static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c); 66static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c);
66/* type is a 'bitmap' of acceptable string types. 67/* type is a 'bitmap' of acceptable string types.
diff --git a/src/lib/libcrypto/asn1/a_d2i_fp.c b/src/lib/libcrypto/asn1/a_d2i_fp.c
index 283a4f74d1..cf1461bd2d 100644
--- a/src/lib/libcrypto/asn1/a_d2i_fp.c
+++ b/src/lib/libcrypto/asn1/a_d2i_fp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_d2i_fp.c,v 1.9 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_d2i_fp.c,v 1.10 2014/07/11 08:44:47 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 *
@@ -56,11 +56,12 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <limits.h> 59#include <limits.h>
61#include "cryptlib.h" 60#include <stdio.h>
62#include <openssl/buffer.h> 61
63#include <openssl/asn1_mac.h> 62#include <openssl/asn1_mac.h>
63#include <openssl/buffer.h>
64#include <openssl/err.h>
64 65
65static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb); 66static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb);
66 67
diff --git a/src/lib/libcrypto/asn1/a_digest.c b/src/lib/libcrypto/asn1/a_digest.c
index 751277f33a..085a57d811 100644
--- a/src/lib/libcrypto/asn1/a_digest.c
+++ b/src/lib/libcrypto/asn1/a_digest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_digest.c,v 1.14 2014/06/24 19:37:58 miod Exp $ */ 1/* $OpenBSD: a_digest.c,v 1.15 2014/07/11 08:44:47 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 *
@@ -56,16 +56,14 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <sys/types.h>
60
59#include <stdio.h> 61#include <stdio.h>
60#include <time.h> 62#include <time.h>
61 63
62#include "cryptlib.h" 64#include <openssl/buffer.h>
63
64#include <sys/types.h>
65
66#include <openssl/err.h> 65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/buffer.h>
69#include <openssl/x509.h> 67#include <openssl/x509.h>
70 68
71int 69int
diff --git a/src/lib/libcrypto/asn1/a_dup.c b/src/lib/libcrypto/asn1/a_dup.c
index 9a9958df16..79cd1d4586 100644
--- a/src/lib/libcrypto/asn1/a_dup.c
+++ b/src/lib/libcrypto/asn1/a_dup.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_dup.c,v 1.12 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_dup.c,v 1.13 2014/07/11 08:44:47 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 *
@@ -57,8 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/err.h>
62 63
63#ifndef NO_OLD_ASN1 64#ifndef NO_OLD_ASN1
64 65
diff --git a/src/lib/libcrypto/asn1/a_enum.c b/src/lib/libcrypto/asn1/a_enum.c
index 51b4f10e85..35cb0eaff5 100644
--- a/src/lib/libcrypto/asn1/a_enum.c
+++ b/src/lib/libcrypto/asn1/a_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_enum.c,v 1.14 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_enum.c,v 1.15 2014/07/11 08:44:47 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 *
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/bn.h> 62#include <openssl/bn.h>
63#include <openssl/err.h>
63 64
64/* 65/*
65 * Code for ENUMERATED type: identical to INTEGER apart from a different tag. 66 * Code for ENUMERATED type: identical to INTEGER apart from a different tag.
diff --git a/src/lib/libcrypto/asn1/a_gentm.c b/src/lib/libcrypto/asn1/a_gentm.c
index 95612ae324..c658b1ea35 100644
--- a/src/lib/libcrypto/asn1/a_gentm.c
+++ b/src/lib/libcrypto/asn1/a_gentm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_gentm.c,v 1.21 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_gentm.c,v 1.22 2014/07/11 08:44:47 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 *
@@ -62,9 +62,10 @@
62#include <string.h> 62#include <string.h>
63#include <time.h> 63#include <time.h>
64 64
65#include "cryptlib.h"
66#include "o_time.h"
67#include <openssl/asn1.h> 65#include <openssl/asn1.h>
66#include <openssl/err.h>
67
68#include "o_time.h"
68 69
69#if 0 70#if 0
70 71
diff --git a/src/lib/libcrypto/asn1/a_i2d_fp.c b/src/lib/libcrypto/asn1/a_i2d_fp.c
index 497358f2c4..424068d784 100644
--- a/src/lib/libcrypto/asn1/a_i2d_fp.c
+++ b/src/lib/libcrypto/asn1/a_i2d_fp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_i2d_fp.c,v 1.13 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_i2d_fp.c,v 1.14 2014/07/11 08:44:47 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 *
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/buffer.h>
63#include <openssl/err.h>
63 64
64#ifndef NO_OLD_ASN1 65#ifndef NO_OLD_ASN1
65 66
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c
index 1a84772231..ba2895db6b 100644
--- a/src/lib/libcrypto/asn1/a_int.c
+++ b/src/lib/libcrypto/asn1/a_int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_int.c,v 1.23 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_int.c,v 1.24 2014/07/11 08:44:47 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 *
@@ -59,9 +59,9 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/asn1.h> 62#include <openssl/asn1.h>
64#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/err.h>
65 65
66ASN1_INTEGER * 66ASN1_INTEGER *
67ASN1_INTEGER_dup(const ASN1_INTEGER *x) 67ASN1_INTEGER_dup(const ASN1_INTEGER *x)
diff --git a/src/lib/libcrypto/asn1/a_mbstr.c b/src/lib/libcrypto/asn1/a_mbstr.c
index 2413c0eaee..3bad3b2ec2 100644
--- a/src/lib/libcrypto/asn1/a_mbstr.c
+++ b/src/lib/libcrypto/asn1/a_mbstr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_mbstr.c,v 1.18 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_mbstr.c,v 1.19 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -60,8 +60,9 @@
60#include <stdio.h> 60#include <stdio.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h"
64#include <openssl/asn1.h> 63#include <openssl/asn1.h>
64#include <openssl/err.h>
65
65#include "asn1_locl.h" 66#include "asn1_locl.h"
66 67
67static int traverse_string(const unsigned char *p, int len, int inform, 68static int traverse_string(const unsigned char *p, int len, int inform,
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c
index 85b5d623b2..551aece6ad 100644
--- a/src/lib/libcrypto/asn1/a_object.c
+++ b/src/lib/libcrypto/asn1/a_object.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_object.c,v 1.20 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_object.c,v 1.21 2014/07/11 08:44:47 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 *
@@ -60,11 +60,11 @@
60#include <stdio.h> 60#include <stdio.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h"
64#include <openssl/buffer.h>
65#include <openssl/asn1.h> 63#include <openssl/asn1.h>
66#include <openssl/objects.h>
67#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/err.h>
66#include <openssl/buffer.h>
67#include <openssl/objects.h>
68 68
69int 69int
70i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) 70i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
diff --git a/src/lib/libcrypto/asn1/a_octet.c b/src/lib/libcrypto/asn1/a_octet.c
index 6daa32824a..8c57592174 100644
--- a/src/lib/libcrypto/asn1/a_octet.c
+++ b/src/lib/libcrypto/asn1/a_octet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_octet.c,v 1.8 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_octet.c,v 1.9 2014/07/11 08:44:47 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 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62 62
63ASN1_OCTET_STRING * 63ASN1_OCTET_STRING *
diff --git a/src/lib/libcrypto/asn1/a_print.c b/src/lib/libcrypto/asn1/a_print.c
index 4a28834e0e..ddcee54c7d 100644
--- a/src/lib/libcrypto/asn1/a_print.c
+++ b/src/lib/libcrypto/asn1/a_print.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_print.c,v 1.10 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_print.c,v 1.11 2014/07/11 08:44:47 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 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62 62
63int 63int
diff --git a/src/lib/libcrypto/asn1/a_set.c b/src/lib/libcrypto/asn1/a_set.c
index 8fe810d2ce..ba4f28be34 100644
--- a/src/lib/libcrypto/asn1/a_set.c
+++ b/src/lib/libcrypto/asn1/a_set.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_set.c,v 1.15 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_set.c,v 1.16 2014/07/11 08:44:47 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 *
@@ -59,8 +59,8 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/asn1_mac.h> 62#include <openssl/asn1_mac.h>
63#include <openssl/err.h>
64 64
65#ifndef NO_ASN1_OLD 65#ifndef NO_ASN1_OLD
66 66
diff --git a/src/lib/libcrypto/asn1/a_sign.c b/src/lib/libcrypto/asn1/a_sign.c
index 5f2a5e6253..83e7f44d12 100644
--- a/src/lib/libcrypto/asn1/a_sign.c
+++ b/src/lib/libcrypto/asn1/a_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_sign.c,v 1.18 2014/06/24 19:37:58 miod Exp $ */ 1/* $OpenBSD: a_sign.c,v 1.19 2014/07/11 08:44:47 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 *
@@ -109,18 +109,18 @@
109 * 109 *
110 */ 110 */
111 111
112#include <sys/types.h>
113
112#include <stdio.h> 114#include <stdio.h>
113#include <time.h> 115#include <time.h>
114 116
115#include "cryptlib.h"
116
117#include <sys/types.h>
118
119#include <openssl/bn.h> 117#include <openssl/bn.h>
118#include <openssl/buffer.h>
119#include <openssl/err.h>
120#include <openssl/evp.h> 120#include <openssl/evp.h>
121#include <openssl/x509.h>
122#include <openssl/objects.h> 121#include <openssl/objects.h>
123#include <openssl/buffer.h> 122#include <openssl/x509.h>
123
124#include "asn1_locl.h" 124#include "asn1_locl.h"
125 125
126int 126int
diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c
index e2e21a2292..b592c0e18a 100644
--- a/src/lib/libcrypto/asn1/a_strex.c
+++ b/src/lib/libcrypto/asn1/a_strex.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_strex.c,v 1.23 2014/07/10 20:42:45 jsing Exp $ */ 1/* $OpenBSD: a_strex.c,v 1.24 2014/07/11 08:44:47 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 */
@@ -58,10 +58,11 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61#include "cryptlib.h" 61
62#include <openssl/asn1.h>
62#include <openssl/crypto.h> 63#include <openssl/crypto.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
64#include <openssl/asn1.h> 65
65#include "asn1_locl.h" 66#include "asn1_locl.h"
66 67
67#include "charmap.h" 68#include "charmap.h"
diff --git a/src/lib/libcrypto/asn1/a_strnid.c b/src/lib/libcrypto/asn1/a_strnid.c
index f877adef1f..be28885363 100644
--- a/src/lib/libcrypto/asn1/a_strnid.c
+++ b/src/lib/libcrypto/asn1/a_strnid.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_strnid.c,v 1.16 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_strnid.c,v 1.17 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -60,11 +60,10 @@
60#include <stdio.h> 60#include <stdio.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h"
64#include <openssl/asn1.h> 63#include <openssl/asn1.h>
64#include <openssl/err.h>
65#include <openssl/objects.h> 65#include <openssl/objects.h>
66 66
67
68static STACK_OF(ASN1_STRING_TABLE) *stable = NULL; 67static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;
69static void st_free(ASN1_STRING_TABLE *tbl); 68static void st_free(ASN1_STRING_TABLE *tbl);
70static int sk_table_cmp(const ASN1_STRING_TABLE * const *a, 69static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
diff --git a/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c
index 7e3a578037..94e249960a 100644
--- a/src/lib/libcrypto/asn1/a_time.c
+++ b/src/lib/libcrypto/asn1/a_time.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_time.c,v 1.20 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_time.c,v 1.21 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -53,7 +53,6 @@
53 * 53 *
54 */ 54 */
55 55
56
57/* This is an implementation of the ASN1 Time structure which is: 56/* This is an implementation of the ASN1 Time structure which is:
58 * Time ::= CHOICE { 57 * Time ::= CHOICE {
59 * utcTime UTCTime, 58 * utcTime UTCTime,
@@ -65,9 +64,10 @@
65#include <string.h> 64#include <string.h>
66#include <time.h> 65#include <time.h>
67 66
68#include "cryptlib.h"
69#include "o_time.h"
70#include <openssl/asn1t.h> 67#include <openssl/asn1t.h>
68#include <openssl/err.h>
69
70#include "o_time.h"
71 71
72IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME) 72IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME)
73 73
diff --git a/src/lib/libcrypto/asn1/a_type.c b/src/lib/libcrypto/asn1/a_type.c
index e9527b84fc..add5ff1253 100644
--- a/src/lib/libcrypto/asn1/a_type.c
+++ b/src/lib/libcrypto/asn1/a_type.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_type.c,v 1.13 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_type.c,v 1.14 2014/07/11 08:44:47 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 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63 63
diff --git a/src/lib/libcrypto/asn1/a_utctm.c b/src/lib/libcrypto/asn1/a_utctm.c
index 4e840f742f..aed855608d 100644
--- a/src/lib/libcrypto/asn1/a_utctm.c
+++ b/src/lib/libcrypto/asn1/a_utctm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_utctm.c,v 1.26 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: a_utctm.c,v 1.27 2014/07/11 08:44:47 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 *
@@ -60,9 +60,10 @@
60#include <string.h> 60#include <string.h>
61#include <time.h> 61#include <time.h>
62 62
63#include "cryptlib.h"
64#include "o_time.h"
65#include <openssl/asn1.h> 63#include <openssl/asn1.h>
64#include <openssl/err.h>
65
66#include "o_time.h"
66 67
67int 68int
68ASN1_UTCTIME_check(ASN1_UTCTIME *d) 69ASN1_UTCTIME_check(ASN1_UTCTIME *d)
diff --git a/src/lib/libcrypto/asn1/a_utf8.c b/src/lib/libcrypto/asn1/a_utf8.c
index 68ba1f7c9b..113a3a2e36 100644
--- a/src/lib/libcrypto/asn1/a_utf8.c
+++ b/src/lib/libcrypto/asn1/a_utf8.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_utf8.c,v 1.7 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: a_utf8.c,v 1.8 2014/07/11 08:44:47 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 *
@@ -57,10 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include "asn1_locl.h"
63 62
63#include "asn1_locl.h"
64 64
65/* UTF8 utilities */ 65/* UTF8 utilities */
66 66
diff --git a/src/lib/libcrypto/asn1/a_verify.c b/src/lib/libcrypto/asn1/a_verify.c
index cf6c9bbf44..ea937cab3a 100644
--- a/src/lib/libcrypto/asn1/a_verify.c
+++ b/src/lib/libcrypto/asn1/a_verify.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_verify.c,v 1.19 2014/06/24 19:37:58 miod Exp $ */ 1/* $OpenBSD: a_verify.c,v 1.20 2014/07/11 08:44:47 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 *
@@ -56,19 +56,19 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <sys/types.h>
60
59#include <stdio.h> 61#include <stdio.h>
60#include <time.h> 62#include <time.h>
61 63
62#include "cryptlib.h"
63#include "asn1_locl.h"
64
65#include <sys/types.h>
66
67#include <openssl/bn.h> 64#include <openssl/bn.h>
68#include <openssl/x509.h>
69#include <openssl/objects.h>
70#include <openssl/buffer.h> 65#include <openssl/buffer.h>
66#include <openssl/err.h>
71#include <openssl/evp.h> 67#include <openssl/evp.h>
68#include <openssl/objects.h>
69#include <openssl/x509.h>
70
71#include "asn1_locl.h"
72 72
73int 73int
74ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, 74ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
diff --git a/src/lib/libcrypto/asn1/ameth_lib.c b/src/lib/libcrypto/asn1/ameth_lib.c
index 43981277c4..8701e97337 100644
--- a/src/lib/libcrypto/asn1/ameth_lib.c
+++ b/src/lib/libcrypto/asn1/ameth_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ameth_lib.c,v 1.11 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: ameth_lib.c,v 1.12 2014/07/11 08:44:47 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 2006. 3 * project 2006.
4 */ 4 */
@@ -61,12 +61,13 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/asn1t.h> 64#include <openssl/asn1t.h>
66#include <openssl/x509.h> 65#include <openssl/x509.h>
66
67#ifndef OPENSSL_NO_ENGINE 67#ifndef OPENSSL_NO_ENGINE
68#include <openssl/engine.h> 68#include <openssl/engine.h>
69#endif 69#endif
70
70#include "asn1_locl.h" 71#include "asn1_locl.h"
71 72
72extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[]; 73extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[];
diff --git a/src/lib/libcrypto/asn1/asn1_gen.c b/src/lib/libcrypto/asn1/asn1_gen.c
index f05d92d929..97be43a03a 100644
--- a/src/lib/libcrypto/asn1/asn1_gen.c
+++ b/src/lib/libcrypto/asn1/asn1_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_gen.c,v 1.11 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: asn1_gen.c,v 1.12 2014/07/11 08:44:47 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 2002. 3 * project 2002.
4 */ 4 */
@@ -58,8 +58,8 @@
58 58
59#include <string.h> 59#include <string.h>
60 60
61#include "cryptlib.h"
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/err.h>
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
64 64
65#define ASN1_GEN_FLAG 0x10000 65#define ASN1_GEN_FLAG 0x10000
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index 98f746c013..b5f3f78b94 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.29 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.30 2014/07/11 08:44:47 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 *
@@ -60,9 +60,9 @@
60#include <stdio.h> 60#include <stdio.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h"
64#include <openssl/asn1.h> 63#include <openssl/asn1.h>
65#include <openssl/asn1_mac.h> 64#include <openssl/asn1_mac.h>
65#include <openssl/err.h>
66 66
67static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, int max); 67static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, int max);
68static void asn1_put_length(unsigned char **pp, int length); 68static void asn1_put_length(unsigned char **pp, int length);
diff --git a/src/lib/libcrypto/asn1/asn1_par.c b/src/lib/libcrypto/asn1/asn1_par.c
index eca9364a24..c6f95c42ab 100644
--- a/src/lib/libcrypto/asn1/asn1_par.c
+++ b/src/lib/libcrypto/asn1/asn1_par.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_par.c,v 1.18 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: asn1_par.c,v 1.19 2014/07/11 08:44:47 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 *
@@ -57,10 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1.h>
61#include <openssl/buffer.h> 62#include <openssl/buffer.h>
62#include <openssl/objects.h> 63#include <openssl/objects.h>
63#include <openssl/asn1.h>
64 64
65static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed, 65static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
66 int indent); 66 int indent);
diff --git a/src/lib/libcrypto/asn1/asn_mime.c b/src/lib/libcrypto/asn1/asn_mime.c
index dc39dd1f08..41b39efa7b 100644
--- a/src/lib/libcrypto/asn1/asn_mime.c
+++ b/src/lib/libcrypto/asn1/asn_mime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn_mime.c,v 1.19 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: asn_mime.c,v 1.20 2014/07/11 08:44:47 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. 3 * project.
4 */ 4 */
@@ -56,11 +56,12 @@
56#include <stdio.h> 56#include <stdio.h>
57#include <string.h> 57#include <string.h>
58 58
59#include "cryptlib.h"
60#include <openssl/rand.h>
61#include <openssl/x509.h>
62#include <openssl/asn1.h> 59#include <openssl/asn1.h>
63#include <openssl/asn1t.h> 60#include <openssl/asn1t.h>
61#include <openssl/err.h>
62#include <openssl/rand.h>
63#include <openssl/x509.h>
64
64#include "asn1_locl.h" 65#include "asn1_locl.h"
65 66
66/* Generalised MIME like utilities for streaming ASN1. Although many 67/* Generalised MIME like utilities for streaming ASN1. Although many
diff --git a/src/lib/libcrypto/asn1/asn_moid.c b/src/lib/libcrypto/asn1/asn_moid.c
index 44b9dbb210..76b6405212 100644
--- a/src/lib/libcrypto/asn1/asn_moid.c
+++ b/src/lib/libcrypto/asn1/asn_moid.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn_moid.c,v 1.11 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: asn_moid.c,v 1.12 2014/07/11 08:44:47 jsing Exp $ */
2/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL 2/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -60,9 +60,9 @@
60#include <stdio.h> 60#include <stdio.h>
61#include <string.h> 61#include <string.h>
62 62
63#include <openssl/crypto.h> 63#include <openssl/err.h>
64#include "cryptlib.h"
65#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/crypto.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67 67
68/* Simple ASN1 OID module: add all objects in a given section */ 68/* Simple ASN1 OID module: add all objects in a given section */
diff --git a/src/lib/libcrypto/asn1/asn_pack.c b/src/lib/libcrypto/asn1/asn_pack.c
index fab2dcbf54..5d3fc3c34d 100644
--- a/src/lib/libcrypto/asn1/asn_pack.c
+++ b/src/lib/libcrypto/asn1/asn_pack.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn_pack.c,v 1.12 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: asn_pack.c,v 1.13 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -57,8 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/err.h>
62 63
63#ifndef NO_ASN1_OLD 64#ifndef NO_ASN1_OLD
64 65
diff --git a/src/lib/libcrypto/asn1/d2i_pr.c b/src/lib/libcrypto/asn1/d2i_pr.c
index 3e140c05f5..2deec613ed 100644
--- a/src/lib/libcrypto/asn1/d2i_pr.c
+++ b/src/lib/libcrypto/asn1/d2i_pr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d2i_pr.c,v 1.11 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: d2i_pr.c,v 1.12 2014/07/11 08:44:47 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 *
@@ -60,15 +60,16 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/asn1.h>
64#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include <openssl/x509.h>
68
67#ifndef OPENSSL_NO_ENGINE 69#ifndef OPENSSL_NO_ENGINE
68#include <openssl/engine.h> 70#include <openssl/engine.h>
69#endif 71#endif
70#include <openssl/x509.h> 72
71#include <openssl/asn1.h>
72#include "asn1_locl.h" 73#include "asn1_locl.h"
73 74
74EVP_PKEY * 75EVP_PKEY *
diff --git a/src/lib/libcrypto/asn1/d2i_pu.c b/src/lib/libcrypto/asn1/d2i_pu.c
index 4a9475b68e..df6fea4af5 100644
--- a/src/lib/libcrypto/asn1/d2i_pu.c
+++ b/src/lib/libcrypto/asn1/d2i_pu.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d2i_pu.c,v 1.11 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: d2i_pu.c,v 1.12 2014/07/11 08:44:47 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 *
@@ -60,20 +60,21 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/asn1.h>
64#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/err.h>
65#include <openssl/evp.h> 66#include <openssl/evp.h>
66#include <openssl/objects.h> 67#include <openssl/objects.h>
67#include <openssl/asn1.h> 68
68#ifndef OPENSSL_NO_RSA
69#include <openssl/rsa.h>
70#endif
71#ifndef OPENSSL_NO_DSA 69#ifndef OPENSSL_NO_DSA
72#include <openssl/dsa.h> 70#include <openssl/dsa.h>
73#endif 71#endif
74#ifndef OPENSSL_NO_EC 72#ifndef OPENSSL_NO_EC
75#include <openssl/ec.h> 73#include <openssl/ec.h>
76#endif 74#endif
75#ifndef OPENSSL_NO_RSA
76#include <openssl/rsa.h>
77#endif
77 78
78EVP_PKEY * 79EVP_PKEY *
79d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) 80d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length)
diff --git a/src/lib/libcrypto/asn1/evp_asn1.c b/src/lib/libcrypto/asn1/evp_asn1.c
index cc4b204019..648fae9fbd 100644
--- a/src/lib/libcrypto/asn1/evp_asn1.c
+++ b/src/lib/libcrypto/asn1/evp_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_asn1.c,v 1.10 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: evp_asn1.c,v 1.11 2014/07/11 08:44:47 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 *
@@ -59,9 +59,9 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/asn1.h> 62#include <openssl/asn1.h>
64#include <openssl/asn1_mac.h> 63#include <openssl/asn1_mac.h>
64#include <openssl/err.h>
65 65
66int 66int
67ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len) 67ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
diff --git a/src/lib/libcrypto/asn1/f_enum.c b/src/lib/libcrypto/asn1/f_enum.c
index 7cf0abb428..7f064edb04 100644
--- a/src/lib/libcrypto/asn1/f_enum.c
+++ b/src/lib/libcrypto/asn1/f_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: f_enum.c,v 1.13 2014/07/10 21:58:08 miod Exp $ */ 1/* $OpenBSD: f_enum.c,v 1.14 2014/07/11 08:44:47 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 *
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/buffer.h>
63#include <openssl/err.h>
63 64
64/* Based on a_int.c: equivalent ENUMERATED functions */ 65/* Based on a_int.c: equivalent ENUMERATED functions */
65 66
diff --git a/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c
index 4d8da10d88..0ec29f5769 100644
--- a/src/lib/libcrypto/asn1/f_int.c
+++ b/src/lib/libcrypto/asn1/f_int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: f_int.c,v 1.16 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: f_int.c,v 1.17 2014/07/11 08:44:47 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 *
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/buffer.h>
63#include <openssl/err.h>
63 64
64int 65int
65i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) 66i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a)
diff --git a/src/lib/libcrypto/asn1/f_string.c b/src/lib/libcrypto/asn1/f_string.c
index eec05f8110..14cd1a906a 100644
--- a/src/lib/libcrypto/asn1/f_string.c
+++ b/src/lib/libcrypto/asn1/f_string.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: f_string.c,v 1.15 2014/07/10 21:58:08 miod Exp $ */ 1/* $OpenBSD: f_string.c,v 1.16 2014/07/11 08:44:47 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 *
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/buffer.h>
63#include <openssl/err.h>
63 64
64int 65int
65i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) 66i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type)
diff --git a/src/lib/libcrypto/asn1/i2d_pr.c b/src/lib/libcrypto/asn1/i2d_pr.c
index 4223078cdb..5fa34678b6 100644
--- a/src/lib/libcrypto/asn1/i2d_pr.c
+++ b/src/lib/libcrypto/asn1/i2d_pr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: i2d_pr.c,v 1.9 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: i2d_pr.c,v 1.10 2014/07/11 08:44:47 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 *
@@ -57,9 +57,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
61#include <openssl/evp.h> 62#include <openssl/evp.h>
62#include <openssl/x509.h> 63#include <openssl/x509.h>
64
63#include "asn1_locl.h" 65#include "asn1_locl.h"
64 66
65int 67int
diff --git a/src/lib/libcrypto/asn1/i2d_pu.c b/src/lib/libcrypto/asn1/i2d_pu.c
index 0f0369f3a5..6e485ea325 100644
--- a/src/lib/libcrypto/asn1/i2d_pu.c
+++ b/src/lib/libcrypto/asn1/i2d_pu.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: i2d_pu.c,v 1.9 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: i2d_pu.c,v 1.10 2014/07/11 08:44:47 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 *
@@ -60,19 +60,20 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/err.h>
65#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h> 66#include <openssl/objects.h>
67#ifndef OPENSSL_NO_RSA 67
68#include <openssl/rsa.h>
69#endif
70#ifndef OPENSSL_NO_DSA 68#ifndef OPENSSL_NO_DSA
71#include <openssl/dsa.h> 69#include <openssl/dsa.h>
72#endif 70#endif
73#ifndef OPENSSL_NO_EC 71#ifndef OPENSSL_NO_EC
74#include <openssl/ec.h> 72#include <openssl/ec.h>
75#endif 73#endif
74#ifndef OPENSSL_NO_RSA
75#include <openssl/rsa.h>
76#endif
76 77
77int 78int
78i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) 79i2d_PublicKey(EVP_PKEY *a, unsigned char **pp)
diff --git a/src/lib/libcrypto/asn1/n_pkey.c b/src/lib/libcrypto/asn1/n_pkey.c
index b2047bd586..230df827f3 100644
--- a/src/lib/libcrypto/asn1/n_pkey.c
+++ b/src/lib/libcrypto/asn1/n_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: n_pkey.c,v 1.20 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: n_pkey.c,v 1.21 2014/07/11 08:44:47 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 *
@@ -61,16 +61,15 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#ifndef OPENSSL_NO_RSA 64#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h>
67#include <openssl/objects.h>
68#include <openssl/asn1t.h> 65#include <openssl/asn1t.h>
69#include <openssl/asn1_mac.h> 66#include <openssl/asn1_mac.h>
67#include <openssl/err.h>
70#include <openssl/evp.h> 68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/rsa.h>
71#include <openssl/x509.h> 71#include <openssl/x509.h>
72 72
73
74#ifndef OPENSSL_NO_RC4 73#ifndef OPENSSL_NO_RC4
75 74
76typedef struct netscape_pkey_st { 75typedef struct netscape_pkey_st {
diff --git a/src/lib/libcrypto/asn1/p5_pbe.c b/src/lib/libcrypto/asn1/p5_pbe.c
index 7f1fce34a2..ba892b185c 100644
--- a/src/lib/libcrypto/asn1/p5_pbe.c
+++ b/src/lib/libcrypto/asn1/p5_pbe.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_pbe.c,v 1.15 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: p5_pbe.c,v 1.16 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -59,10 +59,10 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
64#include <openssl/x509.h> 63#include <openssl/err.h>
65#include <openssl/rand.h> 64#include <openssl/rand.h>
65#include <openssl/x509.h>
66 66
67/* PKCS#5 password based encryption structure */ 67/* PKCS#5 password based encryption structure */
68 68
diff --git a/src/lib/libcrypto/asn1/p5_pbev2.c b/src/lib/libcrypto/asn1/p5_pbev2.c
index 411740f403..8085aba453 100644
--- a/src/lib/libcrypto/asn1/p5_pbev2.c
+++ b/src/lib/libcrypto/asn1/p5_pbev2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_pbev2.c,v 1.16 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: p5_pbev2.c,v 1.17 2014/07/11 08:44:47 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 1999-2004. 3 * project 1999-2004.
4 */ 4 */
@@ -59,10 +59,10 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
64#include <openssl/x509.h> 63#include <openssl/err.h>
65#include <openssl/rand.h> 64#include <openssl/rand.h>
65#include <openssl/x509.h>
66 66
67/* PKCS#5 v2.0 password based encryption structures */ 67/* PKCS#5 v2.0 password based encryption structures */
68 68
diff --git a/src/lib/libcrypto/asn1/p8_pkey.c b/src/lib/libcrypto/asn1/p8_pkey.c
index 4875bebfcc..3aacecb8fb 100644
--- a/src/lib/libcrypto/asn1/p8_pkey.c
+++ b/src/lib/libcrypto/asn1/p8_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p8_pkey.c,v 1.11 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: p8_pkey.c,v 1.12 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63 63
diff --git a/src/lib/libcrypto/asn1/t_bitst.c b/src/lib/libcrypto/asn1/t_bitst.c
index f9a1900c60..ea4138e0fb 100644
--- a/src/lib/libcrypto/asn1/t_bitst.c
+++ b/src/lib/libcrypto/asn1/t_bitst.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_bitst.c,v 1.6 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: t_bitst.c,v 1.7 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -59,7 +59,6 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/conf.h> 62#include <openssl/conf.h>
64#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
65 64
diff --git a/src/lib/libcrypto/asn1/t_crl.c b/src/lib/libcrypto/asn1/t_crl.c
index dfa37e9b1f..e2f9d8b09e 100644
--- a/src/lib/libcrypto/asn1/t_crl.c
+++ b/src/lib/libcrypto/asn1/t_crl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_crl.c,v 1.14 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: t_crl.c,v 1.15 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h>
62#include <openssl/bn.h> 61#include <openssl/bn.h>
62#include <openssl/buffer.h>
63#include <openssl/err.h>
63#include <openssl/objects.h> 64#include <openssl/objects.h>
64#include <openssl/x509.h> 65#include <openssl/x509.h>
65#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
diff --git a/src/lib/libcrypto/asn1/t_pkey.c b/src/lib/libcrypto/asn1/t_pkey.c
index c620504036..b3f7d084c5 100644
--- a/src/lib/libcrypto/asn1/t_pkey.c
+++ b/src/lib/libcrypto/asn1/t_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_pkey.c,v 1.15 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: t_pkey.c,v 1.16 2014/07/11 08:44:47 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 *
@@ -57,10 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/objects.h>
62#include <openssl/buffer.h>
63#include <openssl/bn.h> 61#include <openssl/bn.h>
62#include <openssl/buffer.h>
63#include <openssl/objects.h>
64 64
65int 65int
66ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, 66ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
diff --git a/src/lib/libcrypto/asn1/t_req.c b/src/lib/libcrypto/asn1/t_req.c
index 689df1e203..51f711acf7 100644
--- a/src/lib/libcrypto/asn1/t_req.c
+++ b/src/lib/libcrypto/asn1/t_req.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_req.c,v 1.16 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: t_req.c,v 1.17 2014/07/11 08:44:47 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 *
@@ -60,18 +60,19 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/buffer.h>
65#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/buffer.h>
65#include <openssl/err.h>
66#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include <openssl/x509.h> 67#include <openssl/x509.h>
68#include <openssl/x509v3.h> 68#include <openssl/x509v3.h>
69#ifndef OPENSSL_NO_RSA 69
70#include <openssl/rsa.h>
71#endif
72#ifndef OPENSSL_NO_DSA 70#ifndef OPENSSL_NO_DSA
73#include <openssl/dsa.h> 71#include <openssl/dsa.h>
74#endif 72#endif
73#ifndef OPENSSL_NO_RSA
74#include <openssl/rsa.h>
75#endif
75 76
76int 77int
77X509_REQ_print_fp(FILE *fp, X509_REQ *x) 78X509_REQ_print_fp(FILE *fp, X509_REQ *x)
diff --git a/src/lib/libcrypto/asn1/t_spki.c b/src/lib/libcrypto/asn1/t_spki.c
index 91d275ffc2..39ff0670b6 100644
--- a/src/lib/libcrypto/asn1/t_spki.c
+++ b/src/lib/libcrypto/asn1/t_spki.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_spki.c,v 1.10 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: t_spki.c,v 1.11 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -60,16 +60,16 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/x509.h>
65#include <openssl/asn1.h> 63#include <openssl/asn1.h>
66#ifndef OPENSSL_NO_RSA 64#include <openssl/bn.h>
67#include <openssl/rsa.h> 65#include <openssl/x509.h>
68#endif 66
69#ifndef OPENSSL_NO_DSA 67#ifndef OPENSSL_NO_DSA
70#include <openssl/dsa.h> 68#include <openssl/dsa.h>
71#endif 69#endif
72#include <openssl/bn.h> 70#ifndef OPENSSL_NO_RSA
71#include <openssl/rsa.h>
72#endif
73 73
74/* Print out an SPKI */ 74/* Print out an SPKI */
75 75
diff --git a/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c
index 690015b1c1..e6f0692ccc 100644
--- a/src/lib/libcrypto/asn1/t_x509.c
+++ b/src/lib/libcrypto/asn1/t_x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_x509.c,v 1.23 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: t_x509.c,v 1.24 2014/07/11 08:44:47 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 *
@@ -60,21 +60,23 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/buffer.h>
65#include <openssl/bn.h> 63#include <openssl/bn.h>
66#ifndef OPENSSL_NO_RSA 64#include <openssl/buffer.h>
67#include <openssl/rsa.h> 65#include <openssl/err.h>
68#endif 66#include <openssl/objects.h>
67#include <openssl/x509.h>
68#include <openssl/x509v3.h>
69
69#ifndef OPENSSL_NO_DSA 70#ifndef OPENSSL_NO_DSA
70#include <openssl/dsa.h> 71#include <openssl/dsa.h>
71#endif 72#endif
72#ifndef OPENSSL_NO_EC 73#ifndef OPENSSL_NO_EC
73#include <openssl/ec.h> 74#include <openssl/ec.h>
74#endif 75#endif
75#include <openssl/objects.h> 76#ifndef OPENSSL_NO_RSA
76#include <openssl/x509.h> 77#include <openssl/rsa.h>
77#include <openssl/x509v3.h> 78#endif
79
78#include "asn1_locl.h" 80#include "asn1_locl.h"
79 81
80int 82int
diff --git a/src/lib/libcrypto/asn1/t_x509a.c b/src/lib/libcrypto/asn1/t_x509a.c
index 14bf7438f9..fd68211b84 100644
--- a/src/lib/libcrypto/asn1/t_x509a.c
+++ b/src/lib/libcrypto/asn1/t_x509a.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_x509a.c,v 1.7 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: t_x509a.c,v 1.8 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -57,9 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/evp.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/evp.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
64 64
65/* X509_CERT_AUX and string set routines 65/* X509_CERT_AUX and string set routines
diff --git a/src/lib/libcrypto/asn1/tasn_enc.c b/src/lib/libcrypto/asn1/tasn_enc.c
index 5e7a6201d3..f7209dc4eb 100644
--- a/src/lib/libcrypto/asn1/tasn_enc.c
+++ b/src/lib/libcrypto/asn1/tasn_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_enc.c,v 1.13 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: tasn_enc.c,v 1.14 2014/07/11 08:44:47 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 */
@@ -58,7 +58,7 @@
58 58
59#include <stddef.h> 59#include <stddef.h>
60#include <string.h> 60#include <string.h>
61#include "cryptlib.h" 61
62#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/objects.h> 64#include <openssl/objects.h>
diff --git a/src/lib/libcrypto/asn1/tasn_prn.c b/src/lib/libcrypto/asn1/tasn_prn.c
index d6d702b275..9383750a82 100644
--- a/src/lib/libcrypto/asn1/tasn_prn.c
+++ b/src/lib/libcrypto/asn1/tasn_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_prn.c,v 1.10 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: tasn_prn.c,v 1.11 2014/07/11 08:44:47 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 */
@@ -57,13 +57,14 @@
57 */ 57 */
58 58
59#include <stddef.h> 59#include <stddef.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/objects.h>
64#include <openssl/buffer.h> 63#include <openssl/buffer.h>
65#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/objects.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67
67#include "asn1_locl.h" 68#include "asn1_locl.h"
68 69
69/* Print routines. 70/* Print routines.
diff --git a/src/lib/libcrypto/asn1/x_attrib.c b/src/lib/libcrypto/asn1/x_attrib.c
index 1243927d1c..1efbb98bbd 100644
--- a/src/lib/libcrypto/asn1/x_attrib.c
+++ b/src/lib/libcrypto/asn1/x_attrib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_attrib.c,v 1.8 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: x_attrib.c,v 1.9 2014/07/11 08:44:47 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 *
@@ -57,9 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/objects.h>
62#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
64 64
65/* X509_ATTRIBUTE: this has the following form: 65/* X509_ATTRIBUTE: this has the following form:
diff --git a/src/lib/libcrypto/asn1/x_bignum.c b/src/lib/libcrypto/asn1/x_bignum.c
index 38f8918a12..18ec64eeef 100644
--- a/src/lib/libcrypto/asn1/x_bignum.c
+++ b/src/lib/libcrypto/asn1/x_bignum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_bignum.c,v 1.5 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: x_bignum.c,v 1.6 2014/07/11 08:44:47 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 */
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/bn.h> 62#include <openssl/bn.h>
63 63
diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c
index 13402a66c2..ad77ef7737 100644
--- a/src/lib/libcrypto/asn1/x_crl.c
+++ b/src/lib/libcrypto/asn1/x_crl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_crl.c,v 1.16 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: x_crl.c,v 1.17 2014/07/11 08:44:47 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 *
@@ -60,12 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include "asn1_locl.h"
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/err.h>
66#include <openssl/x509.h> 65#include <openssl/x509.h>
67#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
68 67
68#include "asn1_locl.h"
69
69static int X509_REVOKED_cmp(const X509_REVOKED * const *a, 70static int X509_REVOKED_cmp(const X509_REVOKED * const *a,
70 const X509_REVOKED * const *b); 71 const X509_REVOKED * const *b);
71static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp); 72static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp);
diff --git a/src/lib/libcrypto/asn1/x_info.c b/src/lib/libcrypto/asn1/x_info.c
index 881565c489..6c055fd441 100644
--- a/src/lib/libcrypto/asn1/x_info.c
+++ b/src/lib/libcrypto/asn1/x_info.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_info.c,v 1.13 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: x_info.c,v 1.14 2014/07/11 08:44:47 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 *
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/evp.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/err.h>
63#include <openssl/evp.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
64 65
65X509_INFO * 66X509_INFO *
diff --git a/src/lib/libcrypto/asn1/x_long.c b/src/lib/libcrypto/asn1/x_long.c
index dddcfeb479..1add387453 100644
--- a/src/lib/libcrypto/asn1/x_long.c
+++ b/src/lib/libcrypto/asn1/x_long.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_long.c,v 1.8 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: x_long.c,v 1.9 2014/07/11 08:44:47 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 */
@@ -59,9 +59,9 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
64#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/err.h>
65 65
66/* Custom primitive type for long handling. This converts between an ASN1_INTEGER 66/* Custom primitive type for long handling. This converts between an ASN1_INTEGER
67 * and a long directly. 67 * and a long directly.
diff --git a/src/lib/libcrypto/asn1/x_name.c b/src/lib/libcrypto/asn1/x_name.c
index 4b84cfeffd..98993c84fc 100644
--- a/src/lib/libcrypto/asn1/x_name.c
+++ b/src/lib/libcrypto/asn1/x_name.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_name.c,v 1.18 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: x_name.c,v 1.19 2014/07/11 08:44:47 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 *
@@ -60,9 +60,10 @@
60#include <stdio.h> 60#include <stdio.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h"
64#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/err.h>
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66
66#include "asn1_locl.h" 67#include "asn1_locl.h"
67 68
68typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 69typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
diff --git a/src/lib/libcrypto/asn1/x_pkey.c b/src/lib/libcrypto/asn1/x_pkey.c
index 8488ff37fb..a5134bc6a2 100644
--- a/src/lib/libcrypto/asn1/x_pkey.c
+++ b/src/lib/libcrypto/asn1/x_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_pkey.c,v 1.13 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: x_pkey.c,v 1.14 2014/07/11 08:44:47 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 *
@@ -59,10 +59,10 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h" 62#include <openssl/asn1_mac.h>
63#include <openssl/err.h>
63#include <openssl/evp.h> 64#include <openssl/evp.h>
64#include <openssl/objects.h> 65#include <openssl/objects.h>
65#include <openssl/asn1_mac.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67 67
68/* need to implement */ 68/* need to implement */
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c
index f702bdbe97..87cb25bb50 100644
--- a/src/lib/libcrypto/asn1/x_pubkey.c
+++ b/src/lib/libcrypto/asn1/x_pubkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_pubkey.c,v 1.20 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: x_pubkey.c,v 1.21 2014/07/11 08:44:47 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 *
@@ -60,16 +60,18 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/err.h>
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66#include "asn1_locl.h" 66
67#ifndef OPENSSL_NO_RSA
68#include <openssl/rsa.h>
69#endif
70#ifndef OPENSSL_NO_DSA 67#ifndef OPENSSL_NO_DSA
71#include <openssl/dsa.h> 68#include <openssl/dsa.h>
72#endif 69#endif
70#ifndef OPENSSL_NO_RSA
71#include <openssl/rsa.h>
72#endif
73
74#include "asn1_locl.h"
73 75
74/* Minor tweak to operation: free up EVP_PKEY */ 76/* Minor tweak to operation: free up EVP_PKEY */
75static int 77static int
diff --git a/src/lib/libcrypto/asn1/x_req.c b/src/lib/libcrypto/asn1/x_req.c
index 50bed04fc7..c876edd7f0 100644
--- a/src/lib/libcrypto/asn1/x_req.c
+++ b/src/lib/libcrypto/asn1/x_req.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_req.c,v 1.9 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: x_req.c,v 1.10 2014/07/11 08:44:47 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 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63 63
diff --git a/src/lib/libcrypto/asn1/x_sig.c b/src/lib/libcrypto/asn1/x_sig.c
index 3ebb06b4a1..ab4546e3ca 100644
--- a/src/lib/libcrypto/asn1/x_sig.c
+++ b/src/lib/libcrypto/asn1/x_sig.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_sig.c,v 1.7 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: x_sig.c,v 1.8 2014/07/11 08:44:47 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 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63 63
diff --git a/src/lib/libcrypto/asn1/x_spki.c b/src/lib/libcrypto/asn1/x_spki.c
index 40e9b3674b..836abb13d8 100644
--- a/src/lib/libcrypto/asn1/x_spki.c
+++ b/src/lib/libcrypto/asn1/x_spki.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_spki.c,v 1.7 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: x_spki.c,v 1.8 2014/07/11 08:44:47 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 *
@@ -61,7 +61,7 @@
61 */ 61 */
62 62
63#include <stdio.h> 63#include <stdio.h>
64#include "cryptlib.h" 64
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66#include <openssl/asn1t.h> 66#include <openssl/asn1t.h>
67 67
diff --git a/src/lib/libcrypto/asn1/x_val.c b/src/lib/libcrypto/asn1/x_val.c
index ce501923f6..da9d16346b 100644
--- a/src/lib/libcrypto/asn1/x_val.c
+++ b/src/lib/libcrypto/asn1/x_val.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_val.c,v 1.7 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: x_val.c,v 1.8 2014/07/11 08:44:47 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 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63 63
diff --git a/src/lib/libcrypto/asn1/x_x509.c b/src/lib/libcrypto/asn1/x_x509.c
index 43772f9ac1..0236a0faa2 100644
--- a/src/lib/libcrypto/asn1/x_x509.c
+++ b/src/lib/libcrypto/asn1/x_x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_x509.c,v 1.16 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: x_x509.c,v 1.17 2014/07/11 08:44:47 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 *
@@ -60,9 +60,8 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/evp.h>
66#include <openssl/x509.h> 65#include <openssl/x509.h>
67#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
68 67
diff --git a/src/lib/libcrypto/asn1/x_x509a.c b/src/lib/libcrypto/asn1/x_x509a.c
index cc8b16a7a7..c6837069d9 100644
--- a/src/lib/libcrypto/asn1/x_x509a.c
+++ b/src/lib/libcrypto/asn1/x_x509a.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_x509a.c,v 1.9 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: x_x509a.c,v 1.10 2014/07/11 08:44:47 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 1999. 3 * project 1999.
4 */ 4 */
@@ -57,9 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/evp.h>
62#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
62#include <openssl/evp.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
64 64
65/* X509_CERT_AUX routines. These are used to encode additional 65/* X509_CERT_AUX routines. These are used to encode additional