From: Rich Salz Date: Thu, 5 Mar 2020 17:58:00 +0000 (-0500) Subject: Put sys-specific files in build.info X-Git-Tag: openssl-3.0.0-alpha1~91 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b27ed819431fb7f50ded6fcddfd25de079d7e808;p=oweals%2Fopenssl.git Put sys-specific files in build.info Don't wrap whole files in if[n]def, test in build.info if they should be compiled. rand_win isn't done as there are multiple ways to say "this is windows." Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11263) --- diff --git a/crypto/rand/build.info b/crypto/rand/build.info index 80f5710174..c4e7476ef7 100644 --- a/crypto/rand/build.info +++ b/crypto/rand/build.info @@ -1,10 +1,16 @@ LIBS=../../libcrypto -$COMMON=rand_lib.c rand_crng_test.c rand_win.c rand_unix.c rand_vms.c \ - drbg_lib.c drbg_ctr.c rand_vxworks.c drbg_hash.c drbg_hmac.c +$COMMON=rand_lib.c rand_crng_test.c rand_unix.c rand_win.c \ + drbg_lib.c drbg_ctr.c drbg_hash.c drbg_hmac.c IF[{- !$disabled{'egd'} -}] $COMMON=$COMMON rand_egd.c ENDIF +IF[{- $config{target} =~ /vxworks/i -}] + $COMMON=$COMMON rand_vxworks.c +ENDIF +IF[{- $config{target} =~ /vms/i -}] + $COMMON=$COMMON rand_vms.c +ENDIF SOURCE[../../libcrypto]=$COMMON randfile.c rand_err.c SOURCE[../../providers/libfips.a]=$COMMON diff --git a/crypto/rand/rand_vms.c b/crypto/rand/rand_vms.c index 13d913bc28..d798f55e49 100644 --- a/crypto/rand/rand_vms.c +++ b/crypto/rand/rand_vms.c @@ -9,34 +9,33 @@ #include "e_os.h" -#if defined(OPENSSL_SYS_VMS) -# define __NEW_STARLET 1 /* New starlet definitions since VMS 7.0 */ -# include -# include "internal/cryptlib.h" -# include -# include "crypto/rand.h" -# include "rand_local.h" -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# ifdef __DECC -# pragma message disable DOLLARID -# endif - -# include /* SYS$GET_ENTROPY presence */ - -# ifndef OPENSSL_RAND_SEED_OS -# error "Unsupported seeding method configured; must be os" -# endif +#define __NEW_STARLET 1 /* New starlet definitions since VMS 7.0 */ +#include +#include "internal/cryptlib.h" +#include +#include "crypto/rand.h" +#include "rand_local.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef __DECC +# pragma message disable DOLLARID +#endif + +#include /* SYS$GET_ENTROPY presence */ + +#ifndef OPENSSL_RAND_SEED_OS +# error "Unsupported seeding method configured; must be os" +#endif /* * DATA COLLECTION METHOD @@ -48,14 +47,14 @@ */ /* We need to make sure we have the right size pointer in some cases */ -# if __INITIAL_POINTER_SIZE == 64 -# pragma pointer_size save -# pragma pointer_size 32 -# endif +#if __INITIAL_POINTER_SIZE == 64 +# pragma pointer_size save +# pragma pointer_size 32 +#endif typedef uint32_t *uint32_t__ptr32; -# if __INITIAL_POINTER_SIZE == 64 -# pragma pointer_size restore -# endif +#if __INITIAL_POINTER_SIZE == 64 +# pragma pointer_size restore +#endif struct item_st { short length, code; /* length is number of bytes */ @@ -613,5 +612,3 @@ void rand_pool_cleanup(void) void rand_pool_keep_random_devices_open(int keep) { } - -#endif diff --git a/crypto/rand/rand_vxworks.c b/crypto/rand/rand_vxworks.c index d67469898e..bb0dcb87ad 100644 --- a/crypto/rand/rand_vxworks.c +++ b/crypto/rand/rand_vxworks.c @@ -9,35 +9,32 @@ #include -#ifndef OPENSSL_SYS_VXWORKS -NON_EMPTY_TRANSLATION_UNIT -#else -# include -# include "rand_local.h" -# include "crypto/rand.h" -# include "internal/cryptlib.h" -# include -# include - -# if defined(OPENSSL_RAND_SEED_NONE) +#include +#include "rand_local.h" +#include "crypto/rand.h" +#include "internal/cryptlib.h" +#include +#include + +#if defined(OPENSSL_RAND_SEED_NONE) /* none means none */ -# undef OPENSSL_RAND_SEED_OS -# endif +# undef OPENSSL_RAND_SEED_OS +#endif -# if defined(OPENSSL_RAND_SEED_OS) -# if _WRS_VXWORKS_MAJOR >= 7 -# define RAND_SEED_VXRANDLIB -# else -# error "VxWorks <7 only support RAND_SEED_NONE" -# endif +#if defined(OPENSSL_RAND_SEED_OS) +# if _WRS_VXWORKS_MAJOR >= 7 +# define RAND_SEED_VXRANDLIB +# else +# error "VxWorks <7 only support RAND_SEED_NONE" # endif +#endif -# if defined(RAND_SEED_VXRANDLIB) -# include -# endif +#if defined(RAND_SEED_VXRANDLIB) +# include +#endif /* Macro to convert two thirty two bit values into a sixty four bit one */ -# define TWO32TO64(a, b) ((((uint64_t)(a)) << 32) + (b)) +#define TWO32TO64(a, b) ((((uint64_t)(a)) << 32) + (b)) static uint64_t get_time_stamp(void) { @@ -122,7 +119,7 @@ int rand_pool_add_nonce_data(RAND_POOL *pool) size_t rand_pool_acquire_entropy(RAND_POOL *pool) { -# if defined(RAND_SEED_VXRANDLIB) +#if defined(RAND_SEED_VXRANDLIB) /* vxRandLib based entropy method */ size_t bytes_needed; @@ -159,13 +156,11 @@ size_t rand_pool_acquire_entropy(RAND_POOL *pool) } } return rand_pool_entropy_available(pool); -# else +#else /* * SEED_NONE means none, without randlib we dont have entropy and * rely on it being added externally */ return rand_pool_entropy_available(pool); -# endif /* defined(RAND_SEED_VXRANDLIB) */ +#endif /* defined(RAND_SEED_VXRANDLIB) */ } - -#endif /* OPENSSL_SYS_VXWORKS */