diff options
author | Rich Salz <rsalz@akamai.com> | 2020-03-05 18:58:00 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-04-16 13:52:23 +0200 |
commit | b27ed819431fb7f50ded6fcddfd25de079d7e808 (patch) | |
tree | 8a87bc3d6f03ab6f511c0a4b40dc9bf7d9c5dacb /crypto/rand | |
parent | Use build.info, not ifdef for crypto modules (diff) | |
download | openssl-b27ed819431fb7f50ded6fcddfd25de079d7e808.tar.xz openssl-b27ed819431fb7f50ded6fcddfd25de079d7e808.zip |
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 <tmraz@fedoraproject.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11263)
Diffstat (limited to 'crypto/rand')
-rw-r--r-- | crypto/rand/build.info | 10 | ||||
-rw-r--r-- | crypto/rand/rand_vms.c | 71 | ||||
-rw-r--r-- | crypto/rand/rand_vxworks.c | 51 |
3 files changed, 65 insertions, 67 deletions
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 <unistd.h> -# include "internal/cryptlib.h" -# include <openssl/rand.h> -# include "crypto/rand.h" -# include "rand_local.h" -# include <descrip.h> -# include <dvidef.h> -# include <jpidef.h> -# include <rmidef.h> -# include <syidef.h> -# include <ssdef.h> -# include <starlet.h> -# include <efndef.h> -# include <gen64def.h> -# include <iosbdef.h> -# include <iledef.h> -# include <lib$routines.h> -# ifdef __DECC -# pragma message disable DOLLARID -# endif - -# include <dlfcn.h> /* 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 <unistd.h> +#include "internal/cryptlib.h" +#include <openssl/rand.h> +#include "crypto/rand.h" +#include "rand_local.h" +#include <descrip.h> +#include <dvidef.h> +#include <jpidef.h> +#include <rmidef.h> +#include <syidef.h> +#include <ssdef.h> +#include <starlet.h> +#include <efndef.h> +#include <gen64def.h> +#include <iosbdef.h> +#include <iledef.h> +#include <lib$routines.h> +#ifdef __DECC +# pragma message disable DOLLARID +#endif + +#include <dlfcn.h> /* 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 <openssl/opensslconf.h> -#ifndef OPENSSL_SYS_VXWORKS -NON_EMPTY_TRANSLATION_UNIT -#else -# include <openssl/rand.h> -# include "rand_local.h" -# include "crypto/rand.h" -# include "internal/cryptlib.h" -# include <version.h> -# include <taskLib.h> - -# if defined(OPENSSL_RAND_SEED_NONE) +#include <openssl/rand.h> +#include "rand_local.h" +#include "crypto/rand.h" +#include "internal/cryptlib.h" +#include <version.h> +#include <taskLib.h> + +#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 <randomNumGen.h> -# endif +#if defined(RAND_SEED_VXRANDLIB) +# include <randomNumGen.h> +#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 */ |