diff options
| author | Gary Ching-Pang Lin <glin@suse.com> | 2015-07-28 11:46:38 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2015-07-28 11:46:38 -0400 |
| commit | 5ce38c90cf43ee79cd999716ea83a5a44eeb819e (patch) | |
| tree | 2fb3d9dd667c772fae5f87fa61e1501cf12da0ce /Cryptlib/OpenSSL/crypto/o_init.c | |
| parent | 69ba24ff72921ecabbb47178de40dc5a79350040 (diff) | |
| download | efi-boot-shim-5ce38c90cf43ee79cd999716ea83a5a44eeb819e.tar.gz efi-boot-shim-5ce38c90cf43ee79cd999716ea83a5a44eeb819e.zip | |
Update openssl to 1.0.2d
Also update Cryptlib to edk2 r17731
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/o_init.c')
| -rw-r--r-- | Cryptlib/OpenSSL/crypto/o_init.c | 56 |
1 files changed, 14 insertions, 42 deletions
diff --git a/Cryptlib/OpenSSL/crypto/o_init.c b/Cryptlib/OpenSSL/crypto/o_init.c index 6f5103e2..20883881 100644 --- a/Cryptlib/OpenSSL/crypto/o_init.c +++ b/Cryptlib/OpenSSL/crypto/o_init.c @@ -4,7 +4,7 @@ * project. */ /* ==================================================================== - * Copyright (c) 2007 The OpenSSL Project. All rights reserved. + * Copyright (c) 2011 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,23 +51,13 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * */ #include <e_os.h> #include <openssl/err.h> - -/* Internal only functions: only ever used here */ #ifdef OPENSSL_FIPS -extern void int_ERR_lib_init(void); -# ifndef OPENSSL_NO_ENGINE -extern void int_EVP_MD_init_engine_callbacks(void); -extern void int_EVP_CIPHER_init_engine_callbacks(void); -extern void int_RAND_init_engine_callbacks(void); -# endif +# include <openssl/fips.h> +# include <openssl/rand.h> #endif /* @@ -77,35 +67,17 @@ extern void int_RAND_init_engine_callbacks(void); void OPENSSL_init(void) { -#ifdef OPENSSL_FIPS static int done = 0; - if (!done) { - int_ERR_lib_init(); -# ifdef CRYPTO_MDEBUG - CRYPTO_malloc_debug_init(); -# endif -# ifndef OPENSSL_NO_ENGINE - int_EVP_MD_init_engine_callbacks(); - int_EVP_CIPHER_init_engine_callbacks(); - int_RAND_init_engine_callbacks(); -# endif - done = 1; - } -#endif -} - + if (done) + return; + done = 1; #ifdef OPENSSL_FIPS - -int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) -{ - size_t i; - const unsigned char *a = in_a; - const unsigned char *b = in_b; - unsigned char x = 0; - - for (i = 0; i < len; i++) - x |= a[i] ^ b[i]; - - return x; -} + FIPS_set_locking_callbacks(CRYPTO_lock, CRYPTO_add_lock); + FIPS_set_error_callbacks(ERR_put_error, ERR_add_error_vdata); + FIPS_set_malloc_callbacks(CRYPTO_malloc, CRYPTO_free); + RAND_init_fips(); +#endif +#if 0 + fprintf(stderr, "Called OPENSSL_init\n"); #endif +} |
