From 74e2c009c83ad374bd6acdcfc376a384e25ab007 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 11 Jul 2014 08:44:49 +0000 Subject: 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@ --- src/lib/libcrypto/pem/pem_all.c | 16 ++++++++-------- src/lib/libcrypto/pem/pem_info.c | 15 ++++++++------- src/lib/libcrypto/pem/pem_lib.c | 13 +++++++------ src/lib/libcrypto/pem/pem_oth.c | 9 +++++---- src/lib/libcrypto/pem/pem_pk8.c | 11 ++++++----- src/lib/libcrypto/pem/pem_pkey.c | 11 ++++++----- src/lib/libcrypto/pem/pem_seal.c | 7 ++++--- src/lib/libcrypto/pem/pem_sign.c | 9 +++++---- src/lib/libcrypto/pem/pem_x509.c | 8 ++++---- src/lib/libcrypto/pem/pem_xaux.c | 8 ++++---- src/lib/libcrypto/pem/pvkfmt.c | 7 ++++--- 11 files changed, 61 insertions(+), 53 deletions(-) (limited to 'src/lib/libcrypto/pem') 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 @@ -/* $OpenBSD: pem_all.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ +/* $OpenBSD: pem_all.c,v 1.15 2014/07/11 08:44:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -113,20 +113,20 @@ #include -#include "cryptlib.h" #include #include -#include -#include #include -#ifndef OPENSSL_NO_RSA -#include +#include +#include + +#ifndef OPENSSL_NO_DH +#include #endif #ifndef OPENSSL_NO_DSA #include #endif -#ifndef OPENSSL_NO_DH -#include +#ifndef OPENSSL_NO_RSA +#include #endif #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 @@ -/* $OpenBSD: pem_info.c,v 1.18 2014/07/10 22:45:57 jsing Exp $ */ +/* $OpenBSD: pem_info.c,v 1.19 2014/07/11 08:44:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -61,18 +61,19 @@ #include -#include "cryptlib.h" #include -#include +#include #include -#include +#include #include -#ifndef OPENSSL_NO_RSA -#include -#endif +#include + #ifndef OPENSSL_NO_DSA #include #endif +#ifndef OPENSSL_NO_RSA +#include +#endif STACK_OF(X509_INFO) * PEM_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 @@ -/* $OpenBSD: pem_lib.c,v 1.32 2014/07/10 22:45:57 jsing Exp $ */ +/* $OpenBSD: pem_lib.c,v 1.33 2014/07/11 08:44:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -62,15 +62,14 @@ #include -#include "cryptlib.h" #include -#include #include -#include -#include +#include #include #include -#include "asn1_locl.h" +#include +#include + #ifndef OPENSSL_NO_DES #include #endif @@ -78,6 +77,8 @@ #include #endif +#include "asn1_locl.h" + #define MIN_LENGTH 4 static 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 @@ -/* $OpenBSD: pem_oth.c,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: pem_oth.c,v 1.6 2014/07/11 08:44:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,13 +57,14 @@ */ #include -#include "cryptlib.h" + #include -#include +#include #include +#include +#include #include #include -#include /* Handle 'other' PEMs: not private keys */ 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 @@ -/* $OpenBSD: pem_pk8.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: pem_pk8.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,14 +57,15 @@ */ #include -#include "cryptlib.h" + #include -#include +#include #include +#include +#include +#include #include #include -#include -#include static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid, 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 @@ -/* $OpenBSD: pem_pkey.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ +/* $OpenBSD: pem_pkey.c,v 1.17 2014/07/11 08:44:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -61,17 +61,18 @@ #include -#include "cryptlib.h" #include -#include #include +#include +#include +#include #include #include -#include -#include + #ifndef OPENSSL_NO_ENGINE #include #endif + #include "asn1_locl.h" int 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 @@ -/* $OpenBSD: pem_seal.c,v 1.19 2014/07/10 22:45:57 jsing Exp $ */ +/* $OpenBSD: pem_seal.c,v 1.20 2014/07/11 08:44:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -62,13 +62,14 @@ #include /* for OPENSSL_NO_RSA */ #ifndef OPENSSL_NO_RSA -#include "cryptlib.h" + +#include #include #include #include -#include #include #include +#include int PEM_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 @@ -/* $OpenBSD: pem_sign.c,v 1.10 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: pem_sign.c,v 1.11 2014/07/11 08:44:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,12 +57,13 @@ */ #include -#include "cryptlib.h" -#include + +#include #include #include -#include #include +#include +#include void PEM_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 @@ -/* $OpenBSD: pem_x509.c,v 1.5 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: pem_x509.c,v 1.6 2014/07/11 08:44:49 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -57,11 +57,11 @@ */ #include -#include "cryptlib.h" + #include #include -#include -#include #include +#include +#include IMPLEMENT_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 @@ -/* $OpenBSD: pem_xaux.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: pem_xaux.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -57,12 +57,12 @@ */ #include -#include "cryptlib.h" + #include #include -#include -#include #include +#include +#include IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX) IMPLEMENT_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 @@ -/* $OpenBSD: pvkfmt.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ +/* $OpenBSD: pvkfmt.c,v 1.9 2014/07/11 08:44:49 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2005. */ @@ -64,10 +64,11 @@ #include -#include "cryptlib.h" +#include +#include #include #include -#include + #if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) #include #include -- cgit v1.2.3-55-g6feb