diff options
author | djm <> | 2012-10-13 21:23:50 +0000 |
---|---|---|
committer | djm <> | 2012-10-13 21:23:50 +0000 |
commit | 228cae30b117c2493f69ad3c195341cd6ec8d430 (patch) | |
tree | 29ff00b10d52c0978077c4fd83c33b065bade73e /src/lib/libcrypto/o_init.c | |
parent | 731838c66b52c0ae5888333005b74115a620aa96 (diff) | |
download | openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.tar.gz openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.tar.bz2 openbsd-228cae30b117c2493f69ad3c195341cd6ec8d430.zip |
import OpenSSL-1.0.1c
Diffstat (limited to 'src/lib/libcrypto/o_init.c')
-rw-r--r-- | src/lib/libcrypto/o_init.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/lib/libcrypto/o_init.c b/src/lib/libcrypto/o_init.c index 00ed65a6cf..db4cdc443b 100644 --- a/src/lib/libcrypto/o_init.c +++ b/src/lib/libcrypto/o_init.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
5 | /* ==================================================================== | 5 | /* ==================================================================== |
6 | * Copyright (c) 2007 The OpenSSL Project. All rights reserved. | 6 | * Copyright (c) 2011 The OpenSSL Project. All rights reserved. |
7 | * | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions |
@@ -50,14 +50,14 @@ | |||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. |
51 | * ==================================================================== | 51 | * ==================================================================== |
52 | * | 52 | * |
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | 53 | */ |
58 | 54 | ||
59 | #include <e_os.h> | 55 | #include <e_os.h> |
60 | #include <openssl/err.h> | 56 | #include <openssl/err.h> |
57 | #ifdef OPENSSL_FIPS | ||
58 | #include <openssl/fips.h> | ||
59 | #include <openssl/rand.h> | ||
60 | #endif | ||
61 | 61 | ||
62 | /* Perform any essential OpenSSL initialization operations. | 62 | /* Perform any essential OpenSSL initialization operations. |
63 | * Currently only sets FIPS callbacks | 63 | * Currently only sets FIPS callbacks |
@@ -65,22 +65,18 @@ | |||
65 | 65 | ||
66 | void OPENSSL_init(void) | 66 | void OPENSSL_init(void) |
67 | { | 67 | { |
68 | #ifdef OPENSSL_FIPS | ||
69 | static int done = 0; | 68 | static int done = 0; |
70 | if (!done) | 69 | if (done) |
71 | { | 70 | return; |
72 | int_ERR_lib_init(); | 71 | done = 1; |
73 | #ifdef CRYPTO_MDEBUG | 72 | #ifdef OPENSSL_FIPS |
74 | CRYPTO_malloc_debug_init(); | 73 | FIPS_set_locking_callbacks(CRYPTO_lock, CRYPTO_add_lock); |
75 | #endif | 74 | FIPS_set_error_callbacks(ERR_put_error, ERR_add_error_vdata); |
76 | #ifdef OPENSSL_ENGINE | 75 | FIPS_set_malloc_callbacks(CRYPTO_malloc, CRYPTO_free); |
77 | int_EVP_MD_init_engine_callbacks(); | 76 | RAND_init_fips(); |
78 | int_EVP_CIPHER_init_engine_callbacks(); | ||
79 | int_RAND_init_engine_callbacks(); | ||
80 | #endif | 77 | #endif |
81 | done = 1; | 78 | #if 0 |
82 | } | 79 | fprintf(stderr, "Called OPENSSL_init\n"); |
83 | #endif | 80 | #endif |
84 | } | 81 | } |
85 | |||
86 | 82 | ||