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/bn/bn_add.c | 6 ++++-- src/lib/libcrypto/bn/bn_asm.c | 3 +-- src/lib/libcrypto/bn/bn_blind.c | 5 +++-- src/lib/libcrypto/bn/bn_ctx.c | 5 +++-- src/lib/libcrypto/bn/bn_depr.c | 6 +++--- src/lib/libcrypto/bn/bn_div.c | 7 ++++--- src/lib/libcrypto/bn/bn_exp.c | 5 +++-- src/lib/libcrypto/bn/bn_exp2.c | 6 ++++-- src/lib/libcrypto/bn/bn_gcd.c | 5 +++-- src/lib/libcrypto/bn/bn_gf2m.c | 5 +++-- src/lib/libcrypto/bn/bn_kron.c | 3 +-- src/lib/libcrypto/bn/bn_lib.c | 5 +++-- src/lib/libcrypto/bn/bn_mod.c | 5 +++-- src/lib/libcrypto/bn/bn_mont.c | 3 +-- src/lib/libcrypto/bn/bn_mpi.c | 6 ++++-- src/lib/libcrypto/bn/bn_mul.c | 3 +-- src/lib/libcrypto/bn/bn_nist.c | 7 +++---- src/lib/libcrypto/bn/bn_prime.c | 7 ++++--- src/lib/libcrypto/bn/bn_print.c | 5 +++-- src/lib/libcrypto/bn/bn_rand.c | 8 +++++--- src/lib/libcrypto/bn/bn_recp.c | 6 ++++-- src/lib/libcrypto/bn/bn_shift.c | 3 +-- src/lib/libcrypto/bn/bn_sqr.c | 3 +-- src/lib/libcrypto/bn/bn_sqrt.c | 6 +++--- src/lib/libcrypto/bn/bn_word.c | 4 ++-- 25 files changed, 70 insertions(+), 57 deletions(-) (limited to 'src/lib/libcrypto/bn') 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 @@ -/* $OpenBSD: bn_add.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_add.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,7 +57,9 @@ */ #include -#include "cryptlib.h" + +#include + #include "bn_lcl.h" /* 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 @@ -/* $OpenBSD: bn_asm.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_asm.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -66,7 +66,6 @@ #include -#include "cryptlib.h" #include "bn_lcl.h" #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 @@ -/* $OpenBSD: bn_blind.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_blind.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -113,7 +113,8 @@ #include -#include "cryptlib.h" +#include + #include "bn_lcl.h" #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 @@ -/* $OpenBSD: bn_ctx.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_ctx.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */ /* Written by Ulf Moeller for the OpenSSL project. */ /* ==================================================================== * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. @@ -66,7 +66,8 @@ #include -#include "cryptlib.h" +#include + #include "bn_lcl.h" /* 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 @@ -/* $OpenBSD: bn_depr.c,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_depr.c,v 1.6 2014/07/11 08:44:47 jsing Exp $ */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * @@ -61,10 +61,10 @@ #include -#include "cryptlib.h" -#include "bn_lcl.h" #include +#include "bn_lcl.h" + #ifndef OPENSSL_NO_DEPRECATED BIGNUM * BN_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 @@ -/* $OpenBSD: bn_div.c,v 1.21 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_div.c,v 1.22 2014/07/11 08:44:47 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,11 +57,12 @@ */ #include -#include #include -#include "cryptlib.h" +#include +#include + #include "bn_lcl.h" #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 @@ -/* $OpenBSD: bn_exp.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ +/* $OpenBSD: bn_exp.c,v 1.18 2014/07/11 08:44:47 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -112,7 +112,8 @@ #include #include -#include "cryptlib.h" +#include + #include "bn_lcl.h" /* 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 @@ -/* $OpenBSD: bn_exp2.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_exp2.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -110,7 +110,9 @@ */ #include -#include "cryptlib.h" + +#include + #include "bn_lcl.h" #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 @@ -/* $OpenBSD: bn_gcd.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_gcd.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -109,7 +109,8 @@ * */ -#include "cryptlib.h" +#include + #include "bn_lcl.h" static 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 @@ -/* $OpenBSD: bn_gf2m.c,v 1.14 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_gf2m.c,v 1.15 2014/07/11 08:44:47 jsing Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -94,7 +94,8 @@ #include -#include "cryptlib.h" +#include + #include "bn_lcl.h" #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 @@ -/* $OpenBSD: bn_kron.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_kron.c,v 1.5 2014/07/11 08:44:48 jsing Exp $ */ /* ==================================================================== * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. * @@ -53,7 +53,6 @@ * */ -#include "cryptlib.h" #include "bn_lcl.h" /* 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 @@ -/* $OpenBSD: bn_lib.c,v 1.31 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_lib.c,v 1.32 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -68,7 +68,8 @@ #include -#include "cryptlib.h" +#include + #include "bn_lcl.h" /* 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 @@ -/* $OpenBSD: bn_mod.c,v 1.7 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_mod.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */ /* Includes code written by Lenka Fibikova * for the OpenSSL project. */ /* ==================================================================== @@ -111,7 +111,8 @@ * [including the GNU Public Licence.] */ -#include "cryptlib.h" +#include + #include "bn_lcl.h" int 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 @@ -/* $OpenBSD: bn_mont.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ +/* $OpenBSD: bn_mont.c,v 1.23 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -119,7 +119,6 @@ #include #include -#include "cryptlib.h" #include "bn_lcl.h" #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 @@ -/* $OpenBSD: bn_mpi.c,v 1.6 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_mpi.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,7 +57,9 @@ */ #include -#include "cryptlib.h" + +#include + #include "bn_lcl.h" int 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 @@ -/* $OpenBSD: bn_mul.c,v 1.18 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_mul.c,v 1.19 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -67,7 +67,6 @@ #include -#include "cryptlib.h" #include "bn_lcl.h" #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 @@ -/* $OpenBSD: bn_nist.c,v 1.13 2014/07/10 13:58:22 jsing Exp $ */ +/* $OpenBSD: bn_nist.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -56,12 +56,11 @@ * */ +#include + #include #include "bn_lcl.h" -#include "cryptlib.h" - -#include #define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2 #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 @@ -/* $OpenBSD: bn_prime.c,v 1.9 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_prime.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -111,10 +111,11 @@ #include #include -#include "cryptlib.h" -#include "bn_lcl.h" + #include +#include "bn_lcl.h" + /* NB: these functions have been "upgraded", the deprecated versions (which are * compatibility wrappers using these functions) are in bn_depr.c. * - 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 @@ -/* $OpenBSD: bn_print.c,v 1.21 2014/07/10 22:45:56 jsing Exp $ */ +/* $OpenBSD: bn_print.c,v 1.22 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -61,9 +61,10 @@ #include +#include #include +#include -#include "cryptlib.h" #include "bn_lcl.h" static 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 @@ -/* $OpenBSD: bn_rand.c,v 1.14 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_rand.c,v 1.15 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -111,10 +111,12 @@ #include #include -#include "cryptlib.h" -#include "bn_lcl.h" + +#include #include +#include "bn_lcl.h" + static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) { 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 @@ -/* $OpenBSD: bn_recp.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_recp.c,v 1.11 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,7 +57,9 @@ */ #include -#include "cryptlib.h" + +#include + #include "bn_lcl.h" void 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 @@ -/* $OpenBSD: bn_shift.c,v 1.11 2014/07/10 13:58:22 jsing Exp $ */ +/* $OpenBSD: bn_shift.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -59,7 +59,6 @@ #include #include -#include "cryptlib.h" #include "bn_lcl.h" int 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 @@ -/* $OpenBSD: bn_sqr.c,v 1.9 2014/07/10 13:58:22 jsing Exp $ */ +/* $OpenBSD: bn_sqr.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -59,7 +59,6 @@ #include #include -#include "cryptlib.h" #include "bn_lcl.h" /* 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 @@ -/* $OpenBSD: bn_sqrt.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_sqrt.c,v 1.5 2014/07/11 08:44:48 jsing Exp $ */ /* Written by Lenka Fibikova * and Bodo Moeller for the OpenSSL project. */ /* ==================================================================== @@ -55,9 +55,9 @@ * */ -#include "cryptlib.h" -#include "bn_lcl.h" +#include +#include "bn_lcl.h" BIGNUM * BN_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 @@ -/* $OpenBSD: bn_word.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_word.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,7 +57,7 @@ */ #include -#include "cryptlib.h" + #include "bn_lcl.h" BN_ULONG -- cgit v1.2.3-55-g6feb