From 685707979100dcb344f3d5f29940afcb1e7a92c2 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 14 May 2015 14:54:49 +0200 Subject: [PATCH] Identify and move OpenSSL internal header files There are header files in crypto/ that are used by the rest of OpenSSL. Move those to include/internal and adapt the affected source code, Makefiles and scripts. The header files that got moved are: crypto/constant_time_locl.h crypto/o_dir.h crypto/o_str.h Reviewed-by: Matt Caswell --- crypto/Makefile | 3 +-- crypto/o_dir.c | 2 +- crypto/o_dir_test.c | 2 +- crypto/o_str.c | 2 +- crypto/rsa/rsa_oaep.c | 2 +- crypto/rsa/rsa_pk1.c | 2 +- e_os.h | 4 ++-- {crypto => include/internal}/constant_time_locl.h | 0 {crypto => include/internal}/o_dir.h | 0 {crypto => include/internal}/o_str.h | 0 ssl/Makefile | 2 +- ssl/record/ssl3_record.c | 2 +- ssl/s3_cbc.c | 2 +- ssl/s3_srvr.c | 2 +- ssl/ssl_cert.c | 2 +- test/constant_time_test.c | 2 +- util/mkdef.pl | 4 ++-- 17 files changed, 16 insertions(+), 17 deletions(-) rename {crypto => include/internal}/constant_time_locl.h (100%) rename {crypto => include/internal}/o_dir.h (100%) rename {crypto => include/internal}/o_str.h (100%) diff --git a/crypto/Makefile b/crypto/Makefile index 5270d75e19..de74a0fe25 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -43,8 +43,7 @@ LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \ SRC= $(LIBSRC) -HEADER= cryptlib.h buildinf.h md32_common.h o_str.h o_dir.h \ - constant_time_locl.h +HEADER= cryptlib.h buildinf.h md32_common.h ALL= $(GENERAL) $(SRC) $(HEADER) diff --git a/crypto/o_dir.c b/crypto/o_dir.c index 26242444c8..7bff74e0ec 100644 --- a/crypto/o_dir.c +++ b/crypto/o_dir.c @@ -70,7 +70,7 @@ #define LP_find_file OPENSSL_DIR_read #define LP_find_file_end OPENSSL_DIR_end -#include "o_dir.h" +#include "internal/o_dir.h" #define LPDIR_H #if defined OPENSSL_SYS_UNIX || defined DJGPP diff --git a/crypto/o_dir_test.c b/crypto/o_dir_test.c index 7cdbbbc403..733ffecf3a 100644 --- a/crypto/o_dir_test.c +++ b/crypto/o_dir_test.c @@ -36,7 +36,7 @@ #include #include #include "e_os2.h" -#include "o_dir.h" +#include "internal/o_dir.h" #if defined OPENSSL_SYS_UNIX || defined OPENSSL_SYS_WIN32 || defined OPENSSL_SYS_WINCE # define CURRDIR "." diff --git a/crypto/o_str.c b/crypto/o_str.c index 16fd4e4231..f2f9404db0 100644 --- a/crypto/o_str.c +++ b/crypto/o_str.c @@ -59,7 +59,7 @@ #include #include -#include "o_str.h" +#include "internal/o_str.h" #if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \ !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_WINCE) && \ diff --git a/crypto/rsa/rsa_oaep.c b/crypto/rsa/rsa_oaep.c index d988d6c217..6edfb4145d 100644 --- a/crypto/rsa/rsa_oaep.c +++ b/crypto/rsa/rsa_oaep.c @@ -17,7 +17,7 @@ * one-wayness. For the RSA function, this is an equivalent notion. */ -#include "constant_time_locl.h" +#include "internal/constant_time_locl.h" #include #include "cryptlib.h" diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c index 1bda998ca4..e32a1d5f8f 100644 --- a/crypto/rsa/rsa_pk1.c +++ b/crypto/rsa/rsa_pk1.c @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -#include "constant_time_locl.h" +#include "internal/constant_time_locl.h" #include #include "cryptlib.h" diff --git a/e_os.h b/e_os.h index 7f94bfcae6..4c1b4aa1de 100644 --- a/e_os.h +++ b/e_os.h @@ -605,7 +605,7 @@ extern int sys_nerr; # define strerror(errnum) \ (((errnum)<0 || (errnum)>=sys_nerr) ? NULL : sys_errlist[errnum]) /* Being signed SunOS 4.x memcpy breaks ASN1_OBJECT table lookup */ -# include "crypto/o_str.h" +# include "internal/o_str.h" # define memcmp OPENSSL_memcmp # endif @@ -624,7 +624,7 @@ extern int sys_nerr; # define strncasecmp _strnicmp # elif defined(OPENSSL_SYS_VMS) /* VMS below version 7.0 doesn't have strcasecmp() */ -# include "o_str.h" +# include "internal/o_str.h" # define strcasecmp OPENSSL_strcasecmp # define strncasecmp OPENSSL_strncasecmp # define OPENSSL_IMPLEMENTS_strncasecmp diff --git a/crypto/constant_time_locl.h b/include/internal/constant_time_locl.h similarity index 100% rename from crypto/constant_time_locl.h rename to include/internal/constant_time_locl.h diff --git a/crypto/o_dir.h b/include/internal/o_dir.h similarity index 100% rename from crypto/o_dir.h rename to include/internal/o_dir.h diff --git a/crypto/o_str.h b/include/internal/o_str.h similarity index 100% rename from crypto/o_str.h rename to include/internal/o_str.h diff --git a/ssl/Makefile b/ssl/Makefile index 18b17d27b5..7dc2e02897 100644 --- a/ssl/Makefile +++ b/ssl/Makefile @@ -5,7 +5,7 @@ DIR= ssl TOP= .. CC= cc -INCLUDES= -I../crypto -I$(TOP) -I../include +INCLUDES= -I$(TOP) -I../include CFLAG=-g MAKEFILE= Makefile AR= ar r diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c index db6d4e792b..032812772f 100644 --- a/ssl/record/ssl3_record.c +++ b/ssl/record/ssl3_record.c @@ -110,7 +110,7 @@ */ #include "../ssl_locl.h" -#include "../../crypto/constant_time_locl.h" +#include "internal/constant_time_locl.h" #include #include "record_locl.h" diff --git a/ssl/s3_cbc.c b/ssl/s3_cbc.c index ac0c5f3ab8..f7997eaae3 100644 --- a/ssl/s3_cbc.c +++ b/ssl/s3_cbc.c @@ -53,7 +53,7 @@ * */ -#include "../crypto/constant_time_locl.h" +#include "internal/constant_time_locl.h" #include "ssl_locl.h" #include diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 04dbb7a735..4ee45eb57f 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -151,7 +151,7 @@ #include #include "ssl_locl.h" -#include "../crypto/constant_time_locl.h" +#include "internal/constant_time_locl.h" #include #include #include diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 38e7b822e5..d8b47e6209 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -123,7 +123,7 @@ # include #endif -#include "o_dir.h" +#include "internal/o_dir.h" #include #include #include diff --git a/test/constant_time_test.c b/test/constant_time_test.c index bdb270209e..ed3d7eaac4 100644 --- a/test/constant_time_test.c +++ b/test/constant_time_test.c @@ -44,7 +44,7 @@ * [including the GNU Public Licence.] */ -#include "../crypto/constant_time_locl.h" +#include "internal/constant_time_locl.h" #include #include diff --git a/util/mkdef.pl b/util/mkdef.pl index 6c4ce3fa3a..18bc1ab305 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -262,8 +262,8 @@ $ssl.=" include/openssl/srtp.h"; my $crypto ="include/openssl/crypto.h"; $crypto.=" crypto/cryptlib.h"; -$crypto.=" crypto/o_dir.h"; -$crypto.=" crypto/o_str.h"; +$crypto.=" include/internal/o_dir.h"; +$crypto.=" include/internal/o_str.h"; $crypto.=" include/openssl/des.h" ; # unless $no_des; $crypto.=" include/openssl/idea.h" ; # unless $no_idea; $crypto.=" include/openssl/rc4.h" ; # unless $no_rc4; -- GitLab