summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2014-07-11 08:44:49 +0000
committerjsing <>2014-07-11 08:44:49 +0000
commit8c3482db610348be15fb633bb52b0511c2cabbcf (patch)
tree0e726f9e971e00f4c8cd8afab71589803fc11b7f
parenta336cdb63c1fe5d934826147bf5c19d317ced73b (diff)
downloadopenbsd-8c3482db610348be15fb633bb52b0511c2cabbcf.tar.gz
openbsd-8c3482db610348be15fb633bb52b0511c2cabbcf.tar.bz2
openbsd-8c3482db610348be15fb633bb52b0511c2cabbcf.zip
Only import cryptlib.h in the four source files that actually need it.
Remove the openssl public includes from cryptlib.h and add a small number of includes into the source files that actually need them. While here, also sort/group/tidy the includes. ok beck@ miod@
-rw-r--r--src/lib/libcrypto/aes/aes_ige.c6
-rw-r--r--src/lib/libcrypto/aes/aes_wrap.c3
-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
-rw-r--r--src/lib/libcrypto/bio/b_dump.c4
-rw-r--r--src/lib/libcrypto/bio/b_sock.c6
-rw-r--r--src/lib/libcrypto/bio/bf_buff.c4
-rw-r--r--src/lib/libcrypto/bio/bf_lbuf.c6
-rw-r--r--src/lib/libcrypto/bio/bf_nbio.c8
-rw-r--r--src/lib/libcrypto/bio/bf_null.c6
-rw-r--r--src/lib/libcrypto/bio/bio_cb.c8
-rw-r--r--src/lib/libcrypto/bio/bio_lib.c9
-rw-r--r--src/lib/libcrypto/bio/bss_acpt.c5
-rw-r--r--src/lib/libcrypto/bio/bss_conn.c5
-rw-r--r--src/lib/libcrypto/bio/bss_dgram.c3
-rw-r--r--src/lib/libcrypto/bio/bss_fd.c4
-rw-r--r--src/lib/libcrypto/bio/bss_file.c3
-rw-r--r--src/lib/libcrypto/bio/bss_log.c4
-rw-r--r--src/lib/libcrypto/bio/bss_mem.c5
-rw-r--r--src/lib/libcrypto/bio/bss_null.c3
-rw-r--r--src/lib/libcrypto/bio/bss_sock.c4
-rw-r--r--src/lib/libcrypto/bn/bn_add.c6
-rw-r--r--src/lib/libcrypto/bn/bn_asm.c3
-rw-r--r--src/lib/libcrypto/bn/bn_blind.c5
-rw-r--r--src/lib/libcrypto/bn/bn_ctx.c5
-rw-r--r--src/lib/libcrypto/bn/bn_depr.c6
-rw-r--r--src/lib/libcrypto/bn/bn_div.c7
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c5
-rw-r--r--src/lib/libcrypto/bn/bn_exp2.c6
-rw-r--r--src/lib/libcrypto/bn/bn_gcd.c5
-rw-r--r--src/lib/libcrypto/bn/bn_gf2m.c5
-rw-r--r--src/lib/libcrypto/bn/bn_kron.c3
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c5
-rw-r--r--src/lib/libcrypto/bn/bn_mod.c5
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c3
-rw-r--r--src/lib/libcrypto/bn/bn_mpi.c6
-rw-r--r--src/lib/libcrypto/bn/bn_mul.c3
-rw-r--r--src/lib/libcrypto/bn/bn_nist.c7
-rw-r--r--src/lib/libcrypto/bn/bn_prime.c7
-rw-r--r--src/lib/libcrypto/bn/bn_print.c5
-rw-r--r--src/lib/libcrypto/bn/bn_rand.c8
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c6
-rw-r--r--src/lib/libcrypto/bn/bn_shift.c3
-rw-r--r--src/lib/libcrypto/bn/bn_sqr.c3
-rw-r--r--src/lib/libcrypto/bn/bn_sqrt.c6
-rw-r--r--src/lib/libcrypto/bn/bn_word.c4
-rw-r--r--src/lib/libcrypto/buffer/buf_str.c5
-rw-r--r--src/lib/libcrypto/buffer/buffer.c5
-rw-r--r--src/lib/libcrypto/cmac/cm_ameth.c7
-rw-r--r--src/lib/libcrypto/cmac/cm_pmeth.c8
-rw-r--r--src/lib/libcrypto/cmac/cmac.c4
-rw-r--r--src/lib/libcrypto/cms/cms_cd.c11
-rw-r--r--src/lib/libcrypto/cms/cms_dd.c8
-rw-r--r--src/lib/libcrypto/cms/cms_enc.c10
-rw-r--r--src/lib/libcrypto/cms/cms_env.c12
-rw-r--r--src/lib/libcrypto/cms/cms_ess.c8
-rw-r--r--src/lib/libcrypto/cms/cms_pwri.c14
-rw-r--r--src/lib/libcrypto/cms/cms_sd.c10
-rw-r--r--src/lib/libcrypto/cms/cms_smime.c8
-rw-r--r--src/lib/libcrypto/conf/conf_def.c13
-rw-r--r--src/lib/libcrypto/conf/conf_mall.c8
-rw-r--r--src/lib/libcrypto/conf/conf_mod.c8
-rw-r--r--src/lib/libcrypto/conf/conf_sap.c8
-rw-r--r--src/lib/libcrypto/cryptlib.c7
-rw-r--r--src/lib/libcrypto/cryptlib.h6
-rw-r--r--src/lib/libcrypto/cversion.c5
-rw-r--r--src/lib/libcrypto/des/enc_read.c6
-rw-r--r--src/lib/libcrypto/des/enc_writ.c6
-rw-r--r--src/lib/libcrypto/dh/dh_ameth.c10
-rw-r--r--src/lib/libcrypto/dh/dh_asn1.c6
-rw-r--r--src/lib/libcrypto/dh/dh_check.c4
-rw-r--r--src/lib/libcrypto/dh/dh_depr.c3
-rw-r--r--src/lib/libcrypto/dh/dh_gen.c5
-rw-r--r--src/lib/libcrypto/dh/dh_key.c7
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c4
-rw-r--r--src/lib/libcrypto/dh/dh_pmeth.c11
-rw-r--r--src/lib/libcrypto/dh/dh_prn.c7
-rw-r--r--src/lib/libcrypto/dsa/dsa_ameth.c10
-rw-r--r--src/lib/libcrypto/dsa/dsa_asn1.c7
-rw-r--r--src/lib/libcrypto/dsa/dsa_depr.c5
-rw-r--r--src/lib/libcrypto/dsa/dsa_gen.c6
-rw-r--r--src/lib/libcrypto/dsa/dsa_key.c4
-rw-r--r--src/lib/libcrypto/dsa/dsa_lib.c12
-rw-r--r--src/lib/libcrypto/dsa/dsa_ossl.c9
-rw-r--r--src/lib/libcrypto/dsa/dsa_pmeth.c11
-rw-r--r--src/lib/libcrypto/dsa/dsa_prn.c7
-rw-r--r--src/lib/libcrypto/dsa/dsa_sign.c5
-rw-r--r--src/lib/libcrypto/dsa/dsa_vrf.c3
-rw-r--r--src/lib/libcrypto/dso/dso_dlfcn.c4
-rw-r--r--src/lib/libcrypto/dso/dso_lib.c4
-rw-r--r--src/lib/libcrypto/dso/dso_null.c4
-rw-r--r--src/lib/libcrypto/dso/dso_openssl.c4
-rw-r--r--src/lib/libcrypto/ec/ec_ameth.c10
-rw-r--r--src/lib/libcrypto/ec/ec_pmeth.c7
-rw-r--r--src/lib/libcrypto/ec/eck_prn.c8
-rw-r--r--src/lib/libcrypto/ecdh/ech_ossl.c11
-rw-r--r--src/lib/libcrypto/engine/eng_aesni.c7
-rw-r--r--src/lib/libcrypto/engine/eng_int.h4
-rw-r--r--src/lib/libcrypto/engine/eng_list.c3
-rw-r--r--src/lib/libcrypto/engine/eng_openssl.c16
-rw-r--r--src/lib/libcrypto/engine/eng_table.c4
-rw-r--r--src/lib/libcrypto/err/err.c9
-rw-r--r--src/lib/libcrypto/err/err.h4
-rw-r--r--src/lib/libcrypto/err/err_prn.c7
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c3
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c3
-rw-r--r--src/lib/libcrypto/evp/bio_md.c4
-rw-r--r--src/lib/libcrypto/evp/c_allc.c5
-rw-r--r--src/lib/libcrypto/evp/c_alld.c5
-rw-r--r--src/lib/libcrypto/evp/digest.c6
-rw-r--r--src/lib/libcrypto/evp/e_bf.c9
-rw-r--r--src/lib/libcrypto/evp/e_cast.c8
-rw-r--r--src/lib/libcrypto/evp/e_des.c9
-rw-r--r--src/lib/libcrypto/evp/e_des3.c9
-rw-r--r--src/lib/libcrypto/evp/e_idea.c8
-rw-r--r--src/lib/libcrypto/evp/e_null.c3
-rw-r--r--src/lib/libcrypto/evp/e_rc2.c8
-rw-r--r--src/lib/libcrypto/evp/e_rc4.c7
-rw-r--r--src/lib/libcrypto/evp/e_rc5.c7
-rw-r--r--src/lib/libcrypto/evp/e_xcbc_d.c7
-rw-r--r--src/lib/libcrypto/evp/encode.c3
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c7
-rw-r--r--src/lib/libcrypto/evp/evp_key.c7
-rw-r--r--src/lib/libcrypto/evp/evp_lib.c4
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c5
-rw-r--r--src/lib/libcrypto/evp/evp_pkey.c8
-rw-r--r--src/lib/libcrypto/evp/m_dss.c4
-rw-r--r--src/lib/libcrypto/evp/m_dss1.c5
-rw-r--r--src/lib/libcrypto/evp/m_ecdsa.c3
-rw-r--r--src/lib/libcrypto/evp/m_md4.c7
-rw-r--r--src/lib/libcrypto/evp/m_md5.c8
-rw-r--r--src/lib/libcrypto/evp/m_mdc2.c7
-rw-r--r--src/lib/libcrypto/evp/m_null.c4
-rw-r--r--src/lib/libcrypto/evp/m_ripemd.c8
-rw-r--r--src/lib/libcrypto/evp/m_sha.c6
-rw-r--r--src/lib/libcrypto/evp/m_sha1.c6
-rw-r--r--src/lib/libcrypto/evp/m_sigver.c6
-rw-r--r--src/lib/libcrypto/evp/m_wp.c5
-rw-r--r--src/lib/libcrypto/evp/names.c4
-rw-r--r--src/lib/libcrypto/evp/p5_crpt.c6
-rw-r--r--src/lib/libcrypto/evp/p5_crpt2.c8
-rw-r--r--src/lib/libcrypto/evp/p_dec.c11
-rw-r--r--src/lib/libcrypto/evp/p_enc.c11
-rw-r--r--src/lib/libcrypto/evp/p_lib.c16
-rw-r--r--src/lib/libcrypto/evp/p_open.c7
-rw-r--r--src/lib/libcrypto/evp/p_seal.c10
-rw-r--r--src/lib/libcrypto/evp/p_sign.c5
-rw-r--r--src/lib/libcrypto/evp/p_verify.c5
-rw-r--r--src/lib/libcrypto/evp/pmeth_fn.c8
-rw-r--r--src/lib/libcrypto/evp/pmeth_gn.c10
-rw-r--r--src/lib/libcrypto/evp/pmeth_lib.c7
-rw-r--r--src/lib/libcrypto/ex_data.c4
-rw-r--r--src/lib/libcrypto/hmac/hm_ameth.c4
-rw-r--r--src/lib/libcrypto/hmac/hm_pmeth.c8
-rw-r--r--src/lib/libcrypto/hmac/hmac.c5
-rw-r--r--src/lib/libcrypto/lhash/lh_stats.c6
-rw-r--r--src/lib/libcrypto/mdc2/mdc2_one.c5
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c8
-rw-r--r--src/lib/libcrypto/objects/obj_lib.c6
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_cl.c9
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_ext.c5
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_lib.c10
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_srv.c9
-rw-r--r--src/lib/libcrypto/pem/pem_all.c16
-rw-r--r--src/lib/libcrypto/pem/pem_info.c15
-rw-r--r--src/lib/libcrypto/pem/pem_lib.c13
-rw-r--r--src/lib/libcrypto/pem/pem_oth.c9
-rw-r--r--src/lib/libcrypto/pem/pem_pk8.c11
-rw-r--r--src/lib/libcrypto/pem/pem_pkey.c11
-rw-r--r--src/lib/libcrypto/pem/pem_seal.c7
-rw-r--r--src/lib/libcrypto/pem/pem_sign.c9
-rw-r--r--src/lib/libcrypto/pem/pem_x509.c8
-rw-r--r--src/lib/libcrypto/pem/pem_xaux.c8
-rw-r--r--src/lib/libcrypto/pem/pvkfmt.c7
-rw-r--r--src/lib/libcrypto/pkcs12/p12_add.c5
-rw-r--r--src/lib/libcrypto/pkcs12/p12_asn.c4
-rw-r--r--src/lib/libcrypto/pkcs12/p12_attr.c4
-rw-r--r--src/lib/libcrypto/pkcs12/p12_crpt.c5
-rw-r--r--src/lib/libcrypto/pkcs12/p12_crt.c6
-rw-r--r--src/lib/libcrypto/pkcs12/p12_decr.c6
-rw-r--r--src/lib/libcrypto/pkcs12/p12_init.c5
-rw-r--r--src/lib/libcrypto/pkcs12/p12_key.c6
-rw-r--r--src/lib/libcrypto/pkcs12/p12_kiss.c5
-rw-r--r--src/lib/libcrypto/pkcs12/p12_mutl.c7
-rw-r--r--src/lib/libcrypto/pkcs12/p12_p8d.c4
-rw-r--r--src/lib/libcrypto/pkcs12/p12_p8e.c5
-rw-r--r--src/lib/libcrypto/pkcs12/p12_utl.c3
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_asn1.c4
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_doit.c7
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_lib.c6
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_mime.c8
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_smime.c5
-rw-r--r--src/lib/libcrypto/rand/rand_lib.c3
-rw-r--r--src/lib/libcrypto/rc4/rc4_locl.h4
-rw-r--r--src/lib/libcrypto/rsa/rsa_ameth.c10
-rw-r--r--src/lib/libcrypto/rsa/rsa_asn1.c6
-rw-r--r--src/lib/libcrypto/rsa/rsa_crpt.c8
-rw-r--r--src/lib/libcrypto/rsa/rsa_depr.c3
-rw-r--r--src/lib/libcrypto/rsa/rsa_eay.c6
-rw-r--r--src/lib/libcrypto/rsa/rsa_gen.c5
-rw-r--r--src/lib/libcrypto/rsa/rsa_lib.c8
-rw-r--r--src/lib/libcrypto/rsa/rsa_none.c6
-rw-r--r--src/lib/libcrypto/rsa/rsa_oaep.c7
-rw-r--r--src/lib/libcrypto/rsa/rsa_pk1.c4
-rw-r--r--src/lib/libcrypto/rsa/rsa_pmeth.c10
-rw-r--r--src/lib/libcrypto/rsa/rsa_prn.c7
-rw-r--r--src/lib/libcrypto/rsa/rsa_pss.c6
-rw-r--r--src/lib/libcrypto/rsa/rsa_saos.c6
-rw-r--r--src/lib/libcrypto/rsa/rsa_sign.c7
-rw-r--r--src/lib/libcrypto/rsa/rsa_ssl.c6
-rw-r--r--src/lib/libcrypto/rsa/rsa_x931.c8
-rw-r--r--src/lib/libcrypto/sha/sha512.c6
-rw-r--r--src/lib/libcrypto/srp/srp_lib.c9
-rw-r--r--src/lib/libcrypto/srp/srp_vfy.c11
-rw-r--r--src/lib/libcrypto/stack/stack.c5
-rw-r--r--src/lib/libcrypto/ts/ts_conf.c6
-rw-r--r--src/lib/libcrypto/ts/ts_lib.c7
-rw-r--r--src/lib/libcrypto/ts/ts_req_print.c8
-rw-r--r--src/lib/libcrypto/ts/ts_req_utils.c7
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_print.c8
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_sign.c7
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_utils.c7
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_verify.c6
-rw-r--r--src/lib/libcrypto/ts/ts_verify_ctx.c4
-rw-r--r--src/lib/libcrypto/txt_db/txt_db.c4
-rw-r--r--src/lib/libcrypto/ui/ui_lib.c7
-rw-r--r--src/lib/libcrypto/ui/ui_openssl.c13
-rw-r--r--src/lib/libcrypto/x509/by_dir.c9
-rw-r--r--src/lib/libcrypto/x509/by_file.c9
-rw-r--r--src/lib/libcrypto/x509/x509_att.c9
-rw-r--r--src/lib/libcrypto/x509/x509_cmp.c4
-rw-r--r--src/lib/libcrypto/x509/x509_d2.c5
-rw-r--r--src/lib/libcrypto/x509/x509_ext.c9
-rw-r--r--src/lib/libcrypto/x509/x509_lu.c5
-rw-r--r--src/lib/libcrypto/x509/x509_obj.c6
-rw-r--r--src/lib/libcrypto/x509/x509_r2x.c11
-rw-r--r--src/lib/libcrypto/x509/x509_req.c12
-rw-r--r--src/lib/libcrypto/x509/x509_set.c6
-rw-r--r--src/lib/libcrypto/x509/x509_trs.c6
-rw-r--r--src/lib/libcrypto/x509/x509_txt.c11
-rw-r--r--src/lib/libcrypto/x509/x509_v3.c9
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c12
-rw-r--r--src/lib/libcrypto/x509/x509_vpm.c5
-rw-r--r--src/lib/libcrypto/x509/x509cset.c6
-rw-r--r--src/lib/libcrypto/x509/x509name.c8
-rw-r--r--src/lib/libcrypto/x509/x509rset.c6
-rw-r--r--src/lib/libcrypto/x509/x509spki.c4
-rw-r--r--src/lib/libcrypto/x509/x509type.c4
-rw-r--r--src/lib/libcrypto/x509/x_all.c14
-rw-r--r--src/lib/libcrypto/x509v3/pcy_cache.c3
-rw-r--r--src/lib/libcrypto/x509v3/pcy_data.c3
-rw-r--r--src/lib/libcrypto/x509v3/pcy_lib.c4
-rw-r--r--src/lib/libcrypto/x509v3/pcy_map.c3
-rw-r--r--src/lib/libcrypto/x509v3/pcy_tree.c3
-rw-r--r--src/lib/libcrypto/x509v3/v3_addr.c5
-rw-r--r--src/lib/libcrypto/x509v3/v3_akey.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_akeya.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_alt.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_asid.c7
-rw-r--r--src/lib/libcrypto/x509v3/v3_bcons.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_bitst.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_conf.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_cpols.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_crld.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_enum.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_extku.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_genn.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_ia5.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_info.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_int.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_lib.c5
-rw-r--r--src/lib/libcrypto/x509v3/v3_ncons.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_ocsp.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_pci.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_pcons.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_pku.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_pmaps.c5
-rw-r--r--src/lib/libcrypto/x509v3/v3_prn.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_purp.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_skey.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_sxnet.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_utl.c6
-rw-r--r--src/lib/libssl/src/crypto/aes/aes_ige.c6
-rw-r--r--src/lib/libssl/src/crypto/aes/aes_wrap.c3
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_bitstr.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_bool.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_bytes.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_d2i_fp.c9
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_digest.c10
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_dup.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_enum.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_gentm.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_i2d_fp.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_int.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_mbstr.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_object.c8
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_octet.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_print.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_set.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_sign.c14
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_strex.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_strnid.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_time.c8
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_type.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_utctm.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_utf8.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_verify.c16
-rw-r--r--src/lib/libssl/src/crypto/asn1/ameth_lib.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/asn1_gen.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/asn1_lib.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/asn1_par.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/asn_mime.c9
-rw-r--r--src/lib/libssl/src/crypto/asn1/asn_moid.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/asn_pack.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/d2i_pr.c9
-rw-r--r--src/lib/libssl/src/crypto/asn1/d2i_pu.c13
-rw-r--r--src/lib/libssl/src/crypto/asn1/evp_asn1.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/f_enum.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/f_int.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/f_string.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/i2d_pr.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/i2d_pu.c11
-rw-r--r--src/lib/libssl/src/crypto/asn1/n_pkey.c9
-rw-r--r--src/lib/libssl/src/crypto/asn1/p5_pbe.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/p5_pbev2.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/p8_pkey.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/t_bitst.c3
-rw-r--r--src/lib/libssl/src/crypto/asn1/t_crl.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/t_pkey.c8
-rw-r--r--src/lib/libssl/src/crypto/asn1/t_req.c13
-rw-r--r--src/lib/libssl/src/crypto/asn1/t_spki.c14
-rw-r--r--src/lib/libssl/src/crypto/asn1/t_x509.c20
-rw-r--r--src/lib/libssl/src/crypto/asn1/t_x509a.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/tasn_enc.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/tasn_prn.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_attrib.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_bignum.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_crl.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_info.c7
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_long.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_name.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_pkey.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_pubkey.c14
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_req.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_sig.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_spki.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_val.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_x509.c5
-rw-r--r--src/lib/libssl/src/crypto/asn1/x_x509a.c6
-rw-r--r--src/lib/libssl/src/crypto/bio/b_dump.c4
-rw-r--r--src/lib/libssl/src/crypto/bio/b_sock.c6
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_buff.c4
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_lbuf.c6
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_nbio.c8
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_null.c6
-rw-r--r--src/lib/libssl/src/crypto/bio/bio_cb.c8
-rw-r--r--src/lib/libssl/src/crypto/bio/bio_lib.c9
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_acpt.c5
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_conn.c5
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_dgram.c3
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_fd.c4
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_file.c3
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_log.c4
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_mem.c5
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_null.c3
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_sock.c4
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_add.c6
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_asm.c3
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_blind.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_ctx.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_depr.c6
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_div.c7
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_exp.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_exp2.c6
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_gcd.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_gf2m.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_kron.c3
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_lib.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_mod.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_mont.c3
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_mpi.c6
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_mul.c3
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_nist.c7
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_prime.c7
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_print.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_rand.c8
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_recp.c6
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_shift.c3
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_sqr.c3
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_sqrt.c6
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_word.c4
-rw-r--r--src/lib/libssl/src/crypto/buffer/buf_str.c5
-rw-r--r--src/lib/libssl/src/crypto/buffer/buffer.c5
-rw-r--r--src/lib/libssl/src/crypto/cmac/cm_ameth.c7
-rw-r--r--src/lib/libssl/src/crypto/cmac/cm_pmeth.c8
-rw-r--r--src/lib/libssl/src/crypto/cmac/cmac.c4
-rw-r--r--src/lib/libssl/src/crypto/cms/cms_cd.c11
-rw-r--r--src/lib/libssl/src/crypto/cms/cms_dd.c8
-rw-r--r--src/lib/libssl/src/crypto/cms/cms_enc.c10
-rw-r--r--src/lib/libssl/src/crypto/cms/cms_env.c12
-rw-r--r--src/lib/libssl/src/crypto/cms/cms_ess.c8
-rw-r--r--src/lib/libssl/src/crypto/cms/cms_pwri.c14
-rw-r--r--src/lib/libssl/src/crypto/cms/cms_sd.c10
-rw-r--r--src/lib/libssl/src/crypto/cms/cms_smime.c8
-rw-r--r--src/lib/libssl/src/crypto/conf/conf_def.c13
-rw-r--r--src/lib/libssl/src/crypto/conf/conf_mall.c8
-rw-r--r--src/lib/libssl/src/crypto/conf/conf_mod.c8
-rw-r--r--src/lib/libssl/src/crypto/conf/conf_sap.c8
-rw-r--r--src/lib/libssl/src/crypto/cryptlib.c7
-rw-r--r--src/lib/libssl/src/crypto/cryptlib.h6
-rw-r--r--src/lib/libssl/src/crypto/cversion.c5
-rw-r--r--src/lib/libssl/src/crypto/des/enc_read.c6
-rw-r--r--src/lib/libssl/src/crypto/des/enc_writ.c6
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_ameth.c10
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_asn1.c6
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_check.c4
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_depr.c3
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_gen.c5
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_key.c7
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_lib.c4
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_pmeth.c11
-rw-r--r--src/lib/libssl/src/crypto/dh/dh_prn.c7
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_ameth.c10
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_asn1.c7
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_depr.c5
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_gen.c6
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_key.c4
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_lib.c12
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_ossl.c9
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_pmeth.c11
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_prn.c7
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_sign.c5
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_vrf.c3
-rw-r--r--src/lib/libssl/src/crypto/dso/dso_dlfcn.c4
-rw-r--r--src/lib/libssl/src/crypto/dso/dso_lib.c4
-rw-r--r--src/lib/libssl/src/crypto/dso/dso_null.c4
-rw-r--r--src/lib/libssl/src/crypto/dso/dso_openssl.c4
-rw-r--r--src/lib/libssl/src/crypto/ec/ec_ameth.c10
-rw-r--r--src/lib/libssl/src/crypto/ec/ec_pmeth.c7
-rw-r--r--src/lib/libssl/src/crypto/ec/eck_prn.c8
-rw-r--r--src/lib/libssl/src/crypto/ecdh/ech_ossl.c11
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_aesni.c7
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_int.h4
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_list.c3
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_openssl.c16
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_table.c4
-rw-r--r--src/lib/libssl/src/crypto/err/err.c9
-rw-r--r--src/lib/libssl/src/crypto/err/err.h4
-rw-r--r--src/lib/libssl/src/crypto/err/err_prn.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/bio_b64.c3
-rw-r--r--src/lib/libssl/src/crypto/evp/bio_enc.c3
-rw-r--r--src/lib/libssl/src/crypto/evp/bio_md.c4
-rw-r--r--src/lib/libssl/src/crypto/evp/c_allc.c5
-rw-r--r--src/lib/libssl/src/crypto/evp/c_alld.c5
-rw-r--r--src/lib/libssl/src/crypto/evp/digest.c6
-rw-r--r--src/lib/libssl/src/crypto/evp/e_bf.c9
-rw-r--r--src/lib/libssl/src/crypto/evp/e_cast.c8
-rw-r--r--src/lib/libssl/src/crypto/evp/e_des.c9
-rw-r--r--src/lib/libssl/src/crypto/evp/e_des3.c9
-rw-r--r--src/lib/libssl/src/crypto/evp/e_idea.c8
-rw-r--r--src/lib/libssl/src/crypto/evp/e_null.c3
-rw-r--r--src/lib/libssl/src/crypto/evp/e_rc2.c8
-rw-r--r--src/lib/libssl/src/crypto/evp/e_rc4.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/e_rc5.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/e_xcbc_d.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/encode.c3
-rw-r--r--src/lib/libssl/src/crypto/evp/evp_enc.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/evp_key.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/evp_lib.c4
-rw-r--r--src/lib/libssl/src/crypto/evp/evp_pbe.c5
-rw-r--r--src/lib/libssl/src/crypto/evp/evp_pkey.c8
-rw-r--r--src/lib/libssl/src/crypto/evp/m_dss.c4
-rw-r--r--src/lib/libssl/src/crypto/evp/m_dss1.c5
-rw-r--r--src/lib/libssl/src/crypto/evp/m_ecdsa.c3
-rw-r--r--src/lib/libssl/src/crypto/evp/m_md4.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/m_md5.c8
-rw-r--r--src/lib/libssl/src/crypto/evp/m_mdc2.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/m_null.c4
-rw-r--r--src/lib/libssl/src/crypto/evp/m_ripemd.c8
-rw-r--r--src/lib/libssl/src/crypto/evp/m_sha.c6
-rw-r--r--src/lib/libssl/src/crypto/evp/m_sha1.c6
-rw-r--r--src/lib/libssl/src/crypto/evp/m_sigver.c6
-rw-r--r--src/lib/libssl/src/crypto/evp/m_wp.c5
-rw-r--r--src/lib/libssl/src/crypto/evp/names.c4
-rw-r--r--src/lib/libssl/src/crypto/evp/p5_crpt.c6
-rw-r--r--src/lib/libssl/src/crypto/evp/p5_crpt2.c8
-rw-r--r--src/lib/libssl/src/crypto/evp/p_dec.c11
-rw-r--r--src/lib/libssl/src/crypto/evp/p_enc.c11
-rw-r--r--src/lib/libssl/src/crypto/evp/p_lib.c16
-rw-r--r--src/lib/libssl/src/crypto/evp/p_open.c7
-rw-r--r--src/lib/libssl/src/crypto/evp/p_seal.c10
-rw-r--r--src/lib/libssl/src/crypto/evp/p_sign.c5
-rw-r--r--src/lib/libssl/src/crypto/evp/p_verify.c5
-rw-r--r--src/lib/libssl/src/crypto/evp/pmeth_fn.c8
-rw-r--r--src/lib/libssl/src/crypto/evp/pmeth_gn.c10
-rw-r--r--src/lib/libssl/src/crypto/evp/pmeth_lib.c7
-rw-r--r--src/lib/libssl/src/crypto/ex_data.c4
-rw-r--r--src/lib/libssl/src/crypto/hmac/hm_ameth.c4
-rw-r--r--src/lib/libssl/src/crypto/hmac/hm_pmeth.c8
-rw-r--r--src/lib/libssl/src/crypto/hmac/hmac.c5
-rw-r--r--src/lib/libssl/src/crypto/lhash/lh_stats.c6
-rw-r--r--src/lib/libssl/src/crypto/mdc2/mdc2_one.c5
-rw-r--r--src/lib/libssl/src/crypto/objects/obj_dat.c8
-rw-r--r--src/lib/libssl/src/crypto/objects/obj_lib.c6
-rw-r--r--src/lib/libssl/src/crypto/ocsp/ocsp_cl.c9
-rw-r--r--src/lib/libssl/src/crypto/ocsp/ocsp_ext.c5
-rw-r--r--src/lib/libssl/src/crypto/ocsp/ocsp_lib.c10
-rw-r--r--src/lib/libssl/src/crypto/ocsp/ocsp_srv.c9
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_all.c16
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_info.c15
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_lib.c13
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_oth.c9
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_pk8.c11
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_pkey.c11
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_seal.c7
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_sign.c9
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_x509.c8
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_xaux.c8
-rw-r--r--src/lib/libssl/src/crypto/pem/pvkfmt.c7
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_add.c5
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_asn.c4
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_attr.c4
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_crpt.c5
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_crt.c6
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_decr.c6
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_init.c5
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_key.c6
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_kiss.c5
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_mutl.c7
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_p8d.c4
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_p8e.c5
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_utl.c3
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/pk7_asn1.c4
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/pk7_doit.c7
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/pk7_lib.c6
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/pk7_mime.c8
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/pk7_smime.c5
-rw-r--r--src/lib/libssl/src/crypto/rand/rand_lib.c3
-rw-r--r--src/lib/libssl/src/crypto/rc4/rc4_locl.h4
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_ameth.c10
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_asn1.c6
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_crpt.c8
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_depr.c3
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_eay.c6
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_gen.c5
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_lib.c8
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_none.c6
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_oaep.c7
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_pk1.c4
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_pmeth.c10
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_prn.c7
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_pss.c6
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_saos.c6
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_sign.c7
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_ssl.c6
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_x931.c8
-rw-r--r--src/lib/libssl/src/crypto/sha/sha512.c6
-rw-r--r--src/lib/libssl/src/crypto/srp/srp_lib.c9
-rw-r--r--src/lib/libssl/src/crypto/srp/srp_vfy.c11
-rw-r--r--src/lib/libssl/src/crypto/stack/stack.c5
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_conf.c6
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_lib.c7
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_req_print.c8
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_req_utils.c7
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_rsp_print.c8
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_rsp_sign.c7
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_rsp_utils.c7
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_rsp_verify.c6
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_verify_ctx.c4
-rw-r--r--src/lib/libssl/src/crypto/txt_db/txt_db.c4
-rw-r--r--src/lib/libssl/src/crypto/ui/ui_lib.c7
-rw-r--r--src/lib/libssl/src/crypto/ui/ui_openssl.c13
-rw-r--r--src/lib/libssl/src/crypto/x509/by_dir.c9
-rw-r--r--src/lib/libssl/src/crypto/x509/by_file.c9
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_att.c9
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_cmp.c4
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_d2.c5
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_ext.c9
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_lu.c5
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_obj.c6
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_r2x.c11
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_req.c12
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_set.c6
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_trs.c6
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_txt.c11
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_v3.c9
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_vfy.c12
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_vpm.c5
-rw-r--r--src/lib/libssl/src/crypto/x509/x509cset.c6
-rw-r--r--src/lib/libssl/src/crypto/x509/x509name.c8
-rw-r--r--src/lib/libssl/src/crypto/x509/x509rset.c6
-rw-r--r--src/lib/libssl/src/crypto/x509/x509spki.c4
-rw-r--r--src/lib/libssl/src/crypto/x509/x509type.c4
-rw-r--r--src/lib/libssl/src/crypto/x509/x_all.c14
-rw-r--r--src/lib/libssl/src/crypto/x509v3/pcy_cache.c3
-rw-r--r--src/lib/libssl/src/crypto/x509v3/pcy_data.c3
-rw-r--r--src/lib/libssl/src/crypto/x509v3/pcy_lib.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/pcy_map.c3
-rw-r--r--src/lib/libssl/src/crypto/x509v3/pcy_tree.c3
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_addr.c5
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_akey.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_akeya.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_alt.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_asid.c7
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_bcons.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_bitst.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_conf.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_cpols.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_crld.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_enum.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_extku.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_genn.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_ia5.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_info.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_int.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_lib.c5
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_ncons.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_ocsp.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_pci.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_pcons.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_pku.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_pmaps.c5
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_prn.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_purp.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_skey.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_sxnet.c6
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_utl.c6
690 files changed, 2290 insertions, 2194 deletions
diff --git a/src/lib/libcrypto/aes/aes_ige.c b/src/lib/libcrypto/aes/aes_ige.c
index d5dc5967f4..a8dec0a361 100644
--- a/src/lib/libcrypto/aes/aes_ige.c
+++ b/src/lib/libcrypto/aes/aes_ige.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: aes_ige.c,v 1.5 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: aes_ige.c,v 1.6 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -49,9 +49,9 @@
49 * 49 *
50 */ 50 */
51 51
52#include "cryptlib.h"
53
54#include <openssl/aes.h> 52#include <openssl/aes.h>
53#include <openssl/crypto.h>
54
55#include "aes_locl.h" 55#include "aes_locl.h"
56 56
57#define N_WORDS (AES_BLOCK_SIZE / sizeof(unsigned long)) 57#define N_WORDS (AES_BLOCK_SIZE / sizeof(unsigned long))
diff --git a/src/lib/libcrypto/aes/aes_wrap.c b/src/lib/libcrypto/aes/aes_wrap.c
index 6578bbb6fd..4479473e6b 100644
--- a/src/lib/libcrypto/aes/aes_wrap.c
+++ b/src/lib/libcrypto/aes/aes_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: aes_wrap.c,v 1.8 2014/07/10 13:58:21 jsing Exp $ */ 1/* $OpenBSD: aes_wrap.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. 3 * project.
4 */ 4 */
@@ -53,7 +53,6 @@
53 53
54#include <string.h> 54#include <string.h>
55 55
56#include "cryptlib.h"
57#include <openssl/aes.h> 56#include <openssl/aes.h>
58#include <openssl/bio.h> 57#include <openssl/bio.h>
59 58
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
diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c
index 62a6c269ac..91979bd755 100644
--- a/src/lib/libcrypto/bio/b_dump.c
+++ b/src/lib/libcrypto/bio/b_dump.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: b_dump.c,v 1.18 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: b_dump.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 *
@@ -65,8 +65,6 @@
65 65
66#include <openssl/bio.h> 66#include <openssl/bio.h>
67 67
68#include "cryptlib.h"
69
70#define TRUNCATE 68#define TRUNCATE
71#define DUMP_WIDTH 16 69#define DUMP_WIDTH 16
72#define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH - ((i - (i > 6 ? 6 : i) + 3) / 4)) 70#define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH - ((i - (i > 6 ? 6 : i) + 3) / 4))
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c
index bbae2a31b9..8c37a3e175 100644
--- a/src/lib/libcrypto/bio/b_sock.c
+++ b/src/lib/libcrypto/bio/b_sock.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: b_sock.c,v 1.53 2014/07/10 21:57:40 miod Exp $ */ 1/* $OpenBSD: b_sock.c,v 1.54 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 *
@@ -72,8 +72,8 @@
72#include <unistd.h> 72#include <unistd.h>
73 73
74#include <openssl/bio.h> 74#include <openssl/bio.h>
75 75#include <openssl/buffer.h>
76#include "cryptlib.h" 76#include <openssl/err.h>
77 77
78int 78int
79BIO_get_host_ip(const char *str, unsigned char *ip) 79BIO_get_host_ip(const char *str, unsigned char *ip)
diff --git a/src/lib/libcrypto/bio/bf_buff.c b/src/lib/libcrypto/bio/bf_buff.c
index ea55e490be..ab47ae4627 100644
--- a/src/lib/libcrypto/bio/bf_buff.c
+++ b/src/lib/libcrypto/bio/bf_buff.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_buff.c,v 1.20 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bf_buff.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,8 +60,8 @@
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/bio.h> 63#include <openssl/bio.h>
64#include <openssl/err.h>
65 65
66static int buffer_write(BIO *h, const char *buf, int num); 66static int buffer_write(BIO *h, const char *buf, int num);
67static int buffer_read(BIO *h, char *buf, int size); 67static int buffer_read(BIO *h, char *buf, int size);
diff --git a/src/lib/libcrypto/bio/bf_lbuf.c b/src/lib/libcrypto/bio/bf_lbuf.c
index 8c2b6e6d4d..e90b7f239f 100644
--- a/src/lib/libcrypto/bio/bf_lbuf.c
+++ b/src/lib/libcrypto/bio/bf_lbuf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_lbuf.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bf_lbuf.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 *
@@ -56,9 +56,9 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <errno.h> 59#include <errno.h>
61#include "cryptlib.h" 60#include <stdio.h>
61
62#include <openssl/bio.h> 62#include <openssl/bio.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
diff --git a/src/lib/libcrypto/bio/bf_nbio.c b/src/lib/libcrypto/bio/bf_nbio.c
index e2480e7489..86a13a8bc8 100644
--- a/src/lib/libcrypto/bio/bf_nbio.c
+++ b/src/lib/libcrypto/bio/bf_nbio.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_nbio.c,v 1.16 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bf_nbio.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 *
@@ -56,11 +56,11 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <errno.h> 59#include <errno.h>
61#include "cryptlib.h" 60#include <stdio.h>
62#include <openssl/rand.h> 61
63#include <openssl/bio.h> 62#include <openssl/bio.h>
63#include <openssl/rand.h>
64 64
65/* BIO_put and BIO_get both add to the digest, 65/* BIO_put and BIO_get both add to the digest,
66 * BIO_gets returns the digest */ 66 * BIO_gets returns the digest */
diff --git a/src/lib/libcrypto/bio/bf_null.c b/src/lib/libcrypto/bio/bf_null.c
index 1ef2fbe0f9..09d54b6b21 100644
--- a/src/lib/libcrypto/bio/bf_null.c
+++ b/src/lib/libcrypto/bio/bf_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_null.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bf_null.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 *
@@ -56,9 +56,9 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <errno.h> 59#include <errno.h>
61#include "cryptlib.h" 60#include <stdio.h>
61
62#include <openssl/bio.h> 62#include <openssl/bio.h>
63 63
64/* BIO_put and BIO_get both add to the digest, 64/* BIO_put and BIO_get both add to the digest,
diff --git a/src/lib/libcrypto/bio/bio_cb.c b/src/lib/libcrypto/bio/bio_cb.c
index 5701b53d05..7d1f025452 100644
--- a/src/lib/libcrypto/bio/bio_cb.c
+++ b/src/lib/libcrypto/bio/bio_cb.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_cb.c,v 1.14 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bio_cb.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,11 +57,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h>
61#include <stdlib.h> 60#include <stdlib.h>
62#include "cryptlib.h" 61#include <string.h>
63#include <openssl/bio.h> 62
64#include <openssl/err.h> 63#include <openssl/err.h>
64#include <openssl/bio.h>
65 65
66long 66long
67BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, 67BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl,
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c
index 876a357bef..41b3d31678 100644
--- a/src/lib/libcrypto/bio/bio_lib.c
+++ b/src/lib/libcrypto/bio/bio_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_lib.c,v 1.18 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bio_lib.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 *
@@ -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 <errno.h> 59#include <errno.h>
61#include <openssl/crypto.h> 60#include <stdio.h>
62#include "cryptlib.h" 61
63#include <openssl/bio.h> 62#include <openssl/bio.h>
63#include <openssl/crypto.h>
64#include <openssl/err.h>
64#include <openssl/stack.h> 65#include <openssl/stack.h>
65 66
66BIO * 67BIO *
diff --git a/src/lib/libcrypto/bio/bss_acpt.c b/src/lib/libcrypto/bio/bss_acpt.c
index 580c52da6c..c0316a2999 100644
--- a/src/lib/libcrypto/bio/bss_acpt.c
+++ b/src/lib/libcrypto/bio/bss_acpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_acpt.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_acpt.c,v 1.23 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 *
@@ -63,8 +63,9 @@
63#include <string.h> 63#include <string.h>
64#include <unistd.h> 64#include <unistd.h>
65 65
66#include "cryptlib.h"
67#include <openssl/bio.h> 66#include <openssl/bio.h>
67#include <openssl/buffer.h>
68#include <openssl/err.h>
68 69
69#define SOCKET_PROTOCOL IPPROTO_TCP 70#define SOCKET_PROTOCOL IPPROTO_TCP
70 71
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c
index d5763a0ce3..8049f5c3f0 100644
--- a/src/lib/libcrypto/bio/bss_conn.c
+++ b/src/lib/libcrypto/bio/bss_conn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_conn.c,v 1.28 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_conn.c,v 1.29 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 *
@@ -66,8 +66,9 @@
66#include <string.h> 66#include <string.h>
67#include <unistd.h> 67#include <unistd.h>
68 68
69#include "cryptlib.h"
70#include <openssl/bio.h> 69#include <openssl/bio.h>
70#include <openssl/buffer.h>
71#include <openssl/err.h>
71 72
72#define SOCKET_PROTOCOL IPPROTO_TCP 73#define SOCKET_PROTOCOL IPPROTO_TCP
73 74
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c
index d56b71ba27..caa8480657 100644
--- a/src/lib/libcrypto/bio/bss_dgram.c
+++ b/src/lib/libcrypto/bio/bss_dgram.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_dgram.c,v 1.30 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bss_dgram.c,v 1.31 2014/07/11 08:44:47 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -69,7 +69,6 @@
69 69
70#include <openssl/opensslconf.h> 70#include <openssl/opensslconf.h>
71 71
72#include "cryptlib.h"
73#include <openssl/bio.h> 72#include <openssl/bio.h>
74 73
75#ifndef OPENSSL_NO_DGRAM 74#ifndef OPENSSL_NO_DGRAM
diff --git a/src/lib/libcrypto/bio/bss_fd.c b/src/lib/libcrypto/bio/bss_fd.c
index 6e8e8d0815..71abb4744a 100644
--- a/src/lib/libcrypto/bio/bss_fd.c
+++ b/src/lib/libcrypto/bio/bss_fd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_fd.c,v 1.16 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bss_fd.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 *
@@ -63,8 +63,6 @@
63 63
64#include <openssl/opensslconf.h> 64#include <openssl/opensslconf.h>
65 65
66#include "cryptlib.h"
67
68#if defined(OPENSSL_NO_POSIX_IO) 66#if defined(OPENSSL_NO_POSIX_IO)
69/* 67/*
70 * One can argue that one should implement dummy placeholder for 68 * One can argue that one should implement dummy placeholder for
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c
index 44345f3c70..4fa3fb6062 100644
--- a/src/lib/libcrypto/bio/bss_file.c
+++ b/src/lib/libcrypto/bio/bss_file.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_file.c,v 1.29 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_file.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 *
@@ -87,7 +87,6 @@
87#include <stdio.h> 87#include <stdio.h>
88#include <string.h> 88#include <string.h>
89 89
90#include "cryptlib.h"
91#include <openssl/bio.h> 90#include <openssl/bio.h>
92#include <openssl/err.h> 91#include <openssl/err.h>
93 92
diff --git a/src/lib/libcrypto/bio/bss_log.c b/src/lib/libcrypto/bio/bss_log.c
index 63361ce22f..fcaa985aa0 100644
--- a/src/lib/libcrypto/bio/bss_log.c
+++ b/src/lib/libcrypto/bio/bss_log.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_log.c,v 1.20 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_log.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 *
@@ -67,8 +67,6 @@
67#include <string.h> 67#include <string.h>
68#include <syslog.h> 68#include <syslog.h>
69 69
70#include "cryptlib.h"
71
72#include <openssl/buffer.h> 70#include <openssl/buffer.h>
73#include <openssl/err.h> 71#include <openssl/err.h>
74 72
diff --git a/src/lib/libcrypto/bio/bss_mem.c b/src/lib/libcrypto/bio/bss_mem.c
index 849a2d05ce..8310f8cf4d 100644
--- a/src/lib/libcrypto/bio/bss_mem.c
+++ b/src/lib/libcrypto/bio/bss_mem.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_mem.c,v 1.12 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_mem.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 *
@@ -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/bio.h> 63#include <openssl/bio.h>
64#include <openssl/err.h>
65#include <openssl/buffer.h>
65 66
66static int mem_write(BIO *h, const char *buf, int num); 67static int mem_write(BIO *h, const char *buf, int num);
67static int mem_read(BIO *h, char *buf, int size); 68static int mem_read(BIO *h, char *buf, int size);
diff --git a/src/lib/libcrypto/bio/bss_null.c b/src/lib/libcrypto/bio/bss_null.c
index 226076e13a..42ee626b13 100644
--- a/src/lib/libcrypto/bio/bss_null.c
+++ b/src/lib/libcrypto/bio/bss_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_null.c,v 1.9 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_null.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,7 +60,6 @@
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/bio.h> 63#include <openssl/bio.h>
65 64
66static int null_write(BIO *h, const char *buf, int num); 65static int null_write(BIO *h, const char *buf, int num);
diff --git a/src/lib/libcrypto/bio/bss_sock.c b/src/lib/libcrypto/bio/bss_sock.c
index ced988f97a..dd470eb65e 100644
--- a/src/lib/libcrypto/bio/bss_sock.c
+++ b/src/lib/libcrypto/bio/bss_sock.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_sock.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_sock.c,v 1.23 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 *
@@ -63,8 +63,6 @@
63#include <string.h> 63#include <string.h>
64#include <unistd.h> 64#include <unistd.h>
65 65
66#include "cryptlib.h"
67
68#include <openssl/bio.h> 66#include <openssl/bio.h>
69 67
70static int sock_write(BIO *h, const char *buf, int num); 68static int sock_write(BIO *h, const char *buf, int num);
diff --git a/src/lib/libcrypto/bn/bn_add.c b/src/lib/libcrypto/bn/bn_add.c
index d551741ed8..5b2e2495b8 100644
--- a/src/lib/libcrypto/bn/bn_add.c
+++ b/src/lib/libcrypto/bn/bn_add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_add.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_add.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,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63/* r can == a or b */ 65/* r can == a or b */
diff --git a/src/lib/libcrypto/bn/bn_asm.c b/src/lib/libcrypto/bn/bn_asm.c
index 01e03cc81f..c6efd2513a 100644
--- a/src/lib/libcrypto/bn/bn_asm.c
+++ b/src/lib/libcrypto/bn/bn_asm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_asm.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_asm.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 *
@@ -66,7 +66,6 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h"
70#include "bn_lcl.h" 69#include "bn_lcl.h"
71 70
72#if defined(BN_LLONG) || defined(BN_UMULT_HIGH) 71#if defined(BN_LLONG) || defined(BN_UMULT_HIGH)
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c
index 2170181aae..5f559da067 100644
--- a/src/lib/libcrypto/bn/bn_blind.c
+++ b/src/lib/libcrypto/bn/bn_blind.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_blind.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_blind.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -113,7 +113,8 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h" 116#include <openssl/err.h>
117
117#include "bn_lcl.h" 118#include "bn_lcl.h"
118 119
119#define BN_BLINDING_COUNTER 32 120#define BN_BLINDING_COUNTER 32
diff --git a/src/lib/libcrypto/bn/bn_ctx.c b/src/lib/libcrypto/bn/bn_ctx.c
index d3384a0385..0bd523c2d4 100644
--- a/src/lib/libcrypto/bn/bn_ctx.c
+++ b/src/lib/libcrypto/bn/bn_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_ctx.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_ctx.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */
2/* Written by Ulf Moeller for the OpenSSL project. */ 2/* Written by Ulf Moeller for the OpenSSL project. */
3/* ==================================================================== 3/* ====================================================================
4 * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. 4 * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved.
@@ -66,7 +66,8 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h" 69#include <openssl/err.h>
70
70#include "bn_lcl.h" 71#include "bn_lcl.h"
71 72
72/* TODO list 73/* TODO list
diff --git a/src/lib/libcrypto/bn/bn_depr.c b/src/lib/libcrypto/bn/bn_depr.c
index 93af852aa5..68f8f822e3 100644
--- a/src/lib/libcrypto/bn/bn_depr.c
+++ b/src/lib/libcrypto/bn/bn_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_depr.c,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_depr.c,v 1.6 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -61,10 +61,10 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include "bn_lcl.h"
66#include <openssl/rand.h> 64#include <openssl/rand.h>
67 65
66#include "bn_lcl.h"
67
68#ifndef OPENSSL_NO_DEPRECATED 68#ifndef OPENSSL_NO_DEPRECATED
69BIGNUM * 69BIGNUM *
70BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add, 70BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c
index 40a3c1551d..f4deccf77f 100644
--- a/src/lib/libcrypto/bn/bn_div.c
+++ b/src/lib/libcrypto/bn/bn_div.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_div.c,v 1.21 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_div.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 *
@@ -57,11 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/bn.h>
61 60
62#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
63 62
64#include "cryptlib.h" 63#include <openssl/bn.h>
64#include <openssl/err.h>
65
65#include "bn_lcl.h" 66#include "bn_lcl.h"
66 67
67#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \ 68#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index d88f8b2a82..09e32396fb 100644
--- a/src/lib/libcrypto/bn/bn_exp.c
+++ b/src/lib/libcrypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_exp.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 *
@@ -112,7 +112,8 @@
112#include <stdlib.h> 112#include <stdlib.h>
113#include <string.h> 113#include <string.h>
114 114
115#include "cryptlib.h" 115#include <openssl/err.h>
116
116#include "bn_lcl.h" 117#include "bn_lcl.h"
117 118
118/* maximum precomputation table size for *variable* sliding windows */ 119/* maximum precomputation table size for *variable* sliding windows */
diff --git a/src/lib/libcrypto/bn/bn_exp2.c b/src/lib/libcrypto/bn/bn_exp2.c
index c9cced8128..c8f0294f7a 100644
--- a/src/lib/libcrypto/bn/bn_exp2.c
+++ b/src/lib/libcrypto/bn/bn_exp2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp2.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_exp2.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 *
@@ -110,7 +110,9 @@
110 */ 110 */
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include "cryptlib.h" 113
114#include <openssl/err.h>
115
114#include "bn_lcl.h" 116#include "bn_lcl.h"
115 117
116#define TABLE_SIZE 32 118#define TABLE_SIZE 32
diff --git a/src/lib/libcrypto/bn/bn_gcd.c b/src/lib/libcrypto/bn/bn_gcd.c
index 8728f4f921..379bea99ad 100644
--- a/src/lib/libcrypto/bn/bn_gcd.c
+++ b/src/lib/libcrypto/bn/bn_gcd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_gcd.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_gcd.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 *
@@ -109,7 +109,8 @@
109 * 109 *
110 */ 110 */
111 111
112#include "cryptlib.h" 112#include <openssl/err.h>
113
113#include "bn_lcl.h" 114#include "bn_lcl.h"
114 115
115static BIGNUM *euclid(BIGNUM *a, BIGNUM *b); 116static BIGNUM *euclid(BIGNUM *a, BIGNUM *b);
diff --git a/src/lib/libcrypto/bn/bn_gf2m.c b/src/lib/libcrypto/bn/bn_gf2m.c
index 09d4bcc544..d87f80d577 100644
--- a/src/lib/libcrypto/bn/bn_gf2m.c
+++ b/src/lib/libcrypto/bn/bn_gf2m.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_gf2m.c,v 1.14 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_gf2m.c,v 1.15 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -94,7 +94,8 @@
94 94
95#include <openssl/opensslconf.h> 95#include <openssl/opensslconf.h>
96 96
97#include "cryptlib.h" 97#include <openssl/err.h>
98
98#include "bn_lcl.h" 99#include "bn_lcl.h"
99 100
100#ifndef OPENSSL_NO_EC2M 101#ifndef OPENSSL_NO_EC2M
diff --git a/src/lib/libcrypto/bn/bn_kron.c b/src/lib/libcrypto/bn/bn_kron.c
index 632a018a70..699cda55f0 100644
--- a/src/lib/libcrypto/bn/bn_kron.c
+++ b/src/lib/libcrypto/bn/bn_kron.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_kron.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_kron.c,v 1.5 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -53,7 +53,6 @@
53 * 53 *
54 */ 54 */
55 55
56#include "cryptlib.h"
57#include "bn_lcl.h" 56#include "bn_lcl.h"
58 57
59/* least significant word */ 58/* least significant word */
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 747cbb68a5..4ee9b2bbde 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.31 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.32 2014/07/11 08:44:48 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 *
@@ -68,7 +68,8 @@
68 68
69#include <openssl/opensslconf.h> 69#include <openssl/opensslconf.h>
70 70
71#include "cryptlib.h" 71#include <openssl/err.h>
72
72#include "bn_lcl.h" 73#include "bn_lcl.h"
73 74
74/* This stuff appears to be completely unused, so is deprecated */ 75/* This stuff appears to be completely unused, so is deprecated */
diff --git a/src/lib/libcrypto/bn/bn_mod.c b/src/lib/libcrypto/bn/bn_mod.c
index 9bd1f1ca1d..a503ff3b1b 100644
--- a/src/lib/libcrypto/bn/bn_mod.c
+++ b/src/lib/libcrypto/bn/bn_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mod.c,v 1.7 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_mod.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. */ 3 * for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -111,7 +111,8 @@
111 * [including the GNU Public Licence.] 111 * [including the GNU Public Licence.]
112 */ 112 */
113 113
114#include "cryptlib.h" 114#include <openssl/err.h>
115
115#include "bn_lcl.h" 116#include "bn_lcl.h"
116 117
117int 118int
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 32d9e3836a..5803ca493d 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.23 2014/07/11 08:44:48 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 *
@@ -119,7 +119,6 @@
119#include <stdio.h> 119#include <stdio.h>
120#include <stdint.h> 120#include <stdint.h>
121 121
122#include "cryptlib.h"
123#include "bn_lcl.h" 122#include "bn_lcl.h"
124 123
125#define MONT_WORD /* use the faster word-based algorithm */ 124#define MONT_WORD /* use the faster word-based algorithm */
diff --git a/src/lib/libcrypto/bn/bn_mpi.c b/src/lib/libcrypto/bn/bn_mpi.c
index a0824112a1..cf4c7d8d24 100644
--- a/src/lib/libcrypto/bn/bn_mpi.c
+++ b/src/lib/libcrypto/bn/bn_mpi.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mpi.c,v 1.6 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_mpi.c,v 1.7 2014/07/11 08:44:48 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,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63int 65int
diff --git a/src/lib/libcrypto/bn/bn_mul.c b/src/lib/libcrypto/bn/bn_mul.c
index 71bfe2d9ec..daba02d6ca 100644
--- a/src/lib/libcrypto/bn/bn_mul.c
+++ b/src/lib/libcrypto/bn/bn_mul.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mul.c,v 1.18 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_mul.c,v 1.19 2014/07/11 08:44:48 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 *
@@ -67,7 +67,6 @@
67 67
68#include <openssl/opensslconf.h> 68#include <openssl/opensslconf.h>
69 69
70#include "cryptlib.h"
71#include "bn_lcl.h" 70#include "bn_lcl.h"
72 71
73#if defined(OPENSSL_NO_ASM) || !defined(OPENSSL_BN_ASM_PART_WORDS) 72#if defined(OPENSSL_NO_ASM) || !defined(OPENSSL_BN_ASM_PART_WORDS)
diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c
index dd47ffb8be..53ed559c06 100644
--- a/src/lib/libcrypto/bn/bn_nist.c
+++ b/src/lib/libcrypto/bn/bn_nist.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_nist.c,v 1.13 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_nist.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -56,12 +56,11 @@
56 * 56 *
57 */ 57 */
58 58
59#include <machine/endian.h>
60
59#include <stdint.h> 61#include <stdint.h>
60 62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62#include "cryptlib.h"
63
64#include <machine/endian.h>
65 64
66#define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2 65#define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2
67#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2 66#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
diff --git a/src/lib/libcrypto/bn/bn_prime.c b/src/lib/libcrypto/bn/bn_prime.c
index 78c3fcd74f..db786a63ef 100644
--- a/src/lib/libcrypto/bn/bn_prime.c
+++ b/src/lib/libcrypto/bn/bn_prime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_prime.c,v 1.9 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_prime.c,v 1.10 2014/07/11 08:44:48 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 *
@@ -111,10 +111,11 @@
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include <time.h> 113#include <time.h>
114#include "cryptlib.h" 114
115#include "bn_lcl.h"
116#include <openssl/rand.h> 115#include <openssl/rand.h>
117 116
117#include "bn_lcl.h"
118
118/* NB: these functions have been "upgraded", the deprecated versions (which are 119/* NB: these functions have been "upgraded", the deprecated versions (which are
119 * compatibility wrappers using these functions) are in bn_depr.c. 120 * compatibility wrappers using these functions) are in bn_depr.c.
120 * - Geoff 121 * - Geoff
diff --git a/src/lib/libcrypto/bn/bn_print.c b/src/lib/libcrypto/bn/bn_print.c
index db51887fbe..ccdae5ae09 100644
--- a/src/lib/libcrypto/bn/bn_print.c
+++ b/src/lib/libcrypto/bn/bn_print.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_print.c,v 1.21 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_print.c,v 1.22 2014/07/11 08:44:48 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,9 +61,10 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include <openssl/bio.h>
64#include <openssl/buffer.h> 65#include <openssl/buffer.h>
66#include <openssl/err.h>
65 67
66#include "cryptlib.h"
67#include "bn_lcl.h" 68#include "bn_lcl.h"
68 69
69static const char Hex[]="0123456789ABCDEF"; 70static const char Hex[]="0123456789ABCDEF";
diff --git a/src/lib/libcrypto/bn/bn_rand.c b/src/lib/libcrypto/bn/bn_rand.c
index cbb1984a2e..acb17882ef 100644
--- a/src/lib/libcrypto/bn/bn_rand.c
+++ b/src/lib/libcrypto/bn/bn_rand.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_rand.c,v 1.14 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_rand.c,v 1.15 2014/07/11 08:44:48 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 *
@@ -111,10 +111,12 @@
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include <time.h> 113#include <time.h>
114#include "cryptlib.h" 114
115#include "bn_lcl.h" 115#include <openssl/err.h>
116#include <openssl/rand.h> 116#include <openssl/rand.h>
117 117
118#include "bn_lcl.h"
119
118static int 120static int
119bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) 121bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
120{ 122{
diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c
index 50dd65dd38..b90c5421f1 100644
--- a/src/lib/libcrypto/bn/bn_recp.c
+++ b/src/lib/libcrypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.11 2014/07/11 08:44:48 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,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63void 65void
diff --git a/src/lib/libcrypto/bn/bn_shift.c b/src/lib/libcrypto/bn/bn_shift.c
index 70bb92cd81..771ddff7b0 100644
--- a/src/lib/libcrypto/bn/bn_shift.c
+++ b/src/lib/libcrypto/bn/bn_shift.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_shift.c,v 1.11 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_shift.c,v 1.12 2014/07/11 08:44:48 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,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 "bn_lcl.h" 62#include "bn_lcl.h"
64 63
65int 64int
diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c
index 7c54082085..d4a9f46040 100644
--- a/src/lib/libcrypto/bn/bn_sqr.c
+++ b/src/lib/libcrypto/bn/bn_sqr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqr.c,v 1.9 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_sqr.c,v 1.10 2014/07/11 08:44:48 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,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 "bn_lcl.h" 62#include "bn_lcl.h"
64 63
65/* r must not be a */ 64/* r must not be a */
diff --git a/src/lib/libcrypto/bn/bn_sqrt.c b/src/lib/libcrypto/bn/bn_sqrt.c
index 4bb84edce1..9a59d56b3f 100644
--- a/src/lib/libcrypto/bn/bn_sqrt.c
+++ b/src/lib/libcrypto/bn/bn_sqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqrt.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_sqrt.c,v 1.5 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * and Bodo Moeller for the OpenSSL project. */ 3 * and Bodo Moeller for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -55,9 +55,9 @@
55 * 55 *
56 */ 56 */
57 57
58#include "cryptlib.h" 58#include <openssl/err.h>
59#include "bn_lcl.h"
60 59
60#include "bn_lcl.h"
61 61
62BIGNUM * 62BIGNUM *
63BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 63BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
diff --git a/src/lib/libcrypto/bn/bn_word.c b/src/lib/libcrypto/bn/bn_word.c
index 8f50d6d573..c4c6754c37 100644
--- a/src/lib/libcrypto/bn/bn_word.c
+++ b/src/lib/libcrypto/bn/bn_word.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_word.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_word.c,v 1.12 2014/07/11 08:44:48 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 "bn_lcl.h" 61#include "bn_lcl.h"
62 62
63BN_ULONG 63BN_ULONG
diff --git a/src/lib/libcrypto/buffer/buf_str.c b/src/lib/libcrypto/buffer/buf_str.c
index 33836d0af4..f7e4c0b966 100644
--- a/src/lib/libcrypto/buffer/buf_str.c
+++ b/src/lib/libcrypto/buffer/buf_str.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: buf_str.c,v 1.8 2014/04/26 13:07:16 jsing Exp $ */ 1/* $OpenBSD: buf_str.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Bob Beck 3 * Copyright (c) 2014 Bob Beck
4 * 4 *
@@ -18,8 +18,9 @@
18#include <stdlib.h> 18#include <stdlib.h>
19#include <stdio.h> 19#include <stdio.h>
20#include <string.h> 20#include <string.h>
21#include "cryptlib.h" 21
22#include <openssl/buffer.h> 22#include <openssl/buffer.h>
23#include <openssl/err.h>
23 24
24/* 25/*
25 * XXX these functions accept a NULL arg and return NULL 26 * XXX these functions accept a NULL arg and return NULL
diff --git a/src/lib/libcrypto/buffer/buffer.c b/src/lib/libcrypto/buffer/buffer.c
index af32cbf50b..ac3729d52b 100644
--- a/src/lib/libcrypto/buffer/buffer.c
+++ b/src/lib/libcrypto/buffer/buffer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: buffer.c,v 1.20 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: buffer.c,v 1.21 2014/07/11 08:44:48 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,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h>
60#include <string.h> 61#include <string.h>
61 62
62#include "cryptlib.h"
63#include <openssl/buffer.h> 63#include <openssl/buffer.h>
64#include <openssl/err.h>
64 65
65/* LIMIT_BEFORE_EXPANSION is the maximum n such that (n+3)/3*4 < 2**31. That 66/* LIMIT_BEFORE_EXPANSION is the maximum n such that (n+3)/3*4 < 2**31. That
66 * function is applied in several functions in this file and this limit ensures 67 * function is applied in several functions in this file and this limit ensures
diff --git a/src/lib/libcrypto/cmac/cm_ameth.c b/src/lib/libcrypto/cmac/cm_ameth.c
index 763d161cfe..39d8ad3aa8 100644
--- a/src/lib/libcrypto/cmac/cm_ameth.c
+++ b/src/lib/libcrypto/cmac/cm_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cm_ameth.c,v 1.5 2014/06/21 13:42:14 jsing Exp $ */ 1/* $OpenBSD: cm_ameth.c,v 1.6 2014/07/11 08:44:48 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 2010. 3 * project 2010.
4 */ 4 */
@@ -52,9 +52,10 @@
52 */ 52 */
53 53
54#include <stdio.h> 54#include <stdio.h>
55#include "cryptlib.h" 55
56#include <openssl/evp.h>
57#include <openssl/cmac.h> 56#include <openssl/cmac.h>
57#include <openssl/evp.h>
58
58#include "asn1_locl.h" 59#include "asn1_locl.h"
59 60
60/* CMAC "ASN1" method. This is just here to indicate the 61/* CMAC "ASN1" method. This is just here to indicate the
diff --git a/src/lib/libcrypto/cmac/cm_pmeth.c b/src/lib/libcrypto/cmac/cm_pmeth.c
index 6aba656f18..d9059ca4a8 100644
--- a/src/lib/libcrypto/cmac/cm_pmeth.c
+++ b/src/lib/libcrypto/cmac/cm_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cm_pmeth.c,v 1.7 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: cm_pmeth.c,v 1.8 2014/07/11 08:44:48 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 2010. 3 * project 2010.
4 */ 4 */
@@ -54,11 +54,11 @@
54#include <stdio.h> 54#include <stdio.h>
55#include <string.h> 55#include <string.h>
56 56
57#include "cryptlib.h" 57#include <openssl/cmac.h>
58#include <openssl/evp.h>
58#include <openssl/x509.h> 59#include <openssl/x509.h>
59#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
60#include <openssl/evp.h> 61
61#include <openssl/cmac.h>
62#include "evp_locl.h" 62#include "evp_locl.h"
63 63
64/* The context structure and "key" is simply a CMAC_CTX */ 64/* The context structure and "key" is simply a CMAC_CTX */
diff --git a/src/lib/libcrypto/cmac/cmac.c b/src/lib/libcrypto/cmac/cmac.c
index b717f786f1..baba674ec1 100644
--- a/src/lib/libcrypto/cmac/cmac.c
+++ b/src/lib/libcrypto/cmac/cmac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cmac.c,v 1.7 2014/06/21 13:42:14 jsing Exp $ */ 1/* $OpenBSD: cmac.c,v 1.8 2014/07/11 08:44:48 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 */
@@ -54,7 +54,7 @@
54#include <stdio.h> 54#include <stdio.h>
55#include <stdlib.h> 55#include <stdlib.h>
56#include <string.h> 56#include <string.h>
57#include "cryptlib.h" 57
58#include <openssl/cmac.h> 58#include <openssl/cmac.h>
59 59
60struct CMAC_CTX_st { 60struct CMAC_CTX_st {
diff --git a/src/lib/libcrypto/cms/cms_cd.c b/src/lib/libcrypto/cms/cms_cd.c
index 2a67c5df30..bcf1506916 100644
--- a/src/lib/libcrypto/cms/cms_cd.c
+++ b/src/lib/libcrypto/cms/cms_cd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_cd.c,v 1.4 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: cms_cd.c,v 1.5 2014/07/11 08:44:48 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 */
@@ -53,16 +53,17 @@
53 53
54#include <openssl/opensslconf.h> 54#include <openssl/opensslconf.h>
55 55
56#include "cryptlib.h"
57#include <openssl/asn1t.h> 56#include <openssl/asn1t.h>
57#include <openssl/bio.h>
58#include <openssl/cms.h>
59#include <openssl/err.h>
58#include <openssl/pem.h> 60#include <openssl/pem.h>
59#include <openssl/x509v3.h> 61#include <openssl/x509v3.h>
60#include <openssl/err.h> 62
61#include <openssl/cms.h>
62#include <openssl/bio.h>
63#ifndef OPENSSL_NO_COMP 63#ifndef OPENSSL_NO_COMP
64#include <openssl/comp.h> 64#include <openssl/comp.h>
65#endif 65#endif
66
66#include "cms_lcl.h" 67#include "cms_lcl.h"
67 68
68DECLARE_ASN1_ITEM(CMS_CompressedData) 69DECLARE_ASN1_ITEM(CMS_CompressedData)
diff --git a/src/lib/libcrypto/cms/cms_dd.c b/src/lib/libcrypto/cms/cms_dd.c
index 7b1fff889a..eee25f5f07 100644
--- a/src/lib/libcrypto/cms/cms_dd.c
+++ b/src/lib/libcrypto/cms/cms_dd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_dd.c,v 1.3 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_dd.c,v 1.4 2014/07/11 08:44:48 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 */
@@ -51,12 +51,12 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
55#include <openssl/cms.h>
56#include <openssl/err.h>
56#include <openssl/pem.h> 57#include <openssl/pem.h>
57#include <openssl/x509v3.h> 58#include <openssl/x509v3.h>
58#include <openssl/err.h> 59
59#include <openssl/cms.h>
60#include "cms_lcl.h" 60#include "cms_lcl.h"
61 61
62DECLARE_ASN1_ITEM(CMS_DigestedData) 62DECLARE_ASN1_ITEM(CMS_DigestedData)
diff --git a/src/lib/libcrypto/cms/cms_enc.c b/src/lib/libcrypto/cms/cms_enc.c
index faa1b14d4b..efe19a3131 100644
--- a/src/lib/libcrypto/cms/cms_enc.c
+++ b/src/lib/libcrypto/cms/cms_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_enc.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_enc.c,v 1.5 2014/07/11 08:44:48 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 */
@@ -51,13 +51,13 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
56#include <openssl/pem.h>
57#include <openssl/x509v3.h>
58#include <openssl/err.h>
59#include <openssl/cms.h> 55#include <openssl/cms.h>
56#include <openssl/err.h>
57#include <openssl/pem.h>
60#include <openssl/rand.h> 58#include <openssl/rand.h>
59#include <openssl/x509v3.h>
60
61#include "cms_lcl.h" 61#include "cms_lcl.h"
62 62
63/* CMS EncryptedData Utilities */ 63/* CMS EncryptedData Utilities */
diff --git a/src/lib/libcrypto/cms/cms_env.c b/src/lib/libcrypto/cms/cms_env.c
index 2dd4e2faba..66ec1a9343 100644
--- a/src/lib/libcrypto/cms/cms_env.c
+++ b/src/lib/libcrypto/cms/cms_env.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_env.c,v 1.5 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_env.c,v 1.6 2014/07/11 08:44:48 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 */
@@ -51,14 +51,14 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h" 54#include <openssl/aes.h>
55#include <openssl/asn1t.h> 55#include <openssl/asn1t.h>
56#include <openssl/pem.h>
57#include <openssl/x509v3.h>
58#include <openssl/err.h>
59#include <openssl/cms.h> 56#include <openssl/cms.h>
57#include <openssl/err.h>
58#include <openssl/pem.h>
60#include <openssl/rand.h> 59#include <openssl/rand.h>
61#include <openssl/aes.h> 60#include <openssl/x509v3.h>
61
62#include "cms_lcl.h" 62#include "cms_lcl.h"
63#include "asn1_locl.h" 63#include "asn1_locl.h"
64 64
diff --git a/src/lib/libcrypto/cms/cms_ess.c b/src/lib/libcrypto/cms/cms_ess.c
index f972ff3ee3..e3b7e7da4c 100644
--- a/src/lib/libcrypto/cms/cms_ess.c
+++ b/src/lib/libcrypto/cms/cms_ess.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_ess.c,v 1.5 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_ess.c,v 1.6 2014/07/11 08:44:48 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 */
@@ -51,13 +51,13 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
55#include <openssl/cms.h>
56#include <openssl/err.h>
56#include <openssl/pem.h> 57#include <openssl/pem.h>
57#include <openssl/rand.h> 58#include <openssl/rand.h>
58#include <openssl/x509v3.h> 59#include <openssl/x509v3.h>
59#include <openssl/err.h> 60
60#include <openssl/cms.h>
61#include "cms_lcl.h" 61#include "cms_lcl.h"
62 62
63DECLARE_ASN1_ITEM(CMS_ReceiptRequest) 63DECLARE_ASN1_ITEM(CMS_ReceiptRequest)
diff --git a/src/lib/libcrypto/cms/cms_pwri.c b/src/lib/libcrypto/cms/cms_pwri.c
index 04d0cb833f..ea3fbf87dd 100644
--- a/src/lib/libcrypto/cms/cms_pwri.c
+++ b/src/lib/libcrypto/cms/cms_pwri.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_pwri.c,v 1.5 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_pwri.c,v 1.6 2014/07/11 08:44:48 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 */
@@ -51,16 +51,16 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h" 54#include <openssl/aes.h>
55#include <openssl/asn1t.h> 55#include <openssl/asn1t.h>
56#include <openssl/pem.h>
57#include <openssl/x509v3.h>
58#include <openssl/err.h>
59#include <openssl/cms.h> 56#include <openssl/cms.h>
57#include <openssl/err.h>
58#include <openssl/pem.h>
60#include <openssl/rand.h> 59#include <openssl/rand.h>
61#include <openssl/aes.h> 60#include <openssl/x509v3.h>
62#include "cms_lcl.h" 61
63#include "asn1_locl.h" 62#include "asn1_locl.h"
63#include "cms_lcl.h"
64 64
65int 65int
66CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, unsigned char *pass, 66CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, unsigned char *pass,
diff --git a/src/lib/libcrypto/cms/cms_sd.c b/src/lib/libcrypto/cms/cms_sd.c
index 0993502a1d..63c3f69bae 100644
--- a/src/lib/libcrypto/cms/cms_sd.c
+++ b/src/lib/libcrypto/cms/cms_sd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_sd.c,v 1.5 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_sd.c,v 1.6 2014/07/11 08:44:48 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 */
@@ -51,14 +51,14 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
55#include <openssl/cms.h>
56#include <openssl/err.h>
56#include <openssl/pem.h> 57#include <openssl/pem.h>
57#include <openssl/x509v3.h> 58#include <openssl/x509v3.h>
58#include <openssl/err.h> 59
59#include <openssl/cms.h>
60#include "cms_lcl.h"
61#include "asn1_locl.h" 60#include "asn1_locl.h"
61#include "cms_lcl.h"
62 62
63/* CMS SignedData Utilities */ 63/* CMS SignedData Utilities */
64 64
diff --git a/src/lib/libcrypto/cms/cms_smime.c b/src/lib/libcrypto/cms/cms_smime.c
index 049ef69d38..4f80561e5d 100644
--- a/src/lib/libcrypto/cms/cms_smime.c
+++ b/src/lib/libcrypto/cms/cms_smime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_smime.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_smime.c,v 1.11 2014/07/11 08:44:48 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 */
@@ -51,12 +51,12 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
55#include <openssl/cms.h>
56#include <openssl/err.h>
56#include <openssl/x509.h> 57#include <openssl/x509.h>
57#include <openssl/x509v3.h> 58#include <openssl/x509v3.h>
58#include <openssl/err.h> 59
59#include <openssl/cms.h>
60#include "cms_lcl.h" 60#include "cms_lcl.h"
61 61
62static int 62static int
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index f9b4a5b148..e5bff15f7a 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_def.c,v 1.26 2014/07/09 11:10:50 bcook Exp $ */ 1/* $OpenBSD: conf_def.c,v 1.27 2014/07/11 08:44:48 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,14 +60,15 @@
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include <string.h> 62#include <string.h>
63#include "cryptlib.h" 63
64#include <openssl/stack.h> 64#include <openssl/buffer.h>
65#include <openssl/lhash.h>
66#include <openssl/conf.h> 65#include <openssl/conf.h>
67#include <openssl/conf_api.h> 66#include <openssl/conf_api.h>
68#include "conf_def.h"
69#include <openssl/buffer.h>
70#include <openssl/err.h> 67#include <openssl/err.h>
68#include <openssl/lhash.h>
69#include <openssl/stack.h>
70
71#include "conf_def.h"
71 72
72static char *eat_ws(CONF *conf, char *p); 73static char *eat_ws(CONF *conf, char *p);
73static char *eat_alpha_numeric(CONF *conf, char *p); 74static char *eat_alpha_numeric(CONF *conf, char *p);
diff --git a/src/lib/libcrypto/conf/conf_mall.c b/src/lib/libcrypto/conf/conf_mall.c
index 5eef7a7d18..18631b3ba8 100644
--- a/src/lib/libcrypto/conf/conf_mall.c
+++ b/src/lib/libcrypto/conf/conf_mall.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_mall.c,v 1.8 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: conf_mall.c,v 1.9 2014/07/11 08:44:48 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,11 +60,11 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/crypto.h> 63#include <openssl/asn1.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#include <openssl/asn1.h> 67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c
index def64361ff..36ffeb9f95 100644
--- a/src/lib/libcrypto/conf/conf_mod.c
+++ b/src/lib/libcrypto/conf/conf_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_mod.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: conf_mod.c,v 1.23 2014/07/11 08:44:48 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 */
@@ -61,17 +61,15 @@
61#include <string.h> 61#include <string.h>
62#include <unistd.h> 62#include <unistd.h>
63 63
64#include <openssl/crypto.h>
65#include "cryptlib.h"
66#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/crypto.h>
67#include <openssl/dso.h> 66#include <openssl/dso.h>
67#include <openssl/err.h>
68#include <openssl/x509.h> 68#include <openssl/x509.h>
69 69
70
71#define DSO_mod_init_name "OPENSSL_init" 70#define DSO_mod_init_name "OPENSSL_init"
72#define DSO_mod_finish_name "OPENSSL_finish" 71#define DSO_mod_finish_name "OPENSSL_finish"
73 72
74
75/* This structure contains a data about supported modules. 73/* This structure contains a data about supported modules.
76 * entries in this table correspond to either dynamic or 74 * entries in this table correspond to either dynamic or
77 * static modules. 75 * static modules.
diff --git a/src/lib/libcrypto/conf/conf_sap.c b/src/lib/libcrypto/conf/conf_sap.c
index 332b48ba5a..52d05dbe13 100644
--- a/src/lib/libcrypto/conf/conf_sap.c
+++ b/src/lib/libcrypto/conf/conf_sap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_sap.c,v 1.9 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: conf_sap.c,v 1.10 2014/07/11 08:44:48 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,11 +60,11 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/crypto.h> 63#include <openssl/asn1.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#include <openssl/asn1.h> 67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c
index 30023af332..6a75d9568c 100644
--- a/src/lib/libcrypto/cryptlib.c
+++ b/src/lib/libcrypto/cryptlib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cryptlib.c,v 1.31 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: cryptlib.c,v 1.32 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -114,12 +114,15 @@
114 * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. 114 * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
115 */ 115 */
116 116
117#include <stdarg.h>
117#include <string.h> 118#include <string.h>
118#include <unistd.h> 119#include <unistd.h>
119 120
120#include <openssl/opensslconf.h> 121#include <openssl/opensslconf.h>
121 122
122#include "cryptlib.h" 123#include <openssl/crypto.h>
124#include <openssl/buffer.h>
125#include <openssl/err.h>
123#include <openssl/safestack.h> 126#include <openssl/safestack.h>
124 127
125DECLARE_STACK_OF(CRYPTO_dynlock) 128DECLARE_STACK_OF(CRYPTO_dynlock)
diff --git a/src/lib/libcrypto/cryptlib.h b/src/lib/libcrypto/cryptlib.h
index 679af821c1..ad679dfa8d 100644
--- a/src/lib/libcrypto/cryptlib.h
+++ b/src/lib/libcrypto/cryptlib.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: cryptlib.h,v 1.23 2014/07/10 22:13:39 jsing Exp $ */ 1/* $OpenBSD: cryptlib.h,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,10 +59,6 @@
59#ifndef HEADER_CRYPTLIB_H 59#ifndef HEADER_CRYPTLIB_H
60#define HEADER_CRYPTLIB_H 60#define HEADER_CRYPTLIB_H
61 61
62#include <openssl/crypto.h>
63#include <openssl/buffer.h>
64#include <openssl/bio.h>
65#include <openssl/err.h>
66#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
67 63
68#ifdef __cplusplus 64#ifdef __cplusplus
diff --git a/src/lib/libcrypto/cversion.c b/src/lib/libcrypto/cversion.c
index 68f27633db..e9f40c24cf 100644
--- a/src/lib/libcrypto/cversion.c
+++ b/src/lib/libcrypto/cversion.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cversion.c,v 1.13 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: cversion.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 *
@@ -56,7 +56,8 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include "cryptlib.h" 59#include <openssl/crypto.h>
60#include <openssl/opensslv.h>
60 61
61const char * 62const char *
62SSLeay_version(int t) 63SSLeay_version(int t)
diff --git a/src/lib/libcrypto/des/enc_read.c b/src/lib/libcrypto/des/enc_read.c
index b358fadd48..e4680af4f2 100644
--- a/src/lib/libcrypto/des/enc_read.c
+++ b/src/lib/libcrypto/des/enc_read.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: enc_read.c,v 1.13 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: enc_read.c,v 1.14 2014/07/11 08:44:48 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,17 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <errno.h> 59#include <errno.h>
60#include <stdio.h>
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include "des_locl.h" 64#include "des_locl.h"
66 65
67/* This has some uglies in it but it works - even over sockets. */ 66/* This has some uglies in it but it works - even over sockets. */
68/*extern int errno;*/ 67/*extern int errno;*/
69int DES_rw_mode = DES_PCBC_MODE; 68int DES_rw_mode = DES_PCBC_MODE;
70 69
71
72/* 70/*
73 * WARNINGS: 71 * WARNINGS:
74 * 72 *
diff --git a/src/lib/libcrypto/des/enc_writ.c b/src/lib/libcrypto/des/enc_writ.c
index 0e3a2d856a..a7049ff44e 100644
--- a/src/lib/libcrypto/des/enc_writ.c
+++ b/src/lib/libcrypto/des/enc_writ.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: enc_writ.c,v 1.11 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: enc_writ.c,v 1.12 2014/07/11 08:44:48 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,10 +62,10 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include "des_locl.h"
67#include <openssl/rand.h> 65#include <openssl/rand.h>
68 66
67#include "des_locl.h"
68
69/* 69/*
70 * WARNINGS: 70 * WARNINGS:
71 * 71 *
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c
index 21714bb748..91178a92b0 100644
--- a/src/lib/libcrypto/dh/dh_ameth.c
+++ b/src/lib/libcrypto/dh/dh_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_ameth.c,v 1.10 2014/07/09 22:55:17 tedu Exp $ */ 1/* $OpenBSD: dh_ameth.c,v 1.11 2014/07/11 08:44:48 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 */
@@ -57,11 +57,13 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/x509.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/dh.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
63#include <openssl/dh.h>
64#include <openssl/err.h>
65#include <openssl/x509.h>
66
65#include "asn1_locl.h" 67#include "asn1_locl.h"
66 68
67static void 69static void
diff --git a/src/lib/libcrypto/dh/dh_asn1.c b/src/lib/libcrypto/dh/dh_asn1.c
index ed3a015279..ee478c7958 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.5 2014/07/09 13:26:47 miod Exp $ */ 1/* $OpenBSD: dh_asn1.c,v 1.6 2014/07/11 08:44:48 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,11 +57,11 @@
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/bn.h> 62#include <openssl/bn.h>
62#include <openssl/dh.h> 63#include <openssl/dh.h>
63#include <openssl/objects.h> 64#include <openssl/objects.h>
64#include <openssl/asn1t.h>
65 65
66/* Override the default free and new methods */ 66/* Override the default free and new methods */
67static int 67static int
diff --git a/src/lib/libcrypto/dh/dh_check.c b/src/lib/libcrypto/dh/dh_check.c
index 070a33081a..01b9531a44 100644
--- a/src/lib/libcrypto/dh/dh_check.c
+++ b/src/lib/libcrypto/dh/dh_check.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_check.c,v 1.12 2014/07/09 13:30:00 miod Exp $ */ 1/* $OpenBSD: dh_check.c,v 1.13 2014/07/11 08:44:48 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/bn.h> 61#include <openssl/bn.h>
62#include <openssl/dh.h> 62#include <openssl/dh.h>
63 63
diff --git a/src/lib/libcrypto/dh/dh_depr.c b/src/lib/libcrypto/dh/dh_depr.c
index 13f2029a59..0b75b0be5e 100644
--- a/src/lib/libcrypto/dh/dh_depr.c
+++ b/src/lib/libcrypto/dh/dh_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_depr.c,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dh_depr.c,v 1.6 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -59,7 +59,6 @@
59 59
60#include <openssl/opensslconf.h> 60#include <openssl/opensslconf.h>
61 61
62#include "cryptlib.h"
63#include <openssl/bn.h> 62#include <openssl/bn.h>
64#include <openssl/dh.h> 63#include <openssl/dh.h>
65 64
diff --git a/src/lib/libcrypto/dh/dh_gen.c b/src/lib/libcrypto/dh/dh_gen.c
index 453ea3e8e4..6a884eff9e 100644
--- a/src/lib/libcrypto/dh/dh_gen.c
+++ b/src/lib/libcrypto/dh/dh_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_gen.c,v 1.12 2014/07/09 13:26:47 miod Exp $ */ 1/* $OpenBSD: dh_gen.c,v 1.13 2014/07/11 08:44:48 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 */ 62 */
63 63
64#include <stdio.h> 64#include <stdio.h>
65#include "cryptlib.h" 65
66#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/dh.h> 67#include <openssl/dh.h>
68#include <openssl/err.h>
68 69
69static int dh_builtin_genparams(DH *ret, int prime_len, int generator, 70static int dh_builtin_genparams(DH *ret, int prime_len, int generator,
70 BN_GENCB *cb); 71 BN_GENCB *cb);
diff --git a/src/lib/libcrypto/dh/dh_key.c b/src/lib/libcrypto/dh/dh_key.c
index 4fbedd8daa..6d90816122 100644
--- a/src/lib/libcrypto/dh/dh_key.c
+++ b/src/lib/libcrypto/dh/dh_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_key.c,v 1.19 2014/07/09 13:26:47 miod Exp $ */ 1/* $OpenBSD: dh_key.c,v 1.20 2014/07/11 08:44:48 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,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/bn.h> 61#include <openssl/bn.h>
62#include <openssl/rand.h>
63#include <openssl/dh.h> 62#include <openssl/dh.h>
63#include <openssl/err.h>
64#include <openssl/rand.h>
64 65
65static int generate_key(DH *dh); 66static int generate_key(DH *dh);
66static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh); 67static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c
index 1cf14061c9..0a956e5416 100644
--- a/src/lib/libcrypto/dh/dh_lib.c
+++ b/src/lib/libcrypto/dh/dh_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_lib.c,v 1.18 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dh_lib.c,v 1.19 2014/07/11 08:44:48 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 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>
65#include <openssl/dh.h> 64#include <openssl/dh.h>
65
66#ifndef OPENSSL_NO_ENGINE 66#ifndef OPENSSL_NO_ENGINE
67#include <openssl/engine.h> 67#include <openssl/engine.h>
68#endif 68#endif
diff --git a/src/lib/libcrypto/dh/dh_pmeth.c b/src/lib/libcrypto/dh/dh_pmeth.c
index aa681add06..6d750eb30d 100644
--- a/src/lib/libcrypto/dh/dh_pmeth.c
+++ b/src/lib/libcrypto/dh/dh_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_pmeth.c,v 1.8 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dh_pmeth.c,v 1.9 2014/07/11 08:44:48 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 */
@@ -60,12 +60,13 @@
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>
65#include <openssl/x509.h>
66#include <openssl/evp.h>
67#include <openssl/dh.h>
68#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/dh.h>
66#include <openssl/err.h>
67#include <openssl/evp.h>
68#include <openssl/x509.h>
69
69#include "evp_locl.h" 70#include "evp_locl.h"
70 71
71/* DH pkey context structure */ 72/* DH pkey context structure */
diff --git a/src/lib/libcrypto/dh/dh_prn.c b/src/lib/libcrypto/dh/dh_prn.c
index 846419691e..73d0476e21 100644
--- a/src/lib/libcrypto/dh/dh_prn.c
+++ b/src/lib/libcrypto/dh/dh_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_prn.c,v 1.4 2014/07/09 13:26:47 miod Exp $ */ 1/* $OpenBSD: dh_prn.c,v 1.5 2014/07/11 08:44:48 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/dh.h> 61#include <openssl/dh.h>
62#include <openssl/err.h>
63#include <openssl/evp.h>
63 64
64int 65int
65DHparams_print_fp(FILE *fp, const DH *x) 66DHparams_print_fp(FILE *fp, const DH *x)
diff --git a/src/lib/libcrypto/dsa/dsa_ameth.c b/src/lib/libcrypto/dsa/dsa_ameth.c
index 1f08585e5f..73c58ec94c 100644
--- a/src/lib/libcrypto/dsa/dsa_ameth.c
+++ b/src/lib/libcrypto/dsa/dsa_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_ameth.c,v 1.11 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dsa_ameth.c,v 1.12 2014/07/11 08:44:48 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 */
@@ -60,14 +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#include <openssl/dsa.h>
67#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/dsa.h>
66#include <openssl/err.h>
67#include <openssl/x509.h>
68
68#ifndef OPENSSL_NO_CMS 69#ifndef OPENSSL_NO_CMS
69#include <openssl/cms.h> 70#include <openssl/cms.h>
70#endif 71#endif
72
71#include "asn1_locl.h" 73#include "asn1_locl.h"
72 74
73static int 75static int
diff --git a/src/lib/libcrypto/dsa/dsa_asn1.c b/src/lib/libcrypto/dsa/dsa_asn1.c
index cc03f29823..bbe091b928 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.11 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_asn1.c,v 1.12 2014/07/11 08:44:48 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,10 +57,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/dsa.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/dsa.h>
64#include <openssl/err.h>
64#include <openssl/rand.h> 65#include <openssl/rand.h>
65 66
66/* Override the default new methods */ 67/* Override the default new methods */
diff --git a/src/lib/libcrypto/dsa/dsa_depr.c b/src/lib/libcrypto/dsa/dsa_depr.c
index d8ac6f9d92..472e329207 100644
--- a/src/lib/libcrypto/dsa/dsa_depr.c
+++ b/src/lib/libcrypto/dsa/dsa_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_depr.c,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dsa_depr.c,v 1.6 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -63,10 +63,9 @@
63 63
64#ifndef OPENSSL_NO_SHA 64#ifndef OPENSSL_NO_SHA
65 65
66#include "cryptlib.h"
67#include <openssl/evp.h>
68#include <openssl/bn.h> 66#include <openssl/bn.h>
69#include <openssl/dsa.h> 67#include <openssl/dsa.h>
68#include <openssl/evp.h>
70#include <openssl/rand.h> 69#include <openssl/rand.h>
71#include <openssl/sha.h> 70#include <openssl/sha.h>
72 71
diff --git a/src/lib/libcrypto/dsa/dsa_gen.c b/src/lib/libcrypto/dsa/dsa_gen.c
index 491b4de5f9..d41e7562e1 100644
--- a/src/lib/libcrypto/dsa/dsa_gen.c
+++ b/src/lib/libcrypto/dsa/dsa_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_gen.c,v 1.14 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dsa_gen.c,v 1.15 2014/07/11 08:44:48 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 *
@@ -63,11 +63,11 @@
63#include <stdio.h> 63#include <stdio.h>
64#include <string.h> 64#include <string.h>
65 65
66#include "cryptlib.h"
67#include <openssl/evp.h>
68#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/evp.h>
69#include <openssl/rand.h> 68#include <openssl/rand.h>
70#include <openssl/sha.h> 69#include <openssl/sha.h>
70
71#include "dsa_locl.h" 71#include "dsa_locl.h"
72 72
73int 73int
diff --git a/src/lib/libcrypto/dsa/dsa_key.c b/src/lib/libcrypto/dsa/dsa_key.c
index 723e1888df..4573ecbcce 100644
--- a/src/lib/libcrypto/dsa/dsa_key.c
+++ b/src/lib/libcrypto/dsa/dsa_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_key.c,v 1.17 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dsa_key.c,v 1.18 2014/07/11 08:44:48 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,8 +61,8 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#ifndef OPENSSL_NO_SHA 64#ifndef OPENSSL_NO_SHA
65
66#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/dsa.h> 67#include <openssl/dsa.h>
68#include <openssl/rand.h> 68#include <openssl/rand.h>
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c
index 3bf8427d4c..97307134cd 100644
--- a/src/lib/libcrypto/dsa/dsa_lib.c
+++ b/src/lib/libcrypto/dsa/dsa_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_lib.c,v 1.19 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dsa_lib.c,v 1.20 2014/07/11 08:44:48 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,16 +62,16 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h" 65#include <openssl/asn1.h>
66#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/dsa.h> 67#include <openssl/dsa.h>
68#include <openssl/asn1.h> 68
69#ifndef OPENSSL_NO_ENGINE
70#include <openssl/engine.h>
71#endif
72#ifndef OPENSSL_NO_DH 69#ifndef OPENSSL_NO_DH
73#include <openssl/dh.h> 70#include <openssl/dh.h>
74#endif 71#endif
72#ifndef OPENSSL_NO_ENGINE
73#include <openssl/engine.h>
74#endif
75 75
76static const DSA_METHOD *default_DSA_method = NULL; 76static const DSA_METHOD *default_DSA_method = NULL;
77 77
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c
index 17119eb187..5bff836c50 100644
--- a/src/lib/libcrypto/dsa/dsa_ossl.c
+++ b/src/lib/libcrypto/dsa/dsa_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_ossl.c,v 1.19 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_ossl.c,v 1.20 2014/07/11 08:44:48 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,12 +59,13 @@
59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ 59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include "cryptlib.h" 62
63#include <openssl/asn1.h>
63#include <openssl/bn.h> 64#include <openssl/bn.h>
64#include <openssl/sha.h>
65#include <openssl/dsa.h> 65#include <openssl/dsa.h>
66#include <openssl/err.h>
66#include <openssl/rand.h> 67#include <openssl/rand.h>
67#include <openssl/asn1.h> 68#include <openssl/sha.h>
68 69
69static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); 70static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
70static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, 71static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
diff --git a/src/lib/libcrypto/dsa/dsa_pmeth.c b/src/lib/libcrypto/dsa/dsa_pmeth.c
index 2e44e8d5dd..c7a2edfc94 100644
--- a/src/lib/libcrypto/dsa/dsa_pmeth.c
+++ b/src/lib/libcrypto/dsa/dsa_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_pmeth.c,v 1.9 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dsa_pmeth.c,v 1.10 2014/07/11 08:44:48 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 */
@@ -60,13 +60,14 @@
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>
65#include <openssl/x509.h>
66#include <openssl/evp.h>
67#include <openssl/bn.h> 64#include <openssl/bn.h>
68#include "evp_locl.h" 65#include <openssl/err.h>
66#include <openssl/evp.h>
67#include <openssl/x509.h>
68
69#include "dsa_locl.h" 69#include "dsa_locl.h"
70#include "evp_locl.h"
70 71
71/* DSA pkey context structure */ 72/* DSA pkey context structure */
72 73
diff --git a/src/lib/libcrypto/dsa/dsa_prn.c b/src/lib/libcrypto/dsa/dsa_prn.c
index 5a7423c831..60f4e6c760 100644
--- a/src/lib/libcrypto/dsa/dsa_prn.c
+++ b/src/lib/libcrypto/dsa/dsa_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_prn.c,v 1.4 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_prn.c,v 1.5 2014/07/11 08:44:48 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 */
@@ -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/dsa.h> 61#include <openssl/dsa.h>
62#include <openssl/err.h>
63#include <openssl/evp.h>
63 64
64int 65int
65DSA_print_fp(FILE *fp, const DSA *x, int off) 66DSA_print_fp(FILE *fp, const DSA *x, int off)
diff --git a/src/lib/libcrypto/dsa/dsa_sign.c b/src/lib/libcrypto/dsa/dsa_sign.c
index 40223a1d59..efeb35477c 100644
--- a/src/lib/libcrypto/dsa/dsa_sign.c
+++ b/src/lib/libcrypto/dsa/dsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_sign.c,v 1.16 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_sign.c,v 1.17 2014/07/11 08:44:48 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 *
@@ -58,10 +58,9 @@
58 58
59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ 59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
60 60
61#include "cryptlib.h" 61#include <openssl/bn.h>
62#include <openssl/dsa.h> 62#include <openssl/dsa.h>
63#include <openssl/rand.h> 63#include <openssl/rand.h>
64#include <openssl/bn.h>
65 64
66DSA_SIG * 65DSA_SIG *
67DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) 66DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
diff --git a/src/lib/libcrypto/dsa/dsa_vrf.c b/src/lib/libcrypto/dsa/dsa_vrf.c
index b82fa41259..1965338f1f 100644
--- a/src/lib/libcrypto/dsa/dsa_vrf.c
+++ b/src/lib/libcrypto/dsa/dsa_vrf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_vrf.c,v 1.15 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_vrf.c,v 1.16 2014/07/11 08:44:48 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 *
@@ -58,7 +58,6 @@
58 58
59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ 59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
60 60
61#include "cryptlib.h"
62#include <openssl/dsa.h> 61#include <openssl/dsa.h>
63 62
64int 63int
diff --git a/src/lib/libcrypto/dso/dso_dlfcn.c b/src/lib/libcrypto/dso/dso_dlfcn.c
index e88553f644..b75c9e23e0 100644
--- a/src/lib/libcrypto/dso/dso_dlfcn.c
+++ b/src/lib/libcrypto/dso/dso_dlfcn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso_dlfcn.c,v 1.26 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dso_dlfcn.c,v 1.27 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
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/dso.h> 62#include <openssl/dso.h>
63#include <openssl/err.h>
64 64
65#ifndef DSO_DLFCN 65#ifndef DSO_DLFCN
66DSO_METHOD * 66DSO_METHOD *
diff --git a/src/lib/libcrypto/dso/dso_lib.c b/src/lib/libcrypto/dso/dso_lib.c
index b76bd1ca84..3002e4d99c 100644
--- a/src/lib/libcrypto/dso/dso_lib.c
+++ b/src/lib/libcrypto/dso/dso_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso_lib.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dso_lib.c,v 1.18 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -60,8 +60,8 @@
60#include <string.h> 60#include <string.h>
61 61
62#include <openssl/crypto.h> 62#include <openssl/crypto.h>
63#include "cryptlib.h"
64#include <openssl/dso.h> 63#include <openssl/dso.h>
64#include <openssl/err.h>
65 65
66static DSO_METHOD *default_DSO_meth = NULL; 66static DSO_METHOD *default_DSO_meth = NULL;
67 67
diff --git a/src/lib/libcrypto/dso/dso_null.c b/src/lib/libcrypto/dso/dso_null.c
index 572d36d1f6..a3dc0ec1ff 100644
--- a/src/lib/libcrypto/dso/dso_null.c
+++ b/src/lib/libcrypto/dso/dso_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso_null.c,v 1.6 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: dso_null.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -60,7 +60,7 @@
60 * no appropriate support for "shared-libraries". */ 60 * no appropriate support for "shared-libraries". */
61 61
62#include <stdio.h> 62#include <stdio.h>
63#include "cryptlib.h" 63
64#include <openssl/dso.h> 64#include <openssl/dso.h>
65 65
66static DSO_METHOD dso_meth_null = { 66static DSO_METHOD dso_meth_null = {
diff --git a/src/lib/libcrypto/dso/dso_openssl.c b/src/lib/libcrypto/dso/dso_openssl.c
index 6b9d9682fe..37d8d5805f 100644
--- a/src/lib/libcrypto/dso/dso_openssl.c
+++ b/src/lib/libcrypto/dso/dso_openssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso_openssl.c,v 1.5 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: dso_openssl.c,v 1.6 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) 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/dso.h> 61#include <openssl/dso.h>
62 62
63/* We just pinch the method from an appropriate "default" method. */ 63/* We just pinch the method from an appropriate "default" method. */
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c
index 6935972de5..93e305b71a 100644
--- a/src/lib/libcrypto/ec/ec_ameth.c
+++ b/src/lib/libcrypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_ameth.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: ec_ameth.c,v 1.11 2014/07/11 08:44:48 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 */
@@ -60,13 +60,15 @@
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/ec.h>
66#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/ec.h>
65#include <openssl/err.h>
66#include <openssl/x509.h>
67
67#ifndef OPENSSL_NO_CMS 68#ifndef OPENSSL_NO_CMS
68#include <openssl/cms.h> 69#include <openssl/cms.h>
69#endif 70#endif
71
70#include "asn1_locl.h" 72#include "asn1_locl.h"
71 73
72static int 74static int
diff --git a/src/lib/libcrypto/ec/ec_pmeth.c b/src/lib/libcrypto/ec/ec_pmeth.c
index 043c2a5a0c..7ba1d50d7f 100644
--- a/src/lib/libcrypto/ec/ec_pmeth.c
+++ b/src/lib/libcrypto/ec/ec_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_pmeth.c,v 1.6 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: ec_pmeth.c,v 1.7 2014/07/11 08:44:48 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 */
@@ -59,12 +59,13 @@
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>
65#include <openssl/ec.h> 63#include <openssl/ec.h>
66#include <openssl/ecdsa.h> 64#include <openssl/ecdsa.h>
65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
67#include <openssl/x509.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69 70
70/* EC pkey context structure */ 71/* EC pkey context structure */
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c
index fb5ee7f52b..b0c8bcd22a 100644
--- a/src/lib/libcrypto/ec/eck_prn.c
+++ b/src/lib/libcrypto/ec/eck_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eck_prn.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eck_prn.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -66,10 +66,10 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h"
70#include <openssl/evp.h>
71#include <openssl/ec.h>
72#include <openssl/bn.h> 69#include <openssl/bn.h>
70#include <openssl/ec.h>
71#include <openssl/err.h>
72#include <openssl/evp.h>
73 73
74int 74int
75ECPKParameters_print_fp(FILE * fp, const EC_GROUP * x, int off) 75ECPKParameters_print_fp(FILE * fp, const EC_GROUP * x, int off)
diff --git a/src/lib/libcrypto/ecdh/ech_ossl.c b/src/lib/libcrypto/ecdh/ech_ossl.c
index aa22ccafa2..d82ace3670 100644
--- a/src/lib/libcrypto/ecdh/ech_ossl.c
+++ b/src/lib/libcrypto/ecdh/ech_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ech_ossl.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: ech_ossl.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -72,13 +72,12 @@
72 72
73#include <openssl/opensslconf.h> 73#include <openssl/opensslconf.h>
74 74
75#include "cryptlib.h" 75#include <openssl/bn.h>
76
77#include "ech_locl.h"
78#include <openssl/err.h> 76#include <openssl/err.h>
79#include <openssl/sha.h>
80#include <openssl/obj_mac.h> 77#include <openssl/obj_mac.h>
81#include <openssl/bn.h> 78#include <openssl/sha.h>
79
80#include "ech_locl.h"
82 81
83static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key, 82static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key,
84 EC_KEY *ecdh, 83 EC_KEY *ecdh,
diff --git a/src/lib/libcrypto/engine/eng_aesni.c b/src/lib/libcrypto/engine/eng_aesni.c
index 0bb558c1fd..94c4c1fb6a 100644
--- a/src/lib/libcrypto/engine/eng_aesni.c
+++ b/src/lib/libcrypto/engine/eng_aesni.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_aesni.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eng_aesni.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Support for Intel AES-NI intruction set 3 * Support for Intel AES-NI intruction set
4 * Author: Huang Ying <ying.huang@intel.com> 4 * Author: Huang Ying <ying.huang@intel.com>
@@ -80,12 +80,11 @@
80 80
81#if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_AES_NI) && !defined(OPENSSL_NO_AES) 81#if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_AES_NI) && !defined(OPENSSL_NO_AES)
82 82
83#include "cryptlib.h" 83#include <openssl/aes.h>
84#include <openssl/dso.h> 84#include <openssl/dso.h>
85#include <openssl/engine.h> 85#include <openssl/engine.h>
86#include <openssl/evp.h>
87#include <openssl/aes.h>
88#include <openssl/err.h> 86#include <openssl/err.h>
87#include <openssl/evp.h>
89 88
90/* AES-NI is available *ONLY* on some x86 CPUs. Not only that it 89/* AES-NI is available *ONLY* on some x86 CPUs. Not only that it
91 doesn't exist elsewhere, but it even can't be compiled on other 90 doesn't exist elsewhere, but it even can't be compiled on other
diff --git a/src/lib/libcrypto/engine/eng_int.h b/src/lib/libcrypto/engine/eng_int.h
index aa3751f267..f240411981 100644
--- a/src/lib/libcrypto/engine/eng_int.h
+++ b/src/lib/libcrypto/engine/eng_int.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_int.h,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eng_int.h,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -64,8 +64,6 @@
64#ifndef HEADER_ENGINE_INT_H 64#ifndef HEADER_ENGINE_INT_H
65#define HEADER_ENGINE_INT_H 65#define HEADER_ENGINE_INT_H
66 66
67#include "cryptlib.h"
68
69/* Take public definitions from engine.h */ 67/* Take public definitions from engine.h */
70#include <openssl/engine.h> 68#include <openssl/engine.h>
71 69
diff --git a/src/lib/libcrypto/engine/eng_list.c b/src/lib/libcrypto/engine/eng_list.c
index 35b45158e9..b84504102f 100644
--- a/src/lib/libcrypto/engine/eng_list.c
+++ b/src/lib/libcrypto/engine/eng_list.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_list.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eng_list.c,v 1.15 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -66,6 +66,7 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h"
69#include "eng_int.h" 70#include "eng_int.h"
70 71
71/* The linked-list of pointers to engine types. engine_list_head 72/* The linked-list of pointers to engine types. engine_list_head
diff --git a/src/lib/libcrypto/engine/eng_openssl.c b/src/lib/libcrypto/engine/eng_openssl.c
index ecc560eb26..f1a58df857 100644
--- a/src/lib/libcrypto/engine/eng_openssl.c
+++ b/src/lib/libcrypto/engine/eng_openssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_openssl.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eng_openssl.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -67,20 +67,20 @@
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include <openssl/crypto.h> 69#include <openssl/crypto.h>
70#include "cryptlib.h"
71#include <openssl/engine.h>
72#include <openssl/dso.h> 70#include <openssl/dso.h>
73#include <openssl/pem.h> 71#include <openssl/engine.h>
74#include <openssl/evp.h> 72#include <openssl/evp.h>
73#include <openssl/pem.h>
75#include <openssl/rand.h> 74#include <openssl/rand.h>
76#ifndef OPENSSL_NO_RSA 75
77#include <openssl/rsa.h> 76#ifndef OPENSSL_NO_DH
77#include <openssl/dh.h>
78#endif 78#endif
79#ifndef OPENSSL_NO_DSA 79#ifndef OPENSSL_NO_DSA
80#include <openssl/dsa.h> 80#include <openssl/dsa.h>
81#endif 81#endif
82#ifndef OPENSSL_NO_DH 82#ifndef OPENSSL_NO_RSA
83#include <openssl/dh.h> 83#include <openssl/rsa.h>
84#endif 84#endif
85 85
86/* This testing gunk is implemented (and explained) lower down. It also assumes 86/* This testing gunk is implemented (and explained) lower down. It also assumes
diff --git a/src/lib/libcrypto/engine/eng_table.c b/src/lib/libcrypto/engine/eng_table.c
index 44f3e892b8..9d52075a76 100644
--- a/src/lib/libcrypto/engine/eng_table.c
+++ b/src/lib/libcrypto/engine/eng_table.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_table.c,v 1.6 2014/06/22 12:05:09 jsing Exp $ */ 1/* $OpenBSD: eng_table.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2001 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -53,9 +53,9 @@
53 * 53 *
54 */ 54 */
55 55
56#include "cryptlib.h"
57#include <openssl/evp.h> 56#include <openssl/evp.h>
58#include <openssl/lhash.h> 57#include <openssl/lhash.h>
58
59#include "eng_int.h" 59#include "eng_int.h"
60 60
61/* The type of the items in the table */ 61/* The type of the items in the table */
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index cc9d78cb07..571bfaed16 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err.c,v 1.37 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: err.c,v 1.38 2014/07/11 08:44:48 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 *
@@ -115,12 +115,11 @@
115 115
116#include <openssl/opensslconf.h> 116#include <openssl/opensslconf.h>
117 117
118#include "cryptlib.h"
119#include <openssl/lhash.h>
120#include <openssl/crypto.h>
121#include <openssl/buffer.h>
122#include <openssl/bio.h> 118#include <openssl/bio.h>
119#include <openssl/buffer.h>
120#include <openssl/crypto.h>
123#include <openssl/err.h> 121#include <openssl/err.h>
122#include <openssl/lhash.h>
124 123
125DECLARE_LHASH_OF(ERR_STRING_DATA); 124DECLARE_LHASH_OF(ERR_STRING_DATA);
126DECLARE_LHASH_OF(ERR_STATE); 125DECLARE_LHASH_OF(ERR_STATE);
diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h
index fc2f1a4eaf..2bd6f0e8aa 100644
--- a/src/lib/libcrypto/err/err.h
+++ b/src/lib/libcrypto/err/err.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: err.h,v 1.19 2014/07/08 11:11:57 jsing Exp $ */ 1/* $OpenBSD: err.h,v 1.20 2014/07/11 08:44:48 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 *
@@ -114,8 +114,10 @@
114 114
115#include <openssl/opensslconf.h> 115#include <openssl/opensslconf.h>
116 116
117#ifndef LIBRESSL_INTERNAL
117#include <stdio.h> 118#include <stdio.h>
118#include <stdlib.h> 119#include <stdlib.h>
120#endif
119 121
120#include <openssl/ossl_typ.h> 122#include <openssl/ossl_typ.h>
121#ifndef OPENSSL_NO_BIO 123#ifndef OPENSSL_NO_BIO
diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c
index 75d7ed7a0a..021bcd5d1d 100644
--- a/src/lib/libcrypto/err/err_prn.c
+++ b/src/lib/libcrypto/err/err_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err_prn.c,v 1.15 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: err_prn.c,v 1.16 2014/07/11 08:44:48 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,11 +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/lhash.h>
64#include <openssl/crypto.h>
65#include <openssl/buffer.h> 62#include <openssl/buffer.h>
63#include <openssl/crypto.h>
66#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/lhash.h>
67 66
68void 67void
69ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u) 68ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u)
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index 7211195adf..632d056168 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_b64.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bio_b64.c,v 1.18 2014/07/11 08:44:48 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,7 +60,6 @@
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> 63#include <openssl/buffer.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
66 65
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index 3b936f5843..e367faa967 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_enc.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bio_enc.c,v 1.18 2014/07/11 08:44:48 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,7 +60,6 @@
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> 63#include <openssl/buffer.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
66 65
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c
index 3d13839df5..b1973746a7 100644
--- a/src/lib/libcrypto/evp/bio_md.c
+++ b/src/lib/libcrypto/evp/bio_md.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_md.c,v 1.13 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: bio_md.c,v 1.14 2014/07/11 08:44:48 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 *
@@ -58,7 +58,7 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <errno.h> 60#include <errno.h>
61#include "cryptlib.h" 61
62#include <openssl/buffer.h> 62#include <openssl/buffer.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
diff --git a/src/lib/libcrypto/evp/c_allc.c b/src/lib/libcrypto/evp/c_allc.c
index a4c796b6d5..657e14f86f 100644
--- a/src/lib/libcrypto/evp/c_allc.c
+++ b/src/lib/libcrypto/evp/c_allc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: c_allc.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: c_allc.c,v 1.13 2014/07/11 08:44:48 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,10 +60,9 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/pkcs12.h>
66#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/pkcs12.h>
67 66
68void 67void
69OpenSSL_add_all_ciphers(void) 68OpenSSL_add_all_ciphers(void)
diff --git a/src/lib/libcrypto/evp/c_alld.c b/src/lib/libcrypto/evp/c_alld.c
index 16726b6caa..8f59100caa 100644
--- a/src/lib/libcrypto/evp/c_alld.c
+++ b/src/lib/libcrypto/evp/c_alld.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: c_alld.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: c_alld.c,v 1.11 2014/07/11 08:44:48 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,10 +60,9 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/pkcs12.h>
66#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/pkcs12.h>
67 66
68void 67void
69OpenSSL_add_all_digests(void) 68OpenSSL_add_all_digests(void)
diff --git a/src/lib/libcrypto/evp/digest.c b/src/lib/libcrypto/evp/digest.c
index e1ce7dd3a3..9a4b1a6293 100644
--- a/src/lib/libcrypto/evp/digest.c
+++ b/src/lib/libcrypto/evp/digest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: digest.c,v 1.20 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: digest.c,v 1.21 2014/07/11 08:44:48 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 *
@@ -114,9 +114,9 @@
114 114
115#include <openssl/opensslconf.h> 115#include <openssl/opensslconf.h>
116 116
117#include "cryptlib.h"
118#include <openssl/objects.h>
119#include <openssl/evp.h> 117#include <openssl/evp.h>
118#include <openssl/objects.h>
119
120#ifndef OPENSSL_NO_ENGINE 120#ifndef OPENSSL_NO_ENGINE
121#include <openssl/engine.h> 121#include <openssl/engine.h>
122#endif 122#endif
diff --git a/src/lib/libcrypto/evp/e_bf.c b/src/lib/libcrypto/evp/e_bf.c
index fe133fb8ea..615c9bd771 100644
--- a/src/lib/libcrypto/evp/e_bf.c
+++ b/src/lib/libcrypto/evp/e_bf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_bf.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_bf.c,v 1.8 2014/07/11 08:44:48 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#ifndef OPENSSL_NO_BF 63#ifndef OPENSSL_NO_BF
64
65#include <openssl/blowfish.h>
65#include <openssl/evp.h> 66#include <openssl/evp.h>
66#include "evp_locl.h"
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68#include <openssl/blowfish.h> 68
69#include "evp_locl.h"
69 70
70static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
71 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libcrypto/evp/e_cast.c b/src/lib/libcrypto/evp/e_cast.c
index 2476bf2799..707daa9656 100644
--- a/src/lib/libcrypto/evp/e_cast.c
+++ b/src/lib/libcrypto/evp/e_cast.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_cast.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_cast.c,v 1.7 2014/07/11 08:44:48 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,13 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_CAST 63#ifndef OPENSSL_NO_CAST
64
65#include <openssl/cast.h>
66#include <openssl/evp.h> 66#include <openssl/evp.h>
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69#include <openssl/cast.h>
70 70
71static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libcrypto/evp/e_des.c b/src/lib/libcrypto/evp/e_des.c
index 1f0de7cbfd..0a32d2adb9 100644
--- a/src/lib/libcrypto/evp/e_des.c
+++ b/src/lib/libcrypto/evp/e_des.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_des.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_des.c,v 1.11 2014/07/11 08:44:48 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,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#ifndef OPENSSL_NO_DES 63#ifndef OPENSSL_NO_DES
64
65#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h>
67#include "evp_locl.h"
68#include <openssl/des.h> 66#include <openssl/des.h>
67#include <openssl/objects.h>
69#include <openssl/rand.h> 68#include <openssl/rand.h>
70 69
70#include "evp_locl.h"
71
71static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
73static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); 74static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
diff --git a/src/lib/libcrypto/evp/e_des3.c b/src/lib/libcrypto/evp/e_des3.c
index f4264d8ca4..0f1974f6c9 100644
--- a/src/lib/libcrypto/evp/e_des3.c
+++ b/src/lib/libcrypto/evp/e_des3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_des3.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_des3.c,v 1.16 2014/07/11 08:44:48 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,14 +61,15 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#ifndef OPENSSL_NO_DES 64#ifndef OPENSSL_NO_DES
65
66#include <openssl/des.h>
66#include <openssl/evp.h> 67#include <openssl/evp.h>
67#include <openssl/objects.h> 68#include <openssl/objects.h>
68#include "evp_locl.h"
69#include <openssl/des.h>
70#include <openssl/rand.h> 69#include <openssl/rand.h>
71 70
71#include "evp_locl.h"
72
72static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 73static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 74 const unsigned char *iv, int enc);
74 75
diff --git a/src/lib/libcrypto/evp/e_idea.c b/src/lib/libcrypto/evp/e_idea.c
index 7dd385e04e..3ba4dbcdb9 100644
--- a/src/lib/libcrypto/evp/e_idea.c
+++ b/src/lib/libcrypto/evp/e_idea.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_idea.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_idea.c,v 1.9 2014/07/11 08:44:48 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,13 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_IDEA 63#ifndef OPENSSL_NO_IDEA
64
66#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/idea.h>
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69#include <openssl/idea.h>
70 70
71static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libcrypto/evp/e_null.c b/src/lib/libcrypto/evp/e_null.c
index 0d0a06f2e3..65374cc3f5 100644
--- a/src/lib/libcrypto/evp/e_null.c
+++ b/src/lib/libcrypto/evp/e_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_null.c,v 1.13 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: e_null.c,v 1.14 2014/07/11 08:44:48 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,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/evp.h> 62#include <openssl/evp.h>
64#include <openssl/objects.h> 63#include <openssl/objects.h>
65 64
diff --git a/src/lib/libcrypto/evp/e_rc2.c b/src/lib/libcrypto/evp/e_rc2.c
index c164ab10f7..456a22eeeb 100644
--- a/src/lib/libcrypto/evp/e_rc2.c
+++ b/src/lib/libcrypto/evp/e_rc2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc2.c,v 1.9 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc2.c,v 1.10 2014/07/11 08:44:48 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,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC2 63#ifndef OPENSSL_NO_RC2
66 64
65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include "evp_locl.h"
70#include <openssl/rc2.h> 68#include <openssl/rc2.h>
71 69
70#include "evp_locl.h"
71
72static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
74static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx); 74static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx);
diff --git a/src/lib/libcrypto/evp/e_rc4.c b/src/lib/libcrypto/evp/e_rc4.c
index f8e4149a62..e77a293141 100644
--- a/src/lib/libcrypto/evp/e_rc4.c
+++ b/src/lib/libcrypto/evp/e_rc4.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc4.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc4.c,v 1.14 2014/07/11 08:44:48 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,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC4 63#ifndef OPENSSL_NO_RC4
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include "evp_locl.h"
69#include <openssl/objects.h> 66#include <openssl/objects.h>
70#include <openssl/rc4.h> 67#include <openssl/rc4.h>
71 68
69#include "evp_locl.h"
70
72/* FIXME: surely this is available elsewhere? */ 71/* FIXME: surely this is available elsewhere? */
73#define EVP_RC4_KEY_SIZE 16 72#define EVP_RC4_KEY_SIZE 16
74 73
diff --git a/src/lib/libcrypto/evp/e_rc5.c b/src/lib/libcrypto/evp/e_rc5.c
index 00e1251818..3a1dab9999 100644
--- a/src/lib/libcrypto/evp/e_rc5.c
+++ b/src/lib/libcrypto/evp/e_rc5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc5.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc5.c,v 1.7 2014/07/11 08:44:48 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,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC5 63#ifndef OPENSSL_NO_RC5
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include "evp_locl.h"
70#include <openssl/rc5.h> 67#include <openssl/rc5.h>
71 68
69#include "evp_locl.h"
70
72static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
74static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); 73static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
diff --git a/src/lib/libcrypto/evp/e_xcbc_d.c b/src/lib/libcrypto/evp/e_xcbc_d.c
index 496850b315..2aae0a9151 100644
--- a/src/lib/libcrypto/evp/e_xcbc_d.c
+++ b/src/lib/libcrypto/evp/e_xcbc_d.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_xcbc_d.c,v 1.11 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_xcbc_d.c,v 1.12 2014/07/11 08:44:48 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,14 +61,13 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65
66#ifndef OPENSSL_NO_DES 64#ifndef OPENSSL_NO_DES
67 65
66#include <openssl/des.h>
68#include <openssl/evp.h> 67#include <openssl/evp.h>
69#include <openssl/objects.h> 68#include <openssl/objects.h>
69
70#include "evp_locl.h" 70#include "evp_locl.h"
71#include <openssl/des.h>
72 71
73static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
74 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c
index a83cf76c9f..f33afb03d3 100644
--- a/src/lib/libcrypto/evp/encode.c
+++ b/src/lib/libcrypto/evp/encode.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: encode.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: encode.c,v 1.18 2014/07/11 08:44:48 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,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/evp.h> 62#include <openssl/evp.h>
64 63
65#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) 64#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index 798ac442f9..4333e4dff8 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_enc.c,v 1.23 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: evp_enc.c,v 1.24 2014/07/11 08:44:48 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,13 +61,14 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/evp.h>
66#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/evp.h>
67#include <openssl/rand.h> 66#include <openssl/rand.h>
67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
71
71#include "evp_locl.h" 72#include "evp_locl.h"
72 73
73#define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl) 74#define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl)
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c
index 4380be9137..dffca300c6 100644
--- a/src/lib/libcrypto/evp/evp_key.c
+++ b/src/lib/libcrypto/evp/evp_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_key.c,v 1.17 2014/07/10 19:30:06 miod Exp $ */ 1/* $OpenBSD: evp_key.c,v 1.18 2014/07/11 08:44:48 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,11 +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/x509.h>
64#include <openssl/objects.h>
65#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
66#include <openssl/ui.h> 64#include <openssl/ui.h>
65#include <openssl/x509.h>
67 66
68/* should be init to zeros. */ 67/* should be init to zeros. */
69static char prompt_string[80]; 68static char prompt_string[80];
diff --git a/src/lib/libcrypto/evp/evp_lib.c b/src/lib/libcrypto/evp/evp_lib.c
index 1664703288..310252d0e8 100644
--- a/src/lib/libcrypto/evp/evp_lib.c
+++ b/src/lib/libcrypto/evp/evp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_lib.c,v 1.12 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: evp_lib.c,v 1.13 2014/07/11 08:44:48 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,7 +59,7 @@
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/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h> 64#include <openssl/objects.h>
65 65
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c
index 63e71c0bc9..42ec6e0dda 100644
--- a/src/lib/libcrypto/evp/evp_pbe.c
+++ b/src/lib/libcrypto/evp/evp_pbe.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_pbe.c,v 1.19 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: evp_pbe.c,v 1.20 2014/07/11 08:44:48 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 */
@@ -61,10 +61,11 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h" 64#include <openssl/err.h>
65#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/pkcs12.h> 66#include <openssl/pkcs12.h>
67#include <openssl/x509.h> 67#include <openssl/x509.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69 70
70/* Password based encryption (PBE) functions */ 71/* Password based encryption (PBE) functions */
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c
index 46846d2c31..cf7a39be7b 100644
--- a/src/lib/libcrypto/evp/evp_pkey.c
+++ b/src/lib/libcrypto/evp/evp_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_pkey.c,v 1.15 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: evp_pkey.c,v 1.16 2014/07/11 08:44:48 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 */
@@ -58,9 +58,11 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/x509.h> 62#include <openssl/err.h>
63#include <openssl/rand.h> 63#include <openssl/rand.h>
64#include <openssl/x509.h>
65
64#include "asn1_locl.h" 66#include "asn1_locl.h"
65 67
66/* Extract a private key from a PKCS8 structure */ 68/* Extract a private key from a PKCS8 structure */
diff --git a/src/lib/libcrypto/evp/m_dss.c b/src/lib/libcrypto/evp/m_dss.c
index 81e3dd1511..d23c9b4e71 100644
--- a/src/lib/libcrypto/evp/m_dss.c
+++ b/src/lib/libcrypto/evp/m_dss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_dss.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_dss.c,v 1.16 2014/07/11 08:44:48 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,10 +60,10 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/objects.h> 64#include <openssl/objects.h>
66#include <openssl/sha.h> 65#include <openssl/sha.h>
66
67#ifndef OPENSSL_NO_DSA 67#ifndef OPENSSL_NO_DSA
68#include <openssl/dsa.h> 68#include <openssl/dsa.h>
69#endif 69#endif
diff --git a/src/lib/libcrypto/evp/m_dss1.c b/src/lib/libcrypto/evp/m_dss1.c
index efa91230dc..a906c11b69 100644
--- a/src/lib/libcrypto/evp/m_dss1.c
+++ b/src/lib/libcrypto/evp/m_dss1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_dss1.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_dss1.c,v 1.16 2014/07/11 08:44:48 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,13 +60,12 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_SHA 63#ifndef OPENSSL_NO_SHA
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/sha.h> 67#include <openssl/sha.h>
68
70#ifndef OPENSSL_NO_DSA 69#ifndef OPENSSL_NO_DSA
71#include <openssl/dsa.h> 70#include <openssl/dsa.h>
72#endif 71#endif
diff --git a/src/lib/libcrypto/evp/m_ecdsa.c b/src/lib/libcrypto/evp/m_ecdsa.c
index d4872dcf29..b9af6423b5 100644
--- a/src/lib/libcrypto/evp/m_ecdsa.c
+++ b/src/lib/libcrypto/evp/m_ecdsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_ecdsa.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_ecdsa.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -113,7 +113,6 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h"
117#include <openssl/evp.h> 116#include <openssl/evp.h>
118#include <openssl/objects.h> 117#include <openssl/objects.h>
119#include <openssl/x509.h> 118#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/m_md4.c b/src/lib/libcrypto/evp/m_md4.c
index e24d0ad66f..36ea818285 100644
--- a/src/lib/libcrypto/evp/m_md4.c
+++ b/src/lib/libcrypto/evp/m_md4.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_md4.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_md4.c,v 1.13 2014/07/11 08:44:48 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,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MD4 63#ifndef OPENSSL_NO_MD4
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/md4.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/md4.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
diff --git a/src/lib/libcrypto/evp/m_md5.c b/src/lib/libcrypto/evp/m_md5.c
index 445b2b4381..5bd9100a03 100644
--- a/src/lib/libcrypto/evp/m_md5.c
+++ b/src/lib/libcrypto/evp/m_md5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_md5.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_md5.c,v 1.14 2014/07/11 08:44:48 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,17 +60,17 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MD5 63#ifndef OPENSSL_NO_MD5
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/md5.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/md5.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
73
74#include "evp_locl.h" 74#include "evp_locl.h"
75 75
76static int 76static int
diff --git a/src/lib/libcrypto/evp/m_mdc2.c b/src/lib/libcrypto/evp/m_mdc2.c
index c360c986d5..0262f8dc77 100644
--- a/src/lib/libcrypto/evp/m_mdc2.c
+++ b/src/lib/libcrypto/evp/m_mdc2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_mdc2.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_mdc2.c,v 1.14 2014/07/11 08:44:48 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,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MDC2 63#ifndef OPENSSL_NO_MDC2
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/mdc2.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/mdc2.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
diff --git a/src/lib/libcrypto/evp/m_null.c b/src/lib/libcrypto/evp/m_null.c
index 1a10101762..897be3cee9 100644
--- a/src/lib/libcrypto/evp/m_null.c
+++ b/src/lib/libcrypto/evp/m_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_null.c,v 1.8 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: m_null.c,v 1.9 2014/07/11 08:44:48 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/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/m_ripemd.c b/src/lib/libcrypto/evp/m_ripemd.c
index c496a205d6..765eec3138 100644
--- a/src/lib/libcrypto/evp/m_ripemd.c
+++ b/src/lib/libcrypto/evp/m_ripemd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_ripemd.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_ripemd.c,v 1.11 2014/07/11 08:44:48 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,17 +60,17 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RIPEMD 63#ifndef OPENSSL_NO_RIPEMD
66 64
67#include <openssl/ripemd.h>
68#include <openssl/evp.h> 65#include <openssl/evp.h>
69#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include <openssl/ripemd.h>
70#include <openssl/x509.h> 68#include <openssl/x509.h>
69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
73
74#include "evp_locl.h" 74#include "evp_locl.h"
75 75
76static int 76static int
diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c
index ed22c1aec5..73678e4e45 100644
--- a/src/lib/libcrypto/evp/m_sha.c
+++ b/src/lib/libcrypto/evp/m_sha.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sha.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_sha.c,v 1.15 2014/07/11 08:44:48 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,16 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0) 63#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0)
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/x509.h> 67#include <openssl/x509.h>
68
70#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
71#include <openssl/rsa.h> 70#include <openssl/rsa.h>
72#endif 71#endif
72
73#include "evp_locl.h" 73#include "evp_locl.h"
74 74
75static int 75static int
diff --git a/src/lib/libcrypto/evp/m_sha1.c b/src/lib/libcrypto/evp/m_sha1.c
index 0441f632d3..13d5b030d2 100644
--- a/src/lib/libcrypto/evp/m_sha1.c
+++ b/src/lib/libcrypto/evp/m_sha1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sha1.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_sha1.c,v 1.17 2014/07/11 08:44:48 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,16 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_SHA 63#ifndef OPENSSL_NO_SHA
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/sha.h> 67#include <openssl/sha.h>
68
70#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
71#include <openssl/rsa.h> 70#include <openssl/rsa.h>
72#endif 71#endif
73 72
74
75static int 73static int
76init(EVP_MD_CTX *ctx) 74init(EVP_MD_CTX *ctx)
77{ 75{
diff --git a/src/lib/libcrypto/evp/m_sigver.c b/src/lib/libcrypto/evp/m_sigver.c
index 00c9b00732..cc0927325b 100644
--- a/src/lib/libcrypto/evp/m_sigver.c
+++ b/src/lib/libcrypto/evp/m_sigver.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sigver.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: m_sigver.c,v 1.4 2014/07/11 08:44:48 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 */
@@ -57,10 +57,12 @@
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/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
65
64#include "evp_locl.h" 66#include "evp_locl.h"
65 67
66static int 68static int
diff --git a/src/lib/libcrypto/evp/m_wp.c b/src/lib/libcrypto/evp/m_wp.c
index c6b246a3c5..5a391f514e 100644
--- a/src/lib/libcrypto/evp/m_wp.c
+++ b/src/lib/libcrypto/evp/m_wp.c
@@ -1,17 +1,16 @@
1/* $OpenBSD: m_wp.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_wp.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2 2
3#include <stdio.h> 3#include <stdio.h>
4 4
5#include <openssl/opensslconf.h> 5#include <openssl/opensslconf.h>
6 6
7#include "cryptlib.h"
8
9#ifndef OPENSSL_NO_WHIRLPOOL 7#ifndef OPENSSL_NO_WHIRLPOOL
10 8
11#include <openssl/evp.h> 9#include <openssl/evp.h>
12#include <openssl/objects.h> 10#include <openssl/objects.h>
13#include <openssl/x509.h> 11#include <openssl/x509.h>
14#include <openssl/whrlpool.h> 12#include <openssl/whrlpool.h>
13
15#include "evp_locl.h" 14#include "evp_locl.h"
16 15
17static int 16static int
diff --git a/src/lib/libcrypto/evp/names.c b/src/lib/libcrypto/evp/names.c
index fe185bc550..33d7dc8084 100644
--- a/src/lib/libcrypto/evp/names.c
+++ b/src/lib/libcrypto/evp/names.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: names.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: names.c,v 1.12 2014/07/11 08:44:48 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/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/p5_crpt.c b/src/lib/libcrypto/evp/p5_crpt.c
index 1fe6edb143..ec8d816f32 100644
--- a/src/lib/libcrypto/evp/p5_crpt.c
+++ b/src/lib/libcrypto/evp/p5_crpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_crpt.c,v 1.12 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: p5_crpt.c,v 1.13 2014/07/11 08:44:48 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,9 +60,9 @@
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h" 63#include <openssl/err.h>
64#include <openssl/x509.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/x509.h>
66 66
67/* Doesn't do anything now: Builtin PBE algorithms in static table. 67/* Doesn't do anything now: Builtin PBE algorithms in static table.
68 */ 68 */
diff --git a/src/lib/libcrypto/evp/p5_crpt2.c b/src/lib/libcrypto/evp/p5_crpt2.c
index c072376912..61eadec804 100644
--- a/src/lib/libcrypto/evp/p5_crpt2.c
+++ b/src/lib/libcrypto/evp/p5_crpt2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_crpt2.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p5_crpt2.c,v 1.17 2014/07/11 08:44:48 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 */
@@ -62,11 +62,13 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#if !defined(OPENSSL_NO_HMAC) && !defined(OPENSSL_NO_SHA) 65#if !defined(OPENSSL_NO_HMAC) && !defined(OPENSSL_NO_SHA)
67#include <openssl/x509.h> 66
67#include <openssl/err.h>
68#include <openssl/evp.h> 68#include <openssl/evp.h>
69#include <openssl/hmac.h> 69#include <openssl/hmac.h>
70#include <openssl/x509.h>
71
70#include "evp_locl.h" 72#include "evp_locl.h"
71 73
72/* set this to print out info about the keygen algorithm */ 74/* set this to print out info about the keygen algorithm */
diff --git a/src/lib/libcrypto/evp/p_dec.c b/src/lib/libcrypto/evp/p_dec.c
index c47408dff0..bb4e03091e 100644
--- a/src/lib/libcrypto/evp/p_dec.c
+++ b/src/lib/libcrypto/evp/p_dec.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_dec.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_dec.c,v 1.9 2014/07/11 08:44:48 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,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/evp.h>
64#include <openssl/err.h>
65#include <openssl/objects.h>
64#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/x509.h>
68
65#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 70#include <openssl/rsa.h>
67#endif 71#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 72
72int 73int
73EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl, 74EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
diff --git a/src/lib/libcrypto/evp/p_enc.c b/src/lib/libcrypto/evp/p_enc.c
index a1fb9d1d2c..9421646cd3 100644
--- a/src/lib/libcrypto/evp/p_enc.c
+++ b/src/lib/libcrypto/evp/p_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_enc.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_enc.c,v 1.9 2014/07/11 08:44:48 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,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/err.h>
64#include <openssl/evp.h>
65#include <openssl/objects.h>
64#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/x509.h>
68
65#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 70#include <openssl/rsa.h>
67#endif 71#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 72
72int 73int
73EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len, 74EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len,
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c
index 6db5e95cd0..617d0f8ec3 100644
--- a/src/lib/libcrypto/evp/p_lib.c
+++ b/src/lib/libcrypto/evp/p_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_lib.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_lib.c,v 1.15 2014/07/11 08:44:48 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,21 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/asn1_mac.h>
64#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/err.h> 65#include <openssl/err.h>
66#include <openssl/objects.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/asn1_mac.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#ifndef OPENSSL_NO_RSA 69
71#include <openssl/rsa.h> 70#ifndef OPENSSL_NO_DH
71#include <openssl/dh.h>
72#endif 72#endif
73#ifndef OPENSSL_NO_DSA 73#ifndef OPENSSL_NO_DSA
74#include <openssl/dsa.h> 74#include <openssl/dsa.h>
75#endif 75#endif
76#ifndef OPENSSL_NO_DH 76#ifndef OPENSSL_NO_RSA
77#include <openssl/dh.h> 77#include <openssl/rsa.h>
78#endif 78#endif
79 79
80#ifndef OPENSSL_NO_ENGINE 80#ifndef OPENSSL_NO_ENGINE
diff --git a/src/lib/libcrypto/evp/p_open.c b/src/lib/libcrypto/evp/p_open.c
index aec4d9f3d0..aca83e74f6 100644
--- a/src/lib/libcrypto/evp/p_open.c
+++ b/src/lib/libcrypto/evp/p_open.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_open.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_open.c,v 1.16 2014/07/11 08:44:48 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,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RSA 63#ifndef OPENSSL_NO_RSA
66 64
65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h>
70#include <openssl/rsa.h> 68#include <openssl/rsa.h>
69#include <openssl/x509.h>
71 70
72int 71int
73EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 72EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
diff --git a/src/lib/libcrypto/evp/p_seal.c b/src/lib/libcrypto/evp/p_seal.c
index 4acb9f8054..4f8417ae64 100644
--- a/src/lib/libcrypto/evp/p_seal.c
+++ b/src/lib/libcrypto/evp/p_seal.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_seal.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_seal.c,v 1.13 2014/07/11 08:44:48 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,14 +60,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/evp.h>
64#include <openssl/objects.h>
64#include <openssl/rand.h> 65#include <openssl/rand.h>
66#include <openssl/x509.h>
67
65#ifndef OPENSSL_NO_RSA 68#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 69#include <openssl/rsa.h>
67#endif 70#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 71
72int 72int
73EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, 73EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek,
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c
index 34fdf147c6..f68a950c9c 100644
--- a/src/lib/libcrypto/evp/p_sign.c
+++ b/src/lib/libcrypto/evp/p_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_sign.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: p_sign.c,v 1.12 2014/07/11 08:44:48 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,8 @@
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/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/p_verify.c b/src/lib/libcrypto/evp/p_verify.c
index a9a52e85d3..e653fcf6a5 100644
--- a/src/lib/libcrypto/evp/p_verify.c
+++ b/src/lib/libcrypto/evp/p_verify.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_verify.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: p_verify.c,v 1.12 2014/07/11 08:44:48 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,8 @@
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/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/pmeth_fn.c b/src/lib/libcrypto/evp/pmeth_fn.c
index 0af978b6e2..c4a53b0d5f 100644
--- a/src/lib/libcrypto/evp/pmeth_fn.c
+++ b/src/lib/libcrypto/evp/pmeth_fn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_fn.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: pmeth_fn.c,v 1.4 2014/07/11 08:44:48 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 */
@@ -58,9 +58,11 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/objects.h> 62#include <openssl/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
64#include "evp_locl.h" 66#include "evp_locl.h"
65 67
66#define M_check_autoarg(ctx, arg, arglen, err) \ 68#define M_check_autoarg(ctx, arg, arglen, err) \
diff --git a/src/lib/libcrypto/evp/pmeth_gn.c b/src/lib/libcrypto/evp/pmeth_gn.c
index 173df68a28..9eb10d4874 100644
--- a/src/lib/libcrypto/evp/pmeth_gn.c
+++ b/src/lib/libcrypto/evp/pmeth_gn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_gn.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: pmeth_gn.c,v 1.4 2014/07/11 08:44:48 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 */
@@ -58,10 +58,12 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/objects.h>
63#include <openssl/evp.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
63#include <openssl/err.h>
64#include <openssl/evp.h>
65#include <openssl/objects.h>
66
65#include "evp_locl.h" 67#include "evp_locl.h"
66 68
67int 69int
diff --git a/src/lib/libcrypto/evp/pmeth_lib.c b/src/lib/libcrypto/evp/pmeth_lib.c
index f23524b8a9..c9c3444a13 100644
--- a/src/lib/libcrypto/evp/pmeth_lib.c
+++ b/src/lib/libcrypto/evp/pmeth_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_lib.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pmeth_lib.c,v 1.8 2014/07/11 08:44:48 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 */
@@ -62,12 +62,13 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/objects.h>
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h>
67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
71
71#include "asn1_locl.h" 72#include "asn1_locl.h"
72#include "evp_locl.h" 73#include "evp_locl.h"
73 74
diff --git a/src/lib/libcrypto/ex_data.c b/src/lib/libcrypto/ex_data.c
index 4fb97038b0..7ac5a692c7 100644
--- a/src/lib/libcrypto/ex_data.c
+++ b/src/lib/libcrypto/ex_data.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ex_data.c,v 1.16 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: ex_data.c,v 1.17 2014/07/11 08:44:47 jsing Exp $ */
2 2
3/* 3/*
4 * Overhaul notes; 4 * Overhaul notes;
@@ -138,7 +138,7 @@
138 * 138 *
139 */ 139 */
140 140
141#include "cryptlib.h" 141#include <openssl/err.h>
142#include <openssl/lhash.h> 142#include <openssl/lhash.h>
143 143
144/* What an "implementation of ex_data functionality" looks like */ 144/* What an "implementation of ex_data functionality" looks like */
diff --git a/src/lib/libcrypto/hmac/hm_ameth.c b/src/lib/libcrypto/hmac/hm_ameth.c
index e552f6ea2c..f4fa6f4bc3 100644
--- a/src/lib/libcrypto/hmac/hm_ameth.c
+++ b/src/lib/libcrypto/hmac/hm_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hm_ameth.c,v 1.7 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: hm_ameth.c,v 1.8 2014/07/11 08:44:48 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 2007. 3 * project 2007.
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/evp.h> 62#include <openssl/evp.h>
63
64#include "asn1_locl.h" 64#include "asn1_locl.h"
65 65
66#define HMAC_TEST_PRIVATE_KEY_FORMAT 66#define HMAC_TEST_PRIVATE_KEY_FORMAT
diff --git a/src/lib/libcrypto/hmac/hm_pmeth.c b/src/lib/libcrypto/hmac/hm_pmeth.c
index 8bcd3c557f..255f4ece8b 100644
--- a/src/lib/libcrypto/hmac/hm_pmeth.c
+++ b/src/lib/libcrypto/hmac/hm_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hm_pmeth.c,v 1.7 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: hm_pmeth.c,v 1.8 2014/07/11 08:44:48 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 2007. 3 * project 2007.
4 */ 4 */
@@ -59,11 +59,11 @@
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/x509.h>
64#include <openssl/x509v3.h>
65#include <openssl/evp.h> 62#include <openssl/evp.h>
66#include <openssl/hmac.h> 63#include <openssl/hmac.h>
64#include <openssl/x509.h>
65#include <openssl/x509v3.h>
66
67#include "evp_locl.h" 67#include "evp_locl.h"
68 68
69/* HMAC pkey context structure */ 69/* HMAC pkey context structure */
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c
index 975fc4d1ec..f2e5f149e0 100644
--- a/src/lib/libcrypto/hmac/hmac.c
+++ b/src/lib/libcrypto/hmac/hmac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hmac.c,v 1.20 2014/06/21 13:39:46 jsing Exp $ */ 1/* $OpenBSD: hmac.c,v 1.21 2014/07/11 08:44:48 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 *
@@ -55,10 +55,11 @@
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58
58#include <stdio.h> 59#include <stdio.h>
59#include <stdlib.h> 60#include <stdlib.h>
60#include <string.h> 61#include <string.h>
61#include "cryptlib.h" 62
62#include <openssl/hmac.h> 63#include <openssl/hmac.h>
63 64
64int 65int
diff --git a/src/lib/libcrypto/lhash/lh_stats.c b/src/lib/libcrypto/lhash/lh_stats.c
index b4202efb2e..e7dde47806 100644
--- a/src/lib/libcrypto/lhash/lh_stats.c
+++ b/src/lib/libcrypto/lhash/lh_stats.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: lh_stats.c,v 1.11 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: lh_stats.c,v 1.12 2014/07/11 08:44:48 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,10 +62,6 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65/* If you wish to build this outside of SSLeay, remove the following lines
66 * and things should work as expected */
67#include "cryptlib.h"
68
69#ifndef OPENSSL_NO_BIO 65#ifndef OPENSSL_NO_BIO
70#include <openssl/bio.h> 66#include <openssl/bio.h>
71#endif 67#endif
diff --git a/src/lib/libcrypto/mdc2/mdc2_one.c b/src/lib/libcrypto/mdc2/mdc2_one.c
index 6740d00925..8f922b1c7d 100644
--- a/src/lib/libcrypto/mdc2/mdc2_one.c
+++ b/src/lib/libcrypto/mdc2/mdc2_one.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mdc2_one.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: mdc2_one.c,v 1.4 2014/07/11 08:44:49 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,8 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/crypto.h>
61#include <openssl/mdc2.h> 62#include <openssl/mdc2.h>
62 63
63unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md) 64unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md)
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index 4d0307a315..071febba52 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_dat.c,v 1.29 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: obj_dat.c,v 1.30 2014/07/11 08:44:49 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 *
@@ -63,11 +63,11 @@
63 63
64#include <openssl/opensslconf.h> 64#include <openssl/opensslconf.h>
65 65
66#include "cryptlib.h"
67#include <openssl/lhash.h>
68#include <openssl/asn1.h> 66#include <openssl/asn1.h>
69#include <openssl/objects.h>
70#include <openssl/bn.h> 67#include <openssl/bn.h>
68#include <openssl/err.h>
69#include <openssl/lhash.h>
70#include <openssl/objects.h>
71 71
72/* obj_dat.h is generated from objects.h by obj_dat.pl */ 72/* obj_dat.h is generated from objects.h by obj_dat.pl */
73#ifndef OPENSSL_NO_OBJECT 73#ifndef OPENSSL_NO_OBJECT
diff --git a/src/lib/libcrypto/objects/obj_lib.c b/src/lib/libcrypto/objects/obj_lib.c
index 41e0af696e..6dc515e628 100644
--- a/src/lib/libcrypto/objects/obj_lib.c
+++ b/src/lib/libcrypto/objects/obj_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_lib.c,v 1.11 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: obj_lib.c,v 1.12 2014/07/11 08:44:49 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/err.h>
63#include <openssl/buffer.h>
63#include <openssl/lhash.h> 64#include <openssl/lhash.h>
64#include <openssl/objects.h> 65#include <openssl/objects.h>
65#include <openssl/buffer.h>
66 66
67ASN1_OBJECT * 67ASN1_OBJECT *
68OBJ_dup(const ASN1_OBJECT *o) 68OBJ_dup(const ASN1_OBJECT *o)
diff --git a/src/lib/libcrypto/ocsp/ocsp_cl.c b/src/lib/libcrypto/ocsp/ocsp_cl.c
index d435adae90..030aaef18c 100644
--- a/src/lib/libcrypto/ocsp/ocsp_cl.c
+++ b/src/lib/libcrypto/ocsp/ocsp_cl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_cl.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: ocsp_cl.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -63,13 +63,14 @@
63 63
64#include <stdio.h> 64#include <stdio.h>
65#include <time.h> 65#include <time.h>
66#include <cryptlib.h> 66
67#include <openssl/err.h>
68#include <openssl/ocsp.h>
67#include <openssl/objects.h> 69#include <openssl/objects.h>
70#include <openssl/pem.h>
68#include <openssl/rand.h> 71#include <openssl/rand.h>
69#include <openssl/x509.h> 72#include <openssl/x509.h>
70#include <openssl/pem.h>
71#include <openssl/x509v3.h> 73#include <openssl/x509v3.h>
72#include <openssl/ocsp.h>
73 74
74/* Utility functions related to sending OCSP requests and extracting 75/* Utility functions related to sending OCSP requests and extracting
75 * relevant information from the response. 76 * relevant information from the response.
diff --git a/src/lib/libcrypto/ocsp/ocsp_ext.c b/src/lib/libcrypto/ocsp/ocsp_ext.c
index a0e58e7401..c7b9d817ac 100644
--- a/src/lib/libcrypto/ocsp/ocsp_ext.c
+++ b/src/lib/libcrypto/ocsp/ocsp_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_ext.c,v 1.10 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ocsp_ext.c,v 1.11 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -61,14 +61,13 @@
61 * 61 *
62 */ 62 */
63 63
64#include <cryptlib.h>
65#include <stdio.h> 64#include <stdio.h>
66#include <string.h> 65#include <string.h>
67 66
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h>
70#include <openssl/ocsp.h> 68#include <openssl/ocsp.h>
71#include <openssl/rand.h> 69#include <openssl/rand.h>
70#include <openssl/x509.h>
72#include <openssl/x509v3.h> 71#include <openssl/x509v3.h>
73 72
74/* Standard wrapper functions for extensions */ 73/* Standard wrapper functions for extensions */
diff --git a/src/lib/libcrypto/ocsp/ocsp_lib.c b/src/lib/libcrypto/ocsp/ocsp_lib.c
index eda627f4ed..8599e48bff 100644
--- a/src/lib/libcrypto/ocsp/ocsp_lib.c
+++ b/src/lib/libcrypto/ocsp/ocsp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_lib.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: ocsp_lib.c,v 1.14 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -61,19 +61,19 @@
61 * 61 *
62 */ 62 */
63 63
64#include <cryptlib.h>
65#include <stdio.h> 64#include <stdio.h>
66#include <string.h> 65#include <string.h>
67 66
68#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
69 68
69#include <openssl/asn1t.h>
70#include <openssl/err.h>
70#include <openssl/objects.h> 71#include <openssl/objects.h>
72#include <openssl/ocsp.h>
73#include <openssl/pem.h>
71#include <openssl/rand.h> 74#include <openssl/rand.h>
72#include <openssl/x509.h> 75#include <openssl/x509.h>
73#include <openssl/pem.h>
74#include <openssl/x509v3.h> 76#include <openssl/x509v3.h>
75#include <openssl/ocsp.h>
76#include <openssl/asn1t.h>
77 77
78/* Convert a certificate and its issuer to an OCSP_CERTID */ 78/* Convert a certificate and its issuer to an OCSP_CERTID */
79 79
diff --git a/src/lib/libcrypto/ocsp/ocsp_srv.c b/src/lib/libcrypto/ocsp/ocsp_srv.c
index cad3bf81be..c18519fb11 100644
--- a/src/lib/libcrypto/ocsp/ocsp_srv.c
+++ b/src/lib/libcrypto/ocsp/ocsp_srv.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_srv.c,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: ocsp_srv.c,v 1.6 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -57,13 +57,14 @@
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/objects.h> 62#include <openssl/objects.h>
63#include <openssl/ocsp.h>
64#include <openssl/pem.h>
62#include <openssl/rand.h> 65#include <openssl/rand.h>
63#include <openssl/x509.h> 66#include <openssl/x509.h>
64#include <openssl/pem.h>
65#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
66#include <openssl/ocsp.h>
67 68
68/* Utility functions related to sending OCSP responses and extracting 69/* Utility functions related to sending OCSP responses and extracting
69 * relevant information from the request. 70 * relevant information from the request.
diff --git a/src/lib/libcrypto/pem/pem_all.c b/src/lib/libcrypto/pem/pem_all.c
index e883acdc65..7df917b01c 100644
--- a/src/lib/libcrypto/pem/pem_all.c
+++ b/src/lib/libcrypto/pem/pem_all.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_all.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_all.c,v 1.15 2014/07/11 08:44:49 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 *
@@ -113,20 +113,20 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h"
117#include <openssl/bio.h> 116#include <openssl/bio.h>
118#include <openssl/evp.h> 117#include <openssl/evp.h>
119#include <openssl/x509.h>
120#include <openssl/pkcs7.h>
121#include <openssl/pem.h> 118#include <openssl/pem.h>
122#ifndef OPENSSL_NO_RSA 119#include <openssl/pkcs7.h>
123#include <openssl/rsa.h> 120#include <openssl/x509.h>
121
122#ifndef OPENSSL_NO_DH
123#include <openssl/dh.h>
124#endif 124#endif
125#ifndef OPENSSL_NO_DSA 125#ifndef OPENSSL_NO_DSA
126#include <openssl/dsa.h> 126#include <openssl/dsa.h>
127#endif 127#endif
128#ifndef OPENSSL_NO_DH 128#ifndef OPENSSL_NO_RSA
129#include <openssl/dh.h> 129#include <openssl/rsa.h>
130#endif 130#endif
131 131
132#ifndef OPENSSL_NO_RSA 132#ifndef OPENSSL_NO_RSA
diff --git a/src/lib/libcrypto/pem/pem_info.c b/src/lib/libcrypto/pem/pem_info.c
index eaf70e4267..9ddcb56596 100644
--- a/src/lib/libcrypto/pem/pem_info.c
+++ b/src/lib/libcrypto/pem/pem_info.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_info.c,v 1.18 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_info.c,v 1.19 2014/07/11 08:44:49 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,18 +61,19 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/buffer.h> 64#include <openssl/buffer.h>
66#include <openssl/objects.h> 65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/x509.h> 67#include <openssl/objects.h>
69#include <openssl/pem.h> 68#include <openssl/pem.h>
70#ifndef OPENSSL_NO_RSA 69#include <openssl/x509.h>
71#include <openssl/rsa.h> 70
72#endif
73#ifndef OPENSSL_NO_DSA 71#ifndef OPENSSL_NO_DSA
74#include <openssl/dsa.h> 72#include <openssl/dsa.h>
75#endif 73#endif
74#ifndef OPENSSL_NO_RSA
75#include <openssl/rsa.h>
76#endif
76 77
77STACK_OF(X509_INFO) * 78STACK_OF(X509_INFO) *
78PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, 79PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c
index 70e2aa633d..8e5c82c245 100644
--- a/src/lib/libcrypto/pem/pem_lib.c
+++ b/src/lib/libcrypto/pem/pem_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_lib.c,v 1.32 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_lib.c,v 1.33 2014/07/11 08:44:49 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,15 +62,14 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/buffer.h> 65#include <openssl/buffer.h>
67#include <openssl/objects.h>
68#include <openssl/evp.h> 66#include <openssl/evp.h>
69#include <openssl/rand.h> 67#include <openssl/objects.h>
70#include <openssl/x509.h>
71#include <openssl/pem.h> 68#include <openssl/pem.h>
72#include <openssl/pkcs12.h> 69#include <openssl/pkcs12.h>
73#include "asn1_locl.h" 70#include <openssl/rand.h>
71#include <openssl/x509.h>
72
74#ifndef OPENSSL_NO_DES 73#ifndef OPENSSL_NO_DES
75#include <openssl/des.h> 74#include <openssl/des.h>
76#endif 75#endif
@@ -78,6 +77,8 @@
78#include <openssl/engine.h> 77#include <openssl/engine.h>
79#endif 78#endif
80 79
80#include "asn1_locl.h"
81
81#define MIN_LENGTH 4 82#define MIN_LENGTH 4
82 83
83static int load_iv(char **fromp, unsigned char *to, int num); 84static int load_iv(char **fromp, unsigned char *to, int num);
diff --git a/src/lib/libcrypto/pem/pem_oth.c b/src/lib/libcrypto/pem/pem_oth.c
index 41a1696f9a..d56c6b26d1 100644
--- a/src/lib/libcrypto/pem/pem_oth.c
+++ b/src/lib/libcrypto/pem/pem_oth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_oth.c,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_oth.c,v 1.6 2014/07/11 08:44:49 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,13 +57,14 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h> 61#include <openssl/buffer.h>
62#include <openssl/objects.h> 62#include <openssl/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include <openssl/pem.h>
64#include <openssl/rand.h> 66#include <openssl/rand.h>
65#include <openssl/x509.h> 67#include <openssl/x509.h>
66#include <openssl/pem.h>
67 68
68/* Handle 'other' PEMs: not private keys */ 69/* Handle 'other' PEMs: not private keys */
69 70
diff --git a/src/lib/libcrypto/pem/pem_pk8.c b/src/lib/libcrypto/pem/pem_pk8.c
index fc53826077..dafbd13814 100644
--- a/src/lib/libcrypto/pem/pem_pk8.c
+++ b/src/lib/libcrypto/pem/pem_pk8.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_pk8.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_pk8.c,v 1.7 2014/07/11 08:44:49 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,14 +57,15 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h> 61#include <openssl/buffer.h>
62#include <openssl/objects.h> 62#include <openssl/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include <openssl/pem.h>
66#include <openssl/pkcs12.h>
64#include <openssl/rand.h> 67#include <openssl/rand.h>
65#include <openssl/x509.h> 68#include <openssl/x509.h>
66#include <openssl/pkcs12.h>
67#include <openssl/pem.h>
68 69
69static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid, 70static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid,
70 const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); 71 const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u);
diff --git a/src/lib/libcrypto/pem/pem_pkey.c b/src/lib/libcrypto/pem/pem_pkey.c
index 68d6590f14..7e5e4f5771 100644
--- a/src/lib/libcrypto/pem/pem_pkey.c
+++ b/src/lib/libcrypto/pem/pem_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_pkey.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_pkey.c,v 1.17 2014/07/11 08:44:49 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,17 +61,18 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/buffer.h> 64#include <openssl/buffer.h>
66#include <openssl/objects.h>
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h>
67#include <openssl/pem.h>
68#include <openssl/pkcs12.h>
68#include <openssl/rand.h> 69#include <openssl/rand.h>
69#include <openssl/x509.h> 70#include <openssl/x509.h>
70#include <openssl/pkcs12.h> 71
71#include <openssl/pem.h>
72#ifndef OPENSSL_NO_ENGINE 72#ifndef OPENSSL_NO_ENGINE
73#include <openssl/engine.h> 73#include <openssl/engine.h>
74#endif 74#endif
75
75#include "asn1_locl.h" 76#include "asn1_locl.h"
76 77
77int pem_check_suffix(const char *pem_str, const char *suffix); 78int pem_check_suffix(const char *pem_str, const char *suffix);
diff --git a/src/lib/libcrypto/pem/pem_seal.c b/src/lib/libcrypto/pem/pem_seal.c
index 08680e45db..90ba01584c 100644
--- a/src/lib/libcrypto/pem/pem_seal.c
+++ b/src/lib/libcrypto/pem/pem_seal.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_seal.c,v 1.19 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_seal.c,v 1.20 2014/07/11 08:44:49 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,13 +62,14 @@
62#include <openssl/opensslconf.h> /* for OPENSSL_NO_RSA */ 62#include <openssl/opensslconf.h> /* for OPENSSL_NO_RSA */
63 63
64#ifndef OPENSSL_NO_RSA 64#ifndef OPENSSL_NO_RSA
65#include "cryptlib.h" 65
66#include <openssl/err.h>
66#include <openssl/evp.h> 67#include <openssl/evp.h>
67#include <openssl/rand.h> 68#include <openssl/rand.h>
68#include <openssl/objects.h> 69#include <openssl/objects.h>
69#include <openssl/x509.h>
70#include <openssl/pem.h> 70#include <openssl/pem.h>
71#include <openssl/rsa.h> 71#include <openssl/rsa.h>
72#include <openssl/x509.h>
72 73
73int 74int
74PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, 75PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
diff --git a/src/lib/libcrypto/pem/pem_sign.c b/src/lib/libcrypto/pem/pem_sign.c
index f1c4d4dcb9..0f996c7220 100644
--- a/src/lib/libcrypto/pem/pem_sign.c
+++ b/src/lib/libcrypto/pem/pem_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_sign.c,v 1.10 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_sign.c,v 1.11 2014/07/11 08:44:49 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,12 +57,13 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/rand.h> 61#include <openssl/err.h>
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/x509.h>
65#include <openssl/pem.h> 64#include <openssl/pem.h>
65#include <openssl/rand.h>
66#include <openssl/x509.h>
66 67
67void 68void
68PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) 69PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type)
diff --git a/src/lib/libcrypto/pem/pem_x509.c b/src/lib/libcrypto/pem/pem_x509.c
index 7b4b888ea9..e4b7f1c2c6 100644
--- a/src/lib/libcrypto/pem/pem_x509.c
+++ b/src/lib/libcrypto/pem/pem_x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_x509.c,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_x509.c,v 1.6 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -57,11 +57,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/bio.h> 61#include <openssl/bio.h>
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/x509.h>
64#include <openssl/pkcs7.h>
65#include <openssl/pem.h> 63#include <openssl/pem.h>
64#include <openssl/pkcs7.h>
65#include <openssl/x509.h>
66 66
67IMPLEMENT_PEM_rw(X509, X509, PEM_STRING_X509, X509) 67IMPLEMENT_PEM_rw(X509, X509, PEM_STRING_X509, X509)
diff --git a/src/lib/libcrypto/pem/pem_xaux.c b/src/lib/libcrypto/pem/pem_xaux.c
index 99e2cd367b..eb76840532 100644
--- a/src/lib/libcrypto/pem/pem_xaux.c
+++ b/src/lib/libcrypto/pem/pem_xaux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_xaux.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_xaux.c,v 1.7 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -57,12 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/bio.h> 61#include <openssl/bio.h>
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/x509.h>
64#include <openssl/pkcs7.h>
65#include <openssl/pem.h> 63#include <openssl/pem.h>
64#include <openssl/pkcs7.h>
65#include <openssl/x509.h>
66 66
67IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX) 67IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX)
68IMPLEMENT_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR, PEM_STRING_X509_PAIR, 68IMPLEMENT_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR, PEM_STRING_X509_PAIR,
diff --git a/src/lib/libcrypto/pem/pvkfmt.c b/src/lib/libcrypto/pem/pvkfmt.c
index 8a945b4dd7..55cfffa7bc 100644
--- a/src/lib/libcrypto/pem/pvkfmt.c
+++ b/src/lib/libcrypto/pem/pvkfmt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pvkfmt.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pvkfmt.c,v 1.9 2014/07/11 08:44:49 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 2005. 3 * project 2005.
4 */ 4 */
@@ -64,10 +64,11 @@
64 64
65#include <openssl/opensslconf.h> 65#include <openssl/opensslconf.h>
66 66
67#include "cryptlib.h" 67#include <openssl/bn.h>
68#include <openssl/err.h>
68#include <openssl/pem.h> 69#include <openssl/pem.h>
69#include <openssl/rand.h> 70#include <openssl/rand.h>
70#include <openssl/bn.h> 71
71#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) 72#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
72#include <openssl/dsa.h> 73#include <openssl/dsa.h>
73#include <openssl/rsa.h> 74#include <openssl/rsa.h>
diff --git a/src/lib/libcrypto/pkcs12/p12_add.c b/src/lib/libcrypto/pkcs12/p12_add.c
index 6aa872631e..11373cda4f 100644
--- a/src/lib/libcrypto/pkcs12/p12_add.c
+++ b/src/lib/libcrypto/pkcs12/p12_add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_add.c,v 1.10 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_add.c,v 1.11 2014/07/11 08:44:49 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,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63/* Pack an object into an OCTET STRING and turn into a safebag */ 64/* Pack an object into an OCTET STRING and turn into a safebag */
diff --git a/src/lib/libcrypto/pkcs12/p12_asn.c b/src/lib/libcrypto/pkcs12/p12_asn.c
index b72db76383..5b3285ebe2 100644
--- a/src/lib/libcrypto/pkcs12/p12_asn.c
+++ b/src/lib/libcrypto/pkcs12/p12_asn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_asn.c,v 1.5 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_asn.c,v 1.6 2014/07/11 08:44:49 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/pkcs12.h> 62#include <openssl/pkcs12.h>
63 63
diff --git a/src/lib/libcrypto/pkcs12/p12_attr.c b/src/lib/libcrypto/pkcs12/p12_attr.c
index 05e9b11fd1..7552cf0a60 100644
--- a/src/lib/libcrypto/pkcs12/p12_attr.c
+++ b/src/lib/libcrypto/pkcs12/p12_attr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_attr.c,v 1.9 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_attr.c,v 1.10 2014/07/11 08:44:49 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/pkcs12.h> 61#include <openssl/pkcs12.h>
62 62
63/* Add a local keyid to a safebag */ 63/* Add a local keyid to a safebag */
diff --git a/src/lib/libcrypto/pkcs12/p12_crpt.c b/src/lib/libcrypto/pkcs12/p12_crpt.c
index 1709b30d5e..288c93c49f 100644
--- a/src/lib/libcrypto/pkcs12/p12_crpt.c
+++ b/src/lib/libcrypto/pkcs12/p12_crpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_crpt.c,v 1.10 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_crpt.c,v 1.11 2014/07/11 08:44:49 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,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63/* PKCS#12 PBE algorithms now in static table */ 64/* PKCS#12 PBE algorithms now in static table */
diff --git a/src/lib/libcrypto/pkcs12/p12_crt.c b/src/lib/libcrypto/pkcs12/p12_crt.c
index 538637e78a..1d5c3dfd16 100644
--- a/src/lib/libcrypto/pkcs12/p12_crt.c
+++ b/src/lib/libcrypto/pkcs12/p12_crt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_crt.c,v 1.14 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_crt.c,v 1.15 2014/07/11 08:44:49 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 */
@@ -57,9 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h"
61#include <openssl/pkcs12.h>
62 60
61#include <openssl/err.h>
62#include <openssl/pkcs12.h>
63 63
64static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags, 64static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags,
65 PKCS12_SAFEBAG *bag); 65 PKCS12_SAFEBAG *bag);
diff --git a/src/lib/libcrypto/pkcs12/p12_decr.c b/src/lib/libcrypto/pkcs12/p12_decr.c
index c06f580de2..b6bd508bf1 100644
--- a/src/lib/libcrypto/pkcs12/p12_decr.c
+++ b/src/lib/libcrypto/pkcs12/p12_decr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_decr.c,v 1.12 2014/07/10 10:01:23 miod Exp $ */ 1/* $OpenBSD: p12_decr.c,v 1.13 2014/07/11 08:44:49 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"
61#include <openssl/pkcs12.h>
62 60
61#include <openssl/err.h>
62#include <openssl/pkcs12.h>
63 63
64/* Encrypt/Decrypt a buffer based on password and algor, result in a 64/* Encrypt/Decrypt a buffer based on password and algor, result in a
65 * malloc'ed buffer 65 * malloc'ed buffer
diff --git a/src/lib/libcrypto/pkcs12/p12_init.c b/src/lib/libcrypto/pkcs12/p12_init.c
index b4da7be77c..2db73d34c2 100644
--- a/src/lib/libcrypto/pkcs12/p12_init.c
+++ b/src/lib/libcrypto/pkcs12/p12_init.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_init.c,v 1.8 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_init.c,v 1.9 2014/07/11 08:44:49 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,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63/* Initialise a PKCS12 structure to take data */ 64/* Initialise a PKCS12 structure to take data */
diff --git a/src/lib/libcrypto/pkcs12/p12_key.c b/src/lib/libcrypto/pkcs12/p12_key.c
index 379108f4b5..1f7583084e 100644
--- a/src/lib/libcrypto/pkcs12/p12_key.c
+++ b/src/lib/libcrypto/pkcs12/p12_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_key.c,v 1.19 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: p12_key.c,v 1.20 2014/07/11 08:44:49 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,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/pkcs12.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
63#include <openssl/err.h>
64#include <openssl/pkcs12.h>
65 65
66/* PKCS12 compatible key/IV generation */ 66/* PKCS12 compatible key/IV generation */
67#ifndef min 67#ifndef min
diff --git a/src/lib/libcrypto/pkcs12/p12_kiss.c b/src/lib/libcrypto/pkcs12/p12_kiss.c
index 4063ba4b82..eaaa2bc911 100644
--- a/src/lib/libcrypto/pkcs12/p12_kiss.c
+++ b/src/lib/libcrypto/pkcs12/p12_kiss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_kiss.c,v 1.15 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_kiss.c,v 1.16 2014/07/11 08:44:49 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,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63/* Simplified PKCS#12 routines */ 64/* Simplified PKCS#12 routines */
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c
index 582d1de23b..453d30d65f 100644
--- a/src/lib/libcrypto/pkcs12/p12_mutl.c
+++ b/src/lib/libcrypto/pkcs12/p12_mutl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_mutl.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p12_mutl.c,v 1.17 2014/07/11 08:44:49 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 */
@@ -62,10 +62,11 @@
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#ifndef OPENSSL_NO_HMAC 64#ifndef OPENSSL_NO_HMAC
65#include "cryptlib.h" 65
66#include <openssl/err.h>
66#include <openssl/hmac.h> 67#include <openssl/hmac.h>
67#include <openssl/rand.h>
68#include <openssl/pkcs12.h> 68#include <openssl/pkcs12.h>
69#include <openssl/rand.h>
69 70
70/* Generate a MAC */ 71/* Generate a MAC */
71int 72int
diff --git a/src/lib/libcrypto/pkcs12/p12_p8d.c b/src/lib/libcrypto/pkcs12/p12_p8d.c
index 4aceae6a9f..5d3339e2f2 100644
--- a/src/lib/libcrypto/pkcs12/p12_p8d.c
+++ b/src/lib/libcrypto/pkcs12/p12_p8d.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_p8d.c,v 1.4 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_p8d.c,v 1.5 2014/07/11 08:44:49 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 2001. 3 * project 2001.
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/pkcs12.h> 61#include <openssl/pkcs12.h>
62 62
63PKCS8_PRIV_KEY_INFO * 63PKCS8_PRIV_KEY_INFO *
diff --git a/src/lib/libcrypto/pkcs12/p12_p8e.c b/src/lib/libcrypto/pkcs12/p12_p8e.c
index 1ee6a32f6a..24ed7f69ed 100644
--- a/src/lib/libcrypto/pkcs12/p12_p8e.c
+++ b/src/lib/libcrypto/pkcs12/p12_p8e.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_p8e.c,v 1.4 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_p8e.c,v 1.5 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -57,7 +57,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63X509_SIG * 64X509_SIG *
diff --git a/src/lib/libcrypto/pkcs12/p12_utl.c b/src/lib/libcrypto/pkcs12/p12_utl.c
index 712e16cf99..b60d4d020c 100644
--- a/src/lib/libcrypto/pkcs12/p12_utl.c
+++ b/src/lib/libcrypto/pkcs12/p12_utl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_utl.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: p12_utl.c,v 1.12 2014/07/11 08:44:49 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/pkcs12.h> 62#include <openssl/pkcs12.h>
64 63
65/* Cheap and nasty Unicode stuff */ 64/* Cheap and nasty Unicode stuff */
diff --git a/src/lib/libcrypto/pkcs7/pk7_asn1.c b/src/lib/libcrypto/pkcs7/pk7_asn1.c
index 8be5447518..5191eb5076 100644
--- a/src/lib/libcrypto/pkcs7/pk7_asn1.c
+++ b/src/lib/libcrypto/pkcs7/pk7_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_asn1.c,v 1.6 2014/06/29 17:05:36 jsing Exp $ */ 1/* $OpenBSD: pk7_asn1.c,v 1.7 2014/07/11 08:44:49 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/pkcs7.h> 62#include <openssl/pkcs7.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c
index 8ef3f392df..4556949456 100644
--- a/src/lib/libcrypto/pkcs7/pk7_doit.c
+++ b/src/lib/libcrypto/pkcs7/pk7_doit.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_doit.c,v 1.26 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: pk7_doit.c,v 1.27 2014/07/11 08:44:49 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,12 +59,11 @@
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/err.h>
63#include <openssl/rand.h>
64#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/rand.h>
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67#include <openssl/err.h>
68 67
69static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype, 68static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
70 void *value); 69 void *value);
diff --git a/src/lib/libcrypto/pkcs7/pk7_lib.c b/src/lib/libcrypto/pkcs7/pk7_lib.c
index 63b73f88aa..699f5df394 100644
--- a/src/lib/libcrypto/pkcs7/pk7_lib.c
+++ b/src/lib/libcrypto/pkcs7/pk7_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_lib.c,v 1.12 2014/07/08 09:08:27 jsing Exp $ */ 1/* $OpenBSD: pk7_lib.c,v 1.13 2014/07/11 08:44:49 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/objects.h> 62#include <openssl/objects.h>
62#include <openssl/x509.h> 63#include <openssl/x509.h>
64
63#include "asn1_locl.h" 65#include "asn1_locl.h"
64 66
65long 67long
diff --git a/src/lib/libcrypto/pkcs7/pk7_mime.c b/src/lib/libcrypto/pkcs7/pk7_mime.c
index 8f32125f0b..e14abf31a9 100644
--- a/src/lib/libcrypto/pkcs7/pk7_mime.c
+++ b/src/lib/libcrypto/pkcs7/pk7_mime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_mime.c,v 1.10 2014/06/29 17:05:36 jsing Exp $ */ 1/* $OpenBSD: pk7_mime.c,v 1.11 2014/07/11 08:44:49 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 */
@@ -52,12 +52,12 @@
52 * 52 *
53 */ 53 */
54 54
55#include <stdio.h>
56#include <ctype.h> 55#include <ctype.h>
57#include "cryptlib.h" 56#include <stdio.h>
57
58#include <openssl/asn1.h>
58#include <openssl/rand.h> 59#include <openssl/rand.h>
59#include <openssl/x509.h> 60#include <openssl/x509.h>
60#include <openssl/asn1.h>
61 61
62/* PKCS#7 wrappers round generalised stream and MIME routines */ 62/* PKCS#7 wrappers round generalised stream and MIME routines */
63 63
diff --git a/src/lib/libcrypto/pkcs7/pk7_smime.c b/src/lib/libcrypto/pkcs7/pk7_smime.c
index 6b7b1ccd46..b76e2b1915 100644
--- a/src/lib/libcrypto/pkcs7/pk7_smime.c
+++ b/src/lib/libcrypto/pkcs7/pk7_smime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_smime.c,v 1.17 2014/07/10 21:42:43 miod Exp $ */ 1/* $OpenBSD: pk7_smime.c,v 1.18 2014/07/11 08:44:49 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 */
@@ -59,7 +59,8 @@
59/* Simple PKCS#7 processing functions */ 59/* Simple PKCS#7 processing functions */
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include "cryptlib.h" 62
63#include <openssl/err.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
64#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
65 66
diff --git a/src/lib/libcrypto/rand/rand_lib.c b/src/lib/libcrypto/rand/rand_lib.c
index 38c1569940..2b2c827740 100644
--- a/src/lib/libcrypto/rand/rand_lib.c
+++ b/src/lib/libcrypto/rand/rand_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rand_lib.c,v 1.18 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rand_lib.c,v 1.19 2014/07/11 08:44:49 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> 3 * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
4 * 4 *
@@ -17,7 +17,6 @@
17 17
18#include <openssl/opensslconf.h> 18#include <openssl/opensslconf.h>
19 19
20#include "cryptlib.h"
21#include <openssl/rand.h> 20#include <openssl/rand.h>
22 21
23#include <stdlib.h> 22#include <stdlib.h>
diff --git a/src/lib/libcrypto/rc4/rc4_locl.h b/src/lib/libcrypto/rc4/rc4_locl.h
index 513d4dd82e..d2b08064a3 100644
--- a/src/lib/libcrypto/rc4/rc4_locl.h
+++ b/src/lib/libcrypto/rc4/rc4_locl.h
@@ -1,7 +1,5 @@
1/* $OpenBSD: rc4_locl.h,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: rc4_locl.h,v 1.4 2014/07/11 08:44:49 jsing Exp $ */
2 2
3#ifndef HEADER_RC4_LOCL_H 3#ifndef HEADER_RC4_LOCL_H
4#define HEADER_RC4_LOCL_H 4#define HEADER_RC4_LOCL_H
5#include <openssl/opensslconf.h>
6#include <cryptlib.h>
7#endif 5#endif
diff --git a/src/lib/libcrypto/rsa/rsa_ameth.c b/src/lib/libcrypto/rsa/rsa_ameth.c
index 1eeb58ed9b..bcc0eee4b9 100644
--- a/src/lib/libcrypto/rsa/rsa_ameth.c
+++ b/src/lib/libcrypto/rsa/rsa_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_ameth.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_ameth.c,v 1.11 2014/07/11 08:44:49 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 */
@@ -60,14 +60,16 @@
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>
65#include <openssl/x509.h>
66#include <openssl/rsa.h>
67#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/err.h>
66#include <openssl/rsa.h>
67#include <openssl/x509.h>
68
68#ifndef OPENSSL_NO_CMS 69#ifndef OPENSSL_NO_CMS
69#include <openssl/cms.h> 70#include <openssl/cms.h>
70#endif 71#endif
72
71#include "asn1_locl.h" 73#include "asn1_locl.h"
72 74
73static int 75static int
diff --git a/src/lib/libcrypto/rsa/rsa_asn1.c b/src/lib/libcrypto/rsa/rsa_asn1.c
index 9bc5f17b06..573b9f8b8d 100644
--- a/src/lib/libcrypto/rsa/rsa_asn1.c
+++ b/src/lib/libcrypto/rsa/rsa_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_asn1.c,v 1.8 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_asn1.c,v 1.9 2014/07/11 08:44:49 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,11 +57,11 @@
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/bn.h> 62#include <openssl/bn.h>
62#include <openssl/rsa.h> 63#include <openssl/rsa.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
64#include <openssl/asn1t.h>
65 65
66/* Override the default free and new methods */ 66/* Override the default free and new methods */
67static int 67static int
diff --git a/src/lib/libcrypto/rsa/rsa_crpt.c b/src/lib/libcrypto/rsa/rsa_crpt.c
index 220ce9497a..2adb2b31b2 100644
--- a/src/lib/libcrypto/rsa/rsa_crpt.c
+++ b/src/lib/libcrypto/rsa/rsa_crpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_crpt.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_crpt.c,v 1.11 2014/07/11 08:44:49 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,12 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/bn.h>
63#include <openssl/crypto.h> 64#include <openssl/crypto.h>
64#include "cryptlib.h"
65#include <openssl/lhash.h> 65#include <openssl/lhash.h>
66#include <openssl/bn.h>
67#include <openssl/rsa.h>
68#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/rsa.h>
68
69#ifndef OPENSSL_NO_ENGINE 69#ifndef OPENSSL_NO_ENGINE
70#include <openssl/engine.h> 70#include <openssl/engine.h>
71#endif 71#endif
diff --git a/src/lib/libcrypto/rsa/rsa_depr.c b/src/lib/libcrypto/rsa/rsa_depr.c
index 547f9a491e..b830a2293c 100644
--- a/src/lib/libcrypto/rsa/rsa_depr.c
+++ b/src/lib/libcrypto/rsa/rsa_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_depr.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_depr.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -61,7 +61,6 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/bn.h> 64#include <openssl/bn.h>
66#include <openssl/rsa.h> 65#include <openssl/rsa.h>
67 66
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c
index 3cc8f6c5cf..571a9a0f05 100644
--- a/src/lib/libcrypto/rsa/rsa_eay.c
+++ b/src/lib/libcrypto/rsa/rsa_eay.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_eay.c,v 1.33 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_eay.c,v 1.34 2014/07/11 08:44:49 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 *
@@ -113,10 +113,10 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h"
117#include <openssl/bn.h> 116#include <openssl/bn.h>
118#include <openssl/rsa.h> 117#include <openssl/err.h>
119#include <openssl/rand.h> 118#include <openssl/rand.h>
119#include <openssl/rsa.h>
120 120
121static int RSA_eay_public_encrypt(int flen, const unsigned char *from, 121static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
122 unsigned char *to, RSA *rsa, int padding); 122 unsigned char *to, RSA *rsa, int padding);
diff --git a/src/lib/libcrypto/rsa/rsa_gen.c b/src/lib/libcrypto/rsa/rsa_gen.c
index f000b41940..a3b9da4856 100644
--- a/src/lib/libcrypto/rsa/rsa_gen.c
+++ b/src/lib/libcrypto/rsa/rsa_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_gen.c,v 1.15 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_gen.c,v 1.16 2014/07/11 08:44:49 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 *
@@ -64,8 +64,9 @@
64 64
65#include <stdio.h> 65#include <stdio.h>
66#include <time.h> 66#include <time.h>
67#include "cryptlib.h" 67
68#include <openssl/bn.h> 68#include <openssl/bn.h>
69#include <openssl/err.h>
69#include <openssl/rsa.h> 70#include <openssl/rsa.h>
70 71
71static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); 72static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb);
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c
index d7a51c7b05..157c347f88 100644
--- a/src/lib/libcrypto/rsa/rsa_lib.c
+++ b/src/lib/libcrypto/rsa/rsa_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_lib.c,v 1.27 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_lib.c,v 1.28 2014/07/11 08:44:49 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,12 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/bn.h>
63#include <openssl/crypto.h> 64#include <openssl/crypto.h>
64#include "cryptlib.h"
65#include <openssl/lhash.h> 65#include <openssl/lhash.h>
66#include <openssl/bn.h>
67#include <openssl/rsa.h>
68#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/rsa.h>
68
69#ifndef OPENSSL_NO_ENGINE 69#ifndef OPENSSL_NO_ENGINE
70#include <openssl/engine.h> 70#include <openssl/engine.h>
71#endif 71#endif
diff --git a/src/lib/libcrypto/rsa/rsa_none.c b/src/lib/libcrypto/rsa/rsa_none.c
index 503d93bb68..3527f1c682 100644
--- a/src/lib/libcrypto/rsa/rsa_none.c
+++ b/src/lib/libcrypto/rsa/rsa_none.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_none.c,v 1.8 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_none.c,v 1.9 2014/07/11 08:44:49 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"
63#include <openssl/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/rand.h> 64#include <openssl/rand.h>
65#include <openssl/rsa.h>
66 66
67int 67int
68RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *from, 68RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *from,
diff --git a/src/lib/libcrypto/rsa/rsa_oaep.c b/src/lib/libcrypto/rsa/rsa_oaep.c
index 09799818d3..9be0f9be31 100644
--- a/src/lib/libcrypto/rsa/rsa_oaep.c
+++ b/src/lib/libcrypto/rsa/rsa_oaep.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_oaep.c,v 1.22 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_oaep.c,v 1.23 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Ulf Moeller. This software is distributed on an "AS IS" 2/* Written by Ulf Moeller. This software is distributed on an "AS IS"
3 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ 3 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */
4 4
@@ -24,11 +24,12 @@
24#include <openssl/opensslconf.h> 24#include <openssl/opensslconf.h>
25 25
26#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) 26#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
27#include "cryptlib.h" 27
28#include <openssl/bn.h> 28#include <openssl/bn.h>
29#include <openssl/rsa.h> 29#include <openssl/err.h>
30#include <openssl/evp.h> 30#include <openssl/evp.h>
31#include <openssl/rand.h> 31#include <openssl/rand.h>
32#include <openssl/rsa.h>
32#include <openssl/sha.h> 33#include <openssl/sha.h>
33 34
34static int MGF1(unsigned char *mask, long len, const unsigned char *seed, 35static int MGF1(unsigned char *mask, long len, const unsigned char *seed,
diff --git a/src/lib/libcrypto/rsa/rsa_pk1.c b/src/lib/libcrypto/rsa/rsa_pk1.c
index 6d11ee19f9..4f82bf6768 100644
--- a/src/lib/libcrypto/rsa/rsa_pk1.c
+++ b/src/lib/libcrypto/rsa/rsa_pk1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pk1.c,v 1.12 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_pk1.c,v 1.13 2014/07/11 08:44:49 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/bn.h> 62#include <openssl/bn.h>
63#include <openssl/err.h>
64#include <openssl/rsa.h> 64#include <openssl/rsa.h>
65#include <openssl/rand.h> 65#include <openssl/rand.h>
66 66
diff --git a/src/lib/libcrypto/rsa/rsa_pmeth.c b/src/lib/libcrypto/rsa/rsa_pmeth.c
index 0b2d680eed..954190d560 100644
--- a/src/lib/libcrypto/rsa/rsa_pmeth.c
+++ b/src/lib/libcrypto/rsa/rsa_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pmeth.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_pmeth.c,v 1.14 2014/07/11 08:44:49 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 */
@@ -62,15 +62,17 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/asn1t.h> 65#include <openssl/asn1t.h>
67#include <openssl/x509.h>
68#include <openssl/rsa.h>
69#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/err.h>
70#include <openssl/evp.h> 68#include <openssl/evp.h>
69#include <openssl/rsa.h>
70#include <openssl/x509.h>
71
71#ifndef OPENSSL_NO_CMS 72#ifndef OPENSSL_NO_CMS
72#include <openssl/cms.h> 73#include <openssl/cms.h>
73#endif 74#endif
75
74#include "evp_locl.h" 76#include "evp_locl.h"
75#include "rsa_locl.h" 77#include "rsa_locl.h"
76 78
diff --git a/src/lib/libcrypto/rsa/rsa_prn.c b/src/lib/libcrypto/rsa/rsa_prn.c
index 5d5b0e29d8..db82dab5be 100644
--- a/src/lib/libcrypto/rsa/rsa_prn.c
+++ b/src/lib/libcrypto/rsa/rsa_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_prn.c,v 1.5 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_prn.c,v 1.6 2014/07/11 08:44:49 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 */
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/rsa.h> 61#include <openssl/err.h>
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/rsa.h>
63 64
64int 65int
65RSA_print_fp(FILE *fp, const RSA *x, int off) 66RSA_print_fp(FILE *fp, const RSA *x, int off)
diff --git a/src/lib/libcrypto/rsa/rsa_pss.c b/src/lib/libcrypto/rsa/rsa_pss.c
index fa32a856ba..e18ca632aa 100644
--- a/src/lib/libcrypto/rsa/rsa_pss.c
+++ b/src/lib/libcrypto/rsa/rsa_pss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pss.c,v 1.8 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_pss.c,v 1.9 2014/07/11 08:44:49 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 2005. 3 * project 2005.
4 */ 4 */
@@ -59,11 +59,11 @@
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/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
66#include <openssl/rand.h> 65#include <openssl/rand.h>
66#include <openssl/rsa.h>
67#include <openssl/sha.h> 67#include <openssl/sha.h>
68 68
69static const unsigned char zeroes[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 69static const unsigned char zeroes[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
diff --git a/src/lib/libcrypto/rsa/rsa_saos.c b/src/lib/libcrypto/rsa/rsa_saos.c
index f2cf06af4c..47b2a4e95f 100644
--- a/src/lib/libcrypto/rsa/rsa_saos.c
+++ b/src/lib/libcrypto/rsa/rsa_saos.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_saos.c,v 1.14 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_saos.c,v 1.15 2014/07/11 08:44:49 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"
63#include <openssl/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/rsa.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67 67
68int 68int
diff --git a/src/lib/libcrypto/rsa/rsa_sign.c b/src/lib/libcrypto/rsa/rsa_sign.c
index c7e0a55829..a446b563b3 100644
--- a/src/lib/libcrypto/rsa/rsa_sign.c
+++ b/src/lib/libcrypto/rsa/rsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_sign.c,v 1.21 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_sign.c,v 1.22 2014/07/11 08:44:49 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,11 +59,12 @@
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/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/rsa.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67
67#include "rsa_locl.h" 68#include "rsa_locl.h"
68 69
69/* Size of an SSL signature: MD5+SHA1 */ 70/* Size of an SSL signature: MD5+SHA1 */
diff --git a/src/lib/libcrypto/rsa/rsa_ssl.c b/src/lib/libcrypto/rsa/rsa_ssl.c
index 71372341c2..a5fe5004b1 100644
--- a/src/lib/libcrypto/rsa/rsa_ssl.c
+++ b/src/lib/libcrypto/rsa/rsa_ssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_ssl.c,v 1.12 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_ssl.c,v 1.13 2014/07/11 08:44:49 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"
63#include <openssl/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/rand.h> 64#include <openssl/rand.h>
65#include <openssl/rsa.h>
66 66
67int 67int
68RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from, 68RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from,
diff --git a/src/lib/libcrypto/rsa/rsa_x931.c b/src/lib/libcrypto/rsa/rsa_x931.c
index 5809f62cbd..8ee309e6c9 100644
--- a/src/lib/libcrypto/rsa/rsa_x931.c
+++ b/src/lib/libcrypto/rsa/rsa_x931.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_x931.c,v 1.7 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_x931.c,v 1.8 2014/07/11 08:44:49 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 2005. 3 * project 2005.
4 */ 4 */
@@ -59,11 +59,11 @@
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/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/rand.h>
66#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/rand.h>
66#include <openssl/rsa.h>
67 67
68int 68int
69RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *from, 69RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *from,
diff --git a/src/lib/libcrypto/sha/sha512.c b/src/lib/libcrypto/sha/sha512.c
index eb10024e32..ad72b7e6f1 100644
--- a/src/lib/libcrypto/sha/sha512.c
+++ b/src/lib/libcrypto/sha/sha512.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sha512.c,v 1.12 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: sha512.c,v 1.13 2014/07/11 08:44:49 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2004 The OpenSSL Project. All rights reserved 3 * Copyright (c) 2004 The OpenSSL Project. All rights reserved
4 * according to the OpenSSL license [found in ../../LICENSE]. 4 * according to the OpenSSL license [found in ../../LICENSE].
@@ -50,10 +50,8 @@
50 */ 50 */
51 51
52#include <openssl/crypto.h> 52#include <openssl/crypto.h>
53#include <openssl/sha.h>
54#include <openssl/opensslv.h> 53#include <openssl/opensslv.h>
55 54#include <openssl/sha.h>
56#include "cryptlib.h"
57 55
58#if !defined(__STRICT_ALIGNMENT) || defined(SHA512_ASM) 56#if !defined(__STRICT_ALIGNMENT) || defined(SHA512_ASM)
59#define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA 57#define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
diff --git a/src/lib/libcrypto/srp/srp_lib.c b/src/lib/libcrypto/srp/srp_lib.c
index 078296fa0a..1e96adc6a3 100644
--- a/src/lib/libcrypto/srp/srp_lib.c
+++ b/src/lib/libcrypto/srp/srp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: srp_lib.c,v 1.8 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: srp_lib.c,v 1.9 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with 2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with
3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr) 3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr)
4 * for the EdelKey project and contributed to the OpenSSL project 2004. 4 * for the EdelKey project and contributed to the OpenSSL project 2004.
@@ -60,10 +60,11 @@
60#include <openssl/opensslconf.h> 60#include <openssl/opensslconf.h>
61 61
62#ifndef OPENSSL_NO_SRP 62#ifndef OPENSSL_NO_SRP
63#include "cryptlib.h" 63
64#include "srp_lcl.h"
65#include <openssl/srp.h>
66#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/srp.h>
66
67#include "srp_lcl.h"
67 68
68#if (BN_BYTES == 8) 69#if (BN_BYTES == 8)
69# if defined(_LP64) 70# if defined(_LP64)
diff --git a/src/lib/libcrypto/srp/srp_vfy.c b/src/lib/libcrypto/srp/srp_vfy.c
index 756744609a..0981890086 100644
--- a/src/lib/libcrypto/srp/srp_vfy.c
+++ b/src/lib/libcrypto/srp/srp_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: srp_vfy.c,v 1.6 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: srp_vfy.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with 2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with
3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr) 3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr)
4 * for the EdelKey project and contributed to the OpenSSL project 2004. 4 * for the EdelKey project and contributed to the OpenSSL project 2004.
@@ -60,14 +60,15 @@
60#include <openssl/opensslconf.h> 60#include <openssl/opensslconf.h>
61 61
62#ifndef OPENSSL_NO_SRP 62#ifndef OPENSSL_NO_SRP
63#include "cryptlib.h" 63
64#include "srp_lcl.h"
65#include <openssl/srp.h>
66#include <openssl/evp.h>
67#include <openssl/buffer.h> 64#include <openssl/buffer.h>
65#include <openssl/evp.h>
68#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/srp.h>
69#include <openssl/txt_db.h> 68#include <openssl/txt_db.h>
70 69
70#include "srp_lcl.h"
71
71#define SRP_RANDOM_SALT_LEN 20 72#define SRP_RANDOM_SALT_LEN 20
72#define MAX_LEN 2500 73#define MAX_LEN 2500
73 74
diff --git a/src/lib/libcrypto/stack/stack.c b/src/lib/libcrypto/stack/stack.c
index a219d959e9..cbd4d216f6 100644
--- a/src/lib/libcrypto/stack/stack.c
+++ b/src/lib/libcrypto/stack/stack.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: stack.c,v 1.17 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: stack.c,v 1.18 2014/07/11 08:44:49 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 *
@@ -69,9 +69,8 @@
69#include <stdio.h> 69#include <stdio.h>
70#include <string.h> 70#include <string.h>
71 71
72#include "cryptlib.h"
73#include <openssl/stack.h>
74#include <openssl/objects.h> 72#include <openssl/objects.h>
73#include <openssl/stack.h>
75 74
76#undef MIN_NODES 75#undef MIN_NODES
77#define MIN_NODES 4 76#define MIN_NODES 4
diff --git a/src/lib/libcrypto/ts/ts_conf.c b/src/lib/libcrypto/ts/ts_conf.c
index 685fdc0736..ec033b1cfc 100644
--- a/src/lib/libcrypto/ts/ts_conf.c
+++ b/src/lib/libcrypto/ts/ts_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_conf.c,v 1.6 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: ts_conf.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -61,12 +61,12 @@
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/crypto.h> 63#include <openssl/crypto.h>
64#include "cryptlib.h"
65#include <openssl/pem.h> 64#include <openssl/pem.h>
65#include <openssl/ts.h>
66
66#ifndef OPENSSL_NO_ENGINE 67#ifndef OPENSSL_NO_ENGINE
67#include <openssl/engine.h> 68#include <openssl/engine.h>
68#endif 69#endif
69#include <openssl/ts.h>
70 70
71/* Macro definitions for the configuration file. */ 71/* Macro definitions for the configuration file. */
72 72
diff --git a/src/lib/libcrypto/ts/ts_lib.c b/src/lib/libcrypto/ts/ts_lib.c
index ad37037b7f..f08bb8701d 100644
--- a/src/lib/libcrypto/ts/ts_lib.c
+++ b/src/lib/libcrypto/ts/ts_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_lib.c,v 1.7 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ts_lib.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -59,11 +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/objects.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
65#include <openssl/x509v3.h> 63#include <openssl/objects.h>
66#include <openssl/ts.h> 64#include <openssl/ts.h>
65#include <openssl/x509v3.h>
67 66
68/* Local function declarations. */ 67/* Local function declarations. */
69 68
diff --git a/src/lib/libcrypto/ts/ts_req_print.c b/src/lib/libcrypto/ts/ts_req_print.c
index 0fd115f684..64a8133a58 100644
--- a/src/lib/libcrypto/ts/ts_req_print.c
+++ b/src/lib/libcrypto/ts/ts_req_print.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_req_print.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ts_req_print.c,v 1.4 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -57,11 +57,11 @@
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/bn.h> 61#include <openssl/bn.h>
63#include <openssl/x509v3.h> 62#include <openssl/objects.h>
64#include <openssl/ts.h> 63#include <openssl/ts.h>
64#include <openssl/x509v3.h>
65 65
66/* Function definitions. */ 66/* Function definitions. */
67 67
diff --git a/src/lib/libcrypto/ts/ts_req_utils.c b/src/lib/libcrypto/ts/ts_req_utils.c
index 8ba1246cf8..ab813b2b42 100644
--- a/src/lib/libcrypto/ts/ts_req_utils.c
+++ b/src/lib/libcrypto/ts/ts_req_utils.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_req_utils.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ts_req_utils.c,v 1.4 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -57,10 +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/objects.h> 62#include <openssl/objects.h>
62#include <openssl/x509v3.h>
63#include <openssl/ts.h> 63#include <openssl/ts.h>
64#include <openssl/x509v3.h>
64 65
65int 66int
66TS_REQ_set_version(TS_REQ *a, long version) 67TS_REQ_set_version(TS_REQ *a, long version)
diff --git a/src/lib/libcrypto/ts/ts_rsp_print.c b/src/lib/libcrypto/ts/ts_rsp_print.c
index be76c86e44..c442b71646 100644
--- a/src/lib/libcrypto/ts/ts_rsp_print.c
+++ b/src/lib/libcrypto/ts/ts_rsp_print.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_print.c,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ts_rsp_print.c,v 1.5 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -57,11 +57,11 @@
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/bn.h> 61#include <openssl/bn.h>
63#include <openssl/x509v3.h> 62#include <openssl/objects.h>
64#include <openssl/ts.h> 63#include <openssl/ts.h>
64#include <openssl/x509v3.h>
65 65
66struct status_map_st { 66struct status_map_st {
67 int bit; 67 int bit;
diff --git a/src/lib/libcrypto/ts/ts_rsp_sign.c b/src/lib/libcrypto/ts/ts_rsp_sign.c
index 5421085b5a..9d20e66f9a 100644
--- a/src/lib/libcrypto/ts/ts_rsp_sign.c
+++ b/src/lib/libcrypto/ts/ts_rsp_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_sign.c,v 1.16 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ts_rsp_sign.c,v 1.17 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -60,11 +60,10 @@
60 60
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h" 63#include <openssl/err.h>
64
65#include <openssl/objects.h> 64#include <openssl/objects.h>
66#include <openssl/ts.h>
67#include <openssl/pkcs7.h> 65#include <openssl/pkcs7.h>
66#include <openssl/ts.h>
68 67
69/* Private function declarations. */ 68/* Private function declarations. */
70 69
diff --git a/src/lib/libcrypto/ts/ts_rsp_utils.c b/src/lib/libcrypto/ts/ts_rsp_utils.c
index bf449e7abf..0d05814297 100644
--- a/src/lib/libcrypto/ts/ts_rsp_utils.c
+++ b/src/lib/libcrypto/ts/ts_rsp_utils.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_utils.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ts_rsp_utils.c,v 1.4 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -57,10 +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/objects.h> 62#include <openssl/objects.h>
62#include <openssl/ts.h>
63#include <openssl/pkcs7.h> 63#include <openssl/pkcs7.h>
64#include <openssl/ts.h>
64 65
65/* Function definitions. */ 66/* Function definitions. */
66 67
diff --git a/src/lib/libcrypto/ts/ts_rsp_verify.c b/src/lib/libcrypto/ts/ts_rsp_verify.c
index 8b3d5a86ac..25fc22dfaf 100644
--- a/src/lib/libcrypto/ts/ts_rsp_verify.c
+++ b/src/lib/libcrypto/ts/ts_rsp_verify.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_verify.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ts_rsp_verify.c,v 1.12 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
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/err.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/ts.h>
65#include <openssl/pkcs7.h> 64#include <openssl/pkcs7.h>
65#include <openssl/ts.h>
66 66
67/* Private function declarations. */ 67/* Private function declarations. */
68 68
diff --git a/src/lib/libcrypto/ts/ts_verify_ctx.c b/src/lib/libcrypto/ts/ts_verify_ctx.c
index 3b500233db..373399d943 100644
--- a/src/lib/libcrypto/ts/ts_verify_ctx.c
+++ b/src/lib/libcrypto/ts/ts_verify_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_verify_ctx.c,v 1.6 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ts_verify_ctx.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2003. 3 * project 2003.
4 */ 4 */
@@ -58,7 +58,7 @@
58 58
59#include <string.h> 59#include <string.h>
60 60
61#include "cryptlib.h" 61#include <openssl/err.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/ts.h> 63#include <openssl/ts.h>
64 64
diff --git a/src/lib/libcrypto/txt_db/txt_db.c b/src/lib/libcrypto/txt_db/txt_db.c
index 274be5f4dc..26df76a9c2 100644
--- a/src/lib/libcrypto/txt_db/txt_db.c
+++ b/src/lib/libcrypto/txt_db/txt_db.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: txt_db.c,v 1.17 2014/07/09 11:10:51 bcook Exp $ */ 1/* $OpenBSD: txt_db.c,v 1.18 2014/07/11 08:44:49 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,7 +59,7 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62#include "cryptlib.h" 62
63#include <openssl/buffer.h> 63#include <openssl/buffer.h>
64#include <openssl/txt_db.h> 64#include <openssl/txt_db.h>
65 65
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c
index fa171b4d21..c2fe62df33 100644
--- a/src/lib/libcrypto/ui/ui_lib.c
+++ b/src/lib/libcrypto/ui/ui_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ui_lib.c,v 1.24 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ui_lib.c,v 1.25 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -60,11 +60,10 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#include <openssl/buffer.h> 63#include <openssl/buffer.h>
66#include <openssl/ui.h>
67#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/ui.h>
66
68#include "ui_locl.h" 67#include "ui_locl.h"
69 68
70IMPLEMENT_STACK_OF(UI_STRING_ST) static const UI_METHOD *default_UI_meth = NULL; 69IMPLEMENT_STACK_OF(UI_STRING_ST) static const UI_METHOD *default_UI_meth = NULL;
diff --git a/src/lib/libcrypto/ui/ui_openssl.c b/src/lib/libcrypto/ui/ui_openssl.c
index 32298625ca..f7f01bb4f1 100644
--- a/src/lib/libcrypto/ui/ui_openssl.c
+++ b/src/lib/libcrypto/ui/ui_openssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ui_openssl.c,v 1.21 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ui_openssl.c,v 1.22 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) and others 2/* Written by Richard Levitte (richard@levitte.org) and others
3 * for the OpenSSL project 2001. 3 * for the OpenSSL project 2001.
4 */ 4 */
@@ -114,26 +114,23 @@
114 * [including the GNU Public Licence.] 114 * [including the GNU Public Licence.]
115 */ 115 */
116 116
117#include <sys/ioctl.h>
118
117#include <openssl/opensslconf.h> 119#include <openssl/opensslconf.h>
118 120
121#include <errno.h>
119#include <signal.h> 122#include <signal.h>
120#include <stdio.h> 123#include <stdio.h>
121#include <string.h> 124#include <string.h>
122#include <errno.h>
123
124#include <unistd.h>
125#include <termios.h> 125#include <termios.h>
126#include <unistd.h>
126 127
127#include "ui_locl.h" 128#include "ui_locl.h"
128#include "cryptlib.h"
129
130#include <sys/ioctl.h>
131 129
132#ifndef NX509_SIG 130#ifndef NX509_SIG
133#define NX509_SIG 32 131#define NX509_SIG 32
134#endif 132#endif
135 133
136
137/* Define globals. They are protected by a lock */ 134/* Define globals. They are protected by a lock */
138static struct sigaction savsig[NX509_SIG]; 135static struct sigaction savsig[NX509_SIG];
139 136
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c
index 110c22d6f5..a7dc2292bc 100644
--- a/src/lib/libcrypto/x509/by_dir.c
+++ b/src/lib/libcrypto/x509/by_dir.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: by_dir.c,v 1.31 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: by_dir.c,v 1.32 2014/07/11 08:44:49 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 *
@@ -66,15 +66,14 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h" 69#include <openssl/err.h>
70#include <openssl/lhash.h>
71#include <openssl/x509.h>
70 72
71#ifndef OPENSSL_NO_POSIX_IO 73#ifndef OPENSSL_NO_POSIX_IO
72# include <sys/stat.h> 74# include <sys/stat.h>
73#endif 75#endif
74 76
75#include <openssl/lhash.h>
76#include <openssl/x509.h>
77
78typedef struct lookup_dir_hashes_st { 77typedef struct lookup_dir_hashes_st {
79 unsigned long hash; 78 unsigned long hash;
80 int suffix; 79 int suffix;
diff --git a/src/lib/libcrypto/x509/by_file.c b/src/lib/libcrypto/x509/by_file.c
index cf3553181d..10adcfbd77 100644
--- a/src/lib/libcrypto/x509/by_file.c
+++ b/src/lib/libcrypto/x509/by_file.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: by_file.c,v 1.14 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: by_file.c,v 1.15 2014/07/11 08:44:49 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,12 +61,11 @@
61#include <time.h> 61#include <time.h>
62#include <unistd.h> 62#include <unistd.h>
63 63
64#include "cryptlib.h"
65#include <openssl/lhash.h>
66#include <openssl/buffer.h> 64#include <openssl/buffer.h>
67#include <openssl/x509.h> 65#include <openssl/err.h>
68#include <openssl/pem.h> 66#include <openssl/pem.h>
69 67#include <openssl/lhash.h>
68#include <openssl/x509.h>
70 69
71static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, 70static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
72 long argl, char **ret); 71 long argl, char **ret);
diff --git a/src/lib/libcrypto/x509/x509_att.c b/src/lib/libcrypto/x509/x509_att.c
index 241464d999..4ae7504cae 100644
--- a/src/lib/libcrypto/x509/x509_att.c
+++ b/src/lib/libcrypto/x509/x509_att.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_att.c,v 1.10 2014/07/03 21:21:11 miod Exp $ */ 1/* $OpenBSD: x509_att.c,v 1.11 2014/07/11 08:44:49 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,11 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/stack.h> 60
61#include "cryptlib.h"
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/objects.h> 62#include <openssl/err.h>
64#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include <openssl/stack.h>
65#include <openssl/x509.h> 66#include <openssl/x509.h>
66#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
67 68
diff --git a/src/lib/libcrypto/x509/x509_cmp.c b/src/lib/libcrypto/x509/x509_cmp.c
index 20b4ceba27..e26866dc80 100644
--- a/src/lib/libcrypto/x509/x509_cmp.c
+++ b/src/lib/libcrypto/x509/x509_cmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_cmp.c,v 1.21 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: x509_cmp.c,v 1.22 2014/07/11 08:44:49 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,8 +62,8 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/asn1.h> 65#include <openssl/asn1.h>
66#include <openssl/err.h>
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68#include <openssl/x509.h> 68#include <openssl/x509.h>
69#include <openssl/x509v3.h> 69#include <openssl/x509v3.h>
diff --git a/src/lib/libcrypto/x509/x509_d2.c b/src/lib/libcrypto/x509/x509_d2.c
index 9d42a63f30..cc22f4f470 100644
--- a/src/lib/libcrypto/x509/x509_d2.c
+++ b/src/lib/libcrypto/x509/x509_d2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_d2.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_d2.c,v 1.9 2014/07/11 08:44:49 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/crypto.h> 61#include <openssl/crypto.h>
62#include <openssl/err.h>
62#include <openssl/x509.h> 63#include <openssl/x509.h>
63 64
64int 65int
diff --git a/src/lib/libcrypto/x509/x509_ext.c b/src/lib/libcrypto/x509/x509_ext.c
index 9d4f1d1122..a5b5430ad4 100644
--- a/src/lib/libcrypto/x509/x509_ext.c
+++ b/src/lib/libcrypto/x509/x509_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_ext.c,v 1.7 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_ext.c,v 1.8 2014/07/11 08:44:49 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,15 +57,14 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/stack.h> 60
61#include "cryptlib.h"
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/objects.h>
64#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/stack.h>
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68
69int 68int
70X509_CRL_get_ext_count(X509_CRL *x) 69X509_CRL_get_ext_count(X509_CRL *x)
71{ 70{
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c
index 1634ae951d..8d3e4f4dce 100644
--- a/src/lib/libcrypto/x509/x509_lu.c
+++ b/src/lib/libcrypto/x509/x509_lu.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_lu.c,v 1.15 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_lu.c,v 1.16 2014/07/11 08:44:49 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,8 @@
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/lhash.h> 62#include <openssl/lhash.h>
62#include <openssl/x509.h> 63#include <openssl/x509.h>
63#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
diff --git a/src/lib/libcrypto/x509/x509_obj.c b/src/lib/libcrypto/x509/x509_obj.c
index 88f058d882..f7f2a380a1 100644
--- a/src/lib/libcrypto/x509/x509_obj.c
+++ b/src/lib/libcrypto/x509/x509_obj.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_obj.c,v 1.15 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: x509_obj.c,v 1.16 2014/07/11 08:44:49 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,11 +59,11 @@
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/buffer.h>
63#include <openssl/err.h>
63#include <openssl/lhash.h> 64#include <openssl/lhash.h>
64#include <openssl/objects.h> 65#include <openssl/objects.h>
65#include <openssl/x509.h> 66#include <openssl/x509.h>
66#include <openssl/buffer.h>
67 67
68char * 68char *
69X509_NAME_oneline(X509_NAME *a, char *buf, int len) 69X509_NAME_oneline(X509_NAME *a, char *buf, int len)
diff --git a/src/lib/libcrypto/x509/x509_r2x.c b/src/lib/libcrypto/x509/x509_r2x.c
index e87dd11fba..9a9a59d9bb 100644
--- a/src/lib/libcrypto/x509/x509_r2x.c
+++ b/src/lib/libcrypto/x509/x509_r2x.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_r2x.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_r2x.c,v 1.9 2014/07/11 08:44:49 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,13 +57,14 @@
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/bn.h> 62#include <openssl/bn.h>
63#include <openssl/buffer.h>
64#include <openssl/err.h>
62#include <openssl/evp.h> 65#include <openssl/evp.h>
63#include <openssl/asn1.h>
64#include <openssl/x509.h>
65#include <openssl/objects.h> 66#include <openssl/objects.h>
66#include <openssl/buffer.h> 67#include <openssl/x509.h>
67 68
68X509 * 69X509 *
69X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) 70X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
diff --git a/src/lib/libcrypto/x509/x509_req.c b/src/lib/libcrypto/x509/x509_req.c
index d22fc12a70..22d2124614 100644
--- a/src/lib/libcrypto/x509/x509_req.c
+++ b/src/lib/libcrypto/x509/x509_req.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_req.c,v 1.14 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: x509_req.c,v 1.15 2014/07/11 08:44:49 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,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/bn.h>
65#include <openssl/evp.h>
66#include <openssl/asn1.h> 63#include <openssl/asn1.h>
67#include <openssl/asn1t.h> 64#include <openssl/asn1t.h>
68#include <openssl/x509.h> 65#include <openssl/bn.h>
69#include <openssl/objects.h>
70#include <openssl/buffer.h> 66#include <openssl/buffer.h>
67#include <openssl/err.h>
68#include <openssl/evp.h>
69#include <openssl/objects.h>
71#include <openssl/pem.h> 70#include <openssl/pem.h>
71#include <openssl/x509.h>
72 72
73X509_REQ * 73X509_REQ *
74X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) 74X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c
index 523c6621b1..3be557cbc0 100644
--- a/src/lib/libcrypto/x509/x509_set.c
+++ b/src/lib/libcrypto/x509/x509_set.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_set.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_set.c,v 1.9 2014/07/11 08:44:49 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 <openssl/objects.h>
63#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66int 66int
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c
index b8e01603c5..f104c1fd16 100644
--- a/src/lib/libcrypto/x509/x509_trs.c
+++ b/src/lib/libcrypto/x509/x509_trs.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_trs.c,v 1.14 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_trs.c,v 1.15 2014/07/11 08:44:49 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"
61#include <openssl/x509v3.h>
62 60
61#include <openssl/err.h>
62#include <openssl/x509v3.h>
63 63
64static int tr_cmp(const X509_TRUST * const *a, const X509_TRUST * const *b); 64static int tr_cmp(const X509_TRUST * const *a, const X509_TRUST * const *b);
65static void trtable_free(X509_TRUST *p); 65static void trtable_free(X509_TRUST *p);
diff --git a/src/lib/libcrypto/x509/x509_txt.c b/src/lib/libcrypto/x509/x509_txt.c
index b1b3f3e58d..14fa2378c4 100644
--- a/src/lib/libcrypto/x509/x509_txt.c
+++ b/src/lib/libcrypto/x509/x509_txt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_txt.c,v 1.18 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_txt.c,v 1.19 2014/07/11 08:44:49 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,17 +56,16 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <errno.h>
59#include <stdio.h> 60#include <stdio.h>
60#include <time.h> 61#include <time.h>
61#include <errno.h>
62 62
63#include "cryptlib.h" 63#include <openssl/asn1.h>
64#include <openssl/lhash.h>
65#include <openssl/buffer.h> 64#include <openssl/buffer.h>
66#include <openssl/evp.h> 65#include <openssl/evp.h>
67#include <openssl/asn1.h> 66#include <openssl/lhash.h>
68#include <openssl/x509.h>
69#include <openssl/objects.h> 67#include <openssl/objects.h>
68#include <openssl/x509.h>
70 69
71const char * 70const char *
72X509_verify_cert_error_string(long n) 71X509_verify_cert_error_string(long n)
diff --git a/src/lib/libcrypto/x509/x509_v3.c b/src/lib/libcrypto/x509/x509_v3.c
index 7425782ebf..a745e6f71b 100644
--- a/src/lib/libcrypto/x509/x509_v3.c
+++ b/src/lib/libcrypto/x509/x509_v3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_v3.c,v 1.9 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_v3.c,v 1.10 2014/07/11 08:44:49 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,11 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/stack.h> 60
61#include "cryptlib.h"
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/objects.h> 62#include <openssl/err.h>
64#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include <openssl/stack.h>
65#include <openssl/x509.h> 66#include <openssl/x509.h>
66#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
67 68
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index 60067d220f..f7feb85f36 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.c,v 1.32 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.33 2014/07/11 08:44:49 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 *
@@ -64,15 +64,15 @@
64 64
65#include <openssl/opensslconf.h> 65#include <openssl/opensslconf.h>
66 66
67#include "cryptlib.h" 67#include <openssl/asn1.h>
68#include <openssl/crypto.h>
69#include <openssl/lhash.h>
70#include <openssl/buffer.h> 68#include <openssl/buffer.h>
69#include <openssl/crypto.h>
70#include <openssl/err.h>
71#include <openssl/evp.h> 71#include <openssl/evp.h>
72#include <openssl/asn1.h> 72#include <openssl/lhash.h>
73#include <openssl/objects.h>
73#include <openssl/x509.h> 74#include <openssl/x509.h>
74#include <openssl/x509v3.h> 75#include <openssl/x509v3.h>
75#include <openssl/objects.h>
76 76
77/* CRL score values */ 77/* CRL score values */
78 78
diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c
index 3730d593cd..ec35267298 100644
--- a/src/lib/libcrypto/x509/x509_vpm.c
+++ b/src/lib/libcrypto/x509/x509_vpm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vpm.c,v 1.8 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: x509_vpm.c,v 1.9 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -59,10 +59,9 @@
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/buffer.h>
63#include <openssl/crypto.h> 63#include <openssl/crypto.h>
64#include <openssl/lhash.h> 64#include <openssl/lhash.h>
65#include <openssl/buffer.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/x509/x509cset.c b/src/lib/libcrypto/x509/x509cset.c
index 8ef19c2a40..a4442632f6 100644
--- a/src/lib/libcrypto/x509/x509cset.c
+++ b/src/lib/libcrypto/x509/x509cset.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509cset.c,v 1.7 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509cset.c,v 1.8 2014/07/11 08:44:49 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 2001. 3 * project 2001.
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 <openssl/objects.h>
63#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66int 66int
diff --git a/src/lib/libcrypto/x509/x509name.c b/src/lib/libcrypto/x509/x509name.c
index 4151ea0bc5..465a1cadb5 100644
--- a/src/lib/libcrypto/x509/x509name.c
+++ b/src/lib/libcrypto/x509/x509name.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509name.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: x509name.c,v 1.12 2014/07/11 08:44:49 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,11 +59,11 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include <openssl/stack.h>
63#include "cryptlib.h"
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/objects.h> 63#include <openssl/err.h>
66#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/objects.h>
66#include <openssl/stack.h>
67#include <openssl/x509.h> 67#include <openssl/x509.h>
68 68
69int 69int
diff --git a/src/lib/libcrypto/x509/x509rset.c b/src/lib/libcrypto/x509/x509rset.c
index 509f38b111..cfac977636 100644
--- a/src/lib/libcrypto/x509/x509rset.c
+++ b/src/lib/libcrypto/x509/x509rset.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509rset.c,v 1.5 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509rset.c,v 1.6 2014/07/11 08:44:49 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 <openssl/objects.h>
63#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66int 66int
diff --git a/src/lib/libcrypto/x509/x509spki.c b/src/lib/libcrypto/x509/x509spki.c
index 28e499b9b2..cd29a8138a 100644
--- a/src/lib/libcrypto/x509/x509spki.c
+++ b/src/lib/libcrypto/x509/x509spki.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509spki.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: x509spki.c,v 1.12 2014/07/11 08:44:49 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,7 @@
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/err.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
64 64
65int 65int
diff --git a/src/lib/libcrypto/x509/x509type.c b/src/lib/libcrypto/x509/x509type.c
index 29f38e2a9a..58335b4e64 100644
--- a/src/lib/libcrypto/x509/x509type.c
+++ b/src/lib/libcrypto/x509/x509type.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509type.c,v 1.10 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509type.c,v 1.11 2014/07/11 08:44:49 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/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/x509/x_all.c b/src/lib/libcrypto/x509/x_all.c
index f01e47416d..edb5f520fa 100644
--- a/src/lib/libcrypto/x509/x_all.c
+++ b/src/lib/libcrypto/x509/x_all.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_all.c,v 1.17 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: x_all.c,v 1.18 2014/07/11 08:44:49 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,18 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/stack.h>
64#include "cryptlib.h"
65#include <openssl/buffer.h>
66#include <openssl/asn1.h> 63#include <openssl/asn1.h>
64#include <openssl/buffer.h>
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/stack.h>
68#include <openssl/x509.h> 67#include <openssl/x509.h>
69#ifndef OPENSSL_NO_RSA 68
70#include <openssl/rsa.h>
71#endif
72#ifndef OPENSSL_NO_DSA 69#ifndef OPENSSL_NO_DSA
73#include <openssl/dsa.h> 70#include <openssl/dsa.h>
74#endif 71#endif
72#ifndef OPENSSL_NO_RSA
73#include <openssl/rsa.h>
74#endif
75 75
76int 76int
77X509_verify(X509 *a, EVP_PKEY *r) 77X509_verify(X509 *a, EVP_PKEY *r)
diff --git a/src/lib/libcrypto/x509v3/pcy_cache.c b/src/lib/libcrypto/x509v3/pcy_cache.c
index 6f50cff451..9c8ba8298b 100644
--- a/src/lib/libcrypto/x509v3/pcy_cache.c
+++ b/src/lib/libcrypto/x509v3/pcy_cache.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_cache.c,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: pcy_cache.c,v 1.5 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,7 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59#include "cryptlib.h"
60#include <openssl/x509.h> 59#include <openssl/x509.h>
61#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
62 61
diff --git a/src/lib/libcrypto/x509v3/pcy_data.c b/src/lib/libcrypto/x509v3/pcy_data.c
index 773faaf1e7..698ca6ace5 100644
--- a/src/lib/libcrypto/x509v3/pcy_data.c
+++ b/src/lib/libcrypto/x509v3/pcy_data.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_data.c,v 1.7 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: pcy_data.c,v 1.8 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,7 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59#include "cryptlib.h"
60#include <openssl/x509.h> 59#include <openssl/x509.h>
61#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
62 61
diff --git a/src/lib/libcrypto/x509v3/pcy_lib.c b/src/lib/libcrypto/x509v3/pcy_lib.c
index 2a1f827570..321370e135 100644
--- a/src/lib/libcrypto/x509v3/pcy_lib.c
+++ b/src/lib/libcrypto/x509v3/pcy_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_lib.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: pcy_lib.c,v 1.4 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,8 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59
60#include "cryptlib.h"
61#include <openssl/x509.h> 59#include <openssl/x509.h>
62#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
63 61
diff --git a/src/lib/libcrypto/x509v3/pcy_map.c b/src/lib/libcrypto/x509v3/pcy_map.c
index a22de52631..6ee1ffe895 100644
--- a/src/lib/libcrypto/x509v3/pcy_map.c
+++ b/src/lib/libcrypto/x509v3/pcy_map.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_map.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: pcy_map.c,v 1.4 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,7 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59#include "cryptlib.h"
60#include <openssl/x509.h> 59#include <openssl/x509.h>
61#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
62 61
diff --git a/src/lib/libcrypto/x509v3/pcy_tree.c b/src/lib/libcrypto/x509v3/pcy_tree.c
index aaf27e9802..2c6472a8a1 100644
--- a/src/lib/libcrypto/x509v3/pcy_tree.c
+++ b/src/lib/libcrypto/x509v3/pcy_tree.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_tree.c,v 1.11 2014/07/09 16:59:33 miod Exp $ */ 1/* $OpenBSD: pcy_tree.c,v 1.12 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,7 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59#include "cryptlib.h"
60#include <openssl/x509.h> 59#include <openssl/x509.h>
61#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
62 61
diff --git a/src/lib/libcrypto/x509v3/v3_addr.c b/src/lib/libcrypto/x509v3/v3_addr.c
index 9099994dc4..28031a0754 100644
--- a/src/lib/libcrypto/x509v3/v3_addr.c
+++ b/src/lib/libcrypto/x509v3/v3_addr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_addr.c,v 1.11 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: v3_addr.c,v 1.12 2014/07/11 08:44:49 jsing Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -65,11 +65,10 @@
65 65
66#include <openssl/opensslconf.h> 66#include <openssl/opensslconf.h>
67 67
68#include "cryptlib.h"
69#include <openssl/conf.h>
70#include <openssl/asn1.h> 68#include <openssl/asn1.h>
71#include <openssl/asn1t.h> 69#include <openssl/asn1t.h>
72#include <openssl/buffer.h> 70#include <openssl/buffer.h>
71#include <openssl/conf.h>
73#include <openssl/x509v3.h> 72#include <openssl/x509v3.h>
74 73
75#ifndef OPENSSL_NO_RFC3779 74#ifndef OPENSSL_NO_RFC3779
diff --git a/src/lib/libcrypto/x509v3/v3_akey.c b/src/lib/libcrypto/x509v3/v3_akey.c
index 870b5415d0..b0beb55fee 100644
--- a/src/lib/libcrypto/x509v3/v3_akey.c
+++ b/src/lib/libcrypto/x509v3/v3_akey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_akey.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_akey.c,v 1.12 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, 68static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_akeya.c b/src/lib/libcrypto/x509v3/v3_akeya.c
index 14aa03acab..247c9f48a9 100644
--- a/src/lib/libcrypto/x509v3/v3_akeya.c
+++ b/src/lib/libcrypto/x509v3/v3_akeya.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_akeya.c,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_akeya.c,v 1.5 2014/07/11 08:44:49 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,10 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/conf.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/conf.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66ASN1_SEQUENCE(AUTHORITY_KEYID) = { 66ASN1_SEQUENCE(AUTHORITY_KEYID) = {
diff --git a/src/lib/libcrypto/x509v3/v3_alt.c b/src/lib/libcrypto/x509v3/v3_alt.c
index eaf17938fe..7ae4b6bd97 100644
--- a/src/lib/libcrypto/x509v3/v3_alt.c
+++ b/src/lib/libcrypto/x509v3/v3_alt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_alt.c,v 1.20 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_alt.c,v 1.21 2014/07/11 08:44:49 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 */
@@ -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/conf.h> 62#include <openssl/conf.h>
63#include <openssl/err.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, 66static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_asid.c b/src/lib/libcrypto/x509v3/v3_asid.c
index 473304c1e5..4ff8f0da37 100644
--- a/src/lib/libcrypto/x509v3/v3_asid.c
+++ b/src/lib/libcrypto/x509v3/v3_asid.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_asid.c,v 1.9 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: v3_asid.c,v 1.10 2014/07/11 08:44:49 jsing Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -65,13 +65,12 @@
65 65
66#include <openssl/opensslconf.h> 66#include <openssl/opensslconf.h>
67 67
68#include "cryptlib.h"
69#include <openssl/conf.h>
70#include <openssl/asn1.h> 68#include <openssl/asn1.h>
71#include <openssl/asn1t.h> 69#include <openssl/asn1t.h>
70#include <openssl/bn.h>
71#include <openssl/conf.h>
72#include <openssl/x509v3.h> 72#include <openssl/x509v3.h>
73#include <openssl/x509.h> 73#include <openssl/x509.h>
74#include <openssl/bn.h>
75 74
76#ifndef OPENSSL_NO_RFC3779 75#ifndef OPENSSL_NO_RFC3779
77 76
diff --git a/src/lib/libcrypto/x509v3/v3_bcons.c b/src/lib/libcrypto/x509v3/v3_bcons.c
index ec7e68f82c..8e2632d379 100644
--- a/src/lib/libcrypto/x509v3/v3_bcons.c
+++ b/src/lib/libcrypto/x509v3/v3_bcons.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_bcons.c,v 1.9 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_bcons.c,v 1.10 2014/07/11 08:44:49 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/asn1.h> 62#include <openssl/asn1.h>
64#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
65#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, 68static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_bitst.c b/src/lib/libcrypto/x509v3/v3_bitst.c
index 3be899252a..c0c6ad3d8c 100644
--- a/src/lib/libcrypto/x509v3/v3_bitst.c
+++ b/src/lib/libcrypto/x509v3/v3_bitst.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_bitst.c,v 1.9 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_bitst.c,v 1.10 2014/07/11 08:44:49 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,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/conf.h> 62#include <openssl/conf.h>
63#include <openssl/err.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static BIT_STRING_BITNAME ns_cert_type_table[] = { 66static BIT_STRING_BITNAME ns_cert_type_table[] = {
diff --git a/src/lib/libcrypto/x509v3/v3_conf.c b/src/lib/libcrypto/x509v3/v3_conf.c
index c827128403..c25e75c23b 100644
--- a/src/lib/libcrypto/x509v3/v3_conf.c
+++ b/src/lib/libcrypto/x509v3/v3_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_conf.c,v 1.14 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_conf.c,v 1.15 2014/07/11 08:44:49 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 */
@@ -61,8 +61,8 @@
61#include <stdio.h> 61#include <stdio.h>
62#include <string.h> 62#include <string.h>
63 63
64#include "cryptlib.h"
65#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
68 68
diff --git a/src/lib/libcrypto/x509v3/v3_cpols.c b/src/lib/libcrypto/x509v3/v3_cpols.c
index 88552a0297..51d02abd22 100644
--- a/src/lib/libcrypto/x509v3/v3_cpols.c
+++ b/src/lib/libcrypto/x509v3/v3_cpols.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_cpols.c,v 1.14 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_cpols.c,v 1.15 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68#include "pcy_int.h" 68#include "pcy_int.h"
diff --git a/src/lib/libcrypto/x509v3/v3_crld.c b/src/lib/libcrypto/x509v3/v3_crld.c
index 0fa2ff26cd..aac0c7706e 100644
--- a/src/lib/libcrypto/x509v3/v3_crld.c
+++ b/src/lib/libcrypto/x509v3/v3_crld.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_crld.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_crld.c,v 1.12 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static void *v2i_crld(const X509V3_EXT_METHOD *method, 68static void *v2i_crld(const X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_enum.c b/src/lib/libcrypto/x509v3/v3_enum.c
index 42ba341617..8900d7e01b 100644
--- a/src/lib/libcrypto/x509v3/v3_enum.c
+++ b/src/lib/libcrypto/x509v3/v3_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_enum.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_enum.c,v 1.9 2014/07/11 08:44:49 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/x509v3.h> 61#include <openssl/x509v3.h>
62 62
63static ENUMERATED_NAMES crl_reasons[] = { 63static ENUMERATED_NAMES crl_reasons[] = {
diff --git a/src/lib/libcrypto/x509v3/v3_extku.c b/src/lib/libcrypto/x509v3/v3_extku.c
index a60bf08f09..0f36a99525 100644
--- a/src/lib/libcrypto/x509v3/v3_extku.c
+++ b/src/lib/libcrypto/x509v3/v3_extku.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_extku.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_extku.c,v 1.9 2014/07/11 08:44:49 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 */
@@ -56,11 +56,11 @@
56 * 56 *
57 */ 57 */
58 58
59
60#include <stdio.h> 59#include <stdio.h>
61#include "cryptlib.h" 60
62#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
63#include <openssl/conf.h> 62#include <openssl/conf.h>
63#include <openssl/err.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, 66static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_genn.c b/src/lib/libcrypto/x509v3/v3_genn.c
index 36907e3b59..716f4a7b99 100644
--- a/src/lib/libcrypto/x509v3/v3_genn.c
+++ b/src/lib/libcrypto/x509v3/v3_genn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_genn.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_genn.c,v 1.9 2014/07/11 08:44:49 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 */
@@ -58,7 +58,7 @@
58 58
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61
62#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/conf.h> 63#include <openssl/conf.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
diff --git a/src/lib/libcrypto/x509v3/v3_ia5.c b/src/lib/libcrypto/x509v3/v3_ia5.c
index 07f44400a3..a9ac7197b6 100644
--- a/src/lib/libcrypto/x509v3/v3_ia5.c
+++ b/src/lib/libcrypto/x509v3/v3_ia5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_ia5.c,v 1.12 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_ia5.c,v 1.13 2014/07/11 08:44:49 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,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/conf.h> 63#include <openssl/conf.h>
64#include <openssl/err.h>
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66 66
67static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5); 67static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5);
diff --git a/src/lib/libcrypto/x509v3/v3_info.c b/src/lib/libcrypto/x509v3/v3_info.c
index c70a22bf0e..8e590ed808 100644
--- a/src/lib/libcrypto/x509v3/v3_info.c
+++ b/src/lib/libcrypto/x509v3/v3_info.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_info.c,v 1.17 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_info.c,v 1.18 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS( 68static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(
diff --git a/src/lib/libcrypto/x509v3/v3_int.c b/src/lib/libcrypto/x509v3/v3_int.c
index b8ced906af..e1f6eb1c0a 100644
--- a/src/lib/libcrypto/x509v3/v3_int.c
+++ b/src/lib/libcrypto/x509v3/v3_int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_int.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_int.c,v 1.9 2014/07/11 08:44:49 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/x509v3.h> 61#include <openssl/x509v3.h>
62 62
63const X509V3_EXT_METHOD v3_crl_num = { 63const X509V3_EXT_METHOD v3_crl_num = {
diff --git a/src/lib/libcrypto/x509v3/v3_lib.c b/src/lib/libcrypto/x509v3/v3_lib.c
index 21cd35b59f..8870177f51 100644
--- a/src/lib/libcrypto/x509v3/v3_lib.c
+++ b/src/lib/libcrypto/x509v3/v3_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_lib.c,v 1.12 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_lib.c,v 1.13 2014/07/11 08:44:49 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 */
@@ -58,8 +58,9 @@
58/* X509 v3 extension utilities */ 58/* X509 v3 extension utilities */
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61
62#include <openssl/conf.h> 62#include <openssl/conf.h>
63#include <openssl/err.h>
63#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
64 65
65#include "ext_dat.h" 66#include "ext_dat.h"
diff --git a/src/lib/libcrypto/x509v3/v3_ncons.c b/src/lib/libcrypto/x509v3/v3_ncons.c
index b44b24dbd4..7768dabb1f 100644
--- a/src/lib/libcrypto/x509v3/v3_ncons.c
+++ b/src/lib/libcrypto/x509v3/v3_ncons.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_ncons.c,v 1.4 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_ncons.c,v 1.5 2014/07/11 08:44:49 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 */
@@ -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/conf.h> 63#include <openssl/conf.h>
64#include <openssl/err.h>
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66 66
67static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, 67static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_ocsp.c b/src/lib/libcrypto/x509v3/v3_ocsp.c
index 0406c83be3..d606240b12 100644
--- a/src/lib/libcrypto/x509v3/v3_ocsp.c
+++ b/src/lib/libcrypto/x509v3/v3_ocsp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_ocsp.c,v 1.9 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: v3_ocsp.c,v 1.10 2014/07/11 08:44:49 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 */
@@ -63,9 +63,9 @@
63 63
64#ifndef OPENSSL_NO_OCSP 64#ifndef OPENSSL_NO_OCSP
65 65
66#include "cryptlib.h"
67#include <openssl/conf.h>
68#include <openssl/asn1.h> 66#include <openssl/asn1.h>
67#include <openssl/conf.h>
68#include <openssl/err.h>
69#include <openssl/ocsp.h> 69#include <openssl/ocsp.h>
70#include <openssl/x509v3.h> 70#include <openssl/x509v3.h>
71 71
diff --git a/src/lib/libcrypto/x509v3/v3_pci.c b/src/lib/libcrypto/x509v3/v3_pci.c
index 56b955c9c3..d3f73352d9 100644
--- a/src/lib/libcrypto/x509v3/v3_pci.c
+++ b/src/lib/libcrypto/x509v3/v3_pci.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pci.c,v 1.7 2014/07/10 21:57:20 miod Exp $ */ 1/* $OpenBSD: v3_pci.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */
2/* Contributed to the OpenSSL Project 2004 2/* Contributed to the OpenSSL Project 2004
3 * by Richard Levitte (richard@levitte.org) 3 * by Richard Levitte (richard@levitte.org)
4 */ 4 */
@@ -37,8 +37,8 @@
37#include <stdio.h> 37#include <stdio.h>
38#include <string.h> 38#include <string.h>
39 39
40#include "cryptlib.h"
41#include <openssl/conf.h> 40#include <openssl/conf.h>
41#include <openssl/err.h>
42#include <openssl/x509v3.h> 42#include <openssl/x509v3.h>
43 43
44static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext, 44static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,
diff --git a/src/lib/libcrypto/x509v3/v3_pcons.c b/src/lib/libcrypto/x509v3/v3_pcons.c
index 8405123160..64e1f44b21 100644
--- a/src/lib/libcrypto/x509v3/v3_pcons.c
+++ b/src/lib/libcrypto/x509v3/v3_pcons.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pcons.c,v 1.4 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_pcons.c,v 1.5 2014/07/11 08:44:49 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 */
@@ -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/asn1.h> 62#include <openssl/asn1.h>
64#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
65#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static STACK_OF(CONF_VALUE) * 68static STACK_OF(CONF_VALUE) *
diff --git a/src/lib/libcrypto/x509v3/v3_pku.c b/src/lib/libcrypto/x509v3/v3_pku.c
index 6008438f0f..6cfbc3bd3e 100644
--- a/src/lib/libcrypto/x509v3/v3_pku.c
+++ b/src/lib/libcrypto/x509v3/v3_pku.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pku.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_pku.c,v 1.9 2014/07/11 08:44:49 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/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
diff --git a/src/lib/libcrypto/x509v3/v3_pmaps.c b/src/lib/libcrypto/x509v3/v3_pmaps.c
index 7173b6f9eb..9b09518b5d 100644
--- a/src/lib/libcrypto/x509v3/v3_pmaps.c
+++ b/src/lib/libcrypto/x509v3/v3_pmaps.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pmaps.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_pmaps.c,v 1.4 2014/07/11 08:44:49 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 */
@@ -58,9 +58,10 @@
58 58
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61
62#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/conf.h> 63#include <openssl/conf.h>
64#include <openssl/err.h>
64#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
65 66
66static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, 67static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_prn.c b/src/lib/libcrypto/x509v3/v3_prn.c
index 81bd8e69eb..037d129c87 100644
--- a/src/lib/libcrypto/x509v3/v3_prn.c
+++ b/src/lib/libcrypto/x509v3/v3_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_prn.c,v 1.16 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_prn.c,v 1.17 2014/07/11 08:44:49 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 */
@@ -58,7 +58,7 @@
58/* X509 v3 extension utilities */ 58/* X509 v3 extension utilities */
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61
62#include <openssl/conf.h> 62#include <openssl/conf.h>
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
64 64
diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c
index 0d4b9aae64..03fb427277 100644
--- a/src/lib/libcrypto/x509v3/v3_purp.c
+++ b/src/lib/libcrypto/x509v3/v3_purp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_purp.c,v 1.20 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: v3_purp.c,v 1.21 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -61,7 +61,7 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h" 64#include <openssl/err.h>
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66#include <openssl/x509_vfy.h> 66#include <openssl/x509_vfy.h>
67 67
diff --git a/src/lib/libcrypto/x509v3/v3_skey.c b/src/lib/libcrypto/x509v3/v3_skey.c
index ee9508f886..ab2521f21a 100644
--- a/src/lib/libcrypto/x509v3/v3_skey.c
+++ b/src/lib/libcrypto/x509v3/v3_skey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_skey.c,v 1.9 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_skey.c,v 1.10 2014/07/11 08:44:49 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,7 @@
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/err.h>
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
64 64
65static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, 65static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_sxnet.c b/src/lib/libcrypto/x509v3/v3_sxnet.c
index 9688fa396c..81e8ab67dd 100644
--- a/src/lib/libcrypto/x509v3/v3_sxnet.c
+++ b/src/lib/libcrypto/x509v3/v3_sxnet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_sxnet.c,v 1.10 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_sxnet.c,v 1.11 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68/* Support for Thawte strong extranet extension */ 68/* Support for Thawte strong extranet extension */
diff --git a/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c
index 25116573ba..d9987e32a5 100644
--- a/src/lib/libcrypto/x509v3/v3_utl.c
+++ b/src/lib/libcrypto/x509v3/v3_utl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_utl.c,v 1.21 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_utl.c,v 1.22 2014/07/11 08:44:49 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 */
@@ -61,10 +61,10 @@
61#include <stdio.h> 61#include <stdio.h>
62#include <string.h> 62#include <string.h>
63 63
64#include "cryptlib.h" 64#include <openssl/bn.h>
65#include <openssl/conf.h> 65#include <openssl/conf.h>
66#include <openssl/err.h>
66#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
67#include <openssl/bn.h>
68 68
69static char *strip_spaces(char *name); 69static char *strip_spaces(char *name);
70static int sk_strcmp(const char * const *a, const char * const *b); 70static int sk_strcmp(const char * const *a, const char * const *b);
diff --git a/src/lib/libssl/src/crypto/aes/aes_ige.c b/src/lib/libssl/src/crypto/aes/aes_ige.c
index d5dc5967f4..a8dec0a361 100644
--- a/src/lib/libssl/src/crypto/aes/aes_ige.c
+++ b/src/lib/libssl/src/crypto/aes/aes_ige.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: aes_ige.c,v 1.5 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: aes_ige.c,v 1.6 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -49,9 +49,9 @@
49 * 49 *
50 */ 50 */
51 51
52#include "cryptlib.h"
53
54#include <openssl/aes.h> 52#include <openssl/aes.h>
53#include <openssl/crypto.h>
54
55#include "aes_locl.h" 55#include "aes_locl.h"
56 56
57#define N_WORDS (AES_BLOCK_SIZE / sizeof(unsigned long)) 57#define N_WORDS (AES_BLOCK_SIZE / sizeof(unsigned long))
diff --git a/src/lib/libssl/src/crypto/aes/aes_wrap.c b/src/lib/libssl/src/crypto/aes/aes_wrap.c
index 6578bbb6fd..4479473e6b 100644
--- a/src/lib/libssl/src/crypto/aes/aes_wrap.c
+++ b/src/lib/libssl/src/crypto/aes/aes_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: aes_wrap.c,v 1.8 2014/07/10 13:58:21 jsing Exp $ */ 1/* $OpenBSD: aes_wrap.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. 3 * project.
4 */ 4 */
@@ -53,7 +53,6 @@
53 53
54#include <string.h> 54#include <string.h>
55 55
56#include "cryptlib.h"
57#include <openssl/aes.h> 56#include <openssl/aes.h>
58#include <openssl/bio.h> 57#include <openssl/bio.h>
59 58
diff --git a/src/lib/libssl/src/crypto/asn1/a_bitstr.c b/src/lib/libssl/src/crypto/asn1/a_bitstr.c
index a90eadef28..473a945e09 100644
--- a/src/lib/libssl/src/crypto/asn1/a_bitstr.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_bool.c b/src/lib/libssl/src/crypto/asn1/a_bool.c
index dd1ef9b015..d5a0c0c8a4 100644
--- a/src/lib/libssl/src/crypto/asn1/a_bool.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_bytes.c b/src/lib/libssl/src/crypto/asn1/a_bytes.c
index c8d1a5a1e9..727ad3ed9b 100644
--- a/src/lib/libssl/src/crypto/asn1/a_bytes.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_d2i_fp.c b/src/lib/libssl/src/crypto/asn1/a_d2i_fp.c
index 283a4f74d1..cf1461bd2d 100644
--- a/src/lib/libssl/src/crypto/asn1/a_d2i_fp.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_digest.c b/src/lib/libssl/src/crypto/asn1/a_digest.c
index 751277f33a..085a57d811 100644
--- a/src/lib/libssl/src/crypto/asn1/a_digest.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_dup.c b/src/lib/libssl/src/crypto/asn1/a_dup.c
index 9a9958df16..79cd1d4586 100644
--- a/src/lib/libssl/src/crypto/asn1/a_dup.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_enum.c b/src/lib/libssl/src/crypto/asn1/a_enum.c
index 51b4f10e85..35cb0eaff5 100644
--- a/src/lib/libssl/src/crypto/asn1/a_enum.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_gentm.c b/src/lib/libssl/src/crypto/asn1/a_gentm.c
index 95612ae324..c658b1ea35 100644
--- a/src/lib/libssl/src/crypto/asn1/a_gentm.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_i2d_fp.c b/src/lib/libssl/src/crypto/asn1/a_i2d_fp.c
index 497358f2c4..424068d784 100644
--- a/src/lib/libssl/src/crypto/asn1/a_i2d_fp.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_int.c b/src/lib/libssl/src/crypto/asn1/a_int.c
index 1a84772231..ba2895db6b 100644
--- a/src/lib/libssl/src/crypto/asn1/a_int.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_mbstr.c b/src/lib/libssl/src/crypto/asn1/a_mbstr.c
index 2413c0eaee..3bad3b2ec2 100644
--- a/src/lib/libssl/src/crypto/asn1/a_mbstr.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_object.c b/src/lib/libssl/src/crypto/asn1/a_object.c
index 85b5d623b2..551aece6ad 100644
--- a/src/lib/libssl/src/crypto/asn1/a_object.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_octet.c b/src/lib/libssl/src/crypto/asn1/a_octet.c
index 6daa32824a..8c57592174 100644
--- a/src/lib/libssl/src/crypto/asn1/a_octet.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_print.c b/src/lib/libssl/src/crypto/asn1/a_print.c
index 4a28834e0e..ddcee54c7d 100644
--- a/src/lib/libssl/src/crypto/asn1/a_print.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_set.c b/src/lib/libssl/src/crypto/asn1/a_set.c
index 8fe810d2ce..ba4f28be34 100644
--- a/src/lib/libssl/src/crypto/asn1/a_set.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_sign.c b/src/lib/libssl/src/crypto/asn1/a_sign.c
index 5f2a5e6253..83e7f44d12 100644
--- a/src/lib/libssl/src/crypto/asn1/a_sign.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_strex.c b/src/lib/libssl/src/crypto/asn1/a_strex.c
index e2e21a2292..b592c0e18a 100644
--- a/src/lib/libssl/src/crypto/asn1/a_strex.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_strnid.c b/src/lib/libssl/src/crypto/asn1/a_strnid.c
index f877adef1f..be28885363 100644
--- a/src/lib/libssl/src/crypto/asn1/a_strnid.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_time.c b/src/lib/libssl/src/crypto/asn1/a_time.c
index 7e3a578037..94e249960a 100644
--- a/src/lib/libssl/src/crypto/asn1/a_time.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_type.c b/src/lib/libssl/src/crypto/asn1/a_type.c
index e9527b84fc..add5ff1253 100644
--- a/src/lib/libssl/src/crypto/asn1/a_type.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_utctm.c b/src/lib/libssl/src/crypto/asn1/a_utctm.c
index 4e840f742f..aed855608d 100644
--- a/src/lib/libssl/src/crypto/asn1/a_utctm.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_utf8.c b/src/lib/libssl/src/crypto/asn1/a_utf8.c
index 68ba1f7c9b..113a3a2e36 100644
--- a/src/lib/libssl/src/crypto/asn1/a_utf8.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_verify.c b/src/lib/libssl/src/crypto/asn1/a_verify.c
index cf6c9bbf44..ea937cab3a 100644
--- a/src/lib/libssl/src/crypto/asn1/a_verify.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/ameth_lib.c b/src/lib/libssl/src/crypto/asn1/ameth_lib.c
index 43981277c4..8701e97337 100644
--- a/src/lib/libssl/src/crypto/asn1/ameth_lib.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/asn1_gen.c b/src/lib/libssl/src/crypto/asn1/asn1_gen.c
index f05d92d929..97be43a03a 100644
--- a/src/lib/libssl/src/crypto/asn1/asn1_gen.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/asn1_lib.c b/src/lib/libssl/src/crypto/asn1/asn1_lib.c
index 98f746c013..b5f3f78b94 100644
--- a/src/lib/libssl/src/crypto/asn1/asn1_lib.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/asn1_par.c b/src/lib/libssl/src/crypto/asn1/asn1_par.c
index eca9364a24..c6f95c42ab 100644
--- a/src/lib/libssl/src/crypto/asn1/asn1_par.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/asn_mime.c b/src/lib/libssl/src/crypto/asn1/asn_mime.c
index dc39dd1f08..41b39efa7b 100644
--- a/src/lib/libssl/src/crypto/asn1/asn_mime.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/asn_moid.c b/src/lib/libssl/src/crypto/asn1/asn_moid.c
index 44b9dbb210..76b6405212 100644
--- a/src/lib/libssl/src/crypto/asn1/asn_moid.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/asn_pack.c b/src/lib/libssl/src/crypto/asn1/asn_pack.c
index fab2dcbf54..5d3fc3c34d 100644
--- a/src/lib/libssl/src/crypto/asn1/asn_pack.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/d2i_pr.c b/src/lib/libssl/src/crypto/asn1/d2i_pr.c
index 3e140c05f5..2deec613ed 100644
--- a/src/lib/libssl/src/crypto/asn1/d2i_pr.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/d2i_pu.c b/src/lib/libssl/src/crypto/asn1/d2i_pu.c
index 4a9475b68e..df6fea4af5 100644
--- a/src/lib/libssl/src/crypto/asn1/d2i_pu.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/evp_asn1.c b/src/lib/libssl/src/crypto/asn1/evp_asn1.c
index cc4b204019..648fae9fbd 100644
--- a/src/lib/libssl/src/crypto/asn1/evp_asn1.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/f_enum.c b/src/lib/libssl/src/crypto/asn1/f_enum.c
index 7cf0abb428..7f064edb04 100644
--- a/src/lib/libssl/src/crypto/asn1/f_enum.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/f_int.c b/src/lib/libssl/src/crypto/asn1/f_int.c
index 4d8da10d88..0ec29f5769 100644
--- a/src/lib/libssl/src/crypto/asn1/f_int.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/f_string.c b/src/lib/libssl/src/crypto/asn1/f_string.c
index eec05f8110..14cd1a906a 100644
--- a/src/lib/libssl/src/crypto/asn1/f_string.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/i2d_pr.c b/src/lib/libssl/src/crypto/asn1/i2d_pr.c
index 4223078cdb..5fa34678b6 100644
--- a/src/lib/libssl/src/crypto/asn1/i2d_pr.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/i2d_pu.c b/src/lib/libssl/src/crypto/asn1/i2d_pu.c
index 0f0369f3a5..6e485ea325 100644
--- a/src/lib/libssl/src/crypto/asn1/i2d_pu.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/n_pkey.c b/src/lib/libssl/src/crypto/asn1/n_pkey.c
index b2047bd586..230df827f3 100644
--- a/src/lib/libssl/src/crypto/asn1/n_pkey.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/p5_pbe.c b/src/lib/libssl/src/crypto/asn1/p5_pbe.c
index 7f1fce34a2..ba892b185c 100644
--- a/src/lib/libssl/src/crypto/asn1/p5_pbe.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/p5_pbev2.c b/src/lib/libssl/src/crypto/asn1/p5_pbev2.c
index 411740f403..8085aba453 100644
--- a/src/lib/libssl/src/crypto/asn1/p5_pbev2.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/p8_pkey.c b/src/lib/libssl/src/crypto/asn1/p8_pkey.c
index 4875bebfcc..3aacecb8fb 100644
--- a/src/lib/libssl/src/crypto/asn1/p8_pkey.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/t_bitst.c b/src/lib/libssl/src/crypto/asn1/t_bitst.c
index f9a1900c60..ea4138e0fb 100644
--- a/src/lib/libssl/src/crypto/asn1/t_bitst.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/t_crl.c b/src/lib/libssl/src/crypto/asn1/t_crl.c
index dfa37e9b1f..e2f9d8b09e 100644
--- a/src/lib/libssl/src/crypto/asn1/t_crl.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/t_pkey.c b/src/lib/libssl/src/crypto/asn1/t_pkey.c
index c620504036..b3f7d084c5 100644
--- a/src/lib/libssl/src/crypto/asn1/t_pkey.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/t_req.c b/src/lib/libssl/src/crypto/asn1/t_req.c
index 689df1e203..51f711acf7 100644
--- a/src/lib/libssl/src/crypto/asn1/t_req.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/t_spki.c b/src/lib/libssl/src/crypto/asn1/t_spki.c
index 91d275ffc2..39ff0670b6 100644
--- a/src/lib/libssl/src/crypto/asn1/t_spki.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/t_x509.c b/src/lib/libssl/src/crypto/asn1/t_x509.c
index 690015b1c1..e6f0692ccc 100644
--- a/src/lib/libssl/src/crypto/asn1/t_x509.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/t_x509a.c b/src/lib/libssl/src/crypto/asn1/t_x509a.c
index 14bf7438f9..fd68211b84 100644
--- a/src/lib/libssl/src/crypto/asn1/t_x509a.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/tasn_enc.c b/src/lib/libssl/src/crypto/asn1/tasn_enc.c
index 5e7a6201d3..f7209dc4eb 100644
--- a/src/lib/libssl/src/crypto/asn1/tasn_enc.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/tasn_prn.c b/src/lib/libssl/src/crypto/asn1/tasn_prn.c
index d6d702b275..9383750a82 100644
--- a/src/lib/libssl/src/crypto/asn1/tasn_prn.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_attrib.c b/src/lib/libssl/src/crypto/asn1/x_attrib.c
index 1243927d1c..1efbb98bbd 100644
--- a/src/lib/libssl/src/crypto/asn1/x_attrib.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_bignum.c b/src/lib/libssl/src/crypto/asn1/x_bignum.c
index 38f8918a12..18ec64eeef 100644
--- a/src/lib/libssl/src/crypto/asn1/x_bignum.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_crl.c b/src/lib/libssl/src/crypto/asn1/x_crl.c
index 13402a66c2..ad77ef7737 100644
--- a/src/lib/libssl/src/crypto/asn1/x_crl.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_info.c b/src/lib/libssl/src/crypto/asn1/x_info.c
index 881565c489..6c055fd441 100644
--- a/src/lib/libssl/src/crypto/asn1/x_info.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_long.c b/src/lib/libssl/src/crypto/asn1/x_long.c
index dddcfeb479..1add387453 100644
--- a/src/lib/libssl/src/crypto/asn1/x_long.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_name.c b/src/lib/libssl/src/crypto/asn1/x_name.c
index 4b84cfeffd..98993c84fc 100644
--- a/src/lib/libssl/src/crypto/asn1/x_name.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_pkey.c b/src/lib/libssl/src/crypto/asn1/x_pkey.c
index 8488ff37fb..a5134bc6a2 100644
--- a/src/lib/libssl/src/crypto/asn1/x_pkey.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_pubkey.c b/src/lib/libssl/src/crypto/asn1/x_pubkey.c
index f702bdbe97..87cb25bb50 100644
--- a/src/lib/libssl/src/crypto/asn1/x_pubkey.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_req.c b/src/lib/libssl/src/crypto/asn1/x_req.c
index 50bed04fc7..c876edd7f0 100644
--- a/src/lib/libssl/src/crypto/asn1/x_req.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_sig.c b/src/lib/libssl/src/crypto/asn1/x_sig.c
index 3ebb06b4a1..ab4546e3ca 100644
--- a/src/lib/libssl/src/crypto/asn1/x_sig.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_spki.c b/src/lib/libssl/src/crypto/asn1/x_spki.c
index 40e9b3674b..836abb13d8 100644
--- a/src/lib/libssl/src/crypto/asn1/x_spki.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_val.c b/src/lib/libssl/src/crypto/asn1/x_val.c
index ce501923f6..da9d16346b 100644
--- a/src/lib/libssl/src/crypto/asn1/x_val.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_x509.c b/src/lib/libssl/src/crypto/asn1/x_x509.c
index 43772f9ac1..0236a0faa2 100644
--- a/src/lib/libssl/src/crypto/asn1/x_x509.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/x_x509a.c b/src/lib/libssl/src/crypto/asn1/x_x509a.c
index cc8b16a7a7..c6837069d9 100644
--- a/src/lib/libssl/src/crypto/asn1/x_x509a.c
+++ b/src/lib/libssl/src/crypto/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
diff --git a/src/lib/libssl/src/crypto/bio/b_dump.c b/src/lib/libssl/src/crypto/bio/b_dump.c
index 62a6c269ac..91979bd755 100644
--- a/src/lib/libssl/src/crypto/bio/b_dump.c
+++ b/src/lib/libssl/src/crypto/bio/b_dump.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: b_dump.c,v 1.18 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: b_dump.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 *
@@ -65,8 +65,6 @@
65 65
66#include <openssl/bio.h> 66#include <openssl/bio.h>
67 67
68#include "cryptlib.h"
69
70#define TRUNCATE 68#define TRUNCATE
71#define DUMP_WIDTH 16 69#define DUMP_WIDTH 16
72#define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH - ((i - (i > 6 ? 6 : i) + 3) / 4)) 70#define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH - ((i - (i > 6 ? 6 : i) + 3) / 4))
diff --git a/src/lib/libssl/src/crypto/bio/b_sock.c b/src/lib/libssl/src/crypto/bio/b_sock.c
index bbae2a31b9..8c37a3e175 100644
--- a/src/lib/libssl/src/crypto/bio/b_sock.c
+++ b/src/lib/libssl/src/crypto/bio/b_sock.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: b_sock.c,v 1.53 2014/07/10 21:57:40 miod Exp $ */ 1/* $OpenBSD: b_sock.c,v 1.54 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 *
@@ -72,8 +72,8 @@
72#include <unistd.h> 72#include <unistd.h>
73 73
74#include <openssl/bio.h> 74#include <openssl/bio.h>
75 75#include <openssl/buffer.h>
76#include "cryptlib.h" 76#include <openssl/err.h>
77 77
78int 78int
79BIO_get_host_ip(const char *str, unsigned char *ip) 79BIO_get_host_ip(const char *str, unsigned char *ip)
diff --git a/src/lib/libssl/src/crypto/bio/bf_buff.c b/src/lib/libssl/src/crypto/bio/bf_buff.c
index ea55e490be..ab47ae4627 100644
--- a/src/lib/libssl/src/crypto/bio/bf_buff.c
+++ b/src/lib/libssl/src/crypto/bio/bf_buff.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_buff.c,v 1.20 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bf_buff.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,8 +60,8 @@
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/bio.h> 63#include <openssl/bio.h>
64#include <openssl/err.h>
65 65
66static int buffer_write(BIO *h, const char *buf, int num); 66static int buffer_write(BIO *h, const char *buf, int num);
67static int buffer_read(BIO *h, char *buf, int size); 67static int buffer_read(BIO *h, char *buf, int size);
diff --git a/src/lib/libssl/src/crypto/bio/bf_lbuf.c b/src/lib/libssl/src/crypto/bio/bf_lbuf.c
index 8c2b6e6d4d..e90b7f239f 100644
--- a/src/lib/libssl/src/crypto/bio/bf_lbuf.c
+++ b/src/lib/libssl/src/crypto/bio/bf_lbuf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_lbuf.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bf_lbuf.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 *
@@ -56,9 +56,9 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <errno.h> 59#include <errno.h>
61#include "cryptlib.h" 60#include <stdio.h>
61
62#include <openssl/bio.h> 62#include <openssl/bio.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
diff --git a/src/lib/libssl/src/crypto/bio/bf_nbio.c b/src/lib/libssl/src/crypto/bio/bf_nbio.c
index e2480e7489..86a13a8bc8 100644
--- a/src/lib/libssl/src/crypto/bio/bf_nbio.c
+++ b/src/lib/libssl/src/crypto/bio/bf_nbio.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_nbio.c,v 1.16 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bf_nbio.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 *
@@ -56,11 +56,11 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <errno.h> 59#include <errno.h>
61#include "cryptlib.h" 60#include <stdio.h>
62#include <openssl/rand.h> 61
63#include <openssl/bio.h> 62#include <openssl/bio.h>
63#include <openssl/rand.h>
64 64
65/* BIO_put and BIO_get both add to the digest, 65/* BIO_put and BIO_get both add to the digest,
66 * BIO_gets returns the digest */ 66 * BIO_gets returns the digest */
diff --git a/src/lib/libssl/src/crypto/bio/bf_null.c b/src/lib/libssl/src/crypto/bio/bf_null.c
index 1ef2fbe0f9..09d54b6b21 100644
--- a/src/lib/libssl/src/crypto/bio/bf_null.c
+++ b/src/lib/libssl/src/crypto/bio/bf_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_null.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bf_null.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 *
@@ -56,9 +56,9 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <errno.h> 59#include <errno.h>
61#include "cryptlib.h" 60#include <stdio.h>
61
62#include <openssl/bio.h> 62#include <openssl/bio.h>
63 63
64/* BIO_put and BIO_get both add to the digest, 64/* BIO_put and BIO_get both add to the digest,
diff --git a/src/lib/libssl/src/crypto/bio/bio_cb.c b/src/lib/libssl/src/crypto/bio/bio_cb.c
index 5701b53d05..7d1f025452 100644
--- a/src/lib/libssl/src/crypto/bio/bio_cb.c
+++ b/src/lib/libssl/src/crypto/bio/bio_cb.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_cb.c,v 1.14 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bio_cb.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,11 +57,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h>
61#include <stdlib.h> 60#include <stdlib.h>
62#include "cryptlib.h" 61#include <string.h>
63#include <openssl/bio.h> 62
64#include <openssl/err.h> 63#include <openssl/err.h>
64#include <openssl/bio.h>
65 65
66long 66long
67BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, 67BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl,
diff --git a/src/lib/libssl/src/crypto/bio/bio_lib.c b/src/lib/libssl/src/crypto/bio/bio_lib.c
index 876a357bef..41b3d31678 100644
--- a/src/lib/libssl/src/crypto/bio/bio_lib.c
+++ b/src/lib/libssl/src/crypto/bio/bio_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_lib.c,v 1.18 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bio_lib.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 *
@@ -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 <errno.h> 59#include <errno.h>
61#include <openssl/crypto.h> 60#include <stdio.h>
62#include "cryptlib.h" 61
63#include <openssl/bio.h> 62#include <openssl/bio.h>
63#include <openssl/crypto.h>
64#include <openssl/err.h>
64#include <openssl/stack.h> 65#include <openssl/stack.h>
65 66
66BIO * 67BIO *
diff --git a/src/lib/libssl/src/crypto/bio/bss_acpt.c b/src/lib/libssl/src/crypto/bio/bss_acpt.c
index 580c52da6c..c0316a2999 100644
--- a/src/lib/libssl/src/crypto/bio/bss_acpt.c
+++ b/src/lib/libssl/src/crypto/bio/bss_acpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_acpt.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_acpt.c,v 1.23 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 *
@@ -63,8 +63,9 @@
63#include <string.h> 63#include <string.h>
64#include <unistd.h> 64#include <unistd.h>
65 65
66#include "cryptlib.h"
67#include <openssl/bio.h> 66#include <openssl/bio.h>
67#include <openssl/buffer.h>
68#include <openssl/err.h>
68 69
69#define SOCKET_PROTOCOL IPPROTO_TCP 70#define SOCKET_PROTOCOL IPPROTO_TCP
70 71
diff --git a/src/lib/libssl/src/crypto/bio/bss_conn.c b/src/lib/libssl/src/crypto/bio/bss_conn.c
index d5763a0ce3..8049f5c3f0 100644
--- a/src/lib/libssl/src/crypto/bio/bss_conn.c
+++ b/src/lib/libssl/src/crypto/bio/bss_conn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_conn.c,v 1.28 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_conn.c,v 1.29 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 *
@@ -66,8 +66,9 @@
66#include <string.h> 66#include <string.h>
67#include <unistd.h> 67#include <unistd.h>
68 68
69#include "cryptlib.h"
70#include <openssl/bio.h> 69#include <openssl/bio.h>
70#include <openssl/buffer.h>
71#include <openssl/err.h>
71 72
72#define SOCKET_PROTOCOL IPPROTO_TCP 73#define SOCKET_PROTOCOL IPPROTO_TCP
73 74
diff --git a/src/lib/libssl/src/crypto/bio/bss_dgram.c b/src/lib/libssl/src/crypto/bio/bss_dgram.c
index d56b71ba27..caa8480657 100644
--- a/src/lib/libssl/src/crypto/bio/bss_dgram.c
+++ b/src/lib/libssl/src/crypto/bio/bss_dgram.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_dgram.c,v 1.30 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bss_dgram.c,v 1.31 2014/07/11 08:44:47 jsing Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -69,7 +69,6 @@
69 69
70#include <openssl/opensslconf.h> 70#include <openssl/opensslconf.h>
71 71
72#include "cryptlib.h"
73#include <openssl/bio.h> 72#include <openssl/bio.h>
74 73
75#ifndef OPENSSL_NO_DGRAM 74#ifndef OPENSSL_NO_DGRAM
diff --git a/src/lib/libssl/src/crypto/bio/bss_fd.c b/src/lib/libssl/src/crypto/bio/bss_fd.c
index 6e8e8d0815..71abb4744a 100644
--- a/src/lib/libssl/src/crypto/bio/bss_fd.c
+++ b/src/lib/libssl/src/crypto/bio/bss_fd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_fd.c,v 1.16 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bss_fd.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 *
@@ -63,8 +63,6 @@
63 63
64#include <openssl/opensslconf.h> 64#include <openssl/opensslconf.h>
65 65
66#include "cryptlib.h"
67
68#if defined(OPENSSL_NO_POSIX_IO) 66#if defined(OPENSSL_NO_POSIX_IO)
69/* 67/*
70 * One can argue that one should implement dummy placeholder for 68 * One can argue that one should implement dummy placeholder for
diff --git a/src/lib/libssl/src/crypto/bio/bss_file.c b/src/lib/libssl/src/crypto/bio/bss_file.c
index 44345f3c70..4fa3fb6062 100644
--- a/src/lib/libssl/src/crypto/bio/bss_file.c
+++ b/src/lib/libssl/src/crypto/bio/bss_file.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_file.c,v 1.29 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_file.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 *
@@ -87,7 +87,6 @@
87#include <stdio.h> 87#include <stdio.h>
88#include <string.h> 88#include <string.h>
89 89
90#include "cryptlib.h"
91#include <openssl/bio.h> 90#include <openssl/bio.h>
92#include <openssl/err.h> 91#include <openssl/err.h>
93 92
diff --git a/src/lib/libssl/src/crypto/bio/bss_log.c b/src/lib/libssl/src/crypto/bio/bss_log.c
index 63361ce22f..fcaa985aa0 100644
--- a/src/lib/libssl/src/crypto/bio/bss_log.c
+++ b/src/lib/libssl/src/crypto/bio/bss_log.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_log.c,v 1.20 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_log.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 *
@@ -67,8 +67,6 @@
67#include <string.h> 67#include <string.h>
68#include <syslog.h> 68#include <syslog.h>
69 69
70#include "cryptlib.h"
71
72#include <openssl/buffer.h> 70#include <openssl/buffer.h>
73#include <openssl/err.h> 71#include <openssl/err.h>
74 72
diff --git a/src/lib/libssl/src/crypto/bio/bss_mem.c b/src/lib/libssl/src/crypto/bio/bss_mem.c
index 849a2d05ce..8310f8cf4d 100644
--- a/src/lib/libssl/src/crypto/bio/bss_mem.c
+++ b/src/lib/libssl/src/crypto/bio/bss_mem.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_mem.c,v 1.12 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_mem.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 *
@@ -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/bio.h> 63#include <openssl/bio.h>
64#include <openssl/err.h>
65#include <openssl/buffer.h>
65 66
66static int mem_write(BIO *h, const char *buf, int num); 67static int mem_write(BIO *h, const char *buf, int num);
67static int mem_read(BIO *h, char *buf, int size); 68static int mem_read(BIO *h, char *buf, int size);
diff --git a/src/lib/libssl/src/crypto/bio/bss_null.c b/src/lib/libssl/src/crypto/bio/bss_null.c
index 226076e13a..42ee626b13 100644
--- a/src/lib/libssl/src/crypto/bio/bss_null.c
+++ b/src/lib/libssl/src/crypto/bio/bss_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_null.c,v 1.9 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_null.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,7 +60,6 @@
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/bio.h> 63#include <openssl/bio.h>
65 64
66static int null_write(BIO *h, const char *buf, int num); 65static int null_write(BIO *h, const char *buf, int num);
diff --git a/src/lib/libssl/src/crypto/bio/bss_sock.c b/src/lib/libssl/src/crypto/bio/bss_sock.c
index ced988f97a..dd470eb65e 100644
--- a/src/lib/libssl/src/crypto/bio/bss_sock.c
+++ b/src/lib/libssl/src/crypto/bio/bss_sock.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_sock.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bss_sock.c,v 1.23 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 *
@@ -63,8 +63,6 @@
63#include <string.h> 63#include <string.h>
64#include <unistd.h> 64#include <unistd.h>
65 65
66#include "cryptlib.h"
67
68#include <openssl/bio.h> 66#include <openssl/bio.h>
69 67
70static int sock_write(BIO *h, const char *buf, int num); 68static int sock_write(BIO *h, const char *buf, int num);
diff --git a/src/lib/libssl/src/crypto/bn/bn_add.c b/src/lib/libssl/src/crypto/bn/bn_add.c
index d551741ed8..5b2e2495b8 100644
--- a/src/lib/libssl/src/crypto/bn/bn_add.c
+++ b/src/lib/libssl/src/crypto/bn/bn_add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_add.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_add.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,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63/* r can == a or b */ 65/* r can == a or b */
diff --git a/src/lib/libssl/src/crypto/bn/bn_asm.c b/src/lib/libssl/src/crypto/bn/bn_asm.c
index 01e03cc81f..c6efd2513a 100644
--- a/src/lib/libssl/src/crypto/bn/bn_asm.c
+++ b/src/lib/libssl/src/crypto/bn/bn_asm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_asm.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_asm.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 *
@@ -66,7 +66,6 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h"
70#include "bn_lcl.h" 69#include "bn_lcl.h"
71 70
72#if defined(BN_LLONG) || defined(BN_UMULT_HIGH) 71#if defined(BN_LLONG) || defined(BN_UMULT_HIGH)
diff --git a/src/lib/libssl/src/crypto/bn/bn_blind.c b/src/lib/libssl/src/crypto/bn/bn_blind.c
index 2170181aae..5f559da067 100644
--- a/src/lib/libssl/src/crypto/bn/bn_blind.c
+++ b/src/lib/libssl/src/crypto/bn/bn_blind.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_blind.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_blind.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -113,7 +113,8 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h" 116#include <openssl/err.h>
117
117#include "bn_lcl.h" 118#include "bn_lcl.h"
118 119
119#define BN_BLINDING_COUNTER 32 120#define BN_BLINDING_COUNTER 32
diff --git a/src/lib/libssl/src/crypto/bn/bn_ctx.c b/src/lib/libssl/src/crypto/bn/bn_ctx.c
index d3384a0385..0bd523c2d4 100644
--- a/src/lib/libssl/src/crypto/bn/bn_ctx.c
+++ b/src/lib/libssl/src/crypto/bn/bn_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_ctx.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_ctx.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */
2/* Written by Ulf Moeller for the OpenSSL project. */ 2/* Written by Ulf Moeller for the OpenSSL project. */
3/* ==================================================================== 3/* ====================================================================
4 * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. 4 * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved.
@@ -66,7 +66,8 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h" 69#include <openssl/err.h>
70
70#include "bn_lcl.h" 71#include "bn_lcl.h"
71 72
72/* TODO list 73/* TODO list
diff --git a/src/lib/libssl/src/crypto/bn/bn_depr.c b/src/lib/libssl/src/crypto/bn/bn_depr.c
index 93af852aa5..68f8f822e3 100644
--- a/src/lib/libssl/src/crypto/bn/bn_depr.c
+++ b/src/lib/libssl/src/crypto/bn/bn_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_depr.c,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_depr.c,v 1.6 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -61,10 +61,10 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include "bn_lcl.h"
66#include <openssl/rand.h> 64#include <openssl/rand.h>
67 65
66#include "bn_lcl.h"
67
68#ifndef OPENSSL_NO_DEPRECATED 68#ifndef OPENSSL_NO_DEPRECATED
69BIGNUM * 69BIGNUM *
70BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add, 70BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
diff --git a/src/lib/libssl/src/crypto/bn/bn_div.c b/src/lib/libssl/src/crypto/bn/bn_div.c
index 40a3c1551d..f4deccf77f 100644
--- a/src/lib/libssl/src/crypto/bn/bn_div.c
+++ b/src/lib/libssl/src/crypto/bn/bn_div.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_div.c,v 1.21 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_div.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 *
@@ -57,11 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/bn.h>
61 60
62#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
63 62
64#include "cryptlib.h" 63#include <openssl/bn.h>
64#include <openssl/err.h>
65
65#include "bn_lcl.h" 66#include "bn_lcl.h"
66 67
67#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \ 68#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \
diff --git a/src/lib/libssl/src/crypto/bn/bn_exp.c b/src/lib/libssl/src/crypto/bn/bn_exp.c
index d88f8b2a82..09e32396fb 100644
--- a/src/lib/libssl/src/crypto/bn/bn_exp.c
+++ b/src/lib/libssl/src/crypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_exp.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 *
@@ -112,7 +112,8 @@
112#include <stdlib.h> 112#include <stdlib.h>
113#include <string.h> 113#include <string.h>
114 114
115#include "cryptlib.h" 115#include <openssl/err.h>
116
116#include "bn_lcl.h" 117#include "bn_lcl.h"
117 118
118/* maximum precomputation table size for *variable* sliding windows */ 119/* maximum precomputation table size for *variable* sliding windows */
diff --git a/src/lib/libssl/src/crypto/bn/bn_exp2.c b/src/lib/libssl/src/crypto/bn/bn_exp2.c
index c9cced8128..c8f0294f7a 100644
--- a/src/lib/libssl/src/crypto/bn/bn_exp2.c
+++ b/src/lib/libssl/src/crypto/bn/bn_exp2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp2.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_exp2.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 *
@@ -110,7 +110,9 @@
110 */ 110 */
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include "cryptlib.h" 113
114#include <openssl/err.h>
115
114#include "bn_lcl.h" 116#include "bn_lcl.h"
115 117
116#define TABLE_SIZE 32 118#define TABLE_SIZE 32
diff --git a/src/lib/libssl/src/crypto/bn/bn_gcd.c b/src/lib/libssl/src/crypto/bn/bn_gcd.c
index 8728f4f921..379bea99ad 100644
--- a/src/lib/libssl/src/crypto/bn/bn_gcd.c
+++ b/src/lib/libssl/src/crypto/bn/bn_gcd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_gcd.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_gcd.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 *
@@ -109,7 +109,8 @@
109 * 109 *
110 */ 110 */
111 111
112#include "cryptlib.h" 112#include <openssl/err.h>
113
113#include "bn_lcl.h" 114#include "bn_lcl.h"
114 115
115static BIGNUM *euclid(BIGNUM *a, BIGNUM *b); 116static BIGNUM *euclid(BIGNUM *a, BIGNUM *b);
diff --git a/src/lib/libssl/src/crypto/bn/bn_gf2m.c b/src/lib/libssl/src/crypto/bn/bn_gf2m.c
index 09d4bcc544..d87f80d577 100644
--- a/src/lib/libssl/src/crypto/bn/bn_gf2m.c
+++ b/src/lib/libssl/src/crypto/bn/bn_gf2m.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_gf2m.c,v 1.14 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_gf2m.c,v 1.15 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -94,7 +94,8 @@
94 94
95#include <openssl/opensslconf.h> 95#include <openssl/opensslconf.h>
96 96
97#include "cryptlib.h" 97#include <openssl/err.h>
98
98#include "bn_lcl.h" 99#include "bn_lcl.h"
99 100
100#ifndef OPENSSL_NO_EC2M 101#ifndef OPENSSL_NO_EC2M
diff --git a/src/lib/libssl/src/crypto/bn/bn_kron.c b/src/lib/libssl/src/crypto/bn/bn_kron.c
index 632a018a70..699cda55f0 100644
--- a/src/lib/libssl/src/crypto/bn/bn_kron.c
+++ b/src/lib/libssl/src/crypto/bn/bn_kron.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_kron.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_kron.c,v 1.5 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -53,7 +53,6 @@
53 * 53 *
54 */ 54 */
55 55
56#include "cryptlib.h"
57#include "bn_lcl.h" 56#include "bn_lcl.h"
58 57
59/* least significant word */ 58/* least significant word */
diff --git a/src/lib/libssl/src/crypto/bn/bn_lib.c b/src/lib/libssl/src/crypto/bn/bn_lib.c
index 747cbb68a5..4ee9b2bbde 100644
--- a/src/lib/libssl/src/crypto/bn/bn_lib.c
+++ b/src/lib/libssl/src/crypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.31 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.32 2014/07/11 08:44:48 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 *
@@ -68,7 +68,8 @@
68 68
69#include <openssl/opensslconf.h> 69#include <openssl/opensslconf.h>
70 70
71#include "cryptlib.h" 71#include <openssl/err.h>
72
72#include "bn_lcl.h" 73#include "bn_lcl.h"
73 74
74/* This stuff appears to be completely unused, so is deprecated */ 75/* This stuff appears to be completely unused, so is deprecated */
diff --git a/src/lib/libssl/src/crypto/bn/bn_mod.c b/src/lib/libssl/src/crypto/bn/bn_mod.c
index 9bd1f1ca1d..a503ff3b1b 100644
--- a/src/lib/libssl/src/crypto/bn/bn_mod.c
+++ b/src/lib/libssl/src/crypto/bn/bn_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mod.c,v 1.7 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_mod.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. */ 3 * for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -111,7 +111,8 @@
111 * [including the GNU Public Licence.] 111 * [including the GNU Public Licence.]
112 */ 112 */
113 113
114#include "cryptlib.h" 114#include <openssl/err.h>
115
115#include "bn_lcl.h" 116#include "bn_lcl.h"
116 117
117int 118int
diff --git a/src/lib/libssl/src/crypto/bn/bn_mont.c b/src/lib/libssl/src/crypto/bn/bn_mont.c
index 32d9e3836a..5803ca493d 100644
--- a/src/lib/libssl/src/crypto/bn/bn_mont.c
+++ b/src/lib/libssl/src/crypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.23 2014/07/11 08:44:48 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 *
@@ -119,7 +119,6 @@
119#include <stdio.h> 119#include <stdio.h>
120#include <stdint.h> 120#include <stdint.h>
121 121
122#include "cryptlib.h"
123#include "bn_lcl.h" 122#include "bn_lcl.h"
124 123
125#define MONT_WORD /* use the faster word-based algorithm */ 124#define MONT_WORD /* use the faster word-based algorithm */
diff --git a/src/lib/libssl/src/crypto/bn/bn_mpi.c b/src/lib/libssl/src/crypto/bn/bn_mpi.c
index a0824112a1..cf4c7d8d24 100644
--- a/src/lib/libssl/src/crypto/bn/bn_mpi.c
+++ b/src/lib/libssl/src/crypto/bn/bn_mpi.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mpi.c,v 1.6 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_mpi.c,v 1.7 2014/07/11 08:44:48 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,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63int 65int
diff --git a/src/lib/libssl/src/crypto/bn/bn_mul.c b/src/lib/libssl/src/crypto/bn/bn_mul.c
index 71bfe2d9ec..daba02d6ca 100644
--- a/src/lib/libssl/src/crypto/bn/bn_mul.c
+++ b/src/lib/libssl/src/crypto/bn/bn_mul.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mul.c,v 1.18 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_mul.c,v 1.19 2014/07/11 08:44:48 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 *
@@ -67,7 +67,6 @@
67 67
68#include <openssl/opensslconf.h> 68#include <openssl/opensslconf.h>
69 69
70#include "cryptlib.h"
71#include "bn_lcl.h" 70#include "bn_lcl.h"
72 71
73#if defined(OPENSSL_NO_ASM) || !defined(OPENSSL_BN_ASM_PART_WORDS) 72#if defined(OPENSSL_NO_ASM) || !defined(OPENSSL_BN_ASM_PART_WORDS)
diff --git a/src/lib/libssl/src/crypto/bn/bn_nist.c b/src/lib/libssl/src/crypto/bn/bn_nist.c
index dd47ffb8be..53ed559c06 100644
--- a/src/lib/libssl/src/crypto/bn/bn_nist.c
+++ b/src/lib/libssl/src/crypto/bn/bn_nist.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_nist.c,v 1.13 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_nist.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -56,12 +56,11 @@
56 * 56 *
57 */ 57 */
58 58
59#include <machine/endian.h>
60
59#include <stdint.h> 61#include <stdint.h>
60 62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62#include "cryptlib.h"
63
64#include <machine/endian.h>
65 64
66#define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2 65#define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2
67#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2 66#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
diff --git a/src/lib/libssl/src/crypto/bn/bn_prime.c b/src/lib/libssl/src/crypto/bn/bn_prime.c
index 78c3fcd74f..db786a63ef 100644
--- a/src/lib/libssl/src/crypto/bn/bn_prime.c
+++ b/src/lib/libssl/src/crypto/bn/bn_prime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_prime.c,v 1.9 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_prime.c,v 1.10 2014/07/11 08:44:48 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 *
@@ -111,10 +111,11 @@
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include <time.h> 113#include <time.h>
114#include "cryptlib.h" 114
115#include "bn_lcl.h"
116#include <openssl/rand.h> 115#include <openssl/rand.h>
117 116
117#include "bn_lcl.h"
118
118/* NB: these functions have been "upgraded", the deprecated versions (which are 119/* NB: these functions have been "upgraded", the deprecated versions (which are
119 * compatibility wrappers using these functions) are in bn_depr.c. 120 * compatibility wrappers using these functions) are in bn_depr.c.
120 * - Geoff 121 * - Geoff
diff --git a/src/lib/libssl/src/crypto/bn/bn_print.c b/src/lib/libssl/src/crypto/bn/bn_print.c
index db51887fbe..ccdae5ae09 100644
--- a/src/lib/libssl/src/crypto/bn/bn_print.c
+++ b/src/lib/libssl/src/crypto/bn/bn_print.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_print.c,v 1.21 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_print.c,v 1.22 2014/07/11 08:44:48 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,9 +61,10 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include <openssl/bio.h>
64#include <openssl/buffer.h> 65#include <openssl/buffer.h>
66#include <openssl/err.h>
65 67
66#include "cryptlib.h"
67#include "bn_lcl.h" 68#include "bn_lcl.h"
68 69
69static const char Hex[]="0123456789ABCDEF"; 70static const char Hex[]="0123456789ABCDEF";
diff --git a/src/lib/libssl/src/crypto/bn/bn_rand.c b/src/lib/libssl/src/crypto/bn/bn_rand.c
index cbb1984a2e..acb17882ef 100644
--- a/src/lib/libssl/src/crypto/bn/bn_rand.c
+++ b/src/lib/libssl/src/crypto/bn/bn_rand.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_rand.c,v 1.14 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_rand.c,v 1.15 2014/07/11 08:44:48 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 *
@@ -111,10 +111,12 @@
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include <time.h> 113#include <time.h>
114#include "cryptlib.h" 114
115#include "bn_lcl.h" 115#include <openssl/err.h>
116#include <openssl/rand.h> 116#include <openssl/rand.h>
117 117
118#include "bn_lcl.h"
119
118static int 120static int
119bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) 121bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
120{ 122{
diff --git a/src/lib/libssl/src/crypto/bn/bn_recp.c b/src/lib/libssl/src/crypto/bn/bn_recp.c
index 50dd65dd38..b90c5421f1 100644
--- a/src/lib/libssl/src/crypto/bn/bn_recp.c
+++ b/src/lib/libssl/src/crypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.11 2014/07/11 08:44:48 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,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63void 65void
diff --git a/src/lib/libssl/src/crypto/bn/bn_shift.c b/src/lib/libssl/src/crypto/bn/bn_shift.c
index 70bb92cd81..771ddff7b0 100644
--- a/src/lib/libssl/src/crypto/bn/bn_shift.c
+++ b/src/lib/libssl/src/crypto/bn/bn_shift.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_shift.c,v 1.11 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_shift.c,v 1.12 2014/07/11 08:44:48 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,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 "bn_lcl.h" 62#include "bn_lcl.h"
64 63
65int 64int
diff --git a/src/lib/libssl/src/crypto/bn/bn_sqr.c b/src/lib/libssl/src/crypto/bn/bn_sqr.c
index 7c54082085..d4a9f46040 100644
--- a/src/lib/libssl/src/crypto/bn/bn_sqr.c
+++ b/src/lib/libssl/src/crypto/bn/bn_sqr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqr.c,v 1.9 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_sqr.c,v 1.10 2014/07/11 08:44:48 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,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 "bn_lcl.h" 62#include "bn_lcl.h"
64 63
65/* r must not be a */ 64/* r must not be a */
diff --git a/src/lib/libssl/src/crypto/bn/bn_sqrt.c b/src/lib/libssl/src/crypto/bn/bn_sqrt.c
index 4bb84edce1..9a59d56b3f 100644
--- a/src/lib/libssl/src/crypto/bn/bn_sqrt.c
+++ b/src/lib/libssl/src/crypto/bn/bn_sqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqrt.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_sqrt.c,v 1.5 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * and Bodo Moeller for the OpenSSL project. */ 3 * and Bodo Moeller for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -55,9 +55,9 @@
55 * 55 *
56 */ 56 */
57 57
58#include "cryptlib.h" 58#include <openssl/err.h>
59#include "bn_lcl.h"
60 59
60#include "bn_lcl.h"
61 61
62BIGNUM * 62BIGNUM *
63BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 63BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
diff --git a/src/lib/libssl/src/crypto/bn/bn_word.c b/src/lib/libssl/src/crypto/bn/bn_word.c
index 8f50d6d573..c4c6754c37 100644
--- a/src/lib/libssl/src/crypto/bn/bn_word.c
+++ b/src/lib/libssl/src/crypto/bn/bn_word.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_word.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_word.c,v 1.12 2014/07/11 08:44:48 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 "bn_lcl.h" 61#include "bn_lcl.h"
62 62
63BN_ULONG 63BN_ULONG
diff --git a/src/lib/libssl/src/crypto/buffer/buf_str.c b/src/lib/libssl/src/crypto/buffer/buf_str.c
index 33836d0af4..f7e4c0b966 100644
--- a/src/lib/libssl/src/crypto/buffer/buf_str.c
+++ b/src/lib/libssl/src/crypto/buffer/buf_str.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: buf_str.c,v 1.8 2014/04/26 13:07:16 jsing Exp $ */ 1/* $OpenBSD: buf_str.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Bob Beck 3 * Copyright (c) 2014 Bob Beck
4 * 4 *
@@ -18,8 +18,9 @@
18#include <stdlib.h> 18#include <stdlib.h>
19#include <stdio.h> 19#include <stdio.h>
20#include <string.h> 20#include <string.h>
21#include "cryptlib.h" 21
22#include <openssl/buffer.h> 22#include <openssl/buffer.h>
23#include <openssl/err.h>
23 24
24/* 25/*
25 * XXX these functions accept a NULL arg and return NULL 26 * XXX these functions accept a NULL arg and return NULL
diff --git a/src/lib/libssl/src/crypto/buffer/buffer.c b/src/lib/libssl/src/crypto/buffer/buffer.c
index af32cbf50b..ac3729d52b 100644
--- a/src/lib/libssl/src/crypto/buffer/buffer.c
+++ b/src/lib/libssl/src/crypto/buffer/buffer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: buffer.c,v 1.20 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: buffer.c,v 1.21 2014/07/11 08:44:48 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,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h>
60#include <string.h> 61#include <string.h>
61 62
62#include "cryptlib.h"
63#include <openssl/buffer.h> 63#include <openssl/buffer.h>
64#include <openssl/err.h>
64 65
65/* LIMIT_BEFORE_EXPANSION is the maximum n such that (n+3)/3*4 < 2**31. That 66/* LIMIT_BEFORE_EXPANSION is the maximum n such that (n+3)/3*4 < 2**31. That
66 * function is applied in several functions in this file and this limit ensures 67 * function is applied in several functions in this file and this limit ensures
diff --git a/src/lib/libssl/src/crypto/cmac/cm_ameth.c b/src/lib/libssl/src/crypto/cmac/cm_ameth.c
index 763d161cfe..39d8ad3aa8 100644
--- a/src/lib/libssl/src/crypto/cmac/cm_ameth.c
+++ b/src/lib/libssl/src/crypto/cmac/cm_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cm_ameth.c,v 1.5 2014/06/21 13:42:14 jsing Exp $ */ 1/* $OpenBSD: cm_ameth.c,v 1.6 2014/07/11 08:44:48 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 2010. 3 * project 2010.
4 */ 4 */
@@ -52,9 +52,10 @@
52 */ 52 */
53 53
54#include <stdio.h> 54#include <stdio.h>
55#include "cryptlib.h" 55
56#include <openssl/evp.h>
57#include <openssl/cmac.h> 56#include <openssl/cmac.h>
57#include <openssl/evp.h>
58
58#include "asn1_locl.h" 59#include "asn1_locl.h"
59 60
60/* CMAC "ASN1" method. This is just here to indicate the 61/* CMAC "ASN1" method. This is just here to indicate the
diff --git a/src/lib/libssl/src/crypto/cmac/cm_pmeth.c b/src/lib/libssl/src/crypto/cmac/cm_pmeth.c
index 6aba656f18..d9059ca4a8 100644
--- a/src/lib/libssl/src/crypto/cmac/cm_pmeth.c
+++ b/src/lib/libssl/src/crypto/cmac/cm_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cm_pmeth.c,v 1.7 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: cm_pmeth.c,v 1.8 2014/07/11 08:44:48 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 2010. 3 * project 2010.
4 */ 4 */
@@ -54,11 +54,11 @@
54#include <stdio.h> 54#include <stdio.h>
55#include <string.h> 55#include <string.h>
56 56
57#include "cryptlib.h" 57#include <openssl/cmac.h>
58#include <openssl/evp.h>
58#include <openssl/x509.h> 59#include <openssl/x509.h>
59#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
60#include <openssl/evp.h> 61
61#include <openssl/cmac.h>
62#include "evp_locl.h" 62#include "evp_locl.h"
63 63
64/* The context structure and "key" is simply a CMAC_CTX */ 64/* The context structure and "key" is simply a CMAC_CTX */
diff --git a/src/lib/libssl/src/crypto/cmac/cmac.c b/src/lib/libssl/src/crypto/cmac/cmac.c
index b717f786f1..baba674ec1 100644
--- a/src/lib/libssl/src/crypto/cmac/cmac.c
+++ b/src/lib/libssl/src/crypto/cmac/cmac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cmac.c,v 1.7 2014/06/21 13:42:14 jsing Exp $ */ 1/* $OpenBSD: cmac.c,v 1.8 2014/07/11 08:44:48 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 */
@@ -54,7 +54,7 @@
54#include <stdio.h> 54#include <stdio.h>
55#include <stdlib.h> 55#include <stdlib.h>
56#include <string.h> 56#include <string.h>
57#include "cryptlib.h" 57
58#include <openssl/cmac.h> 58#include <openssl/cmac.h>
59 59
60struct CMAC_CTX_st { 60struct CMAC_CTX_st {
diff --git a/src/lib/libssl/src/crypto/cms/cms_cd.c b/src/lib/libssl/src/crypto/cms/cms_cd.c
index 2a67c5df30..bcf1506916 100644
--- a/src/lib/libssl/src/crypto/cms/cms_cd.c
+++ b/src/lib/libssl/src/crypto/cms/cms_cd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_cd.c,v 1.4 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: cms_cd.c,v 1.5 2014/07/11 08:44:48 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 */
@@ -53,16 +53,17 @@
53 53
54#include <openssl/opensslconf.h> 54#include <openssl/opensslconf.h>
55 55
56#include "cryptlib.h"
57#include <openssl/asn1t.h> 56#include <openssl/asn1t.h>
57#include <openssl/bio.h>
58#include <openssl/cms.h>
59#include <openssl/err.h>
58#include <openssl/pem.h> 60#include <openssl/pem.h>
59#include <openssl/x509v3.h> 61#include <openssl/x509v3.h>
60#include <openssl/err.h> 62
61#include <openssl/cms.h>
62#include <openssl/bio.h>
63#ifndef OPENSSL_NO_COMP 63#ifndef OPENSSL_NO_COMP
64#include <openssl/comp.h> 64#include <openssl/comp.h>
65#endif 65#endif
66
66#include "cms_lcl.h" 67#include "cms_lcl.h"
67 68
68DECLARE_ASN1_ITEM(CMS_CompressedData) 69DECLARE_ASN1_ITEM(CMS_CompressedData)
diff --git a/src/lib/libssl/src/crypto/cms/cms_dd.c b/src/lib/libssl/src/crypto/cms/cms_dd.c
index 7b1fff889a..eee25f5f07 100644
--- a/src/lib/libssl/src/crypto/cms/cms_dd.c
+++ b/src/lib/libssl/src/crypto/cms/cms_dd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_dd.c,v 1.3 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_dd.c,v 1.4 2014/07/11 08:44:48 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 */
@@ -51,12 +51,12 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
55#include <openssl/cms.h>
56#include <openssl/err.h>
56#include <openssl/pem.h> 57#include <openssl/pem.h>
57#include <openssl/x509v3.h> 58#include <openssl/x509v3.h>
58#include <openssl/err.h> 59
59#include <openssl/cms.h>
60#include "cms_lcl.h" 60#include "cms_lcl.h"
61 61
62DECLARE_ASN1_ITEM(CMS_DigestedData) 62DECLARE_ASN1_ITEM(CMS_DigestedData)
diff --git a/src/lib/libssl/src/crypto/cms/cms_enc.c b/src/lib/libssl/src/crypto/cms/cms_enc.c
index faa1b14d4b..efe19a3131 100644
--- a/src/lib/libssl/src/crypto/cms/cms_enc.c
+++ b/src/lib/libssl/src/crypto/cms/cms_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_enc.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_enc.c,v 1.5 2014/07/11 08:44:48 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 */
@@ -51,13 +51,13 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
56#include <openssl/pem.h>
57#include <openssl/x509v3.h>
58#include <openssl/err.h>
59#include <openssl/cms.h> 55#include <openssl/cms.h>
56#include <openssl/err.h>
57#include <openssl/pem.h>
60#include <openssl/rand.h> 58#include <openssl/rand.h>
59#include <openssl/x509v3.h>
60
61#include "cms_lcl.h" 61#include "cms_lcl.h"
62 62
63/* CMS EncryptedData Utilities */ 63/* CMS EncryptedData Utilities */
diff --git a/src/lib/libssl/src/crypto/cms/cms_env.c b/src/lib/libssl/src/crypto/cms/cms_env.c
index 2dd4e2faba..66ec1a9343 100644
--- a/src/lib/libssl/src/crypto/cms/cms_env.c
+++ b/src/lib/libssl/src/crypto/cms/cms_env.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_env.c,v 1.5 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_env.c,v 1.6 2014/07/11 08:44:48 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 */
@@ -51,14 +51,14 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h" 54#include <openssl/aes.h>
55#include <openssl/asn1t.h> 55#include <openssl/asn1t.h>
56#include <openssl/pem.h>
57#include <openssl/x509v3.h>
58#include <openssl/err.h>
59#include <openssl/cms.h> 56#include <openssl/cms.h>
57#include <openssl/err.h>
58#include <openssl/pem.h>
60#include <openssl/rand.h> 59#include <openssl/rand.h>
61#include <openssl/aes.h> 60#include <openssl/x509v3.h>
61
62#include "cms_lcl.h" 62#include "cms_lcl.h"
63#include "asn1_locl.h" 63#include "asn1_locl.h"
64 64
diff --git a/src/lib/libssl/src/crypto/cms/cms_ess.c b/src/lib/libssl/src/crypto/cms/cms_ess.c
index f972ff3ee3..e3b7e7da4c 100644
--- a/src/lib/libssl/src/crypto/cms/cms_ess.c
+++ b/src/lib/libssl/src/crypto/cms/cms_ess.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_ess.c,v 1.5 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_ess.c,v 1.6 2014/07/11 08:44:48 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 */
@@ -51,13 +51,13 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
55#include <openssl/cms.h>
56#include <openssl/err.h>
56#include <openssl/pem.h> 57#include <openssl/pem.h>
57#include <openssl/rand.h> 58#include <openssl/rand.h>
58#include <openssl/x509v3.h> 59#include <openssl/x509v3.h>
59#include <openssl/err.h> 60
60#include <openssl/cms.h>
61#include "cms_lcl.h" 61#include "cms_lcl.h"
62 62
63DECLARE_ASN1_ITEM(CMS_ReceiptRequest) 63DECLARE_ASN1_ITEM(CMS_ReceiptRequest)
diff --git a/src/lib/libssl/src/crypto/cms/cms_pwri.c b/src/lib/libssl/src/crypto/cms/cms_pwri.c
index 04d0cb833f..ea3fbf87dd 100644
--- a/src/lib/libssl/src/crypto/cms/cms_pwri.c
+++ b/src/lib/libssl/src/crypto/cms/cms_pwri.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_pwri.c,v 1.5 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_pwri.c,v 1.6 2014/07/11 08:44:48 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 */
@@ -51,16 +51,16 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h" 54#include <openssl/aes.h>
55#include <openssl/asn1t.h> 55#include <openssl/asn1t.h>
56#include <openssl/pem.h>
57#include <openssl/x509v3.h>
58#include <openssl/err.h>
59#include <openssl/cms.h> 56#include <openssl/cms.h>
57#include <openssl/err.h>
58#include <openssl/pem.h>
60#include <openssl/rand.h> 59#include <openssl/rand.h>
61#include <openssl/aes.h> 60#include <openssl/x509v3.h>
62#include "cms_lcl.h" 61
63#include "asn1_locl.h" 62#include "asn1_locl.h"
63#include "cms_lcl.h"
64 64
65int 65int
66CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, unsigned char *pass, 66CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, unsigned char *pass,
diff --git a/src/lib/libssl/src/crypto/cms/cms_sd.c b/src/lib/libssl/src/crypto/cms/cms_sd.c
index 0993502a1d..63c3f69bae 100644
--- a/src/lib/libssl/src/crypto/cms/cms_sd.c
+++ b/src/lib/libssl/src/crypto/cms/cms_sd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_sd.c,v 1.5 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_sd.c,v 1.6 2014/07/11 08:44:48 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 */
@@ -51,14 +51,14 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
55#include <openssl/cms.h>
56#include <openssl/err.h>
56#include <openssl/pem.h> 57#include <openssl/pem.h>
57#include <openssl/x509v3.h> 58#include <openssl/x509v3.h>
58#include <openssl/err.h> 59
59#include <openssl/cms.h>
60#include "cms_lcl.h"
61#include "asn1_locl.h" 60#include "asn1_locl.h"
61#include "cms_lcl.h"
62 62
63/* CMS SignedData Utilities */ 63/* CMS SignedData Utilities */
64 64
diff --git a/src/lib/libssl/src/crypto/cms/cms_smime.c b/src/lib/libssl/src/crypto/cms/cms_smime.c
index 049ef69d38..4f80561e5d 100644
--- a/src/lib/libssl/src/crypto/cms/cms_smime.c
+++ b/src/lib/libssl/src/crypto/cms/cms_smime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_smime.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: cms_smime.c,v 1.11 2014/07/11 08:44:48 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 */
@@ -51,12 +51,12 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include "cryptlib.h"
55#include <openssl/asn1t.h> 54#include <openssl/asn1t.h>
55#include <openssl/cms.h>
56#include <openssl/err.h>
56#include <openssl/x509.h> 57#include <openssl/x509.h>
57#include <openssl/x509v3.h> 58#include <openssl/x509v3.h>
58#include <openssl/err.h> 59
59#include <openssl/cms.h>
60#include "cms_lcl.h" 60#include "cms_lcl.h"
61 61
62static int 62static int
diff --git a/src/lib/libssl/src/crypto/conf/conf_def.c b/src/lib/libssl/src/crypto/conf/conf_def.c
index f9b4a5b148..e5bff15f7a 100644
--- a/src/lib/libssl/src/crypto/conf/conf_def.c
+++ b/src/lib/libssl/src/crypto/conf/conf_def.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_def.c,v 1.26 2014/07/09 11:10:50 bcook Exp $ */ 1/* $OpenBSD: conf_def.c,v 1.27 2014/07/11 08:44:48 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,14 +60,15 @@
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include <string.h> 62#include <string.h>
63#include "cryptlib.h" 63
64#include <openssl/stack.h> 64#include <openssl/buffer.h>
65#include <openssl/lhash.h>
66#include <openssl/conf.h> 65#include <openssl/conf.h>
67#include <openssl/conf_api.h> 66#include <openssl/conf_api.h>
68#include "conf_def.h"
69#include <openssl/buffer.h>
70#include <openssl/err.h> 67#include <openssl/err.h>
68#include <openssl/lhash.h>
69#include <openssl/stack.h>
70
71#include "conf_def.h"
71 72
72static char *eat_ws(CONF *conf, char *p); 73static char *eat_ws(CONF *conf, char *p);
73static char *eat_alpha_numeric(CONF *conf, char *p); 74static char *eat_alpha_numeric(CONF *conf, char *p);
diff --git a/src/lib/libssl/src/crypto/conf/conf_mall.c b/src/lib/libssl/src/crypto/conf/conf_mall.c
index 5eef7a7d18..18631b3ba8 100644
--- a/src/lib/libssl/src/crypto/conf/conf_mall.c
+++ b/src/lib/libssl/src/crypto/conf/conf_mall.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_mall.c,v 1.8 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: conf_mall.c,v 1.9 2014/07/11 08:44:48 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,11 +60,11 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/crypto.h> 63#include <openssl/asn1.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#include <openssl/asn1.h> 67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
diff --git a/src/lib/libssl/src/crypto/conf/conf_mod.c b/src/lib/libssl/src/crypto/conf/conf_mod.c
index def64361ff..36ffeb9f95 100644
--- a/src/lib/libssl/src/crypto/conf/conf_mod.c
+++ b/src/lib/libssl/src/crypto/conf/conf_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_mod.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: conf_mod.c,v 1.23 2014/07/11 08:44:48 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 */
@@ -61,17 +61,15 @@
61#include <string.h> 61#include <string.h>
62#include <unistd.h> 62#include <unistd.h>
63 63
64#include <openssl/crypto.h>
65#include "cryptlib.h"
66#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/crypto.h>
67#include <openssl/dso.h> 66#include <openssl/dso.h>
67#include <openssl/err.h>
68#include <openssl/x509.h> 68#include <openssl/x509.h>
69 69
70
71#define DSO_mod_init_name "OPENSSL_init" 70#define DSO_mod_init_name "OPENSSL_init"
72#define DSO_mod_finish_name "OPENSSL_finish" 71#define DSO_mod_finish_name "OPENSSL_finish"
73 72
74
75/* This structure contains a data about supported modules. 73/* This structure contains a data about supported modules.
76 * entries in this table correspond to either dynamic or 74 * entries in this table correspond to either dynamic or
77 * static modules. 75 * static modules.
diff --git a/src/lib/libssl/src/crypto/conf/conf_sap.c b/src/lib/libssl/src/crypto/conf/conf_sap.c
index 332b48ba5a..52d05dbe13 100644
--- a/src/lib/libssl/src/crypto/conf/conf_sap.c
+++ b/src/lib/libssl/src/crypto/conf/conf_sap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_sap.c,v 1.9 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: conf_sap.c,v 1.10 2014/07/11 08:44:48 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,11 +60,11 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/crypto.h> 63#include <openssl/asn1.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#include <openssl/asn1.h> 67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
diff --git a/src/lib/libssl/src/crypto/cryptlib.c b/src/lib/libssl/src/crypto/cryptlib.c
index 30023af332..6a75d9568c 100644
--- a/src/lib/libssl/src/crypto/cryptlib.c
+++ b/src/lib/libssl/src/crypto/cryptlib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cryptlib.c,v 1.31 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: cryptlib.c,v 1.32 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -114,12 +114,15 @@
114 * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. 114 * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
115 */ 115 */
116 116
117#include <stdarg.h>
117#include <string.h> 118#include <string.h>
118#include <unistd.h> 119#include <unistd.h>
119 120
120#include <openssl/opensslconf.h> 121#include <openssl/opensslconf.h>
121 122
122#include "cryptlib.h" 123#include <openssl/crypto.h>
124#include <openssl/buffer.h>
125#include <openssl/err.h>
123#include <openssl/safestack.h> 126#include <openssl/safestack.h>
124 127
125DECLARE_STACK_OF(CRYPTO_dynlock) 128DECLARE_STACK_OF(CRYPTO_dynlock)
diff --git a/src/lib/libssl/src/crypto/cryptlib.h b/src/lib/libssl/src/crypto/cryptlib.h
index 679af821c1..ad679dfa8d 100644
--- a/src/lib/libssl/src/crypto/cryptlib.h
+++ b/src/lib/libssl/src/crypto/cryptlib.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: cryptlib.h,v 1.23 2014/07/10 22:13:39 jsing Exp $ */ 1/* $OpenBSD: cryptlib.h,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,10 +59,6 @@
59#ifndef HEADER_CRYPTLIB_H 59#ifndef HEADER_CRYPTLIB_H
60#define HEADER_CRYPTLIB_H 60#define HEADER_CRYPTLIB_H
61 61
62#include <openssl/crypto.h>
63#include <openssl/buffer.h>
64#include <openssl/bio.h>
65#include <openssl/err.h>
66#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
67 63
68#ifdef __cplusplus 64#ifdef __cplusplus
diff --git a/src/lib/libssl/src/crypto/cversion.c b/src/lib/libssl/src/crypto/cversion.c
index 68f27633db..e9f40c24cf 100644
--- a/src/lib/libssl/src/crypto/cversion.c
+++ b/src/lib/libssl/src/crypto/cversion.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cversion.c,v 1.13 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: cversion.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 *
@@ -56,7 +56,8 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include "cryptlib.h" 59#include <openssl/crypto.h>
60#include <openssl/opensslv.h>
60 61
61const char * 62const char *
62SSLeay_version(int t) 63SSLeay_version(int t)
diff --git a/src/lib/libssl/src/crypto/des/enc_read.c b/src/lib/libssl/src/crypto/des/enc_read.c
index b358fadd48..e4680af4f2 100644
--- a/src/lib/libssl/src/crypto/des/enc_read.c
+++ b/src/lib/libssl/src/crypto/des/enc_read.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: enc_read.c,v 1.13 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: enc_read.c,v 1.14 2014/07/11 08:44:48 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,17 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <stdio.h>
60#include <errno.h> 59#include <errno.h>
60#include <stdio.h>
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include "des_locl.h" 64#include "des_locl.h"
66 65
67/* This has some uglies in it but it works - even over sockets. */ 66/* This has some uglies in it but it works - even over sockets. */
68/*extern int errno;*/ 67/*extern int errno;*/
69int DES_rw_mode = DES_PCBC_MODE; 68int DES_rw_mode = DES_PCBC_MODE;
70 69
71
72/* 70/*
73 * WARNINGS: 71 * WARNINGS:
74 * 72 *
diff --git a/src/lib/libssl/src/crypto/des/enc_writ.c b/src/lib/libssl/src/crypto/des/enc_writ.c
index 0e3a2d856a..a7049ff44e 100644
--- a/src/lib/libssl/src/crypto/des/enc_writ.c
+++ b/src/lib/libssl/src/crypto/des/enc_writ.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: enc_writ.c,v 1.11 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: enc_writ.c,v 1.12 2014/07/11 08:44:48 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,10 +62,10 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include "des_locl.h"
67#include <openssl/rand.h> 65#include <openssl/rand.h>
68 66
67#include "des_locl.h"
68
69/* 69/*
70 * WARNINGS: 70 * WARNINGS:
71 * 71 *
diff --git a/src/lib/libssl/src/crypto/dh/dh_ameth.c b/src/lib/libssl/src/crypto/dh/dh_ameth.c
index 21714bb748..91178a92b0 100644
--- a/src/lib/libssl/src/crypto/dh/dh_ameth.c
+++ b/src/lib/libssl/src/crypto/dh/dh_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_ameth.c,v 1.10 2014/07/09 22:55:17 tedu Exp $ */ 1/* $OpenBSD: dh_ameth.c,v 1.11 2014/07/11 08:44:48 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 */
@@ -57,11 +57,13 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/x509.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/dh.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
63#include <openssl/dh.h>
64#include <openssl/err.h>
65#include <openssl/x509.h>
66
65#include "asn1_locl.h" 67#include "asn1_locl.h"
66 68
67static void 69static void
diff --git a/src/lib/libssl/src/crypto/dh/dh_asn1.c b/src/lib/libssl/src/crypto/dh/dh_asn1.c
index ed3a015279..ee478c7958 100644
--- a/src/lib/libssl/src/crypto/dh/dh_asn1.c
+++ b/src/lib/libssl/src/crypto/dh/dh_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_asn1.c,v 1.5 2014/07/09 13:26:47 miod Exp $ */ 1/* $OpenBSD: dh_asn1.c,v 1.6 2014/07/11 08:44:48 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,11 +57,11 @@
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/bn.h> 62#include <openssl/bn.h>
62#include <openssl/dh.h> 63#include <openssl/dh.h>
63#include <openssl/objects.h> 64#include <openssl/objects.h>
64#include <openssl/asn1t.h>
65 65
66/* Override the default free and new methods */ 66/* Override the default free and new methods */
67static int 67static int
diff --git a/src/lib/libssl/src/crypto/dh/dh_check.c b/src/lib/libssl/src/crypto/dh/dh_check.c
index 070a33081a..01b9531a44 100644
--- a/src/lib/libssl/src/crypto/dh/dh_check.c
+++ b/src/lib/libssl/src/crypto/dh/dh_check.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_check.c,v 1.12 2014/07/09 13:30:00 miod Exp $ */ 1/* $OpenBSD: dh_check.c,v 1.13 2014/07/11 08:44:48 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/bn.h> 61#include <openssl/bn.h>
62#include <openssl/dh.h> 62#include <openssl/dh.h>
63 63
diff --git a/src/lib/libssl/src/crypto/dh/dh_depr.c b/src/lib/libssl/src/crypto/dh/dh_depr.c
index 13f2029a59..0b75b0be5e 100644
--- a/src/lib/libssl/src/crypto/dh/dh_depr.c
+++ b/src/lib/libssl/src/crypto/dh/dh_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_depr.c,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dh_depr.c,v 1.6 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -59,7 +59,6 @@
59 59
60#include <openssl/opensslconf.h> 60#include <openssl/opensslconf.h>
61 61
62#include "cryptlib.h"
63#include <openssl/bn.h> 62#include <openssl/bn.h>
64#include <openssl/dh.h> 63#include <openssl/dh.h>
65 64
diff --git a/src/lib/libssl/src/crypto/dh/dh_gen.c b/src/lib/libssl/src/crypto/dh/dh_gen.c
index 453ea3e8e4..6a884eff9e 100644
--- a/src/lib/libssl/src/crypto/dh/dh_gen.c
+++ b/src/lib/libssl/src/crypto/dh/dh_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_gen.c,v 1.12 2014/07/09 13:26:47 miod Exp $ */ 1/* $OpenBSD: dh_gen.c,v 1.13 2014/07/11 08:44:48 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 */ 62 */
63 63
64#include <stdio.h> 64#include <stdio.h>
65#include "cryptlib.h" 65
66#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/dh.h> 67#include <openssl/dh.h>
68#include <openssl/err.h>
68 69
69static int dh_builtin_genparams(DH *ret, int prime_len, int generator, 70static int dh_builtin_genparams(DH *ret, int prime_len, int generator,
70 BN_GENCB *cb); 71 BN_GENCB *cb);
diff --git a/src/lib/libssl/src/crypto/dh/dh_key.c b/src/lib/libssl/src/crypto/dh/dh_key.c
index 4fbedd8daa..6d90816122 100644
--- a/src/lib/libssl/src/crypto/dh/dh_key.c
+++ b/src/lib/libssl/src/crypto/dh/dh_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_key.c,v 1.19 2014/07/09 13:26:47 miod Exp $ */ 1/* $OpenBSD: dh_key.c,v 1.20 2014/07/11 08:44:48 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,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/bn.h> 61#include <openssl/bn.h>
62#include <openssl/rand.h>
63#include <openssl/dh.h> 62#include <openssl/dh.h>
63#include <openssl/err.h>
64#include <openssl/rand.h>
64 65
65static int generate_key(DH *dh); 66static int generate_key(DH *dh);
66static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh); 67static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
diff --git a/src/lib/libssl/src/crypto/dh/dh_lib.c b/src/lib/libssl/src/crypto/dh/dh_lib.c
index 1cf14061c9..0a956e5416 100644
--- a/src/lib/libssl/src/crypto/dh/dh_lib.c
+++ b/src/lib/libssl/src/crypto/dh/dh_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_lib.c,v 1.18 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dh_lib.c,v 1.19 2014/07/11 08:44:48 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 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>
65#include <openssl/dh.h> 64#include <openssl/dh.h>
65
66#ifndef OPENSSL_NO_ENGINE 66#ifndef OPENSSL_NO_ENGINE
67#include <openssl/engine.h> 67#include <openssl/engine.h>
68#endif 68#endif
diff --git a/src/lib/libssl/src/crypto/dh/dh_pmeth.c b/src/lib/libssl/src/crypto/dh/dh_pmeth.c
index aa681add06..6d750eb30d 100644
--- a/src/lib/libssl/src/crypto/dh/dh_pmeth.c
+++ b/src/lib/libssl/src/crypto/dh/dh_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_pmeth.c,v 1.8 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dh_pmeth.c,v 1.9 2014/07/11 08:44:48 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 */
@@ -60,12 +60,13 @@
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>
65#include <openssl/x509.h>
66#include <openssl/evp.h>
67#include <openssl/dh.h>
68#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/dh.h>
66#include <openssl/err.h>
67#include <openssl/evp.h>
68#include <openssl/x509.h>
69
69#include "evp_locl.h" 70#include "evp_locl.h"
70 71
71/* DH pkey context structure */ 72/* DH pkey context structure */
diff --git a/src/lib/libssl/src/crypto/dh/dh_prn.c b/src/lib/libssl/src/crypto/dh/dh_prn.c
index 846419691e..73d0476e21 100644
--- a/src/lib/libssl/src/crypto/dh/dh_prn.c
+++ b/src/lib/libssl/src/crypto/dh/dh_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_prn.c,v 1.4 2014/07/09 13:26:47 miod Exp $ */ 1/* $OpenBSD: dh_prn.c,v 1.5 2014/07/11 08:44:48 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/dh.h> 61#include <openssl/dh.h>
62#include <openssl/err.h>
63#include <openssl/evp.h>
63 64
64int 65int
65DHparams_print_fp(FILE *fp, const DH *x) 66DHparams_print_fp(FILE *fp, const DH *x)
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_ameth.c b/src/lib/libssl/src/crypto/dsa/dsa_ameth.c
index 1f08585e5f..73c58ec94c 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_ameth.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_ameth.c,v 1.11 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dsa_ameth.c,v 1.12 2014/07/11 08:44:48 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 */
@@ -60,14 +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#include <openssl/dsa.h>
67#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/dsa.h>
66#include <openssl/err.h>
67#include <openssl/x509.h>
68
68#ifndef OPENSSL_NO_CMS 69#ifndef OPENSSL_NO_CMS
69#include <openssl/cms.h> 70#include <openssl/cms.h>
70#endif 71#endif
72
71#include "asn1_locl.h" 73#include "asn1_locl.h"
72 74
73static int 75static int
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_asn1.c b/src/lib/libssl/src/crypto/dsa/dsa_asn1.c
index cc03f29823..bbe091b928 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_asn1.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_asn1.c,v 1.11 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_asn1.c,v 1.12 2014/07/11 08:44:48 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,10 +57,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/dsa.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/dsa.h>
64#include <openssl/err.h>
64#include <openssl/rand.h> 65#include <openssl/rand.h>
65 66
66/* Override the default new methods */ 67/* Override the default new methods */
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_depr.c b/src/lib/libssl/src/crypto/dsa/dsa_depr.c
index d8ac6f9d92..472e329207 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_depr.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_depr.c,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dsa_depr.c,v 1.6 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -63,10 +63,9 @@
63 63
64#ifndef OPENSSL_NO_SHA 64#ifndef OPENSSL_NO_SHA
65 65
66#include "cryptlib.h"
67#include <openssl/evp.h>
68#include <openssl/bn.h> 66#include <openssl/bn.h>
69#include <openssl/dsa.h> 67#include <openssl/dsa.h>
68#include <openssl/evp.h>
70#include <openssl/rand.h> 69#include <openssl/rand.h>
71#include <openssl/sha.h> 70#include <openssl/sha.h>
72 71
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_gen.c b/src/lib/libssl/src/crypto/dsa/dsa_gen.c
index 491b4de5f9..d41e7562e1 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_gen.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_gen.c,v 1.14 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dsa_gen.c,v 1.15 2014/07/11 08:44:48 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 *
@@ -63,11 +63,11 @@
63#include <stdio.h> 63#include <stdio.h>
64#include <string.h> 64#include <string.h>
65 65
66#include "cryptlib.h"
67#include <openssl/evp.h>
68#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/evp.h>
69#include <openssl/rand.h> 68#include <openssl/rand.h>
70#include <openssl/sha.h> 69#include <openssl/sha.h>
70
71#include "dsa_locl.h" 71#include "dsa_locl.h"
72 72
73int 73int
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_key.c b/src/lib/libssl/src/crypto/dsa/dsa_key.c
index 723e1888df..4573ecbcce 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_key.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_key.c,v 1.17 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dsa_key.c,v 1.18 2014/07/11 08:44:48 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,8 +61,8 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#ifndef OPENSSL_NO_SHA 64#ifndef OPENSSL_NO_SHA
65
66#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/dsa.h> 67#include <openssl/dsa.h>
68#include <openssl/rand.h> 68#include <openssl/rand.h>
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_lib.c b/src/lib/libssl/src/crypto/dsa/dsa_lib.c
index 3bf8427d4c..97307134cd 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_lib.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_lib.c,v 1.19 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: dsa_lib.c,v 1.20 2014/07/11 08:44:48 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,16 +62,16 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h" 65#include <openssl/asn1.h>
66#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/dsa.h> 67#include <openssl/dsa.h>
68#include <openssl/asn1.h> 68
69#ifndef OPENSSL_NO_ENGINE
70#include <openssl/engine.h>
71#endif
72#ifndef OPENSSL_NO_DH 69#ifndef OPENSSL_NO_DH
73#include <openssl/dh.h> 70#include <openssl/dh.h>
74#endif 71#endif
72#ifndef OPENSSL_NO_ENGINE
73#include <openssl/engine.h>
74#endif
75 75
76static const DSA_METHOD *default_DSA_method = NULL; 76static const DSA_METHOD *default_DSA_method = NULL;
77 77
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_ossl.c b/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
index 17119eb187..5bff836c50 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_ossl.c,v 1.19 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_ossl.c,v 1.20 2014/07/11 08:44:48 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,12 +59,13 @@
59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ 59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include "cryptlib.h" 62
63#include <openssl/asn1.h>
63#include <openssl/bn.h> 64#include <openssl/bn.h>
64#include <openssl/sha.h>
65#include <openssl/dsa.h> 65#include <openssl/dsa.h>
66#include <openssl/err.h>
66#include <openssl/rand.h> 67#include <openssl/rand.h>
67#include <openssl/asn1.h> 68#include <openssl/sha.h>
68 69
69static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); 70static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
70static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, 71static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_pmeth.c b/src/lib/libssl/src/crypto/dsa/dsa_pmeth.c
index 2e44e8d5dd..c7a2edfc94 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_pmeth.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_pmeth.c,v 1.9 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dsa_pmeth.c,v 1.10 2014/07/11 08:44:48 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 */
@@ -60,13 +60,14 @@
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>
65#include <openssl/x509.h>
66#include <openssl/evp.h>
67#include <openssl/bn.h> 64#include <openssl/bn.h>
68#include "evp_locl.h" 65#include <openssl/err.h>
66#include <openssl/evp.h>
67#include <openssl/x509.h>
68
69#include "dsa_locl.h" 69#include "dsa_locl.h"
70#include "evp_locl.h"
70 71
71/* DSA pkey context structure */ 72/* DSA pkey context structure */
72 73
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_prn.c b/src/lib/libssl/src/crypto/dsa/dsa_prn.c
index 5a7423c831..60f4e6c760 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_prn.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_prn.c,v 1.4 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_prn.c,v 1.5 2014/07/11 08:44:48 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 */
@@ -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/dsa.h> 61#include <openssl/dsa.h>
62#include <openssl/err.h>
63#include <openssl/evp.h>
63 64
64int 65int
65DSA_print_fp(FILE *fp, const DSA *x, int off) 66DSA_print_fp(FILE *fp, const DSA *x, int off)
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_sign.c b/src/lib/libssl/src/crypto/dsa/dsa_sign.c
index 40223a1d59..efeb35477c 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_sign.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_sign.c,v 1.16 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_sign.c,v 1.17 2014/07/11 08:44:48 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 *
@@ -58,10 +58,9 @@
58 58
59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ 59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
60 60
61#include "cryptlib.h" 61#include <openssl/bn.h>
62#include <openssl/dsa.h> 62#include <openssl/dsa.h>
63#include <openssl/rand.h> 63#include <openssl/rand.h>
64#include <openssl/bn.h>
65 64
66DSA_SIG * 65DSA_SIG *
67DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) 66DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_vrf.c b/src/lib/libssl/src/crypto/dsa/dsa_vrf.c
index b82fa41259..1965338f1f 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_vrf.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_vrf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_vrf.c,v 1.15 2014/07/09 10:16:24 miod Exp $ */ 1/* $OpenBSD: dsa_vrf.c,v 1.16 2014/07/11 08:44:48 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 *
@@ -58,7 +58,6 @@
58 58
59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ 59/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
60 60
61#include "cryptlib.h"
62#include <openssl/dsa.h> 61#include <openssl/dsa.h>
63 62
64int 63int
diff --git a/src/lib/libssl/src/crypto/dso/dso_dlfcn.c b/src/lib/libssl/src/crypto/dso/dso_dlfcn.c
index e88553f644..b75c9e23e0 100644
--- a/src/lib/libssl/src/crypto/dso/dso_dlfcn.c
+++ b/src/lib/libssl/src/crypto/dso/dso_dlfcn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso_dlfcn.c,v 1.26 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dso_dlfcn.c,v 1.27 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
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/dso.h> 62#include <openssl/dso.h>
63#include <openssl/err.h>
64 64
65#ifndef DSO_DLFCN 65#ifndef DSO_DLFCN
66DSO_METHOD * 66DSO_METHOD *
diff --git a/src/lib/libssl/src/crypto/dso/dso_lib.c b/src/lib/libssl/src/crypto/dso/dso_lib.c
index b76bd1ca84..3002e4d99c 100644
--- a/src/lib/libssl/src/crypto/dso/dso_lib.c
+++ b/src/lib/libssl/src/crypto/dso/dso_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso_lib.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: dso_lib.c,v 1.18 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -60,8 +60,8 @@
60#include <string.h> 60#include <string.h>
61 61
62#include <openssl/crypto.h> 62#include <openssl/crypto.h>
63#include "cryptlib.h"
64#include <openssl/dso.h> 63#include <openssl/dso.h>
64#include <openssl/err.h>
65 65
66static DSO_METHOD *default_DSO_meth = NULL; 66static DSO_METHOD *default_DSO_meth = NULL;
67 67
diff --git a/src/lib/libssl/src/crypto/dso/dso_null.c b/src/lib/libssl/src/crypto/dso/dso_null.c
index 572d36d1f6..a3dc0ec1ff 100644
--- a/src/lib/libssl/src/crypto/dso/dso_null.c
+++ b/src/lib/libssl/src/crypto/dso/dso_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso_null.c,v 1.6 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: dso_null.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -60,7 +60,7 @@
60 * no appropriate support for "shared-libraries". */ 60 * no appropriate support for "shared-libraries". */
61 61
62#include <stdio.h> 62#include <stdio.h>
63#include "cryptlib.h" 63
64#include <openssl/dso.h> 64#include <openssl/dso.h>
65 65
66static DSO_METHOD dso_meth_null = { 66static DSO_METHOD dso_meth_null = {
diff --git a/src/lib/libssl/src/crypto/dso/dso_openssl.c b/src/lib/libssl/src/crypto/dso/dso_openssl.c
index 6b9d9682fe..37d8d5805f 100644
--- a/src/lib/libssl/src/crypto/dso/dso_openssl.c
+++ b/src/lib/libssl/src/crypto/dso/dso_openssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso_openssl.c,v 1.5 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: dso_openssl.c,v 1.6 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) 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/dso.h> 61#include <openssl/dso.h>
62 62
63/* We just pinch the method from an appropriate "default" method. */ 63/* We just pinch the method from an appropriate "default" method. */
diff --git a/src/lib/libssl/src/crypto/ec/ec_ameth.c b/src/lib/libssl/src/crypto/ec/ec_ameth.c
index 6935972de5..93e305b71a 100644
--- a/src/lib/libssl/src/crypto/ec/ec_ameth.c
+++ b/src/lib/libssl/src/crypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_ameth.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: ec_ameth.c,v 1.11 2014/07/11 08:44:48 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 */
@@ -60,13 +60,15 @@
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/ec.h>
66#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/ec.h>
65#include <openssl/err.h>
66#include <openssl/x509.h>
67
67#ifndef OPENSSL_NO_CMS 68#ifndef OPENSSL_NO_CMS
68#include <openssl/cms.h> 69#include <openssl/cms.h>
69#endif 70#endif
71
70#include "asn1_locl.h" 72#include "asn1_locl.h"
71 73
72static int 74static int
diff --git a/src/lib/libssl/src/crypto/ec/ec_pmeth.c b/src/lib/libssl/src/crypto/ec/ec_pmeth.c
index 043c2a5a0c..7ba1d50d7f 100644
--- a/src/lib/libssl/src/crypto/ec/ec_pmeth.c
+++ b/src/lib/libssl/src/crypto/ec/ec_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_pmeth.c,v 1.6 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: ec_pmeth.c,v 1.7 2014/07/11 08:44:48 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 */
@@ -59,12 +59,13 @@
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>
65#include <openssl/ec.h> 63#include <openssl/ec.h>
66#include <openssl/ecdsa.h> 64#include <openssl/ecdsa.h>
65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
67#include <openssl/x509.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69 70
70/* EC pkey context structure */ 71/* EC pkey context structure */
diff --git a/src/lib/libssl/src/crypto/ec/eck_prn.c b/src/lib/libssl/src/crypto/ec/eck_prn.c
index fb5ee7f52b..b0c8bcd22a 100644
--- a/src/lib/libssl/src/crypto/ec/eck_prn.c
+++ b/src/lib/libssl/src/crypto/ec/eck_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eck_prn.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eck_prn.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -66,10 +66,10 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h"
70#include <openssl/evp.h>
71#include <openssl/ec.h>
72#include <openssl/bn.h> 69#include <openssl/bn.h>
70#include <openssl/ec.h>
71#include <openssl/err.h>
72#include <openssl/evp.h>
73 73
74int 74int
75ECPKParameters_print_fp(FILE * fp, const EC_GROUP * x, int off) 75ECPKParameters_print_fp(FILE * fp, const EC_GROUP * x, int off)
diff --git a/src/lib/libssl/src/crypto/ecdh/ech_ossl.c b/src/lib/libssl/src/crypto/ecdh/ech_ossl.c
index aa22ccafa2..d82ace3670 100644
--- a/src/lib/libssl/src/crypto/ecdh/ech_ossl.c
+++ b/src/lib/libssl/src/crypto/ecdh/ech_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ech_ossl.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: ech_ossl.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -72,13 +72,12 @@
72 72
73#include <openssl/opensslconf.h> 73#include <openssl/opensslconf.h>
74 74
75#include "cryptlib.h" 75#include <openssl/bn.h>
76
77#include "ech_locl.h"
78#include <openssl/err.h> 76#include <openssl/err.h>
79#include <openssl/sha.h>
80#include <openssl/obj_mac.h> 77#include <openssl/obj_mac.h>
81#include <openssl/bn.h> 78#include <openssl/sha.h>
79
80#include "ech_locl.h"
82 81
83static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key, 82static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key,
84 EC_KEY *ecdh, 83 EC_KEY *ecdh,
diff --git a/src/lib/libssl/src/crypto/engine/eng_aesni.c b/src/lib/libssl/src/crypto/engine/eng_aesni.c
index 0bb558c1fd..94c4c1fb6a 100644
--- a/src/lib/libssl/src/crypto/engine/eng_aesni.c
+++ b/src/lib/libssl/src/crypto/engine/eng_aesni.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_aesni.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eng_aesni.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Support for Intel AES-NI intruction set 3 * Support for Intel AES-NI intruction set
4 * Author: Huang Ying <ying.huang@intel.com> 4 * Author: Huang Ying <ying.huang@intel.com>
@@ -80,12 +80,11 @@
80 80
81#if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_AES_NI) && !defined(OPENSSL_NO_AES) 81#if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_AES_NI) && !defined(OPENSSL_NO_AES)
82 82
83#include "cryptlib.h" 83#include <openssl/aes.h>
84#include <openssl/dso.h> 84#include <openssl/dso.h>
85#include <openssl/engine.h> 85#include <openssl/engine.h>
86#include <openssl/evp.h>
87#include <openssl/aes.h>
88#include <openssl/err.h> 86#include <openssl/err.h>
87#include <openssl/evp.h>
89 88
90/* AES-NI is available *ONLY* on some x86 CPUs. Not only that it 89/* AES-NI is available *ONLY* on some x86 CPUs. Not only that it
91 doesn't exist elsewhere, but it even can't be compiled on other 90 doesn't exist elsewhere, but it even can't be compiled on other
diff --git a/src/lib/libssl/src/crypto/engine/eng_int.h b/src/lib/libssl/src/crypto/engine/eng_int.h
index aa3751f267..f240411981 100644
--- a/src/lib/libssl/src/crypto/engine/eng_int.h
+++ b/src/lib/libssl/src/crypto/engine/eng_int.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_int.h,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eng_int.h,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -64,8 +64,6 @@
64#ifndef HEADER_ENGINE_INT_H 64#ifndef HEADER_ENGINE_INT_H
65#define HEADER_ENGINE_INT_H 65#define HEADER_ENGINE_INT_H
66 66
67#include "cryptlib.h"
68
69/* Take public definitions from engine.h */ 67/* Take public definitions from engine.h */
70#include <openssl/engine.h> 68#include <openssl/engine.h>
71 69
diff --git a/src/lib/libssl/src/crypto/engine/eng_list.c b/src/lib/libssl/src/crypto/engine/eng_list.c
index 35b45158e9..b84504102f 100644
--- a/src/lib/libssl/src/crypto/engine/eng_list.c
+++ b/src/lib/libssl/src/crypto/engine/eng_list.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_list.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eng_list.c,v 1.15 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -66,6 +66,7 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h"
69#include "eng_int.h" 70#include "eng_int.h"
70 71
71/* The linked-list of pointers to engine types. engine_list_head 72/* The linked-list of pointers to engine types. engine_list_head
diff --git a/src/lib/libssl/src/crypto/engine/eng_openssl.c b/src/lib/libssl/src/crypto/engine/eng_openssl.c
index ecc560eb26..f1a58df857 100644
--- a/src/lib/libssl/src/crypto/engine/eng_openssl.c
+++ b/src/lib/libssl/src/crypto/engine/eng_openssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_openssl.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: eng_openssl.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -67,20 +67,20 @@
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include <openssl/crypto.h> 69#include <openssl/crypto.h>
70#include "cryptlib.h"
71#include <openssl/engine.h>
72#include <openssl/dso.h> 70#include <openssl/dso.h>
73#include <openssl/pem.h> 71#include <openssl/engine.h>
74#include <openssl/evp.h> 72#include <openssl/evp.h>
73#include <openssl/pem.h>
75#include <openssl/rand.h> 74#include <openssl/rand.h>
76#ifndef OPENSSL_NO_RSA 75
77#include <openssl/rsa.h> 76#ifndef OPENSSL_NO_DH
77#include <openssl/dh.h>
78#endif 78#endif
79#ifndef OPENSSL_NO_DSA 79#ifndef OPENSSL_NO_DSA
80#include <openssl/dsa.h> 80#include <openssl/dsa.h>
81#endif 81#endif
82#ifndef OPENSSL_NO_DH 82#ifndef OPENSSL_NO_RSA
83#include <openssl/dh.h> 83#include <openssl/rsa.h>
84#endif 84#endif
85 85
86/* This testing gunk is implemented (and explained) lower down. It also assumes 86/* This testing gunk is implemented (and explained) lower down. It also assumes
diff --git a/src/lib/libssl/src/crypto/engine/eng_table.c b/src/lib/libssl/src/crypto/engine/eng_table.c
index 44f3e892b8..9d52075a76 100644
--- a/src/lib/libssl/src/crypto/engine/eng_table.c
+++ b/src/lib/libssl/src/crypto/engine/eng_table.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_table.c,v 1.6 2014/06/22 12:05:09 jsing Exp $ */ 1/* $OpenBSD: eng_table.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2001 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -53,9 +53,9 @@
53 * 53 *
54 */ 54 */
55 55
56#include "cryptlib.h"
57#include <openssl/evp.h> 56#include <openssl/evp.h>
58#include <openssl/lhash.h> 57#include <openssl/lhash.h>
58
59#include "eng_int.h" 59#include "eng_int.h"
60 60
61/* The type of the items in the table */ 61/* The type of the items in the table */
diff --git a/src/lib/libssl/src/crypto/err/err.c b/src/lib/libssl/src/crypto/err/err.c
index cc9d78cb07..571bfaed16 100644
--- a/src/lib/libssl/src/crypto/err/err.c
+++ b/src/lib/libssl/src/crypto/err/err.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err.c,v 1.37 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: err.c,v 1.38 2014/07/11 08:44:48 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 *
@@ -115,12 +115,11 @@
115 115
116#include <openssl/opensslconf.h> 116#include <openssl/opensslconf.h>
117 117
118#include "cryptlib.h"
119#include <openssl/lhash.h>
120#include <openssl/crypto.h>
121#include <openssl/buffer.h>
122#include <openssl/bio.h> 118#include <openssl/bio.h>
119#include <openssl/buffer.h>
120#include <openssl/crypto.h>
123#include <openssl/err.h> 121#include <openssl/err.h>
122#include <openssl/lhash.h>
124 123
125DECLARE_LHASH_OF(ERR_STRING_DATA); 124DECLARE_LHASH_OF(ERR_STRING_DATA);
126DECLARE_LHASH_OF(ERR_STATE); 125DECLARE_LHASH_OF(ERR_STATE);
diff --git a/src/lib/libssl/src/crypto/err/err.h b/src/lib/libssl/src/crypto/err/err.h
index fc2f1a4eaf..2bd6f0e8aa 100644
--- a/src/lib/libssl/src/crypto/err/err.h
+++ b/src/lib/libssl/src/crypto/err/err.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: err.h,v 1.19 2014/07/08 11:11:57 jsing Exp $ */ 1/* $OpenBSD: err.h,v 1.20 2014/07/11 08:44:48 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 *
@@ -114,8 +114,10 @@
114 114
115#include <openssl/opensslconf.h> 115#include <openssl/opensslconf.h>
116 116
117#ifndef LIBRESSL_INTERNAL
117#include <stdio.h> 118#include <stdio.h>
118#include <stdlib.h> 119#include <stdlib.h>
120#endif
119 121
120#include <openssl/ossl_typ.h> 122#include <openssl/ossl_typ.h>
121#ifndef OPENSSL_NO_BIO 123#ifndef OPENSSL_NO_BIO
diff --git a/src/lib/libssl/src/crypto/err/err_prn.c b/src/lib/libssl/src/crypto/err/err_prn.c
index 75d7ed7a0a..021bcd5d1d 100644
--- a/src/lib/libssl/src/crypto/err/err_prn.c
+++ b/src/lib/libssl/src/crypto/err/err_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err_prn.c,v 1.15 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: err_prn.c,v 1.16 2014/07/11 08:44:48 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,11 +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/lhash.h>
64#include <openssl/crypto.h>
65#include <openssl/buffer.h> 62#include <openssl/buffer.h>
63#include <openssl/crypto.h>
66#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/lhash.h>
67 66
68void 67void
69ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u) 68ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u)
diff --git a/src/lib/libssl/src/crypto/evp/bio_b64.c b/src/lib/libssl/src/crypto/evp/bio_b64.c
index 7211195adf..632d056168 100644
--- a/src/lib/libssl/src/crypto/evp/bio_b64.c
+++ b/src/lib/libssl/src/crypto/evp/bio_b64.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_b64.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bio_b64.c,v 1.18 2014/07/11 08:44:48 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,7 +60,6 @@
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> 63#include <openssl/buffer.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
66 65
diff --git a/src/lib/libssl/src/crypto/evp/bio_enc.c b/src/lib/libssl/src/crypto/evp/bio_enc.c
index 3b936f5843..e367faa967 100644
--- a/src/lib/libssl/src/crypto/evp/bio_enc.c
+++ b/src/lib/libssl/src/crypto/evp/bio_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_enc.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bio_enc.c,v 1.18 2014/07/11 08:44:48 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,7 +60,6 @@
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> 63#include <openssl/buffer.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
66 65
diff --git a/src/lib/libssl/src/crypto/evp/bio_md.c b/src/lib/libssl/src/crypto/evp/bio_md.c
index 3d13839df5..b1973746a7 100644
--- a/src/lib/libssl/src/crypto/evp/bio_md.c
+++ b/src/lib/libssl/src/crypto/evp/bio_md.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_md.c,v 1.13 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: bio_md.c,v 1.14 2014/07/11 08:44:48 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 *
@@ -58,7 +58,7 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <errno.h> 60#include <errno.h>
61#include "cryptlib.h" 61
62#include <openssl/buffer.h> 62#include <openssl/buffer.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
diff --git a/src/lib/libssl/src/crypto/evp/c_allc.c b/src/lib/libssl/src/crypto/evp/c_allc.c
index a4c796b6d5..657e14f86f 100644
--- a/src/lib/libssl/src/crypto/evp/c_allc.c
+++ b/src/lib/libssl/src/crypto/evp/c_allc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: c_allc.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: c_allc.c,v 1.13 2014/07/11 08:44:48 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,10 +60,9 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/pkcs12.h>
66#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/pkcs12.h>
67 66
68void 67void
69OpenSSL_add_all_ciphers(void) 68OpenSSL_add_all_ciphers(void)
diff --git a/src/lib/libssl/src/crypto/evp/c_alld.c b/src/lib/libssl/src/crypto/evp/c_alld.c
index 16726b6caa..8f59100caa 100644
--- a/src/lib/libssl/src/crypto/evp/c_alld.c
+++ b/src/lib/libssl/src/crypto/evp/c_alld.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: c_alld.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: c_alld.c,v 1.11 2014/07/11 08:44:48 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,10 +60,9 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/pkcs12.h>
66#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/pkcs12.h>
67 66
68void 67void
69OpenSSL_add_all_digests(void) 68OpenSSL_add_all_digests(void)
diff --git a/src/lib/libssl/src/crypto/evp/digest.c b/src/lib/libssl/src/crypto/evp/digest.c
index e1ce7dd3a3..9a4b1a6293 100644
--- a/src/lib/libssl/src/crypto/evp/digest.c
+++ b/src/lib/libssl/src/crypto/evp/digest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: digest.c,v 1.20 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: digest.c,v 1.21 2014/07/11 08:44:48 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 *
@@ -114,9 +114,9 @@
114 114
115#include <openssl/opensslconf.h> 115#include <openssl/opensslconf.h>
116 116
117#include "cryptlib.h"
118#include <openssl/objects.h>
119#include <openssl/evp.h> 117#include <openssl/evp.h>
118#include <openssl/objects.h>
119
120#ifndef OPENSSL_NO_ENGINE 120#ifndef OPENSSL_NO_ENGINE
121#include <openssl/engine.h> 121#include <openssl/engine.h>
122#endif 122#endif
diff --git a/src/lib/libssl/src/crypto/evp/e_bf.c b/src/lib/libssl/src/crypto/evp/e_bf.c
index fe133fb8ea..615c9bd771 100644
--- a/src/lib/libssl/src/crypto/evp/e_bf.c
+++ b/src/lib/libssl/src/crypto/evp/e_bf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_bf.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_bf.c,v 1.8 2014/07/11 08:44:48 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#ifndef OPENSSL_NO_BF 63#ifndef OPENSSL_NO_BF
64
65#include <openssl/blowfish.h>
65#include <openssl/evp.h> 66#include <openssl/evp.h>
66#include "evp_locl.h"
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68#include <openssl/blowfish.h> 68
69#include "evp_locl.h"
69 70
70static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
71 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libssl/src/crypto/evp/e_cast.c b/src/lib/libssl/src/crypto/evp/e_cast.c
index 2476bf2799..707daa9656 100644
--- a/src/lib/libssl/src/crypto/evp/e_cast.c
+++ b/src/lib/libssl/src/crypto/evp/e_cast.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_cast.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_cast.c,v 1.7 2014/07/11 08:44:48 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,13 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_CAST 63#ifndef OPENSSL_NO_CAST
64
65#include <openssl/cast.h>
66#include <openssl/evp.h> 66#include <openssl/evp.h>
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69#include <openssl/cast.h>
70 70
71static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libssl/src/crypto/evp/e_des.c b/src/lib/libssl/src/crypto/evp/e_des.c
index 1f0de7cbfd..0a32d2adb9 100644
--- a/src/lib/libssl/src/crypto/evp/e_des.c
+++ b/src/lib/libssl/src/crypto/evp/e_des.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_des.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_des.c,v 1.11 2014/07/11 08:44:48 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,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#ifndef OPENSSL_NO_DES 63#ifndef OPENSSL_NO_DES
64
65#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h>
67#include "evp_locl.h"
68#include <openssl/des.h> 66#include <openssl/des.h>
67#include <openssl/objects.h>
69#include <openssl/rand.h> 68#include <openssl/rand.h>
70 69
70#include "evp_locl.h"
71
71static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
73static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); 74static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
diff --git a/src/lib/libssl/src/crypto/evp/e_des3.c b/src/lib/libssl/src/crypto/evp/e_des3.c
index f4264d8ca4..0f1974f6c9 100644
--- a/src/lib/libssl/src/crypto/evp/e_des3.c
+++ b/src/lib/libssl/src/crypto/evp/e_des3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_des3.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_des3.c,v 1.16 2014/07/11 08:44:48 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,14 +61,15 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#ifndef OPENSSL_NO_DES 64#ifndef OPENSSL_NO_DES
65
66#include <openssl/des.h>
66#include <openssl/evp.h> 67#include <openssl/evp.h>
67#include <openssl/objects.h> 68#include <openssl/objects.h>
68#include "evp_locl.h"
69#include <openssl/des.h>
70#include <openssl/rand.h> 69#include <openssl/rand.h>
71 70
71#include "evp_locl.h"
72
72static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 73static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 74 const unsigned char *iv, int enc);
74 75
diff --git a/src/lib/libssl/src/crypto/evp/e_idea.c b/src/lib/libssl/src/crypto/evp/e_idea.c
index 7dd385e04e..3ba4dbcdb9 100644
--- a/src/lib/libssl/src/crypto/evp/e_idea.c
+++ b/src/lib/libssl/src/crypto/evp/e_idea.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_idea.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_idea.c,v 1.9 2014/07/11 08:44:48 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,13 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_IDEA 63#ifndef OPENSSL_NO_IDEA
64
66#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/idea.h>
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69#include <openssl/idea.h>
70 70
71static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libssl/src/crypto/evp/e_null.c b/src/lib/libssl/src/crypto/evp/e_null.c
index 0d0a06f2e3..65374cc3f5 100644
--- a/src/lib/libssl/src/crypto/evp/e_null.c
+++ b/src/lib/libssl/src/crypto/evp/e_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_null.c,v 1.13 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: e_null.c,v 1.14 2014/07/11 08:44:48 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,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/evp.h> 62#include <openssl/evp.h>
64#include <openssl/objects.h> 63#include <openssl/objects.h>
65 64
diff --git a/src/lib/libssl/src/crypto/evp/e_rc2.c b/src/lib/libssl/src/crypto/evp/e_rc2.c
index c164ab10f7..456a22eeeb 100644
--- a/src/lib/libssl/src/crypto/evp/e_rc2.c
+++ b/src/lib/libssl/src/crypto/evp/e_rc2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc2.c,v 1.9 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc2.c,v 1.10 2014/07/11 08:44:48 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,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC2 63#ifndef OPENSSL_NO_RC2
66 64
65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include "evp_locl.h"
70#include <openssl/rc2.h> 68#include <openssl/rc2.h>
71 69
70#include "evp_locl.h"
71
72static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
74static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx); 74static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx);
diff --git a/src/lib/libssl/src/crypto/evp/e_rc4.c b/src/lib/libssl/src/crypto/evp/e_rc4.c
index f8e4149a62..e77a293141 100644
--- a/src/lib/libssl/src/crypto/evp/e_rc4.c
+++ b/src/lib/libssl/src/crypto/evp/e_rc4.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc4.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc4.c,v 1.14 2014/07/11 08:44:48 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,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC4 63#ifndef OPENSSL_NO_RC4
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include "evp_locl.h"
69#include <openssl/objects.h> 66#include <openssl/objects.h>
70#include <openssl/rc4.h> 67#include <openssl/rc4.h>
71 68
69#include "evp_locl.h"
70
72/* FIXME: surely this is available elsewhere? */ 71/* FIXME: surely this is available elsewhere? */
73#define EVP_RC4_KEY_SIZE 16 72#define EVP_RC4_KEY_SIZE 16
74 73
diff --git a/src/lib/libssl/src/crypto/evp/e_rc5.c b/src/lib/libssl/src/crypto/evp/e_rc5.c
index 00e1251818..3a1dab9999 100644
--- a/src/lib/libssl/src/crypto/evp/e_rc5.c
+++ b/src/lib/libssl/src/crypto/evp/e_rc5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc5.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc5.c,v 1.7 2014/07/11 08:44:48 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,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC5 63#ifndef OPENSSL_NO_RC5
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include "evp_locl.h"
70#include <openssl/rc5.h> 67#include <openssl/rc5.h>
71 68
69#include "evp_locl.h"
70
72static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
74static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); 73static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
diff --git a/src/lib/libssl/src/crypto/evp/e_xcbc_d.c b/src/lib/libssl/src/crypto/evp/e_xcbc_d.c
index 496850b315..2aae0a9151 100644
--- a/src/lib/libssl/src/crypto/evp/e_xcbc_d.c
+++ b/src/lib/libssl/src/crypto/evp/e_xcbc_d.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_xcbc_d.c,v 1.11 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_xcbc_d.c,v 1.12 2014/07/11 08:44:48 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,14 +61,13 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65
66#ifndef OPENSSL_NO_DES 64#ifndef OPENSSL_NO_DES
67 65
66#include <openssl/des.h>
68#include <openssl/evp.h> 67#include <openssl/evp.h>
69#include <openssl/objects.h> 68#include <openssl/objects.h>
69
70#include "evp_locl.h" 70#include "evp_locl.h"
71#include <openssl/des.h>
72 71
73static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
74 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
diff --git a/src/lib/libssl/src/crypto/evp/encode.c b/src/lib/libssl/src/crypto/evp/encode.c
index a83cf76c9f..f33afb03d3 100644
--- a/src/lib/libssl/src/crypto/evp/encode.c
+++ b/src/lib/libssl/src/crypto/evp/encode.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: encode.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: encode.c,v 1.18 2014/07/11 08:44:48 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,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/evp.h> 62#include <openssl/evp.h>
64 63
65#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) 64#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
diff --git a/src/lib/libssl/src/crypto/evp/evp_enc.c b/src/lib/libssl/src/crypto/evp/evp_enc.c
index 798ac442f9..4333e4dff8 100644
--- a/src/lib/libssl/src/crypto/evp/evp_enc.c
+++ b/src/lib/libssl/src/crypto/evp/evp_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_enc.c,v 1.23 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: evp_enc.c,v 1.24 2014/07/11 08:44:48 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,13 +61,14 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/evp.h>
66#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/evp.h>
67#include <openssl/rand.h> 66#include <openssl/rand.h>
67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
71
71#include "evp_locl.h" 72#include "evp_locl.h"
72 73
73#define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl) 74#define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl)
diff --git a/src/lib/libssl/src/crypto/evp/evp_key.c b/src/lib/libssl/src/crypto/evp/evp_key.c
index 4380be9137..dffca300c6 100644
--- a/src/lib/libssl/src/crypto/evp/evp_key.c
+++ b/src/lib/libssl/src/crypto/evp/evp_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_key.c,v 1.17 2014/07/10 19:30:06 miod Exp $ */ 1/* $OpenBSD: evp_key.c,v 1.18 2014/07/11 08:44:48 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,11 +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/x509.h>
64#include <openssl/objects.h>
65#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
66#include <openssl/ui.h> 64#include <openssl/ui.h>
65#include <openssl/x509.h>
67 66
68/* should be init to zeros. */ 67/* should be init to zeros. */
69static char prompt_string[80]; 68static char prompt_string[80];
diff --git a/src/lib/libssl/src/crypto/evp/evp_lib.c b/src/lib/libssl/src/crypto/evp/evp_lib.c
index 1664703288..310252d0e8 100644
--- a/src/lib/libssl/src/crypto/evp/evp_lib.c
+++ b/src/lib/libssl/src/crypto/evp/evp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_lib.c,v 1.12 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: evp_lib.c,v 1.13 2014/07/11 08:44:48 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,7 +59,7 @@
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/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h> 64#include <openssl/objects.h>
65 65
diff --git a/src/lib/libssl/src/crypto/evp/evp_pbe.c b/src/lib/libssl/src/crypto/evp/evp_pbe.c
index 63e71c0bc9..42ec6e0dda 100644
--- a/src/lib/libssl/src/crypto/evp/evp_pbe.c
+++ b/src/lib/libssl/src/crypto/evp/evp_pbe.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_pbe.c,v 1.19 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: evp_pbe.c,v 1.20 2014/07/11 08:44:48 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 */
@@ -61,10 +61,11 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h" 64#include <openssl/err.h>
65#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/pkcs12.h> 66#include <openssl/pkcs12.h>
67#include <openssl/x509.h> 67#include <openssl/x509.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69 70
70/* Password based encryption (PBE) functions */ 71/* Password based encryption (PBE) functions */
diff --git a/src/lib/libssl/src/crypto/evp/evp_pkey.c b/src/lib/libssl/src/crypto/evp/evp_pkey.c
index 46846d2c31..cf7a39be7b 100644
--- a/src/lib/libssl/src/crypto/evp/evp_pkey.c
+++ b/src/lib/libssl/src/crypto/evp/evp_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_pkey.c,v 1.15 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: evp_pkey.c,v 1.16 2014/07/11 08:44:48 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 */
@@ -58,9 +58,11 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/x509.h> 62#include <openssl/err.h>
63#include <openssl/rand.h> 63#include <openssl/rand.h>
64#include <openssl/x509.h>
65
64#include "asn1_locl.h" 66#include "asn1_locl.h"
65 67
66/* Extract a private key from a PKCS8 structure */ 68/* Extract a private key from a PKCS8 structure */
diff --git a/src/lib/libssl/src/crypto/evp/m_dss.c b/src/lib/libssl/src/crypto/evp/m_dss.c
index 81e3dd1511..d23c9b4e71 100644
--- a/src/lib/libssl/src/crypto/evp/m_dss.c
+++ b/src/lib/libssl/src/crypto/evp/m_dss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_dss.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_dss.c,v 1.16 2014/07/11 08:44:48 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,10 +60,10 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/objects.h> 64#include <openssl/objects.h>
66#include <openssl/sha.h> 65#include <openssl/sha.h>
66
67#ifndef OPENSSL_NO_DSA 67#ifndef OPENSSL_NO_DSA
68#include <openssl/dsa.h> 68#include <openssl/dsa.h>
69#endif 69#endif
diff --git a/src/lib/libssl/src/crypto/evp/m_dss1.c b/src/lib/libssl/src/crypto/evp/m_dss1.c
index efa91230dc..a906c11b69 100644
--- a/src/lib/libssl/src/crypto/evp/m_dss1.c
+++ b/src/lib/libssl/src/crypto/evp/m_dss1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_dss1.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_dss1.c,v 1.16 2014/07/11 08:44:48 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,13 +60,12 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_SHA 63#ifndef OPENSSL_NO_SHA
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/sha.h> 67#include <openssl/sha.h>
68
70#ifndef OPENSSL_NO_DSA 69#ifndef OPENSSL_NO_DSA
71#include <openssl/dsa.h> 70#include <openssl/dsa.h>
72#endif 71#endif
diff --git a/src/lib/libssl/src/crypto/evp/m_ecdsa.c b/src/lib/libssl/src/crypto/evp/m_ecdsa.c
index d4872dcf29..b9af6423b5 100644
--- a/src/lib/libssl/src/crypto/evp/m_ecdsa.c
+++ b/src/lib/libssl/src/crypto/evp/m_ecdsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_ecdsa.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_ecdsa.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -113,7 +113,6 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h"
117#include <openssl/evp.h> 116#include <openssl/evp.h>
118#include <openssl/objects.h> 117#include <openssl/objects.h>
119#include <openssl/x509.h> 118#include <openssl/x509.h>
diff --git a/src/lib/libssl/src/crypto/evp/m_md4.c b/src/lib/libssl/src/crypto/evp/m_md4.c
index e24d0ad66f..36ea818285 100644
--- a/src/lib/libssl/src/crypto/evp/m_md4.c
+++ b/src/lib/libssl/src/crypto/evp/m_md4.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_md4.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_md4.c,v 1.13 2014/07/11 08:44:48 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,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MD4 63#ifndef OPENSSL_NO_MD4
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/md4.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/md4.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
diff --git a/src/lib/libssl/src/crypto/evp/m_md5.c b/src/lib/libssl/src/crypto/evp/m_md5.c
index 445b2b4381..5bd9100a03 100644
--- a/src/lib/libssl/src/crypto/evp/m_md5.c
+++ b/src/lib/libssl/src/crypto/evp/m_md5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_md5.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_md5.c,v 1.14 2014/07/11 08:44:48 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,17 +60,17 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MD5 63#ifndef OPENSSL_NO_MD5
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/md5.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/md5.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
73
74#include "evp_locl.h" 74#include "evp_locl.h"
75 75
76static int 76static int
diff --git a/src/lib/libssl/src/crypto/evp/m_mdc2.c b/src/lib/libssl/src/crypto/evp/m_mdc2.c
index c360c986d5..0262f8dc77 100644
--- a/src/lib/libssl/src/crypto/evp/m_mdc2.c
+++ b/src/lib/libssl/src/crypto/evp/m_mdc2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_mdc2.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_mdc2.c,v 1.14 2014/07/11 08:44:48 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,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MDC2 63#ifndef OPENSSL_NO_MDC2
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/mdc2.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/mdc2.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
diff --git a/src/lib/libssl/src/crypto/evp/m_null.c b/src/lib/libssl/src/crypto/evp/m_null.c
index 1a10101762..897be3cee9 100644
--- a/src/lib/libssl/src/crypto/evp/m_null.c
+++ b/src/lib/libssl/src/crypto/evp/m_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_null.c,v 1.8 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: m_null.c,v 1.9 2014/07/11 08:44:48 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/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libssl/src/crypto/evp/m_ripemd.c b/src/lib/libssl/src/crypto/evp/m_ripemd.c
index c496a205d6..765eec3138 100644
--- a/src/lib/libssl/src/crypto/evp/m_ripemd.c
+++ b/src/lib/libssl/src/crypto/evp/m_ripemd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_ripemd.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_ripemd.c,v 1.11 2014/07/11 08:44:48 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,17 +60,17 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RIPEMD 63#ifndef OPENSSL_NO_RIPEMD
66 64
67#include <openssl/ripemd.h>
68#include <openssl/evp.h> 65#include <openssl/evp.h>
69#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include <openssl/ripemd.h>
70#include <openssl/x509.h> 68#include <openssl/x509.h>
69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
73
74#include "evp_locl.h" 74#include "evp_locl.h"
75 75
76static int 76static int
diff --git a/src/lib/libssl/src/crypto/evp/m_sha.c b/src/lib/libssl/src/crypto/evp/m_sha.c
index ed22c1aec5..73678e4e45 100644
--- a/src/lib/libssl/src/crypto/evp/m_sha.c
+++ b/src/lib/libssl/src/crypto/evp/m_sha.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sha.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_sha.c,v 1.15 2014/07/11 08:44:48 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,16 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0) 63#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0)
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/x509.h> 67#include <openssl/x509.h>
68
70#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
71#include <openssl/rsa.h> 70#include <openssl/rsa.h>
72#endif 71#endif
72
73#include "evp_locl.h" 73#include "evp_locl.h"
74 74
75static int 75static int
diff --git a/src/lib/libssl/src/crypto/evp/m_sha1.c b/src/lib/libssl/src/crypto/evp/m_sha1.c
index 0441f632d3..13d5b030d2 100644
--- a/src/lib/libssl/src/crypto/evp/m_sha1.c
+++ b/src/lib/libssl/src/crypto/evp/m_sha1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sha1.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_sha1.c,v 1.17 2014/07/11 08:44:48 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,16 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_SHA 63#ifndef OPENSSL_NO_SHA
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/sha.h> 67#include <openssl/sha.h>
68
70#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
71#include <openssl/rsa.h> 70#include <openssl/rsa.h>
72#endif 71#endif
73 72
74
75static int 73static int
76init(EVP_MD_CTX *ctx) 74init(EVP_MD_CTX *ctx)
77{ 75{
diff --git a/src/lib/libssl/src/crypto/evp/m_sigver.c b/src/lib/libssl/src/crypto/evp/m_sigver.c
index 00c9b00732..cc0927325b 100644
--- a/src/lib/libssl/src/crypto/evp/m_sigver.c
+++ b/src/lib/libssl/src/crypto/evp/m_sigver.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sigver.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: m_sigver.c,v 1.4 2014/07/11 08:44:48 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 */
@@ -57,10 +57,12 @@
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/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
65
64#include "evp_locl.h" 66#include "evp_locl.h"
65 67
66static int 68static int
diff --git a/src/lib/libssl/src/crypto/evp/m_wp.c b/src/lib/libssl/src/crypto/evp/m_wp.c
index c6b246a3c5..5a391f514e 100644
--- a/src/lib/libssl/src/crypto/evp/m_wp.c
+++ b/src/lib/libssl/src/crypto/evp/m_wp.c
@@ -1,17 +1,16 @@
1/* $OpenBSD: m_wp.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_wp.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2 2
3#include <stdio.h> 3#include <stdio.h>
4 4
5#include <openssl/opensslconf.h> 5#include <openssl/opensslconf.h>
6 6
7#include "cryptlib.h"
8
9#ifndef OPENSSL_NO_WHIRLPOOL 7#ifndef OPENSSL_NO_WHIRLPOOL
10 8
11#include <openssl/evp.h> 9#include <openssl/evp.h>
12#include <openssl/objects.h> 10#include <openssl/objects.h>
13#include <openssl/x509.h> 11#include <openssl/x509.h>
14#include <openssl/whrlpool.h> 12#include <openssl/whrlpool.h>
13
15#include "evp_locl.h" 14#include "evp_locl.h"
16 15
17static int 16static int
diff --git a/src/lib/libssl/src/crypto/evp/names.c b/src/lib/libssl/src/crypto/evp/names.c
index fe185bc550..33d7dc8084 100644
--- a/src/lib/libssl/src/crypto/evp/names.c
+++ b/src/lib/libssl/src/crypto/evp/names.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: names.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: names.c,v 1.12 2014/07/11 08:44:48 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/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libssl/src/crypto/evp/p5_crpt.c b/src/lib/libssl/src/crypto/evp/p5_crpt.c
index 1fe6edb143..ec8d816f32 100644
--- a/src/lib/libssl/src/crypto/evp/p5_crpt.c
+++ b/src/lib/libssl/src/crypto/evp/p5_crpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_crpt.c,v 1.12 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: p5_crpt.c,v 1.13 2014/07/11 08:44:48 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,9 +60,9 @@
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h" 63#include <openssl/err.h>
64#include <openssl/x509.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/x509.h>
66 66
67/* Doesn't do anything now: Builtin PBE algorithms in static table. 67/* Doesn't do anything now: Builtin PBE algorithms in static table.
68 */ 68 */
diff --git a/src/lib/libssl/src/crypto/evp/p5_crpt2.c b/src/lib/libssl/src/crypto/evp/p5_crpt2.c
index c072376912..61eadec804 100644
--- a/src/lib/libssl/src/crypto/evp/p5_crpt2.c
+++ b/src/lib/libssl/src/crypto/evp/p5_crpt2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_crpt2.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p5_crpt2.c,v 1.17 2014/07/11 08:44:48 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 */
@@ -62,11 +62,13 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#if !defined(OPENSSL_NO_HMAC) && !defined(OPENSSL_NO_SHA) 65#if !defined(OPENSSL_NO_HMAC) && !defined(OPENSSL_NO_SHA)
67#include <openssl/x509.h> 66
67#include <openssl/err.h>
68#include <openssl/evp.h> 68#include <openssl/evp.h>
69#include <openssl/hmac.h> 69#include <openssl/hmac.h>
70#include <openssl/x509.h>
71
70#include "evp_locl.h" 72#include "evp_locl.h"
71 73
72/* set this to print out info about the keygen algorithm */ 74/* set this to print out info about the keygen algorithm */
diff --git a/src/lib/libssl/src/crypto/evp/p_dec.c b/src/lib/libssl/src/crypto/evp/p_dec.c
index c47408dff0..bb4e03091e 100644
--- a/src/lib/libssl/src/crypto/evp/p_dec.c
+++ b/src/lib/libssl/src/crypto/evp/p_dec.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_dec.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_dec.c,v 1.9 2014/07/11 08:44:48 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,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/evp.h>
64#include <openssl/err.h>
65#include <openssl/objects.h>
64#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/x509.h>
68
65#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 70#include <openssl/rsa.h>
67#endif 71#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 72
72int 73int
73EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl, 74EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
diff --git a/src/lib/libssl/src/crypto/evp/p_enc.c b/src/lib/libssl/src/crypto/evp/p_enc.c
index a1fb9d1d2c..9421646cd3 100644
--- a/src/lib/libssl/src/crypto/evp/p_enc.c
+++ b/src/lib/libssl/src/crypto/evp/p_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_enc.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_enc.c,v 1.9 2014/07/11 08:44:48 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,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/err.h>
64#include <openssl/evp.h>
65#include <openssl/objects.h>
64#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/x509.h>
68
65#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 70#include <openssl/rsa.h>
67#endif 71#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 72
72int 73int
73EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len, 74EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len,
diff --git a/src/lib/libssl/src/crypto/evp/p_lib.c b/src/lib/libssl/src/crypto/evp/p_lib.c
index 6db5e95cd0..617d0f8ec3 100644
--- a/src/lib/libssl/src/crypto/evp/p_lib.c
+++ b/src/lib/libssl/src/crypto/evp/p_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_lib.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_lib.c,v 1.15 2014/07/11 08:44:48 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,21 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/asn1_mac.h>
64#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/err.h> 65#include <openssl/err.h>
66#include <openssl/objects.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/asn1_mac.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#ifndef OPENSSL_NO_RSA 69
71#include <openssl/rsa.h> 70#ifndef OPENSSL_NO_DH
71#include <openssl/dh.h>
72#endif 72#endif
73#ifndef OPENSSL_NO_DSA 73#ifndef OPENSSL_NO_DSA
74#include <openssl/dsa.h> 74#include <openssl/dsa.h>
75#endif 75#endif
76#ifndef OPENSSL_NO_DH 76#ifndef OPENSSL_NO_RSA
77#include <openssl/dh.h> 77#include <openssl/rsa.h>
78#endif 78#endif
79 79
80#ifndef OPENSSL_NO_ENGINE 80#ifndef OPENSSL_NO_ENGINE
diff --git a/src/lib/libssl/src/crypto/evp/p_open.c b/src/lib/libssl/src/crypto/evp/p_open.c
index aec4d9f3d0..aca83e74f6 100644
--- a/src/lib/libssl/src/crypto/evp/p_open.c
+++ b/src/lib/libssl/src/crypto/evp/p_open.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_open.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_open.c,v 1.16 2014/07/11 08:44:48 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,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RSA 63#ifndef OPENSSL_NO_RSA
66 64
65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h>
70#include <openssl/rsa.h> 68#include <openssl/rsa.h>
69#include <openssl/x509.h>
71 70
72int 71int
73EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 72EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
diff --git a/src/lib/libssl/src/crypto/evp/p_seal.c b/src/lib/libssl/src/crypto/evp/p_seal.c
index 4acb9f8054..4f8417ae64 100644
--- a/src/lib/libssl/src/crypto/evp/p_seal.c
+++ b/src/lib/libssl/src/crypto/evp/p_seal.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_seal.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_seal.c,v 1.13 2014/07/11 08:44:48 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,14 +60,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/evp.h>
64#include <openssl/objects.h>
64#include <openssl/rand.h> 65#include <openssl/rand.h>
66#include <openssl/x509.h>
67
65#ifndef OPENSSL_NO_RSA 68#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 69#include <openssl/rsa.h>
67#endif 70#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 71
72int 72int
73EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, 73EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek,
diff --git a/src/lib/libssl/src/crypto/evp/p_sign.c b/src/lib/libssl/src/crypto/evp/p_sign.c
index 34fdf147c6..f68a950c9c 100644
--- a/src/lib/libssl/src/crypto/evp/p_sign.c
+++ b/src/lib/libssl/src/crypto/evp/p_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_sign.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: p_sign.c,v 1.12 2014/07/11 08:44:48 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,8 @@
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/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
diff --git a/src/lib/libssl/src/crypto/evp/p_verify.c b/src/lib/libssl/src/crypto/evp/p_verify.c
index a9a52e85d3..e653fcf6a5 100644
--- a/src/lib/libssl/src/crypto/evp/p_verify.c
+++ b/src/lib/libssl/src/crypto/evp/p_verify.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_verify.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: p_verify.c,v 1.12 2014/07/11 08:44:48 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,8 @@
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/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
diff --git a/src/lib/libssl/src/crypto/evp/pmeth_fn.c b/src/lib/libssl/src/crypto/evp/pmeth_fn.c
index 0af978b6e2..c4a53b0d5f 100644
--- a/src/lib/libssl/src/crypto/evp/pmeth_fn.c
+++ b/src/lib/libssl/src/crypto/evp/pmeth_fn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_fn.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: pmeth_fn.c,v 1.4 2014/07/11 08:44:48 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 */
@@ -58,9 +58,11 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/objects.h> 62#include <openssl/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
64#include "evp_locl.h" 66#include "evp_locl.h"
65 67
66#define M_check_autoarg(ctx, arg, arglen, err) \ 68#define M_check_autoarg(ctx, arg, arglen, err) \
diff --git a/src/lib/libssl/src/crypto/evp/pmeth_gn.c b/src/lib/libssl/src/crypto/evp/pmeth_gn.c
index 173df68a28..9eb10d4874 100644
--- a/src/lib/libssl/src/crypto/evp/pmeth_gn.c
+++ b/src/lib/libssl/src/crypto/evp/pmeth_gn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_gn.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: pmeth_gn.c,v 1.4 2014/07/11 08:44:48 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 */
@@ -58,10 +58,12 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/objects.h>
63#include <openssl/evp.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
63#include <openssl/err.h>
64#include <openssl/evp.h>
65#include <openssl/objects.h>
66
65#include "evp_locl.h" 67#include "evp_locl.h"
66 68
67int 69int
diff --git a/src/lib/libssl/src/crypto/evp/pmeth_lib.c b/src/lib/libssl/src/crypto/evp/pmeth_lib.c
index f23524b8a9..c9c3444a13 100644
--- a/src/lib/libssl/src/crypto/evp/pmeth_lib.c
+++ b/src/lib/libssl/src/crypto/evp/pmeth_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_lib.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pmeth_lib.c,v 1.8 2014/07/11 08:44:48 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 */
@@ -62,12 +62,13 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/objects.h>
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h>
67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
71
71#include "asn1_locl.h" 72#include "asn1_locl.h"
72#include "evp_locl.h" 73#include "evp_locl.h"
73 74
diff --git a/src/lib/libssl/src/crypto/ex_data.c b/src/lib/libssl/src/crypto/ex_data.c
index 4fb97038b0..7ac5a692c7 100644
--- a/src/lib/libssl/src/crypto/ex_data.c
+++ b/src/lib/libssl/src/crypto/ex_data.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ex_data.c,v 1.16 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: ex_data.c,v 1.17 2014/07/11 08:44:47 jsing Exp $ */
2 2
3/* 3/*
4 * Overhaul notes; 4 * Overhaul notes;
@@ -138,7 +138,7 @@
138 * 138 *
139 */ 139 */
140 140
141#include "cryptlib.h" 141#include <openssl/err.h>
142#include <openssl/lhash.h> 142#include <openssl/lhash.h>
143 143
144/* What an "implementation of ex_data functionality" looks like */ 144/* What an "implementation of ex_data functionality" looks like */
diff --git a/src/lib/libssl/src/crypto/hmac/hm_ameth.c b/src/lib/libssl/src/crypto/hmac/hm_ameth.c
index e552f6ea2c..f4fa6f4bc3 100644
--- a/src/lib/libssl/src/crypto/hmac/hm_ameth.c
+++ b/src/lib/libssl/src/crypto/hmac/hm_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hm_ameth.c,v 1.7 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: hm_ameth.c,v 1.8 2014/07/11 08:44:48 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 2007. 3 * project 2007.
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/evp.h> 62#include <openssl/evp.h>
63
64#include "asn1_locl.h" 64#include "asn1_locl.h"
65 65
66#define HMAC_TEST_PRIVATE_KEY_FORMAT 66#define HMAC_TEST_PRIVATE_KEY_FORMAT
diff --git a/src/lib/libssl/src/crypto/hmac/hm_pmeth.c b/src/lib/libssl/src/crypto/hmac/hm_pmeth.c
index 8bcd3c557f..255f4ece8b 100644
--- a/src/lib/libssl/src/crypto/hmac/hm_pmeth.c
+++ b/src/lib/libssl/src/crypto/hmac/hm_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hm_pmeth.c,v 1.7 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: hm_pmeth.c,v 1.8 2014/07/11 08:44:48 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 2007. 3 * project 2007.
4 */ 4 */
@@ -59,11 +59,11 @@
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/x509.h>
64#include <openssl/x509v3.h>
65#include <openssl/evp.h> 62#include <openssl/evp.h>
66#include <openssl/hmac.h> 63#include <openssl/hmac.h>
64#include <openssl/x509.h>
65#include <openssl/x509v3.h>
66
67#include "evp_locl.h" 67#include "evp_locl.h"
68 68
69/* HMAC pkey context structure */ 69/* HMAC pkey context structure */
diff --git a/src/lib/libssl/src/crypto/hmac/hmac.c b/src/lib/libssl/src/crypto/hmac/hmac.c
index 975fc4d1ec..f2e5f149e0 100644
--- a/src/lib/libssl/src/crypto/hmac/hmac.c
+++ b/src/lib/libssl/src/crypto/hmac/hmac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hmac.c,v 1.20 2014/06/21 13:39:46 jsing Exp $ */ 1/* $OpenBSD: hmac.c,v 1.21 2014/07/11 08:44:48 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 *
@@ -55,10 +55,11 @@
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58
58#include <stdio.h> 59#include <stdio.h>
59#include <stdlib.h> 60#include <stdlib.h>
60#include <string.h> 61#include <string.h>
61#include "cryptlib.h" 62
62#include <openssl/hmac.h> 63#include <openssl/hmac.h>
63 64
64int 65int
diff --git a/src/lib/libssl/src/crypto/lhash/lh_stats.c b/src/lib/libssl/src/crypto/lhash/lh_stats.c
index b4202efb2e..e7dde47806 100644
--- a/src/lib/libssl/src/crypto/lhash/lh_stats.c
+++ b/src/lib/libssl/src/crypto/lhash/lh_stats.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: lh_stats.c,v 1.11 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: lh_stats.c,v 1.12 2014/07/11 08:44:48 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,10 +62,6 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65/* If you wish to build this outside of SSLeay, remove the following lines
66 * and things should work as expected */
67#include "cryptlib.h"
68
69#ifndef OPENSSL_NO_BIO 65#ifndef OPENSSL_NO_BIO
70#include <openssl/bio.h> 66#include <openssl/bio.h>
71#endif 67#endif
diff --git a/src/lib/libssl/src/crypto/mdc2/mdc2_one.c b/src/lib/libssl/src/crypto/mdc2/mdc2_one.c
index 6740d00925..8f922b1c7d 100644
--- a/src/lib/libssl/src/crypto/mdc2/mdc2_one.c
+++ b/src/lib/libssl/src/crypto/mdc2/mdc2_one.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mdc2_one.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: mdc2_one.c,v 1.4 2014/07/11 08:44:49 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,8 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/crypto.h>
61#include <openssl/mdc2.h> 62#include <openssl/mdc2.h>
62 63
63unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md) 64unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md)
diff --git a/src/lib/libssl/src/crypto/objects/obj_dat.c b/src/lib/libssl/src/crypto/objects/obj_dat.c
index 4d0307a315..071febba52 100644
--- a/src/lib/libssl/src/crypto/objects/obj_dat.c
+++ b/src/lib/libssl/src/crypto/objects/obj_dat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_dat.c,v 1.29 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: obj_dat.c,v 1.30 2014/07/11 08:44:49 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 *
@@ -63,11 +63,11 @@
63 63
64#include <openssl/opensslconf.h> 64#include <openssl/opensslconf.h>
65 65
66#include "cryptlib.h"
67#include <openssl/lhash.h>
68#include <openssl/asn1.h> 66#include <openssl/asn1.h>
69#include <openssl/objects.h>
70#include <openssl/bn.h> 67#include <openssl/bn.h>
68#include <openssl/err.h>
69#include <openssl/lhash.h>
70#include <openssl/objects.h>
71 71
72/* obj_dat.h is generated from objects.h by obj_dat.pl */ 72/* obj_dat.h is generated from objects.h by obj_dat.pl */
73#ifndef OPENSSL_NO_OBJECT 73#ifndef OPENSSL_NO_OBJECT
diff --git a/src/lib/libssl/src/crypto/objects/obj_lib.c b/src/lib/libssl/src/crypto/objects/obj_lib.c
index 41e0af696e..6dc515e628 100644
--- a/src/lib/libssl/src/crypto/objects/obj_lib.c
+++ b/src/lib/libssl/src/crypto/objects/obj_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_lib.c,v 1.11 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: obj_lib.c,v 1.12 2014/07/11 08:44:49 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/err.h>
63#include <openssl/buffer.h>
63#include <openssl/lhash.h> 64#include <openssl/lhash.h>
64#include <openssl/objects.h> 65#include <openssl/objects.h>
65#include <openssl/buffer.h>
66 66
67ASN1_OBJECT * 67ASN1_OBJECT *
68OBJ_dup(const ASN1_OBJECT *o) 68OBJ_dup(const ASN1_OBJECT *o)
diff --git a/src/lib/libssl/src/crypto/ocsp/ocsp_cl.c b/src/lib/libssl/src/crypto/ocsp/ocsp_cl.c
index d435adae90..030aaef18c 100644
--- a/src/lib/libssl/src/crypto/ocsp/ocsp_cl.c
+++ b/src/lib/libssl/src/crypto/ocsp/ocsp_cl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_cl.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: ocsp_cl.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -63,13 +63,14 @@
63 63
64#include <stdio.h> 64#include <stdio.h>
65#include <time.h> 65#include <time.h>
66#include <cryptlib.h> 66
67#include <openssl/err.h>
68#include <openssl/ocsp.h>
67#include <openssl/objects.h> 69#include <openssl/objects.h>
70#include <openssl/pem.h>
68#include <openssl/rand.h> 71#include <openssl/rand.h>
69#include <openssl/x509.h> 72#include <openssl/x509.h>
70#include <openssl/pem.h>
71#include <openssl/x509v3.h> 73#include <openssl/x509v3.h>
72#include <openssl/ocsp.h>
73 74
74/* Utility functions related to sending OCSP requests and extracting 75/* Utility functions related to sending OCSP requests and extracting
75 * relevant information from the response. 76 * relevant information from the response.
diff --git a/src/lib/libssl/src/crypto/ocsp/ocsp_ext.c b/src/lib/libssl/src/crypto/ocsp/ocsp_ext.c
index a0e58e7401..c7b9d817ac 100644
--- a/src/lib/libssl/src/crypto/ocsp/ocsp_ext.c
+++ b/src/lib/libssl/src/crypto/ocsp/ocsp_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_ext.c,v 1.10 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ocsp_ext.c,v 1.11 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -61,14 +61,13 @@
61 * 61 *
62 */ 62 */
63 63
64#include <cryptlib.h>
65#include <stdio.h> 64#include <stdio.h>
66#include <string.h> 65#include <string.h>
67 66
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h>
70#include <openssl/ocsp.h> 68#include <openssl/ocsp.h>
71#include <openssl/rand.h> 69#include <openssl/rand.h>
70#include <openssl/x509.h>
72#include <openssl/x509v3.h> 71#include <openssl/x509v3.h>
73 72
74/* Standard wrapper functions for extensions */ 73/* Standard wrapper functions for extensions */
diff --git a/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c b/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c
index eda627f4ed..8599e48bff 100644
--- a/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c
+++ b/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_lib.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: ocsp_lib.c,v 1.14 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -61,19 +61,19 @@
61 * 61 *
62 */ 62 */
63 63
64#include <cryptlib.h>
65#include <stdio.h> 64#include <stdio.h>
66#include <string.h> 65#include <string.h>
67 66
68#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
69 68
69#include <openssl/asn1t.h>
70#include <openssl/err.h>
70#include <openssl/objects.h> 71#include <openssl/objects.h>
72#include <openssl/ocsp.h>
73#include <openssl/pem.h>
71#include <openssl/rand.h> 74#include <openssl/rand.h>
72#include <openssl/x509.h> 75#include <openssl/x509.h>
73#include <openssl/pem.h>
74#include <openssl/x509v3.h> 76#include <openssl/x509v3.h>
75#include <openssl/ocsp.h>
76#include <openssl/asn1t.h>
77 77
78/* Convert a certificate and its issuer to an OCSP_CERTID */ 78/* Convert a certificate and its issuer to an OCSP_CERTID */
79 79
diff --git a/src/lib/libssl/src/crypto/ocsp/ocsp_srv.c b/src/lib/libssl/src/crypto/ocsp/ocsp_srv.c
index cad3bf81be..c18519fb11 100644
--- a/src/lib/libssl/src/crypto/ocsp/ocsp_srv.c
+++ b/src/lib/libssl/src/crypto/ocsp/ocsp_srv.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_srv.c,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: ocsp_srv.c,v 1.6 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -57,13 +57,14 @@
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/objects.h> 62#include <openssl/objects.h>
63#include <openssl/ocsp.h>
64#include <openssl/pem.h>
62#include <openssl/rand.h> 65#include <openssl/rand.h>
63#include <openssl/x509.h> 66#include <openssl/x509.h>
64#include <openssl/pem.h>
65#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
66#include <openssl/ocsp.h>
67 68
68/* Utility functions related to sending OCSP responses and extracting 69/* Utility functions related to sending OCSP responses and extracting
69 * relevant information from the request. 70 * relevant information from the request.
diff --git a/src/lib/libssl/src/crypto/pem/pem_all.c b/src/lib/libssl/src/crypto/pem/pem_all.c
index e883acdc65..7df917b01c 100644
--- a/src/lib/libssl/src/crypto/pem/pem_all.c
+++ b/src/lib/libssl/src/crypto/pem/pem_all.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_all.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_all.c,v 1.15 2014/07/11 08:44:49 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 *
@@ -113,20 +113,20 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h"
117#include <openssl/bio.h> 116#include <openssl/bio.h>
118#include <openssl/evp.h> 117#include <openssl/evp.h>
119#include <openssl/x509.h>
120#include <openssl/pkcs7.h>
121#include <openssl/pem.h> 118#include <openssl/pem.h>
122#ifndef OPENSSL_NO_RSA 119#include <openssl/pkcs7.h>
123#include <openssl/rsa.h> 120#include <openssl/x509.h>
121
122#ifndef OPENSSL_NO_DH
123#include <openssl/dh.h>
124#endif 124#endif
125#ifndef OPENSSL_NO_DSA 125#ifndef OPENSSL_NO_DSA
126#include <openssl/dsa.h> 126#include <openssl/dsa.h>
127#endif 127#endif
128#ifndef OPENSSL_NO_DH 128#ifndef OPENSSL_NO_RSA
129#include <openssl/dh.h> 129#include <openssl/rsa.h>
130#endif 130#endif
131 131
132#ifndef OPENSSL_NO_RSA 132#ifndef OPENSSL_NO_RSA
diff --git a/src/lib/libssl/src/crypto/pem/pem_info.c b/src/lib/libssl/src/crypto/pem/pem_info.c
index eaf70e4267..9ddcb56596 100644
--- a/src/lib/libssl/src/crypto/pem/pem_info.c
+++ b/src/lib/libssl/src/crypto/pem/pem_info.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_info.c,v 1.18 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_info.c,v 1.19 2014/07/11 08:44:49 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,18 +61,19 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/buffer.h> 64#include <openssl/buffer.h>
66#include <openssl/objects.h> 65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/x509.h> 67#include <openssl/objects.h>
69#include <openssl/pem.h> 68#include <openssl/pem.h>
70#ifndef OPENSSL_NO_RSA 69#include <openssl/x509.h>
71#include <openssl/rsa.h> 70
72#endif
73#ifndef OPENSSL_NO_DSA 71#ifndef OPENSSL_NO_DSA
74#include <openssl/dsa.h> 72#include <openssl/dsa.h>
75#endif 73#endif
74#ifndef OPENSSL_NO_RSA
75#include <openssl/rsa.h>
76#endif
76 77
77STACK_OF(X509_INFO) * 78STACK_OF(X509_INFO) *
78PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, 79PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
diff --git a/src/lib/libssl/src/crypto/pem/pem_lib.c b/src/lib/libssl/src/crypto/pem/pem_lib.c
index 70e2aa633d..8e5c82c245 100644
--- a/src/lib/libssl/src/crypto/pem/pem_lib.c
+++ b/src/lib/libssl/src/crypto/pem/pem_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_lib.c,v 1.32 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_lib.c,v 1.33 2014/07/11 08:44:49 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,15 +62,14 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/buffer.h> 65#include <openssl/buffer.h>
67#include <openssl/objects.h>
68#include <openssl/evp.h> 66#include <openssl/evp.h>
69#include <openssl/rand.h> 67#include <openssl/objects.h>
70#include <openssl/x509.h>
71#include <openssl/pem.h> 68#include <openssl/pem.h>
72#include <openssl/pkcs12.h> 69#include <openssl/pkcs12.h>
73#include "asn1_locl.h" 70#include <openssl/rand.h>
71#include <openssl/x509.h>
72
74#ifndef OPENSSL_NO_DES 73#ifndef OPENSSL_NO_DES
75#include <openssl/des.h> 74#include <openssl/des.h>
76#endif 75#endif
@@ -78,6 +77,8 @@
78#include <openssl/engine.h> 77#include <openssl/engine.h>
79#endif 78#endif
80 79
80#include "asn1_locl.h"
81
81#define MIN_LENGTH 4 82#define MIN_LENGTH 4
82 83
83static int load_iv(char **fromp, unsigned char *to, int num); 84static int load_iv(char **fromp, unsigned char *to, int num);
diff --git a/src/lib/libssl/src/crypto/pem/pem_oth.c b/src/lib/libssl/src/crypto/pem/pem_oth.c
index 41a1696f9a..d56c6b26d1 100644
--- a/src/lib/libssl/src/crypto/pem/pem_oth.c
+++ b/src/lib/libssl/src/crypto/pem/pem_oth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_oth.c,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_oth.c,v 1.6 2014/07/11 08:44:49 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,13 +57,14 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h> 61#include <openssl/buffer.h>
62#include <openssl/objects.h> 62#include <openssl/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include <openssl/pem.h>
64#include <openssl/rand.h> 66#include <openssl/rand.h>
65#include <openssl/x509.h> 67#include <openssl/x509.h>
66#include <openssl/pem.h>
67 68
68/* Handle 'other' PEMs: not private keys */ 69/* Handle 'other' PEMs: not private keys */
69 70
diff --git a/src/lib/libssl/src/crypto/pem/pem_pk8.c b/src/lib/libssl/src/crypto/pem/pem_pk8.c
index fc53826077..dafbd13814 100644
--- a/src/lib/libssl/src/crypto/pem/pem_pk8.c
+++ b/src/lib/libssl/src/crypto/pem/pem_pk8.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_pk8.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_pk8.c,v 1.7 2014/07/11 08:44:49 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,14 +57,15 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/buffer.h> 61#include <openssl/buffer.h>
62#include <openssl/objects.h> 62#include <openssl/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include <openssl/pem.h>
66#include <openssl/pkcs12.h>
64#include <openssl/rand.h> 67#include <openssl/rand.h>
65#include <openssl/x509.h> 68#include <openssl/x509.h>
66#include <openssl/pkcs12.h>
67#include <openssl/pem.h>
68 69
69static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid, 70static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid,
70 const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); 71 const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u);
diff --git a/src/lib/libssl/src/crypto/pem/pem_pkey.c b/src/lib/libssl/src/crypto/pem/pem_pkey.c
index 68d6590f14..7e5e4f5771 100644
--- a/src/lib/libssl/src/crypto/pem/pem_pkey.c
+++ b/src/lib/libssl/src/crypto/pem/pem_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_pkey.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_pkey.c,v 1.17 2014/07/11 08:44:49 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,17 +61,18 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/buffer.h> 64#include <openssl/buffer.h>
66#include <openssl/objects.h>
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h>
67#include <openssl/pem.h>
68#include <openssl/pkcs12.h>
68#include <openssl/rand.h> 69#include <openssl/rand.h>
69#include <openssl/x509.h> 70#include <openssl/x509.h>
70#include <openssl/pkcs12.h> 71
71#include <openssl/pem.h>
72#ifndef OPENSSL_NO_ENGINE 72#ifndef OPENSSL_NO_ENGINE
73#include <openssl/engine.h> 73#include <openssl/engine.h>
74#endif 74#endif
75
75#include "asn1_locl.h" 76#include "asn1_locl.h"
76 77
77int pem_check_suffix(const char *pem_str, const char *suffix); 78int pem_check_suffix(const char *pem_str, const char *suffix);
diff --git a/src/lib/libssl/src/crypto/pem/pem_seal.c b/src/lib/libssl/src/crypto/pem/pem_seal.c
index 08680e45db..90ba01584c 100644
--- a/src/lib/libssl/src/crypto/pem/pem_seal.c
+++ b/src/lib/libssl/src/crypto/pem/pem_seal.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_seal.c,v 1.19 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pem_seal.c,v 1.20 2014/07/11 08:44:49 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,13 +62,14 @@
62#include <openssl/opensslconf.h> /* for OPENSSL_NO_RSA */ 62#include <openssl/opensslconf.h> /* for OPENSSL_NO_RSA */
63 63
64#ifndef OPENSSL_NO_RSA 64#ifndef OPENSSL_NO_RSA
65#include "cryptlib.h" 65
66#include <openssl/err.h>
66#include <openssl/evp.h> 67#include <openssl/evp.h>
67#include <openssl/rand.h> 68#include <openssl/rand.h>
68#include <openssl/objects.h> 69#include <openssl/objects.h>
69#include <openssl/x509.h>
70#include <openssl/pem.h> 70#include <openssl/pem.h>
71#include <openssl/rsa.h> 71#include <openssl/rsa.h>
72#include <openssl/x509.h>
72 73
73int 74int
74PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, 75PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
diff --git a/src/lib/libssl/src/crypto/pem/pem_sign.c b/src/lib/libssl/src/crypto/pem/pem_sign.c
index f1c4d4dcb9..0f996c7220 100644
--- a/src/lib/libssl/src/crypto/pem/pem_sign.c
+++ b/src/lib/libssl/src/crypto/pem/pem_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_sign.c,v 1.10 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_sign.c,v 1.11 2014/07/11 08:44:49 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,12 +57,13 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/rand.h> 61#include <openssl/err.h>
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/x509.h>
65#include <openssl/pem.h> 64#include <openssl/pem.h>
65#include <openssl/rand.h>
66#include <openssl/x509.h>
66 67
67void 68void
68PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) 69PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type)
diff --git a/src/lib/libssl/src/crypto/pem/pem_x509.c b/src/lib/libssl/src/crypto/pem/pem_x509.c
index 7b4b888ea9..e4b7f1c2c6 100644
--- a/src/lib/libssl/src/crypto/pem/pem_x509.c
+++ b/src/lib/libssl/src/crypto/pem/pem_x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_x509.c,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_x509.c,v 1.6 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -57,11 +57,11 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/bio.h> 61#include <openssl/bio.h>
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/x509.h>
64#include <openssl/pkcs7.h>
65#include <openssl/pem.h> 63#include <openssl/pem.h>
64#include <openssl/pkcs7.h>
65#include <openssl/x509.h>
66 66
67IMPLEMENT_PEM_rw(X509, X509, PEM_STRING_X509, X509) 67IMPLEMENT_PEM_rw(X509, X509, PEM_STRING_X509, X509)
diff --git a/src/lib/libssl/src/crypto/pem/pem_xaux.c b/src/lib/libssl/src/crypto/pem/pem_xaux.c
index 99e2cd367b..eb76840532 100644
--- a/src/lib/libssl/src/crypto/pem/pem_xaux.c
+++ b/src/lib/libssl/src/crypto/pem/pem_xaux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pem_xaux.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: pem_xaux.c,v 1.7 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -57,12 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/bio.h> 61#include <openssl/bio.h>
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/x509.h>
64#include <openssl/pkcs7.h>
65#include <openssl/pem.h> 63#include <openssl/pem.h>
64#include <openssl/pkcs7.h>
65#include <openssl/x509.h>
66 66
67IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX) 67IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX)
68IMPLEMENT_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR, PEM_STRING_X509_PAIR, 68IMPLEMENT_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR, PEM_STRING_X509_PAIR,
diff --git a/src/lib/libssl/src/crypto/pem/pvkfmt.c b/src/lib/libssl/src/crypto/pem/pvkfmt.c
index 8a945b4dd7..55cfffa7bc 100644
--- a/src/lib/libssl/src/crypto/pem/pvkfmt.c
+++ b/src/lib/libssl/src/crypto/pem/pvkfmt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pvkfmt.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pvkfmt.c,v 1.9 2014/07/11 08:44:49 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 2005. 3 * project 2005.
4 */ 4 */
@@ -64,10 +64,11 @@
64 64
65#include <openssl/opensslconf.h> 65#include <openssl/opensslconf.h>
66 66
67#include "cryptlib.h" 67#include <openssl/bn.h>
68#include <openssl/err.h>
68#include <openssl/pem.h> 69#include <openssl/pem.h>
69#include <openssl/rand.h> 70#include <openssl/rand.h>
70#include <openssl/bn.h> 71
71#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) 72#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
72#include <openssl/dsa.h> 73#include <openssl/dsa.h>
73#include <openssl/rsa.h> 74#include <openssl/rsa.h>
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_add.c b/src/lib/libssl/src/crypto/pkcs12/p12_add.c
index 6aa872631e..11373cda4f 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_add.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_add.c,v 1.10 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_add.c,v 1.11 2014/07/11 08:44:49 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,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63/* Pack an object into an OCTET STRING and turn into a safebag */ 64/* Pack an object into an OCTET STRING and turn into a safebag */
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_asn.c b/src/lib/libssl/src/crypto/pkcs12/p12_asn.c
index b72db76383..5b3285ebe2 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_asn.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_asn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_asn.c,v 1.5 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_asn.c,v 1.6 2014/07/11 08:44:49 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/pkcs12.h> 62#include <openssl/pkcs12.h>
63 63
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_attr.c b/src/lib/libssl/src/crypto/pkcs12/p12_attr.c
index 05e9b11fd1..7552cf0a60 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_attr.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_attr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_attr.c,v 1.9 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_attr.c,v 1.10 2014/07/11 08:44:49 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/pkcs12.h> 61#include <openssl/pkcs12.h>
62 62
63/* Add a local keyid to a safebag */ 63/* Add a local keyid to a safebag */
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_crpt.c b/src/lib/libssl/src/crypto/pkcs12/p12_crpt.c
index 1709b30d5e..288c93c49f 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_crpt.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_crpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_crpt.c,v 1.10 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_crpt.c,v 1.11 2014/07/11 08:44:49 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,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63/* PKCS#12 PBE algorithms now in static table */ 64/* PKCS#12 PBE algorithms now in static table */
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_crt.c b/src/lib/libssl/src/crypto/pkcs12/p12_crt.c
index 538637e78a..1d5c3dfd16 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_crt.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_crt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_crt.c,v 1.14 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_crt.c,v 1.15 2014/07/11 08:44:49 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 */
@@ -57,9 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h"
61#include <openssl/pkcs12.h>
62 60
61#include <openssl/err.h>
62#include <openssl/pkcs12.h>
63 63
64static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags, 64static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags,
65 PKCS12_SAFEBAG *bag); 65 PKCS12_SAFEBAG *bag);
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_decr.c b/src/lib/libssl/src/crypto/pkcs12/p12_decr.c
index c06f580de2..b6bd508bf1 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_decr.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_decr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_decr.c,v 1.12 2014/07/10 10:01:23 miod Exp $ */ 1/* $OpenBSD: p12_decr.c,v 1.13 2014/07/11 08:44:49 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"
61#include <openssl/pkcs12.h>
62 60
61#include <openssl/err.h>
62#include <openssl/pkcs12.h>
63 63
64/* Encrypt/Decrypt a buffer based on password and algor, result in a 64/* Encrypt/Decrypt a buffer based on password and algor, result in a
65 * malloc'ed buffer 65 * malloc'ed buffer
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_init.c b/src/lib/libssl/src/crypto/pkcs12/p12_init.c
index b4da7be77c..2db73d34c2 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_init.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_init.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_init.c,v 1.8 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_init.c,v 1.9 2014/07/11 08:44:49 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,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63/* Initialise a PKCS12 structure to take data */ 64/* Initialise a PKCS12 structure to take data */
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_key.c b/src/lib/libssl/src/crypto/pkcs12/p12_key.c
index 379108f4b5..1f7583084e 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_key.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_key.c,v 1.19 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: p12_key.c,v 1.20 2014/07/11 08:44:49 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,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/pkcs12.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
63#include <openssl/err.h>
64#include <openssl/pkcs12.h>
65 65
66/* PKCS12 compatible key/IV generation */ 66/* PKCS12 compatible key/IV generation */
67#ifndef min 67#ifndef min
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_kiss.c b/src/lib/libssl/src/crypto/pkcs12/p12_kiss.c
index 4063ba4b82..eaaa2bc911 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_kiss.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_kiss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_kiss.c,v 1.15 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_kiss.c,v 1.16 2014/07/11 08:44:49 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,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63/* Simplified PKCS#12 routines */ 64/* Simplified PKCS#12 routines */
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c b/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c
index 582d1de23b..453d30d65f 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_mutl.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p12_mutl.c,v 1.17 2014/07/11 08:44:49 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 */
@@ -62,10 +62,11 @@
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#ifndef OPENSSL_NO_HMAC 64#ifndef OPENSSL_NO_HMAC
65#include "cryptlib.h" 65
66#include <openssl/err.h>
66#include <openssl/hmac.h> 67#include <openssl/hmac.h>
67#include <openssl/rand.h>
68#include <openssl/pkcs12.h> 68#include <openssl/pkcs12.h>
69#include <openssl/rand.h>
69 70
70/* Generate a MAC */ 71/* Generate a MAC */
71int 72int
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_p8d.c b/src/lib/libssl/src/crypto/pkcs12/p12_p8d.c
index 4aceae6a9f..5d3339e2f2 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_p8d.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_p8d.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_p8d.c,v 1.4 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_p8d.c,v 1.5 2014/07/11 08:44:49 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 2001. 3 * project 2001.
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/pkcs12.h> 61#include <openssl/pkcs12.h>
62 62
63PKCS8_PRIV_KEY_INFO * 63PKCS8_PRIV_KEY_INFO *
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_p8e.c b/src/lib/libssl/src/crypto/pkcs12/p12_p8e.c
index 1ee6a32f6a..24ed7f69ed 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_p8e.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_p8e.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_p8e.c,v 1.4 2014/07/08 09:24:53 jsing Exp $ */ 1/* $OpenBSD: p12_p8e.c,v 1.5 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -57,7 +57,8 @@
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/pkcs12.h> 62#include <openssl/pkcs12.h>
62 63
63X509_SIG * 64X509_SIG *
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_utl.c b/src/lib/libssl/src/crypto/pkcs12/p12_utl.c
index 712e16cf99..b60d4d020c 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_utl.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_utl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_utl.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: p12_utl.c,v 1.12 2014/07/11 08:44:49 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/pkcs12.h> 62#include <openssl/pkcs12.h>
64 63
65/* Cheap and nasty Unicode stuff */ 64/* Cheap and nasty Unicode stuff */
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_asn1.c b/src/lib/libssl/src/crypto/pkcs7/pk7_asn1.c
index 8be5447518..5191eb5076 100644
--- a/src/lib/libssl/src/crypto/pkcs7/pk7_asn1.c
+++ b/src/lib/libssl/src/crypto/pkcs7/pk7_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_asn1.c,v 1.6 2014/06/29 17:05:36 jsing Exp $ */ 1/* $OpenBSD: pk7_asn1.c,v 1.7 2014/07/11 08:44:49 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/pkcs7.h> 62#include <openssl/pkcs7.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c b/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c
index 8ef3f392df..4556949456 100644
--- a/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c
+++ b/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_doit.c,v 1.26 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: pk7_doit.c,v 1.27 2014/07/11 08:44:49 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,12 +59,11 @@
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/err.h>
63#include <openssl/rand.h>
64#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/rand.h>
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67#include <openssl/err.h>
68 67
69static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype, 68static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
70 void *value); 69 void *value);
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c b/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c
index 63b73f88aa..699f5df394 100644
--- a/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c
+++ b/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_lib.c,v 1.12 2014/07/08 09:08:27 jsing Exp $ */ 1/* $OpenBSD: pk7_lib.c,v 1.13 2014/07/11 08:44:49 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/objects.h> 62#include <openssl/objects.h>
62#include <openssl/x509.h> 63#include <openssl/x509.h>
64
63#include "asn1_locl.h" 65#include "asn1_locl.h"
64 66
65long 67long
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_mime.c b/src/lib/libssl/src/crypto/pkcs7/pk7_mime.c
index 8f32125f0b..e14abf31a9 100644
--- a/src/lib/libssl/src/crypto/pkcs7/pk7_mime.c
+++ b/src/lib/libssl/src/crypto/pkcs7/pk7_mime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_mime.c,v 1.10 2014/06/29 17:05:36 jsing Exp $ */ 1/* $OpenBSD: pk7_mime.c,v 1.11 2014/07/11 08:44:49 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 */
@@ -52,12 +52,12 @@
52 * 52 *
53 */ 53 */
54 54
55#include <stdio.h>
56#include <ctype.h> 55#include <ctype.h>
57#include "cryptlib.h" 56#include <stdio.h>
57
58#include <openssl/asn1.h>
58#include <openssl/rand.h> 59#include <openssl/rand.h>
59#include <openssl/x509.h> 60#include <openssl/x509.h>
60#include <openssl/asn1.h>
61 61
62/* PKCS#7 wrappers round generalised stream and MIME routines */ 62/* PKCS#7 wrappers round generalised stream and MIME routines */
63 63
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_smime.c b/src/lib/libssl/src/crypto/pkcs7/pk7_smime.c
index 6b7b1ccd46..b76e2b1915 100644
--- a/src/lib/libssl/src/crypto/pkcs7/pk7_smime.c
+++ b/src/lib/libssl/src/crypto/pkcs7/pk7_smime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_smime.c,v 1.17 2014/07/10 21:42:43 miod Exp $ */ 1/* $OpenBSD: pk7_smime.c,v 1.18 2014/07/11 08:44:49 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 */
@@ -59,7 +59,8 @@
59/* Simple PKCS#7 processing functions */ 59/* Simple PKCS#7 processing functions */
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include "cryptlib.h" 62
63#include <openssl/err.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
64#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
65 66
diff --git a/src/lib/libssl/src/crypto/rand/rand_lib.c b/src/lib/libssl/src/crypto/rand/rand_lib.c
index 38c1569940..2b2c827740 100644
--- a/src/lib/libssl/src/crypto/rand/rand_lib.c
+++ b/src/lib/libssl/src/crypto/rand/rand_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rand_lib.c,v 1.18 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rand_lib.c,v 1.19 2014/07/11 08:44:49 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> 3 * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
4 * 4 *
@@ -17,7 +17,6 @@
17 17
18#include <openssl/opensslconf.h> 18#include <openssl/opensslconf.h>
19 19
20#include "cryptlib.h"
21#include <openssl/rand.h> 20#include <openssl/rand.h>
22 21
23#include <stdlib.h> 22#include <stdlib.h>
diff --git a/src/lib/libssl/src/crypto/rc4/rc4_locl.h b/src/lib/libssl/src/crypto/rc4/rc4_locl.h
index 513d4dd82e..d2b08064a3 100644
--- a/src/lib/libssl/src/crypto/rc4/rc4_locl.h
+++ b/src/lib/libssl/src/crypto/rc4/rc4_locl.h
@@ -1,7 +1,5 @@
1/* $OpenBSD: rc4_locl.h,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: rc4_locl.h,v 1.4 2014/07/11 08:44:49 jsing Exp $ */
2 2
3#ifndef HEADER_RC4_LOCL_H 3#ifndef HEADER_RC4_LOCL_H
4#define HEADER_RC4_LOCL_H 4#define HEADER_RC4_LOCL_H
5#include <openssl/opensslconf.h>
6#include <cryptlib.h>
7#endif 5#endif
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_ameth.c b/src/lib/libssl/src/crypto/rsa/rsa_ameth.c
index 1eeb58ed9b..bcc0eee4b9 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_ameth.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_ameth.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_ameth.c,v 1.11 2014/07/11 08:44:49 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 */
@@ -60,14 +60,16 @@
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>
65#include <openssl/x509.h>
66#include <openssl/rsa.h>
67#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/err.h>
66#include <openssl/rsa.h>
67#include <openssl/x509.h>
68
68#ifndef OPENSSL_NO_CMS 69#ifndef OPENSSL_NO_CMS
69#include <openssl/cms.h> 70#include <openssl/cms.h>
70#endif 71#endif
72
71#include "asn1_locl.h" 73#include "asn1_locl.h"
72 74
73static int 75static int
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_asn1.c b/src/lib/libssl/src/crypto/rsa/rsa_asn1.c
index 9bc5f17b06..573b9f8b8d 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_asn1.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_asn1.c,v 1.8 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_asn1.c,v 1.9 2014/07/11 08:44:49 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,11 +57,11 @@
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/bn.h> 62#include <openssl/bn.h>
62#include <openssl/rsa.h> 63#include <openssl/rsa.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
64#include <openssl/asn1t.h>
65 65
66/* Override the default free and new methods */ 66/* Override the default free and new methods */
67static int 67static int
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_crpt.c b/src/lib/libssl/src/crypto/rsa/rsa_crpt.c
index 220ce9497a..2adb2b31b2 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_crpt.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_crpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_crpt.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_crpt.c,v 1.11 2014/07/11 08:44:49 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,12 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/bn.h>
63#include <openssl/crypto.h> 64#include <openssl/crypto.h>
64#include "cryptlib.h"
65#include <openssl/lhash.h> 65#include <openssl/lhash.h>
66#include <openssl/bn.h>
67#include <openssl/rsa.h>
68#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/rsa.h>
68
69#ifndef OPENSSL_NO_ENGINE 69#ifndef OPENSSL_NO_ENGINE
70#include <openssl/engine.h> 70#include <openssl/engine.h>
71#endif 71#endif
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_depr.c b/src/lib/libssl/src/crypto/rsa/rsa_depr.c
index 547f9a491e..b830a2293c 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_depr.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_depr.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_depr.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -61,7 +61,6 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/bn.h> 64#include <openssl/bn.h>
66#include <openssl/rsa.h> 65#include <openssl/rsa.h>
67 66
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_eay.c b/src/lib/libssl/src/crypto/rsa/rsa_eay.c
index 3cc8f6c5cf..571a9a0f05 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_eay.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_eay.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_eay.c,v 1.33 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_eay.c,v 1.34 2014/07/11 08:44:49 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 *
@@ -113,10 +113,10 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h"
117#include <openssl/bn.h> 116#include <openssl/bn.h>
118#include <openssl/rsa.h> 117#include <openssl/err.h>
119#include <openssl/rand.h> 118#include <openssl/rand.h>
119#include <openssl/rsa.h>
120 120
121static int RSA_eay_public_encrypt(int flen, const unsigned char *from, 121static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
122 unsigned char *to, RSA *rsa, int padding); 122 unsigned char *to, RSA *rsa, int padding);
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_gen.c b/src/lib/libssl/src/crypto/rsa/rsa_gen.c
index f000b41940..a3b9da4856 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_gen.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_gen.c,v 1.15 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_gen.c,v 1.16 2014/07/11 08:44:49 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 *
@@ -64,8 +64,9 @@
64 64
65#include <stdio.h> 65#include <stdio.h>
66#include <time.h> 66#include <time.h>
67#include "cryptlib.h" 67
68#include <openssl/bn.h> 68#include <openssl/bn.h>
69#include <openssl/err.h>
69#include <openssl/rsa.h> 70#include <openssl/rsa.h>
70 71
71static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); 72static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb);
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_lib.c b/src/lib/libssl/src/crypto/rsa/rsa_lib.c
index d7a51c7b05..157c347f88 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_lib.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_lib.c,v 1.27 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_lib.c,v 1.28 2014/07/11 08:44:49 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,12 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/bn.h>
63#include <openssl/crypto.h> 64#include <openssl/crypto.h>
64#include "cryptlib.h"
65#include <openssl/lhash.h> 65#include <openssl/lhash.h>
66#include <openssl/bn.h>
67#include <openssl/rsa.h>
68#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/rsa.h>
68
69#ifndef OPENSSL_NO_ENGINE 69#ifndef OPENSSL_NO_ENGINE
70#include <openssl/engine.h> 70#include <openssl/engine.h>
71#endif 71#endif
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_none.c b/src/lib/libssl/src/crypto/rsa/rsa_none.c
index 503d93bb68..3527f1c682 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_none.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_none.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_none.c,v 1.8 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_none.c,v 1.9 2014/07/11 08:44:49 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"
63#include <openssl/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/rand.h> 64#include <openssl/rand.h>
65#include <openssl/rsa.h>
66 66
67int 67int
68RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *from, 68RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *from,
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_oaep.c b/src/lib/libssl/src/crypto/rsa/rsa_oaep.c
index 09799818d3..9be0f9be31 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_oaep.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_oaep.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_oaep.c,v 1.22 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_oaep.c,v 1.23 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Ulf Moeller. This software is distributed on an "AS IS" 2/* Written by Ulf Moeller. This software is distributed on an "AS IS"
3 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ 3 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */
4 4
@@ -24,11 +24,12 @@
24#include <openssl/opensslconf.h> 24#include <openssl/opensslconf.h>
25 25
26#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) 26#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
27#include "cryptlib.h" 27
28#include <openssl/bn.h> 28#include <openssl/bn.h>
29#include <openssl/rsa.h> 29#include <openssl/err.h>
30#include <openssl/evp.h> 30#include <openssl/evp.h>
31#include <openssl/rand.h> 31#include <openssl/rand.h>
32#include <openssl/rsa.h>
32#include <openssl/sha.h> 33#include <openssl/sha.h>
33 34
34static int MGF1(unsigned char *mask, long len, const unsigned char *seed, 35static int MGF1(unsigned char *mask, long len, const unsigned char *seed,
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_pk1.c b/src/lib/libssl/src/crypto/rsa/rsa_pk1.c
index 6d11ee19f9..4f82bf6768 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_pk1.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_pk1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pk1.c,v 1.12 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_pk1.c,v 1.13 2014/07/11 08:44:49 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/bn.h> 62#include <openssl/bn.h>
63#include <openssl/err.h>
64#include <openssl/rsa.h> 64#include <openssl/rsa.h>
65#include <openssl/rand.h> 65#include <openssl/rand.h>
66 66
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c b/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c
index 0b2d680eed..954190d560 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pmeth.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: rsa_pmeth.c,v 1.14 2014/07/11 08:44:49 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 */
@@ -62,15 +62,17 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/asn1t.h> 65#include <openssl/asn1t.h>
67#include <openssl/x509.h>
68#include <openssl/rsa.h>
69#include <openssl/bn.h> 66#include <openssl/bn.h>
67#include <openssl/err.h>
70#include <openssl/evp.h> 68#include <openssl/evp.h>
69#include <openssl/rsa.h>
70#include <openssl/x509.h>
71
71#ifndef OPENSSL_NO_CMS 72#ifndef OPENSSL_NO_CMS
72#include <openssl/cms.h> 73#include <openssl/cms.h>
73#endif 74#endif
75
74#include "evp_locl.h" 76#include "evp_locl.h"
75#include "rsa_locl.h" 77#include "rsa_locl.h"
76 78
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_prn.c b/src/lib/libssl/src/crypto/rsa/rsa_prn.c
index 5d5b0e29d8..db82dab5be 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_prn.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_prn.c,v 1.5 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_prn.c,v 1.6 2014/07/11 08:44:49 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 */
@@ -57,9 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/rsa.h> 61#include <openssl/err.h>
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/rsa.h>
63 64
64int 65int
65RSA_print_fp(FILE *fp, const RSA *x, int off) 66RSA_print_fp(FILE *fp, const RSA *x, int off)
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_pss.c b/src/lib/libssl/src/crypto/rsa/rsa_pss.c
index fa32a856ba..e18ca632aa 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_pss.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_pss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pss.c,v 1.8 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_pss.c,v 1.9 2014/07/11 08:44:49 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 2005. 3 * project 2005.
4 */ 4 */
@@ -59,11 +59,11 @@
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/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
66#include <openssl/rand.h> 65#include <openssl/rand.h>
66#include <openssl/rsa.h>
67#include <openssl/sha.h> 67#include <openssl/sha.h>
68 68
69static const unsigned char zeroes[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 69static const unsigned char zeroes[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_saos.c b/src/lib/libssl/src/crypto/rsa/rsa_saos.c
index f2cf06af4c..47b2a4e95f 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_saos.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_saos.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_saos.c,v 1.14 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_saos.c,v 1.15 2014/07/11 08:44:49 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"
63#include <openssl/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/rsa.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67 67
68int 68int
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_sign.c b/src/lib/libssl/src/crypto/rsa/rsa_sign.c
index c7e0a55829..a446b563b3 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_sign.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_sign.c,v 1.21 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_sign.c,v 1.22 2014/07/11 08:44:49 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,11 +59,12 @@
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/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/rsa.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67
67#include "rsa_locl.h" 68#include "rsa_locl.h"
68 69
69/* Size of an SSL signature: MD5+SHA1 */ 70/* Size of an SSL signature: MD5+SHA1 */
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_ssl.c b/src/lib/libssl/src/crypto/rsa/rsa_ssl.c
index 71372341c2..a5fe5004b1 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_ssl.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_ssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_ssl.c,v 1.12 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_ssl.c,v 1.13 2014/07/11 08:44:49 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"
63#include <openssl/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/rand.h> 64#include <openssl/rand.h>
65#include <openssl/rsa.h>
66 66
67int 67int
68RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from, 68RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from,
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_x931.c b/src/lib/libssl/src/crypto/rsa/rsa_x931.c
index 5809f62cbd..8ee309e6c9 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_x931.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_x931.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_x931.c,v 1.7 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: rsa_x931.c,v 1.8 2014/07/11 08:44:49 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 2005. 3 * project 2005.
4 */ 4 */
@@ -59,11 +59,11 @@
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/bn.h> 62#include <openssl/bn.h>
64#include <openssl/rsa.h> 63#include <openssl/err.h>
65#include <openssl/rand.h>
66#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/rand.h>
66#include <openssl/rsa.h>
67 67
68int 68int
69RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *from, 69RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *from,
diff --git a/src/lib/libssl/src/crypto/sha/sha512.c b/src/lib/libssl/src/crypto/sha/sha512.c
index eb10024e32..ad72b7e6f1 100644
--- a/src/lib/libssl/src/crypto/sha/sha512.c
+++ b/src/lib/libssl/src/crypto/sha/sha512.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sha512.c,v 1.12 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: sha512.c,v 1.13 2014/07/11 08:44:49 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2004 The OpenSSL Project. All rights reserved 3 * Copyright (c) 2004 The OpenSSL Project. All rights reserved
4 * according to the OpenSSL license [found in ../../LICENSE]. 4 * according to the OpenSSL license [found in ../../LICENSE].
@@ -50,10 +50,8 @@
50 */ 50 */
51 51
52#include <openssl/crypto.h> 52#include <openssl/crypto.h>
53#include <openssl/sha.h>
54#include <openssl/opensslv.h> 53#include <openssl/opensslv.h>
55 54#include <openssl/sha.h>
56#include "cryptlib.h"
57 55
58#if !defined(__STRICT_ALIGNMENT) || defined(SHA512_ASM) 56#if !defined(__STRICT_ALIGNMENT) || defined(SHA512_ASM)
59#define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA 57#define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
diff --git a/src/lib/libssl/src/crypto/srp/srp_lib.c b/src/lib/libssl/src/crypto/srp/srp_lib.c
index 078296fa0a..1e96adc6a3 100644
--- a/src/lib/libssl/src/crypto/srp/srp_lib.c
+++ b/src/lib/libssl/src/crypto/srp/srp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: srp_lib.c,v 1.8 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: srp_lib.c,v 1.9 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with 2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with
3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr) 3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr)
4 * for the EdelKey project and contributed to the OpenSSL project 2004. 4 * for the EdelKey project and contributed to the OpenSSL project 2004.
@@ -60,10 +60,11 @@
60#include <openssl/opensslconf.h> 60#include <openssl/opensslconf.h>
61 61
62#ifndef OPENSSL_NO_SRP 62#ifndef OPENSSL_NO_SRP
63#include "cryptlib.h" 63
64#include "srp_lcl.h"
65#include <openssl/srp.h>
66#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/srp.h>
66
67#include "srp_lcl.h"
67 68
68#if (BN_BYTES == 8) 69#if (BN_BYTES == 8)
69# if defined(_LP64) 70# if defined(_LP64)
diff --git a/src/lib/libssl/src/crypto/srp/srp_vfy.c b/src/lib/libssl/src/crypto/srp/srp_vfy.c
index 756744609a..0981890086 100644
--- a/src/lib/libssl/src/crypto/srp/srp_vfy.c
+++ b/src/lib/libssl/src/crypto/srp/srp_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: srp_vfy.c,v 1.6 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: srp_vfy.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with 2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with
3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr) 3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr)
4 * for the EdelKey project and contributed to the OpenSSL project 2004. 4 * for the EdelKey project and contributed to the OpenSSL project 2004.
@@ -60,14 +60,15 @@
60#include <openssl/opensslconf.h> 60#include <openssl/opensslconf.h>
61 61
62#ifndef OPENSSL_NO_SRP 62#ifndef OPENSSL_NO_SRP
63#include "cryptlib.h" 63
64#include "srp_lcl.h"
65#include <openssl/srp.h>
66#include <openssl/evp.h>
67#include <openssl/buffer.h> 64#include <openssl/buffer.h>
65#include <openssl/evp.h>
68#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/srp.h>
69#include <openssl/txt_db.h> 68#include <openssl/txt_db.h>
70 69
70#include "srp_lcl.h"
71
71#define SRP_RANDOM_SALT_LEN 20 72#define SRP_RANDOM_SALT_LEN 20
72#define MAX_LEN 2500 73#define MAX_LEN 2500
73 74
diff --git a/src/lib/libssl/src/crypto/stack/stack.c b/src/lib/libssl/src/crypto/stack/stack.c
index a219d959e9..cbd4d216f6 100644
--- a/src/lib/libssl/src/crypto/stack/stack.c
+++ b/src/lib/libssl/src/crypto/stack/stack.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: stack.c,v 1.17 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: stack.c,v 1.18 2014/07/11 08:44:49 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 *
@@ -69,9 +69,8 @@
69#include <stdio.h> 69#include <stdio.h>
70#include <string.h> 70#include <string.h>
71 71
72#include "cryptlib.h"
73#include <openssl/stack.h>
74#include <openssl/objects.h> 72#include <openssl/objects.h>
73#include <openssl/stack.h>
75 74
76#undef MIN_NODES 75#undef MIN_NODES
77#define MIN_NODES 4 76#define MIN_NODES 4
diff --git a/src/lib/libssl/src/crypto/ts/ts_conf.c b/src/lib/libssl/src/crypto/ts/ts_conf.c
index 685fdc0736..ec033b1cfc 100644
--- a/src/lib/libssl/src/crypto/ts/ts_conf.c
+++ b/src/lib/libssl/src/crypto/ts/ts_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_conf.c,v 1.6 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: ts_conf.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -61,12 +61,12 @@
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/crypto.h> 63#include <openssl/crypto.h>
64#include "cryptlib.h"
65#include <openssl/pem.h> 64#include <openssl/pem.h>
65#include <openssl/ts.h>
66
66#ifndef OPENSSL_NO_ENGINE 67#ifndef OPENSSL_NO_ENGINE
67#include <openssl/engine.h> 68#include <openssl/engine.h>
68#endif 69#endif
69#include <openssl/ts.h>
70 70
71/* Macro definitions for the configuration file. */ 71/* Macro definitions for the configuration file. */
72 72
diff --git a/src/lib/libssl/src/crypto/ts/ts_lib.c b/src/lib/libssl/src/crypto/ts/ts_lib.c
index ad37037b7f..f08bb8701d 100644
--- a/src/lib/libssl/src/crypto/ts/ts_lib.c
+++ b/src/lib/libssl/src/crypto/ts/ts_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_lib.c,v 1.7 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ts_lib.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -59,11 +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/objects.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
65#include <openssl/x509v3.h> 63#include <openssl/objects.h>
66#include <openssl/ts.h> 64#include <openssl/ts.h>
65#include <openssl/x509v3.h>
67 66
68/* Local function declarations. */ 67/* Local function declarations. */
69 68
diff --git a/src/lib/libssl/src/crypto/ts/ts_req_print.c b/src/lib/libssl/src/crypto/ts/ts_req_print.c
index 0fd115f684..64a8133a58 100644
--- a/src/lib/libssl/src/crypto/ts/ts_req_print.c
+++ b/src/lib/libssl/src/crypto/ts/ts_req_print.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_req_print.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ts_req_print.c,v 1.4 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -57,11 +57,11 @@
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/bn.h> 61#include <openssl/bn.h>
63#include <openssl/x509v3.h> 62#include <openssl/objects.h>
64#include <openssl/ts.h> 63#include <openssl/ts.h>
64#include <openssl/x509v3.h>
65 65
66/* Function definitions. */ 66/* Function definitions. */
67 67
diff --git a/src/lib/libssl/src/crypto/ts/ts_req_utils.c b/src/lib/libssl/src/crypto/ts/ts_req_utils.c
index 8ba1246cf8..ab813b2b42 100644
--- a/src/lib/libssl/src/crypto/ts/ts_req_utils.c
+++ b/src/lib/libssl/src/crypto/ts/ts_req_utils.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_req_utils.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ts_req_utils.c,v 1.4 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -57,10 +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/objects.h> 62#include <openssl/objects.h>
62#include <openssl/x509v3.h>
63#include <openssl/ts.h> 63#include <openssl/ts.h>
64#include <openssl/x509v3.h>
64 65
65int 66int
66TS_REQ_set_version(TS_REQ *a, long version) 67TS_REQ_set_version(TS_REQ *a, long version)
diff --git a/src/lib/libssl/src/crypto/ts/ts_rsp_print.c b/src/lib/libssl/src/crypto/ts/ts_rsp_print.c
index be76c86e44..c442b71646 100644
--- a/src/lib/libssl/src/crypto/ts/ts_rsp_print.c
+++ b/src/lib/libssl/src/crypto/ts/ts_rsp_print.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_print.c,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ts_rsp_print.c,v 1.5 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -57,11 +57,11 @@
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/bn.h> 61#include <openssl/bn.h>
63#include <openssl/x509v3.h> 62#include <openssl/objects.h>
64#include <openssl/ts.h> 63#include <openssl/ts.h>
64#include <openssl/x509v3.h>
65 65
66struct status_map_st { 66struct status_map_st {
67 int bit; 67 int bit;
diff --git a/src/lib/libssl/src/crypto/ts/ts_rsp_sign.c b/src/lib/libssl/src/crypto/ts/ts_rsp_sign.c
index 5421085b5a..9d20e66f9a 100644
--- a/src/lib/libssl/src/crypto/ts/ts_rsp_sign.c
+++ b/src/lib/libssl/src/crypto/ts/ts_rsp_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_sign.c,v 1.16 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ts_rsp_sign.c,v 1.17 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -60,11 +60,10 @@
60 60
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h" 63#include <openssl/err.h>
64
65#include <openssl/objects.h> 64#include <openssl/objects.h>
66#include <openssl/ts.h>
67#include <openssl/pkcs7.h> 65#include <openssl/pkcs7.h>
66#include <openssl/ts.h>
68 67
69/* Private function declarations. */ 68/* Private function declarations. */
70 69
diff --git a/src/lib/libssl/src/crypto/ts/ts_rsp_utils.c b/src/lib/libssl/src/crypto/ts/ts_rsp_utils.c
index bf449e7abf..0d05814297 100644
--- a/src/lib/libssl/src/crypto/ts/ts_rsp_utils.c
+++ b/src/lib/libssl/src/crypto/ts/ts_rsp_utils.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_utils.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ts_rsp_utils.c,v 1.4 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -57,10 +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/objects.h> 62#include <openssl/objects.h>
62#include <openssl/ts.h>
63#include <openssl/pkcs7.h> 63#include <openssl/pkcs7.h>
64#include <openssl/ts.h>
64 65
65/* Function definitions. */ 66/* Function definitions. */
66 67
diff --git a/src/lib/libssl/src/crypto/ts/ts_rsp_verify.c b/src/lib/libssl/src/crypto/ts/ts_rsp_verify.c
index 8b3d5a86ac..25fc22dfaf 100644
--- a/src/lib/libssl/src/crypto/ts/ts_rsp_verify.c
+++ b/src/lib/libssl/src/crypto/ts/ts_rsp_verify.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_verify.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ts_rsp_verify.c,v 1.12 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
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/err.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/ts.h>
65#include <openssl/pkcs7.h> 64#include <openssl/pkcs7.h>
65#include <openssl/ts.h>
66 66
67/* Private function declarations. */ 67/* Private function declarations. */
68 68
diff --git a/src/lib/libssl/src/crypto/ts/ts_verify_ctx.c b/src/lib/libssl/src/crypto/ts/ts_verify_ctx.c
index 3b500233db..373399d943 100644
--- a/src/lib/libssl/src/crypto/ts/ts_verify_ctx.c
+++ b/src/lib/libssl/src/crypto/ts/ts_verify_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_verify_ctx.c,v 1.6 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: ts_verify_ctx.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2003. 3 * project 2003.
4 */ 4 */
@@ -58,7 +58,7 @@
58 58
59#include <string.h> 59#include <string.h>
60 60
61#include "cryptlib.h" 61#include <openssl/err.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/ts.h> 63#include <openssl/ts.h>
64 64
diff --git a/src/lib/libssl/src/crypto/txt_db/txt_db.c b/src/lib/libssl/src/crypto/txt_db/txt_db.c
index 274be5f4dc..26df76a9c2 100644
--- a/src/lib/libssl/src/crypto/txt_db/txt_db.c
+++ b/src/lib/libssl/src/crypto/txt_db/txt_db.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: txt_db.c,v 1.17 2014/07/09 11:10:51 bcook Exp $ */ 1/* $OpenBSD: txt_db.c,v 1.18 2014/07/11 08:44:49 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,7 +59,7 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62#include "cryptlib.h" 62
63#include <openssl/buffer.h> 63#include <openssl/buffer.h>
64#include <openssl/txt_db.h> 64#include <openssl/txt_db.h>
65 65
diff --git a/src/lib/libssl/src/crypto/ui/ui_lib.c b/src/lib/libssl/src/crypto/ui/ui_lib.c
index fa171b4d21..c2fe62df33 100644
--- a/src/lib/libssl/src/crypto/ui/ui_lib.c
+++ b/src/lib/libssl/src/crypto/ui/ui_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ui_lib.c,v 1.24 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ui_lib.c,v 1.25 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -60,11 +60,10 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#include <openssl/buffer.h> 63#include <openssl/buffer.h>
66#include <openssl/ui.h>
67#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/ui.h>
66
68#include "ui_locl.h" 67#include "ui_locl.h"
69 68
70IMPLEMENT_STACK_OF(UI_STRING_ST) static const UI_METHOD *default_UI_meth = NULL; 69IMPLEMENT_STACK_OF(UI_STRING_ST) static const UI_METHOD *default_UI_meth = NULL;
diff --git a/src/lib/libssl/src/crypto/ui/ui_openssl.c b/src/lib/libssl/src/crypto/ui/ui_openssl.c
index 32298625ca..f7f01bb4f1 100644
--- a/src/lib/libssl/src/crypto/ui/ui_openssl.c
+++ b/src/lib/libssl/src/crypto/ui/ui_openssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ui_openssl.c,v 1.21 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: ui_openssl.c,v 1.22 2014/07/11 08:44:49 jsing Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) and others 2/* Written by Richard Levitte (richard@levitte.org) and others
3 * for the OpenSSL project 2001. 3 * for the OpenSSL project 2001.
4 */ 4 */
@@ -114,26 +114,23 @@
114 * [including the GNU Public Licence.] 114 * [including the GNU Public Licence.]
115 */ 115 */
116 116
117#include <sys/ioctl.h>
118
117#include <openssl/opensslconf.h> 119#include <openssl/opensslconf.h>
118 120
121#include <errno.h>
119#include <signal.h> 122#include <signal.h>
120#include <stdio.h> 123#include <stdio.h>
121#include <string.h> 124#include <string.h>
122#include <errno.h>
123
124#include <unistd.h>
125#include <termios.h> 125#include <termios.h>
126#include <unistd.h>
126 127
127#include "ui_locl.h" 128#include "ui_locl.h"
128#include "cryptlib.h"
129
130#include <sys/ioctl.h>
131 129
132#ifndef NX509_SIG 130#ifndef NX509_SIG
133#define NX509_SIG 32 131#define NX509_SIG 32
134#endif 132#endif
135 133
136
137/* Define globals. They are protected by a lock */ 134/* Define globals. They are protected by a lock */
138static struct sigaction savsig[NX509_SIG]; 135static struct sigaction savsig[NX509_SIG];
139 136
diff --git a/src/lib/libssl/src/crypto/x509/by_dir.c b/src/lib/libssl/src/crypto/x509/by_dir.c
index 110c22d6f5..a7dc2292bc 100644
--- a/src/lib/libssl/src/crypto/x509/by_dir.c
+++ b/src/lib/libssl/src/crypto/x509/by_dir.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: by_dir.c,v 1.31 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: by_dir.c,v 1.32 2014/07/11 08:44:49 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 *
@@ -66,15 +66,14 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h" 69#include <openssl/err.h>
70#include <openssl/lhash.h>
71#include <openssl/x509.h>
70 72
71#ifndef OPENSSL_NO_POSIX_IO 73#ifndef OPENSSL_NO_POSIX_IO
72# include <sys/stat.h> 74# include <sys/stat.h>
73#endif 75#endif
74 76
75#include <openssl/lhash.h>
76#include <openssl/x509.h>
77
78typedef struct lookup_dir_hashes_st { 77typedef struct lookup_dir_hashes_st {
79 unsigned long hash; 78 unsigned long hash;
80 int suffix; 79 int suffix;
diff --git a/src/lib/libssl/src/crypto/x509/by_file.c b/src/lib/libssl/src/crypto/x509/by_file.c
index cf3553181d..10adcfbd77 100644
--- a/src/lib/libssl/src/crypto/x509/by_file.c
+++ b/src/lib/libssl/src/crypto/x509/by_file.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: by_file.c,v 1.14 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: by_file.c,v 1.15 2014/07/11 08:44:49 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,12 +61,11 @@
61#include <time.h> 61#include <time.h>
62#include <unistd.h> 62#include <unistd.h>
63 63
64#include "cryptlib.h"
65#include <openssl/lhash.h>
66#include <openssl/buffer.h> 64#include <openssl/buffer.h>
67#include <openssl/x509.h> 65#include <openssl/err.h>
68#include <openssl/pem.h> 66#include <openssl/pem.h>
69 67#include <openssl/lhash.h>
68#include <openssl/x509.h>
70 69
71static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, 70static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
72 long argl, char **ret); 71 long argl, char **ret);
diff --git a/src/lib/libssl/src/crypto/x509/x509_att.c b/src/lib/libssl/src/crypto/x509/x509_att.c
index 241464d999..4ae7504cae 100644
--- a/src/lib/libssl/src/crypto/x509/x509_att.c
+++ b/src/lib/libssl/src/crypto/x509/x509_att.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_att.c,v 1.10 2014/07/03 21:21:11 miod Exp $ */ 1/* $OpenBSD: x509_att.c,v 1.11 2014/07/11 08:44:49 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,11 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/stack.h> 60
61#include "cryptlib.h"
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/objects.h> 62#include <openssl/err.h>
64#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include <openssl/stack.h>
65#include <openssl/x509.h> 66#include <openssl/x509.h>
66#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
67 68
diff --git a/src/lib/libssl/src/crypto/x509/x509_cmp.c b/src/lib/libssl/src/crypto/x509/x509_cmp.c
index 20b4ceba27..e26866dc80 100644
--- a/src/lib/libssl/src/crypto/x509/x509_cmp.c
+++ b/src/lib/libssl/src/crypto/x509/x509_cmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_cmp.c,v 1.21 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: x509_cmp.c,v 1.22 2014/07/11 08:44:49 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,8 +62,8 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/asn1.h> 65#include <openssl/asn1.h>
66#include <openssl/err.h>
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68#include <openssl/x509.h> 68#include <openssl/x509.h>
69#include <openssl/x509v3.h> 69#include <openssl/x509v3.h>
diff --git a/src/lib/libssl/src/crypto/x509/x509_d2.c b/src/lib/libssl/src/crypto/x509/x509_d2.c
index 9d42a63f30..cc22f4f470 100644
--- a/src/lib/libssl/src/crypto/x509/x509_d2.c
+++ b/src/lib/libssl/src/crypto/x509/x509_d2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_d2.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_d2.c,v 1.9 2014/07/11 08:44:49 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/crypto.h> 61#include <openssl/crypto.h>
62#include <openssl/err.h>
62#include <openssl/x509.h> 63#include <openssl/x509.h>
63 64
64int 65int
diff --git a/src/lib/libssl/src/crypto/x509/x509_ext.c b/src/lib/libssl/src/crypto/x509/x509_ext.c
index 9d4f1d1122..a5b5430ad4 100644
--- a/src/lib/libssl/src/crypto/x509/x509_ext.c
+++ b/src/lib/libssl/src/crypto/x509/x509_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_ext.c,v 1.7 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_ext.c,v 1.8 2014/07/11 08:44:49 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,15 +57,14 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/stack.h> 60
61#include "cryptlib.h"
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/objects.h>
64#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/stack.h>
65#include <openssl/x509.h> 65#include <openssl/x509.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68
69int 68int
70X509_CRL_get_ext_count(X509_CRL *x) 69X509_CRL_get_ext_count(X509_CRL *x)
71{ 70{
diff --git a/src/lib/libssl/src/crypto/x509/x509_lu.c b/src/lib/libssl/src/crypto/x509/x509_lu.c
index 1634ae951d..8d3e4f4dce 100644
--- a/src/lib/libssl/src/crypto/x509/x509_lu.c
+++ b/src/lib/libssl/src/crypto/x509/x509_lu.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_lu.c,v 1.15 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_lu.c,v 1.16 2014/07/11 08:44:49 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,8 @@
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/lhash.h> 62#include <openssl/lhash.h>
62#include <openssl/x509.h> 63#include <openssl/x509.h>
63#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
diff --git a/src/lib/libssl/src/crypto/x509/x509_obj.c b/src/lib/libssl/src/crypto/x509/x509_obj.c
index 88f058d882..f7f2a380a1 100644
--- a/src/lib/libssl/src/crypto/x509/x509_obj.c
+++ b/src/lib/libssl/src/crypto/x509/x509_obj.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_obj.c,v 1.15 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: x509_obj.c,v 1.16 2014/07/11 08:44:49 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,11 +59,11 @@
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/buffer.h>
63#include <openssl/err.h>
63#include <openssl/lhash.h> 64#include <openssl/lhash.h>
64#include <openssl/objects.h> 65#include <openssl/objects.h>
65#include <openssl/x509.h> 66#include <openssl/x509.h>
66#include <openssl/buffer.h>
67 67
68char * 68char *
69X509_NAME_oneline(X509_NAME *a, char *buf, int len) 69X509_NAME_oneline(X509_NAME *a, char *buf, int len)
diff --git a/src/lib/libssl/src/crypto/x509/x509_r2x.c b/src/lib/libssl/src/crypto/x509/x509_r2x.c
index e87dd11fba..9a9a59d9bb 100644
--- a/src/lib/libssl/src/crypto/x509/x509_r2x.c
+++ b/src/lib/libssl/src/crypto/x509/x509_r2x.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_r2x.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_r2x.c,v 1.9 2014/07/11 08:44:49 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,13 +57,14 @@
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/bn.h> 62#include <openssl/bn.h>
63#include <openssl/buffer.h>
64#include <openssl/err.h>
62#include <openssl/evp.h> 65#include <openssl/evp.h>
63#include <openssl/asn1.h>
64#include <openssl/x509.h>
65#include <openssl/objects.h> 66#include <openssl/objects.h>
66#include <openssl/buffer.h> 67#include <openssl/x509.h>
67 68
68X509 * 69X509 *
69X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) 70X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
diff --git a/src/lib/libssl/src/crypto/x509/x509_req.c b/src/lib/libssl/src/crypto/x509/x509_req.c
index d22fc12a70..22d2124614 100644
--- a/src/lib/libssl/src/crypto/x509/x509_req.c
+++ b/src/lib/libssl/src/crypto/x509/x509_req.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_req.c,v 1.14 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: x509_req.c,v 1.15 2014/07/11 08:44:49 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,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/bn.h>
65#include <openssl/evp.h>
66#include <openssl/asn1.h> 63#include <openssl/asn1.h>
67#include <openssl/asn1t.h> 64#include <openssl/asn1t.h>
68#include <openssl/x509.h> 65#include <openssl/bn.h>
69#include <openssl/objects.h>
70#include <openssl/buffer.h> 66#include <openssl/buffer.h>
67#include <openssl/err.h>
68#include <openssl/evp.h>
69#include <openssl/objects.h>
71#include <openssl/pem.h> 70#include <openssl/pem.h>
71#include <openssl/x509.h>
72 72
73X509_REQ * 73X509_REQ *
74X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) 74X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
diff --git a/src/lib/libssl/src/crypto/x509/x509_set.c b/src/lib/libssl/src/crypto/x509/x509_set.c
index 523c6621b1..3be557cbc0 100644
--- a/src/lib/libssl/src/crypto/x509/x509_set.c
+++ b/src/lib/libssl/src/crypto/x509/x509_set.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_set.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_set.c,v 1.9 2014/07/11 08:44:49 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 <openssl/objects.h>
63#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66int 66int
diff --git a/src/lib/libssl/src/crypto/x509/x509_trs.c b/src/lib/libssl/src/crypto/x509/x509_trs.c
index b8e01603c5..f104c1fd16 100644
--- a/src/lib/libssl/src/crypto/x509/x509_trs.c
+++ b/src/lib/libssl/src/crypto/x509/x509_trs.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_trs.c,v 1.14 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_trs.c,v 1.15 2014/07/11 08:44:49 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"
61#include <openssl/x509v3.h>
62 60
61#include <openssl/err.h>
62#include <openssl/x509v3.h>
63 63
64static int tr_cmp(const X509_TRUST * const *a, const X509_TRUST * const *b); 64static int tr_cmp(const X509_TRUST * const *a, const X509_TRUST * const *b);
65static void trtable_free(X509_TRUST *p); 65static void trtable_free(X509_TRUST *p);
diff --git a/src/lib/libssl/src/crypto/x509/x509_txt.c b/src/lib/libssl/src/crypto/x509/x509_txt.c
index b1b3f3e58d..14fa2378c4 100644
--- a/src/lib/libssl/src/crypto/x509/x509_txt.c
+++ b/src/lib/libssl/src/crypto/x509/x509_txt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_txt.c,v 1.18 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_txt.c,v 1.19 2014/07/11 08:44:49 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,17 +56,16 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <errno.h>
59#include <stdio.h> 60#include <stdio.h>
60#include <time.h> 61#include <time.h>
61#include <errno.h>
62 62
63#include "cryptlib.h" 63#include <openssl/asn1.h>
64#include <openssl/lhash.h>
65#include <openssl/buffer.h> 64#include <openssl/buffer.h>
66#include <openssl/evp.h> 65#include <openssl/evp.h>
67#include <openssl/asn1.h> 66#include <openssl/lhash.h>
68#include <openssl/x509.h>
69#include <openssl/objects.h> 67#include <openssl/objects.h>
68#include <openssl/x509.h>
70 69
71const char * 70const char *
72X509_verify_cert_error_string(long n) 71X509_verify_cert_error_string(long n)
diff --git a/src/lib/libssl/src/crypto/x509/x509_v3.c b/src/lib/libssl/src/crypto/x509/x509_v3.c
index 7425782ebf..a745e6f71b 100644
--- a/src/lib/libssl/src/crypto/x509/x509_v3.c
+++ b/src/lib/libssl/src/crypto/x509/x509_v3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_v3.c,v 1.9 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509_v3.c,v 1.10 2014/07/11 08:44:49 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,11 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/stack.h> 60
61#include "cryptlib.h"
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/objects.h> 62#include <openssl/err.h>
64#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include <openssl/stack.h>
65#include <openssl/x509.h> 66#include <openssl/x509.h>
66#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
67 68
diff --git a/src/lib/libssl/src/crypto/x509/x509_vfy.c b/src/lib/libssl/src/crypto/x509/x509_vfy.c
index 60067d220f..f7feb85f36 100644
--- a/src/lib/libssl/src/crypto/x509/x509_vfy.c
+++ b/src/lib/libssl/src/crypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.c,v 1.32 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.33 2014/07/11 08:44:49 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 *
@@ -64,15 +64,15 @@
64 64
65#include <openssl/opensslconf.h> 65#include <openssl/opensslconf.h>
66 66
67#include "cryptlib.h" 67#include <openssl/asn1.h>
68#include <openssl/crypto.h>
69#include <openssl/lhash.h>
70#include <openssl/buffer.h> 68#include <openssl/buffer.h>
69#include <openssl/crypto.h>
70#include <openssl/err.h>
71#include <openssl/evp.h> 71#include <openssl/evp.h>
72#include <openssl/asn1.h> 72#include <openssl/lhash.h>
73#include <openssl/objects.h>
73#include <openssl/x509.h> 74#include <openssl/x509.h>
74#include <openssl/x509v3.h> 75#include <openssl/x509v3.h>
75#include <openssl/objects.h>
76 76
77/* CRL score values */ 77/* CRL score values */
78 78
diff --git a/src/lib/libssl/src/crypto/x509/x509_vpm.c b/src/lib/libssl/src/crypto/x509/x509_vpm.c
index 3730d593cd..ec35267298 100644
--- a/src/lib/libssl/src/crypto/x509/x509_vpm.c
+++ b/src/lib/libssl/src/crypto/x509/x509_vpm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vpm.c,v 1.8 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: x509_vpm.c,v 1.9 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -59,10 +59,9 @@
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/buffer.h>
63#include <openssl/crypto.h> 63#include <openssl/crypto.h>
64#include <openssl/lhash.h> 64#include <openssl/lhash.h>
65#include <openssl/buffer.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/libssl/src/crypto/x509/x509cset.c b/src/lib/libssl/src/crypto/x509/x509cset.c
index 8ef19c2a40..a4442632f6 100644
--- a/src/lib/libssl/src/crypto/x509/x509cset.c
+++ b/src/lib/libssl/src/crypto/x509/x509cset.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509cset.c,v 1.7 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509cset.c,v 1.8 2014/07/11 08:44:49 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 2001. 3 * project 2001.
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 <openssl/objects.h>
63#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66int 66int
diff --git a/src/lib/libssl/src/crypto/x509/x509name.c b/src/lib/libssl/src/crypto/x509/x509name.c
index 4151ea0bc5..465a1cadb5 100644
--- a/src/lib/libssl/src/crypto/x509/x509name.c
+++ b/src/lib/libssl/src/crypto/x509/x509name.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509name.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: x509name.c,v 1.12 2014/07/11 08:44:49 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,11 +59,11 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include <openssl/stack.h>
63#include "cryptlib.h"
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/objects.h> 63#include <openssl/err.h>
66#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/objects.h>
66#include <openssl/stack.h>
67#include <openssl/x509.h> 67#include <openssl/x509.h>
68 68
69int 69int
diff --git a/src/lib/libssl/src/crypto/x509/x509rset.c b/src/lib/libssl/src/crypto/x509/x509rset.c
index 509f38b111..cfac977636 100644
--- a/src/lib/libssl/src/crypto/x509/x509rset.c
+++ b/src/lib/libssl/src/crypto/x509/x509rset.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509rset.c,v 1.5 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509rset.c,v 1.6 2014/07/11 08:44:49 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 <openssl/objects.h>
63#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66int 66int
diff --git a/src/lib/libssl/src/crypto/x509/x509spki.c b/src/lib/libssl/src/crypto/x509/x509spki.c
index 28e499b9b2..cd29a8138a 100644
--- a/src/lib/libssl/src/crypto/x509/x509spki.c
+++ b/src/lib/libssl/src/crypto/x509/x509spki.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509spki.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: x509spki.c,v 1.12 2014/07/11 08:44:49 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,7 @@
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/err.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
64 64
65int 65int
diff --git a/src/lib/libssl/src/crypto/x509/x509type.c b/src/lib/libssl/src/crypto/x509/x509type.c
index 29f38e2a9a..58335b4e64 100644
--- a/src/lib/libssl/src/crypto/x509/x509type.c
+++ b/src/lib/libssl/src/crypto/x509/x509type.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509type.c,v 1.10 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: x509type.c,v 1.11 2014/07/11 08:44:49 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/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libssl/src/crypto/x509/x_all.c b/src/lib/libssl/src/crypto/x509/x_all.c
index f01e47416d..edb5f520fa 100644
--- a/src/lib/libssl/src/crypto/x509/x_all.c
+++ b/src/lib/libssl/src/crypto/x509/x_all.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_all.c,v 1.17 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: x_all.c,v 1.18 2014/07/11 08:44:49 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,18 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include <openssl/stack.h>
64#include "cryptlib.h"
65#include <openssl/buffer.h>
66#include <openssl/asn1.h> 63#include <openssl/asn1.h>
64#include <openssl/buffer.h>
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/stack.h>
68#include <openssl/x509.h> 67#include <openssl/x509.h>
69#ifndef OPENSSL_NO_RSA 68
70#include <openssl/rsa.h>
71#endif
72#ifndef OPENSSL_NO_DSA 69#ifndef OPENSSL_NO_DSA
73#include <openssl/dsa.h> 70#include <openssl/dsa.h>
74#endif 71#endif
72#ifndef OPENSSL_NO_RSA
73#include <openssl/rsa.h>
74#endif
75 75
76int 76int
77X509_verify(X509 *a, EVP_PKEY *r) 77X509_verify(X509 *a, EVP_PKEY *r)
diff --git a/src/lib/libssl/src/crypto/x509v3/pcy_cache.c b/src/lib/libssl/src/crypto/x509v3/pcy_cache.c
index 6f50cff451..9c8ba8298b 100644
--- a/src/lib/libssl/src/crypto/x509v3/pcy_cache.c
+++ b/src/lib/libssl/src/crypto/x509v3/pcy_cache.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_cache.c,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: pcy_cache.c,v 1.5 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,7 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59#include "cryptlib.h"
60#include <openssl/x509.h> 59#include <openssl/x509.h>
61#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
62 61
diff --git a/src/lib/libssl/src/crypto/x509v3/pcy_data.c b/src/lib/libssl/src/crypto/x509v3/pcy_data.c
index 773faaf1e7..698ca6ace5 100644
--- a/src/lib/libssl/src/crypto/x509v3/pcy_data.c
+++ b/src/lib/libssl/src/crypto/x509v3/pcy_data.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_data.c,v 1.7 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: pcy_data.c,v 1.8 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,7 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59#include "cryptlib.h"
60#include <openssl/x509.h> 59#include <openssl/x509.h>
61#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
62 61
diff --git a/src/lib/libssl/src/crypto/x509v3/pcy_lib.c b/src/lib/libssl/src/crypto/x509v3/pcy_lib.c
index 2a1f827570..321370e135 100644
--- a/src/lib/libssl/src/crypto/x509v3/pcy_lib.c
+++ b/src/lib/libssl/src/crypto/x509v3/pcy_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_lib.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: pcy_lib.c,v 1.4 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,8 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59
60#include "cryptlib.h"
61#include <openssl/x509.h> 59#include <openssl/x509.h>
62#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
63 61
diff --git a/src/lib/libssl/src/crypto/x509v3/pcy_map.c b/src/lib/libssl/src/crypto/x509v3/pcy_map.c
index a22de52631..6ee1ffe895 100644
--- a/src/lib/libssl/src/crypto/x509v3/pcy_map.c
+++ b/src/lib/libssl/src/crypto/x509v3/pcy_map.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_map.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: pcy_map.c,v 1.4 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,7 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59#include "cryptlib.h"
60#include <openssl/x509.h> 59#include <openssl/x509.h>
61#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
62 61
diff --git a/src/lib/libssl/src/crypto/x509v3/pcy_tree.c b/src/lib/libssl/src/crypto/x509v3/pcy_tree.c
index aaf27e9802..2c6472a8a1 100644
--- a/src/lib/libssl/src/crypto/x509v3/pcy_tree.c
+++ b/src/lib/libssl/src/crypto/x509v3/pcy_tree.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_tree.c,v 1.11 2014/07/09 16:59:33 miod Exp $ */ 1/* $OpenBSD: pcy_tree.c,v 1.12 2014/07/11 08:44:49 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 2004. 3 * project 2004.
4 */ 4 */
@@ -56,7 +56,6 @@
56 * 56 *
57 */ 57 */
58 58
59#include "cryptlib.h"
60#include <openssl/x509.h> 59#include <openssl/x509.h>
61#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
62 61
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_addr.c b/src/lib/libssl/src/crypto/x509v3/v3_addr.c
index 9099994dc4..28031a0754 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_addr.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_addr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_addr.c,v 1.11 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: v3_addr.c,v 1.12 2014/07/11 08:44:49 jsing Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -65,11 +65,10 @@
65 65
66#include <openssl/opensslconf.h> 66#include <openssl/opensslconf.h>
67 67
68#include "cryptlib.h"
69#include <openssl/conf.h>
70#include <openssl/asn1.h> 68#include <openssl/asn1.h>
71#include <openssl/asn1t.h> 69#include <openssl/asn1t.h>
72#include <openssl/buffer.h> 70#include <openssl/buffer.h>
71#include <openssl/conf.h>
73#include <openssl/x509v3.h> 72#include <openssl/x509v3.h>
74 73
75#ifndef OPENSSL_NO_RFC3779 74#ifndef OPENSSL_NO_RFC3779
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_akey.c b/src/lib/libssl/src/crypto/x509v3/v3_akey.c
index 870b5415d0..b0beb55fee 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_akey.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_akey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_akey.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_akey.c,v 1.12 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, 68static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_akeya.c b/src/lib/libssl/src/crypto/x509v3/v3_akeya.c
index 14aa03acab..247c9f48a9 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_akeya.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_akeya.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_akeya.c,v 1.4 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_akeya.c,v 1.5 2014/07/11 08:44:49 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,10 +57,10 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/conf.h>
62#include <openssl/asn1.h> 61#include <openssl/asn1.h>
63#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/conf.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66ASN1_SEQUENCE(AUTHORITY_KEYID) = { 66ASN1_SEQUENCE(AUTHORITY_KEYID) = {
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_alt.c b/src/lib/libssl/src/crypto/x509v3/v3_alt.c
index eaf17938fe..7ae4b6bd97 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_alt.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_alt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_alt.c,v 1.20 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_alt.c,v 1.21 2014/07/11 08:44:49 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 */
@@ -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/conf.h> 62#include <openssl/conf.h>
63#include <openssl/err.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, 66static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_asid.c b/src/lib/libssl/src/crypto/x509v3/v3_asid.c
index 473304c1e5..4ff8f0da37 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_asid.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_asid.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_asid.c,v 1.9 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: v3_asid.c,v 1.10 2014/07/11 08:44:49 jsing Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -65,13 +65,12 @@
65 65
66#include <openssl/opensslconf.h> 66#include <openssl/opensslconf.h>
67 67
68#include "cryptlib.h"
69#include <openssl/conf.h>
70#include <openssl/asn1.h> 68#include <openssl/asn1.h>
71#include <openssl/asn1t.h> 69#include <openssl/asn1t.h>
70#include <openssl/bn.h>
71#include <openssl/conf.h>
72#include <openssl/x509v3.h> 72#include <openssl/x509v3.h>
73#include <openssl/x509.h> 73#include <openssl/x509.h>
74#include <openssl/bn.h>
75 74
76#ifndef OPENSSL_NO_RFC3779 75#ifndef OPENSSL_NO_RFC3779
77 76
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_bcons.c b/src/lib/libssl/src/crypto/x509v3/v3_bcons.c
index ec7e68f82c..8e2632d379 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_bcons.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_bcons.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_bcons.c,v 1.9 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_bcons.c,v 1.10 2014/07/11 08:44:49 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/asn1.h> 62#include <openssl/asn1.h>
64#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
65#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, 68static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_bitst.c b/src/lib/libssl/src/crypto/x509v3/v3_bitst.c
index 3be899252a..c0c6ad3d8c 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_bitst.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_bitst.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_bitst.c,v 1.9 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_bitst.c,v 1.10 2014/07/11 08:44:49 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,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/conf.h> 62#include <openssl/conf.h>
63#include <openssl/err.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static BIT_STRING_BITNAME ns_cert_type_table[] = { 66static BIT_STRING_BITNAME ns_cert_type_table[] = {
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_conf.c b/src/lib/libssl/src/crypto/x509v3/v3_conf.c
index c827128403..c25e75c23b 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_conf.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_conf.c,v 1.14 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_conf.c,v 1.15 2014/07/11 08:44:49 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 */
@@ -61,8 +61,8 @@
61#include <stdio.h> 61#include <stdio.h>
62#include <string.h> 62#include <string.h>
63 63
64#include "cryptlib.h"
65#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
68 68
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_cpols.c b/src/lib/libssl/src/crypto/x509v3/v3_cpols.c
index 88552a0297..51d02abd22 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_cpols.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_cpols.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_cpols.c,v 1.14 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_cpols.c,v 1.15 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68#include "pcy_int.h" 68#include "pcy_int.h"
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_crld.c b/src/lib/libssl/src/crypto/x509v3/v3_crld.c
index 0fa2ff26cd..aac0c7706e 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_crld.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_crld.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_crld.c,v 1.11 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_crld.c,v 1.12 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static void *v2i_crld(const X509V3_EXT_METHOD *method, 68static void *v2i_crld(const X509V3_EXT_METHOD *method,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_enum.c b/src/lib/libssl/src/crypto/x509v3/v3_enum.c
index 42ba341617..8900d7e01b 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_enum.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_enum.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_enum.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_enum.c,v 1.9 2014/07/11 08:44:49 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/x509v3.h> 61#include <openssl/x509v3.h>
62 62
63static ENUMERATED_NAMES crl_reasons[] = { 63static ENUMERATED_NAMES crl_reasons[] = {
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_extku.c b/src/lib/libssl/src/crypto/x509v3/v3_extku.c
index a60bf08f09..0f36a99525 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_extku.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_extku.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_extku.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_extku.c,v 1.9 2014/07/11 08:44:49 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 */
@@ -56,11 +56,11 @@
56 * 56 *
57 */ 57 */
58 58
59
60#include <stdio.h> 59#include <stdio.h>
61#include "cryptlib.h" 60
62#include <openssl/asn1t.h> 61#include <openssl/asn1t.h>
63#include <openssl/conf.h> 62#include <openssl/conf.h>
63#include <openssl/err.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, 66static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_genn.c b/src/lib/libssl/src/crypto/x509v3/v3_genn.c
index 36907e3b59..716f4a7b99 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_genn.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_genn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_genn.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_genn.c,v 1.9 2014/07/11 08:44:49 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 */
@@ -58,7 +58,7 @@
58 58
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61
62#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/conf.h> 63#include <openssl/conf.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_ia5.c b/src/lib/libssl/src/crypto/x509v3/v3_ia5.c
index 07f44400a3..a9ac7197b6 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_ia5.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_ia5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_ia5.c,v 1.12 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_ia5.c,v 1.13 2014/07/11 08:44:49 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,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/conf.h> 63#include <openssl/conf.h>
64#include <openssl/err.h>
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66 66
67static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5); 67static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5);
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_info.c b/src/lib/libssl/src/crypto/x509v3/v3_info.c
index c70a22bf0e..8e590ed808 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_info.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_info.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_info.c,v 1.17 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_info.c,v 1.18 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS( 68static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_int.c b/src/lib/libssl/src/crypto/x509v3/v3_int.c
index b8ced906af..e1f6eb1c0a 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_int.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_int.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_int.c,v 1.9 2014/07/11 08:44:49 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/x509v3.h> 61#include <openssl/x509v3.h>
62 62
63const X509V3_EXT_METHOD v3_crl_num = { 63const X509V3_EXT_METHOD v3_crl_num = {
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_lib.c b/src/lib/libssl/src/crypto/x509v3/v3_lib.c
index 21cd35b59f..8870177f51 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_lib.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_lib.c,v 1.12 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_lib.c,v 1.13 2014/07/11 08:44:49 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 */
@@ -58,8 +58,9 @@
58/* X509 v3 extension utilities */ 58/* X509 v3 extension utilities */
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61
62#include <openssl/conf.h> 62#include <openssl/conf.h>
63#include <openssl/err.h>
63#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
64 65
65#include "ext_dat.h" 66#include "ext_dat.h"
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_ncons.c b/src/lib/libssl/src/crypto/x509v3/v3_ncons.c
index b44b24dbd4..7768dabb1f 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_ncons.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_ncons.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_ncons.c,v 1.4 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_ncons.c,v 1.5 2014/07/11 08:44:49 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 */
@@ -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/conf.h> 63#include <openssl/conf.h>
64#include <openssl/err.h>
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66 66
67static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, 67static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_ocsp.c b/src/lib/libssl/src/crypto/x509v3/v3_ocsp.c
index 0406c83be3..d606240b12 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_ocsp.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_ocsp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_ocsp.c,v 1.9 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: v3_ocsp.c,v 1.10 2014/07/11 08:44:49 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 */
@@ -63,9 +63,9 @@
63 63
64#ifndef OPENSSL_NO_OCSP 64#ifndef OPENSSL_NO_OCSP
65 65
66#include "cryptlib.h"
67#include <openssl/conf.h>
68#include <openssl/asn1.h> 66#include <openssl/asn1.h>
67#include <openssl/conf.h>
68#include <openssl/err.h>
69#include <openssl/ocsp.h> 69#include <openssl/ocsp.h>
70#include <openssl/x509v3.h> 70#include <openssl/x509v3.h>
71 71
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_pci.c b/src/lib/libssl/src/crypto/x509v3/v3_pci.c
index 56b955c9c3..d3f73352d9 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_pci.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_pci.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pci.c,v 1.7 2014/07/10 21:57:20 miod Exp $ */ 1/* $OpenBSD: v3_pci.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */
2/* Contributed to the OpenSSL Project 2004 2/* Contributed to the OpenSSL Project 2004
3 * by Richard Levitte (richard@levitte.org) 3 * by Richard Levitte (richard@levitte.org)
4 */ 4 */
@@ -37,8 +37,8 @@
37#include <stdio.h> 37#include <stdio.h>
38#include <string.h> 38#include <string.h>
39 39
40#include "cryptlib.h"
41#include <openssl/conf.h> 40#include <openssl/conf.h>
41#include <openssl/err.h>
42#include <openssl/x509v3.h> 42#include <openssl/x509v3.h>
43 43
44static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext, 44static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_pcons.c b/src/lib/libssl/src/crypto/x509v3/v3_pcons.c
index 8405123160..64e1f44b21 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_pcons.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_pcons.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pcons.c,v 1.4 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_pcons.c,v 1.5 2014/07/11 08:44:49 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 */
@@ -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/asn1.h> 62#include <openssl/asn1.h>
64#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
65#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68static STACK_OF(CONF_VALUE) * 68static STACK_OF(CONF_VALUE) *
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_pku.c b/src/lib/libssl/src/crypto/x509v3/v3_pku.c
index 6008438f0f..6cfbc3bd3e 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_pku.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_pku.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pku.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_pku.c,v 1.9 2014/07/11 08:44:49 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/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_pmaps.c b/src/lib/libssl/src/crypto/x509v3/v3_pmaps.c
index 7173b6f9eb..9b09518b5d 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_pmaps.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_pmaps.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_pmaps.c,v 1.3 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_pmaps.c,v 1.4 2014/07/11 08:44:49 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 */
@@ -58,9 +58,10 @@
58 58
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61
62#include <openssl/asn1t.h> 62#include <openssl/asn1t.h>
63#include <openssl/conf.h> 63#include <openssl/conf.h>
64#include <openssl/err.h>
64#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
65 66
66static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, 67static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_prn.c b/src/lib/libssl/src/crypto/x509v3/v3_prn.c
index 81bd8e69eb..037d129c87 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_prn.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_prn.c,v 1.16 2014/06/12 15:49:31 deraadt Exp $ */ 1/* $OpenBSD: v3_prn.c,v 1.17 2014/07/11 08:44:49 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 */
@@ -58,7 +58,7 @@
58/* X509 v3 extension utilities */ 58/* X509 v3 extension utilities */
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61
62#include <openssl/conf.h> 62#include <openssl/conf.h>
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
64 64
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_purp.c b/src/lib/libssl/src/crypto/x509v3/v3_purp.c
index 0d4b9aae64..03fb427277 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_purp.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_purp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_purp.c,v 1.20 2014/07/10 22:45:58 jsing Exp $ */ 1/* $OpenBSD: v3_purp.c,v 1.21 2014/07/11 08:44:49 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 2001. 3 * project 2001.
4 */ 4 */
@@ -61,7 +61,7 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h" 64#include <openssl/err.h>
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66#include <openssl/x509_vfy.h> 66#include <openssl/x509_vfy.h>
67 67
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_skey.c b/src/lib/libssl/src/crypto/x509v3/v3_skey.c
index ee9508f886..ab2521f21a 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_skey.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_skey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_skey.c,v 1.9 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_skey.c,v 1.10 2014/07/11 08:44:49 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,7 @@
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/err.h>
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
64 64
65static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, 65static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_sxnet.c b/src/lib/libssl/src/crypto/x509v3/v3_sxnet.c
index 9688fa396c..81e8ab67dd 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_sxnet.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_sxnet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_sxnet.c,v 1.10 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_sxnet.c,v 1.11 2014/07/11 08:44:49 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/conf.h>
64#include <openssl/asn1.h> 62#include <openssl/asn1.h>
65#include <openssl/asn1t.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h>
65#include <openssl/err.h>
66#include <openssl/x509v3.h> 66#include <openssl/x509v3.h>
67 67
68/* Support for Thawte strong extranet extension */ 68/* Support for Thawte strong extranet extension */
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_utl.c b/src/lib/libssl/src/crypto/x509v3/v3_utl.c
index 25116573ba..d9987e32a5 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_utl.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_utl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_utl.c,v 1.21 2014/07/10 13:58:23 jsing Exp $ */ 1/* $OpenBSD: v3_utl.c,v 1.22 2014/07/11 08:44:49 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 */
@@ -61,10 +61,10 @@
61#include <stdio.h> 61#include <stdio.h>
62#include <string.h> 62#include <string.h>
63 63
64#include "cryptlib.h" 64#include <openssl/bn.h>
65#include <openssl/conf.h> 65#include <openssl/conf.h>
66#include <openssl/err.h>
66#include <openssl/x509v3.h> 67#include <openssl/x509v3.h>
67#include <openssl/bn.h>
68 68
69static char *strip_spaces(char *name); 69static char *strip_spaces(char *name);
70static int sk_strcmp(const char * const *a, const char * const *b); 70static int sk_strcmp(const char * const *a, const char * const *b);