summaryrefslogtreecommitdiff
path: root/crypto/init.c
diff options
context:
space:
mode:
authorclucey <catriona.lucey@intel.com>2016-02-23 08:01:01 +0000
committerMatt Caswell <matt@openssl.org>2016-03-07 13:36:17 +0000
commit6cba4a66619dfb2c5cb784fe5aa5677cafbf9a33 (patch)
tree9757390141c45251e2127482dbff5b06f183d538 /crypto/init.c
parent7f458a48ff3a231d5841466525d2aacbcd4f6b77 (diff)
downloadopenssl-new-6cba4a66619dfb2c5cb784fe5aa5677cafbf9a33.tar.gz
Rework based on feedback:
1. Cleaned up eventfd handling 2. Reworked socket setup code to allow other algorithms to be added in future 3. Fixed compile errors for static build 4. Added error to error stack in all cases of ALG_PERR/ALG_ERR 5. Called afalg_aes_128_cbc() from bind() to avoid race conditions 6. Used MAX_INFLIGHT define in io_getevents system call 7. Coding style fixes Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/init.c')
-rw-r--r--crypto/init.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/crypto/init.c b/crypto/init.c
index 613606ebdc..2c0bde66f4 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -470,6 +470,18 @@ static void ossl_init_engine_dasync(void)
engine_load_dasync_internal();
engine_inited = 1;
}
+# if !defined(OPENSSL_NO_AFALGENG)
+static OPENSSL_INIT_ONCE engine_afalg = OPENSSL_INIT_ONCE_STATIC_INIT;
+static void ossl_init_engine_afalg(void)
+{
+# ifdef OPENSSL_INIT_DEBUG
+ fprintf(stderr, "OPENSSL_INIT: ossl_init_engine_afalg: "
+ "engine_load_afalg_internal()\n");
+# endif
+ engine_load_afalg_internal();
+ engine_inited = 1;
+}
+# endif
# endif
#endif
@@ -718,9 +730,15 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
if (opts & OPENSSL_INIT_ENGINE_DASYNC) {
ossl_init_once_run(&engine_dasync, ossl_init_engine_dasync);
}
+# if !defined(OPENSSL_NO_AFALGENG)
+ if (opts & OPENSSL_INIT_ENGINE_AFALG) {
+ ossl_init_once_run(&engine_afalg, ossl_init_engine_afalg);
+ }
+# endif
# endif
if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
- | OPENSSL_INIT_ENGINE_DASYNC | OPENSSL_INIT_ENGINE_OPENSSL)) {
+ | OPENSSL_INIT_ENGINE_DASYNC | OPENSSL_INIT_ENGINE_OPENSSL
+ | OPENSSL_INIT_ENGINE_AFALG)) {
ENGINE_register_all_complete();
}
#endif