summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--engines/Makefile24
-rw-r--r--engines/e_dasync.c317
-rw-r--r--engines/e_dasync.ec1
-rw-r--r--engines/e_dasync_err.c147
-rw-r--r--engines/e_dasync_err.h91
-rw-r--r--include/openssl/engine.h1
-rwxr-xr-xutil/libeay.num1
7 files changed, 579 insertions, 3 deletions
diff --git a/engines/Makefile b/engines/Makefile
index 5cd2aa221a..de0dafab42 100644
--- a/engines/Makefile
+++ b/engines/Makefile
@@ -31,13 +31,15 @@ AFLAGS= $(ASFLAGS)
GENERAL=Makefile engines.com install.com engine_vector.mar
LIB=$(TOP)/libcrypto.a
-LIBNAMES= gmp padlock capi
+LIBNAMES= gmp padlock capi dasync
LIBSRC= e_gmp.c \
e_padlock.c \
- e_capi.c
+ e_capi.c \
+ e_dasync.c
LIBOBJ= e_gmp.o \
e_padlock.o \
e_capi.o \
+ e_dasync.o \
$(ENGINES_ASM_OBJ)
TESTLIBNAMES= ossltest
@@ -50,7 +52,8 @@ HEADER= e_gmp_err.c e_gmp_err.h \
e_chil_err.c e_chil_err.h \
e_ubsec_err.c e_ubsec_err.h \
e_capi_err.c e_capi_err.h \
- e_ossltest_err.c e_ossltest_err.h
+ e_ossltest_err.c e_ossltest_err.h \
+ e_dasync_err.c e_dasync_err.h
ALL= $(GENERAL) $(SRC) $(HEADER)
@@ -166,6 +169,21 @@ e_capi.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
e_capi.o: ../include/openssl/sha.h ../include/openssl/stack.h
e_capi.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
e_capi.o: ../include/openssl/x509_vfy.h e_capi.c
+e_dasync.o: ../include/openssl/asn1.h ../include/openssl/async.h
+e_dasync.o: ../include/openssl/bio.h ../include/openssl/bn.h
+e_dasync.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
+e_dasync.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+e_dasync.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+e_dasync.o: ../include/openssl/engine.h ../include/openssl/err.h
+e_dasync.o: ../include/openssl/evp.h ../include/openssl/lhash.h
+e_dasync.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
+e_dasync.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
+e_dasync.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
+e_dasync.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
+e_dasync.o: ../include/openssl/sha.h ../include/openssl/stack.h
+e_dasync.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
+e_dasync.o: ../include/openssl/x509_vfy.h e_dasync.c e_dasync_err.c
+e_dasync.o: e_dasync_err.h
e_gmp.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_gmp.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_gmp.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
diff --git a/engines/e_dasync.c b/engines/e_dasync.c
new file mode 100644
index 0000000000..6c41f7522d
--- /dev/null
+++ b/engines/e_dasync.c
@@ -0,0 +1,317 @@
+/* engines/e_dasync.c */
+/*
+ * Written by Matt Caswell (matt@openssl.org) for the OpenSSL project.
+ */
+/* ====================================================================
+ * Copyright (c) 2015 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
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <openssl/engine.h>
+#include <openssl/sha.h>
+#include <openssl/rsa.h>
+#include <openssl/evp.h>
+#include <openssl/async.h>
+#include <openssl/bn.h>
+
+#define DASYNC_LIB_NAME "DASYNC"
+#include "e_dasync_err.c"
+
+/* Engine Id and Name */
+static const char *engine_dasync_id = "dasync";
+static const char *engine_dasync_name = "Dummy Async engine support";
+
+
+/* Engine Lifetime functions */
+static int dasync_destroy(ENGINE *e);
+static int dasync_init(ENGINE *e);
+static int dasync_finish(ENGINE *e);
+void ENGINE_load_dasync(void);
+
+
+/* Set up digests. Just SHA1 for now */
+static int dasync_digests(ENGINE *e, const EVP_MD **digest,
+ const int **nids, int nid);
+
+static int dasync_digest_nids[] = { NID_sha1, 0 };
+
+
+/* SHA1 */
+static int digest_sha1_init(EVP_MD_CTX *ctx);
+static int digest_sha1_update(EVP_MD_CTX *ctx, const void *data,
+ unsigned long count);
+static int digest_sha1_final(EVP_MD_CTX *ctx, unsigned char *md);
+
+static const EVP_MD digest_sha1 = {
+ NID_sha1,
+ NID_sha1WithRSAEncryption,
+ SHA_DIGEST_LENGTH,
+ EVP_MD_FLAG_PKEY_METHOD_SIGNATURE | EVP_MD_FLAG_DIGALGID_ABSENT,
+ digest_sha1_init,
+ digest_sha1_update,
+ digest_sha1_final,
+ NULL,
+ NULL,
+ EVP_PKEY_NULL_method,
+ SHA_CBLOCK,
+ sizeof(EVP_MD *) + sizeof(SHA_CTX),
+};
+
+/* RSA */
+
+static int dasync_pub_enc(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+static int dasync_pub_dec(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+static int dasync_rsa_priv_enc(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+static int dasync_rsa_priv_dec(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+static int dasync_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa,
+ BN_CTX *ctx);
+
+static int dasync_rsa_init(RSA *rsa);
+static int dasync_rsa_finish(RSA *rsa);
+
+static RSA_METHOD dasync_rsa_method = {
+ "Dummy Async RSA method",
+ dasync_pub_enc, /* pub_enc */
+ dasync_pub_dec, /* pub_dec */
+ dasync_rsa_priv_enc, /* priv_enc */
+ dasync_rsa_priv_dec, /* priv_dec */
+ dasync_rsa_mod_exp, /* rsa_mod_exp */
+ BN_mod_exp_mont, /* bn_mod_exp */
+ dasync_rsa_init, /* init */
+ dasync_rsa_finish, /* finish */
+ 0, /* flags */
+ NULL, /* app_data */
+ 0, /* rsa_sign */
+ 0, /* rsa_verify */
+ NULL /* rsa_keygen */
+};
+
+
+static int bind_dasync(ENGINE *e)
+{
+ /* Ensure the dasync error handling is set up */
+ ERR_load_DASYNC_strings();
+
+ if (!ENGINE_set_id(e, engine_dasync_id)
+ || !ENGINE_set_name(e, engine_dasync_name)
+ || !ENGINE_set_RSA(e, &dasync_rsa_method)
+ || !ENGINE_set_digests(e, dasync_digests)
+ || !ENGINE_set_destroy_function(e, dasync_destroy)
+ || !ENGINE_set_init_function(e, dasync_init)
+ || !ENGINE_set_finish_function(e, dasync_finish)) {
+ DASYNCerr(DASYNC_F_BIND_DASYNC, DASYNC_R_INIT_FAILED);
+ return 0;
+ }
+
+ return 1;
+}
+
+# ifndef OPENSSL_NO_DYNAMIC_ENGINE
+static int bind_helper(ENGINE *e, const char *id)
+{
+ if (id && (strcmp(id, engine_dasync_id) != 0))
+ return 0;
+ if (!bind_dasync(e))
+ return 0;
+ return 1;
+}
+
+IMPLEMENT_DYNAMIC_CHECK_FN()
+ IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
+# endif
+
+static ENGINE *engine_dasync(void)
+{
+ ENGINE *ret = ENGINE_new();
+ if (!ret)
+ return NULL;
+ if (!bind_dasync(ret)) {
+ ENGINE_free(ret);
+ return NULL;
+ }
+ return ret;
+}
+
+void ENGINE_load_dasync(void)
+{
+ ENGINE *toadd = engine_dasync();
+ if (!toadd)
+ return;
+ ENGINE_add(toadd);
+ ENGINE_free(toadd);
+ ERR_clear_error();
+}
+
+static int dasync_init(ENGINE *e)
+{
+ return 1;
+}
+
+
+static int dasync_finish(ENGINE *e)
+{
+ return 1;
+}
+
+
+static int dasync_destroy(ENGINE *e)
+{
+ ERR_unload_DASYNC_strings();
+ return 1;
+}
+
+static int dasync_digests(ENGINE *e, const EVP_MD **digest,
+ const int **nids, int nid)
+{
+ int ok = 1;
+ if (!digest) {
+ /* We are returning a list of supported nids */
+ *nids = dasync_digest_nids;
+ return (sizeof(dasync_digest_nids) -
+ 1) / sizeof(dasync_digest_nids[0]);
+ }
+ /* We are being asked for a specific digest */
+ switch (nid) {
+ case NID_sha1:
+ *digest = &digest_sha1;
+ break;
+ default:
+ ok = 0;
+ *digest = NULL;
+ break;
+ }
+ return ok;
+}
+
+
+/*
+ * SHA1 implementation. At the moment we just defer to the standard
+ * implementation
+ */
+#undef data
+#define data(ctx) ((SHA_CTX *)(ctx)->md_data)
+static int digest_sha1_init(EVP_MD_CTX *ctx)
+{
+ /* Ignore errors - we carry on anyway */
+ ASYNC_pause_job();
+
+ return SHA1_Init(data(ctx));
+}
+
+static int digest_sha1_update(EVP_MD_CTX *ctx, const void *data,
+ unsigned long count)
+{
+ /* Ignore errors - we carry on anyway */
+ ASYNC_pause_job();
+
+ return SHA1_Update(data(ctx), data, (size_t)count);
+}
+
+static int digest_sha1_final(EVP_MD_CTX *ctx, unsigned char *md)
+{
+ /* Ignore errors - we carry on anyway */
+ ASYNC_pause_job();
+
+ return SHA1_Final(md, data(ctx));
+}
+
+/*
+ * RSA implementation
+ */
+
+static int dasync_pub_enc(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding) {
+ /* Ignore errors - we carry on anyway */
+ ASYNC_pause_job();
+ return RSA_PKCS1_OpenSSL()->rsa_pub_enc(flen, from, to, rsa, padding);
+}
+
+static int dasync_pub_dec(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding) {
+ /* Ignore errors - we carry on anyway */
+ ASYNC_pause_job();
+ return RSA_PKCS1_OpenSSL()->rsa_pub_dec(flen, from, to, rsa, padding);
+}
+
+static int dasync_rsa_priv_enc(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding)
+{
+ /* Ignore errors - we carry on anyway */
+ ASYNC_pause_job();
+ return RSA_PKCS1_OpenSSL()->rsa_priv_enc(flen, from, to, rsa, padding);
+}
+
+static int dasync_rsa_priv_dec(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding)
+{
+ /* Ignore errors - we carry on anyway */
+ ASYNC_pause_job();
+ return RSA_PKCS1_OpenSSL()->rsa_priv_dec(flen, from, to, rsa, padding);
+}
+
+static int dasync_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
+{
+ /* Ignore errors - we carry on anyway */
+ ASYNC_pause_job();
+ return RSA_PKCS1_OpenSSL()->rsa_mod_exp(r0, I, rsa, ctx);
+}
+
+static int dasync_rsa_init(RSA *rsa)
+{
+ return RSA_PKCS1_OpenSSL()->init(rsa);
+}
+static int dasync_rsa_finish(RSA *rsa)
+{
+ return RSA_PKCS1_OpenSSL()->finish(rsa);
+}
diff --git a/engines/e_dasync.ec b/engines/e_dasync.ec
new file mode 100644
index 0000000000..385faa0b62
--- /dev/null
+++ b/engines/e_dasync.ec
@@ -0,0 +1 @@
+L DASYNC e_dasync_err.h e_dasync_err.c
diff --git a/engines/e_dasync_err.c b/engines/e_dasync_err.c
new file mode 100644
index 0000000000..a222899e7d
--- /dev/null
+++ b/engines/e_dasync_err.c
@@ -0,0 +1,147 @@
+/* e_dasync_err.c */
+/* ====================================================================
+ * Copyright (c) 1999-2015 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
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * 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).
+ *
+ */
+
+/* NOTE: this file was auto generated by the mkerr.pl script: any changes
+ * made to it will be overwritten when the script next updates this file,
+ * only reason strings will be preserved.
+ */
+
+#include <stdio.h>
+#include <openssl/err.h>
+#include "e_dasync_err.h"
+
+/* BEGIN ERROR CODES */
+#ifndef OPENSSL_NO_ERR
+
+#define ERR_FUNC(func) ERR_PACK(0,func,0)
+#define ERR_REASON(reason) ERR_PACK(0,0,reason)
+
+static ERR_STRING_DATA DASYNC_str_functs[]=
+ {
+{ERR_FUNC(DASYNC_F_BIND_DASYNC), "BIND_DASYNC"},
+{ERR_FUNC(DASYNC_F_CIPHER_AES_128_CBC_CODE), "CIPHER_AES_128_CBC_CODE"},
+{ERR_FUNC(DASYNC_F_DASYNC_BN_MOD_EXP), "DASYNC_BN_MOD_EXP"},
+{ERR_FUNC(DASYNC_F_DASYNC_MOD_EXP), "DASYNC_MOD_EXP"},
+{ERR_FUNC(DASYNC_F_DASYNC_PRIVATE_DECRYPT), "DASYNC_PRIVATE_DECRYPT"},
+{ERR_FUNC(DASYNC_F_DASYNC_PRIVATE_ENCRYPT), "DASYNC_PRIVATE_ENCRYPT"},
+{ERR_FUNC(DASYNC_F_DASYNC_PUBLIC_DECRYPT), "DASYNC_PUBLIC_DECRYPT"},
+{ERR_FUNC(DASYNC_F_DASYNC_PUBLIC_ENCRYPT), "DASYNC_PUBLIC_ENCRYPT"},
+{0,NULL}
+ };
+
+static ERR_STRING_DATA DASYNC_str_reasons[]=
+ {
+{ERR_REASON(DASYNC_R_INIT_FAILED) ,"init failed"},
+{ERR_REASON(DASYNC_R_LENGTH_NOT_BLOCK_ALIGNED),"length not block aligned"},
+{ERR_REASON(DASYNC_R_UNKNOWN_FAULT) ,"unknown fault"},
+{0,NULL}
+ };
+
+#endif
+
+#ifdef DASYNC_LIB_NAME
+static ERR_STRING_DATA DASYNC_lib_name[]=
+ {
+{0 ,DASYNC_LIB_NAME},
+{0,NULL}
+ };
+#endif
+
+
+static int DASYNC_lib_error_code=0;
+static int DASYNC_error_init=1;
+
+static void ERR_load_DASYNC_strings(void)
+ {
+ if (DASYNC_lib_error_code == 0)
+ DASYNC_lib_error_code=ERR_get_next_error_library();
+
+ if (DASYNC_error_init)
+ {
+ DASYNC_error_init=0;
+#ifndef OPENSSL_NO_ERR
+ ERR_load_strings(DASYNC_lib_error_code,DASYNC_str_functs);
+ ERR_load_strings(DASYNC_lib_error_code,DASYNC_str_reasons);
+#endif
+
+#ifdef DASYNC_LIB_NAME
+ DASYNC_lib_name->error = ERR_PACK(DASYNC_lib_error_code,0,0);
+ ERR_load_strings(0,DASYNC_lib_name);
+#endif
+ }
+ }
+
+static void ERR_unload_DASYNC_strings(void)
+ {
+ if (DASYNC_error_init == 0)
+ {
+#ifndef OPENSSL_NO_ERR
+ ERR_unload_strings(DASYNC_lib_error_code,DASYNC_str_functs);
+ ERR_unload_strings(DASYNC_lib_error_code,DASYNC_str_reasons);
+#endif
+
+#ifdef DASYNC_LIB_NAME
+ ERR_unload_strings(0,DASYNC_lib_name);
+#endif
+ DASYNC_error_init=1;
+ }
+ }
+
+static void ERR_DASYNC_error(int function, int reason, char *file, int line)
+ {
+ if (DASYNC_lib_error_code == 0)
+ DASYNC_lib_error_code=ERR_get_next_error_library();
+ ERR_PUT_error(DASYNC_lib_error_code,function,reason,file,line);
+ }
diff --git a/engines/e_dasync_err.h b/engines/e_dasync_err.h
new file mode 100644
index 0000000000..943bfec39b
--- /dev/null
+++ b/engines/e_dasync_err.h
@@ -0,0 +1,91 @@
+/* ====================================================================
+ * Copyright (c) 2015 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
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * 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).
+ *
+ */
+
+#ifndef HEADER_DASYNC_ERR_H
+# define HEADER_DASYNC_ERR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* BEGIN ERROR CODES */
+/* The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+static void ERR_load_DASYNC_strings(void);
+static void ERR_unload_DASYNC_strings(void);
+static void ERR_DASYNC_error(int function, int reason, char *file, int line);
+#define DASYNCerr(f,r) ERR_DASYNC_error((f),(r),__FILE__,__LINE__)
+
+/* Error codes for the DASYNC functions. */
+
+/* Function codes. */
+#define DASYNC_F_BIND_DASYNC 107
+#define DASYNC_F_CIPHER_AES_128_CBC_CODE 100
+#define DASYNC_F_DASYNC_BN_MOD_EXP 101
+#define DASYNC_F_DASYNC_MOD_EXP 102
+#define DASYNC_F_DASYNC_PRIVATE_DECRYPT 103
+#define DASYNC_F_DASYNC_PRIVATE_ENCRYPT 104
+#define DASYNC_F_DASYNC_PUBLIC_DECRYPT 105
+#define DASYNC_F_DASYNC_PUBLIC_ENCRYPT 106
+
+/* Reason codes. */
+#define DASYNC_R_INIT_FAILED 102
+#define DASYNC_R_LENGTH_NOT_BLOCK_ALIGNED 100
+#define DASYNC_R_UNKNOWN_FAULT 101
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/openssl/engine.h b/include/openssl/engine.h
index c228487f90..7a9b495464 100644
--- a/include/openssl/engine.h
+++ b/include/openssl/engine.h
@@ -409,6 +409,7 @@ void ENGINE_load_gmp(void);
# ifndef OPENSSL_NO_GOST
void ENGINE_load_gost(void);
# endif
+void ENGINE_load_dasync(void);
# endif
void ENGINE_load_cryptodev(void);
void ENGINE_load_rdrand(void);
diff --git a/util/libeay.num b/util/libeay.num
index 1f905e887c..5d72034063 100755
--- a/util/libeay.num
+++ b/util/libeay.num
@@ -4649,3 +4649,4 @@ X509_get0_uids 5008 EXIST::FUNCTION:
X509_aux_print 5009 EXIST::FUNCTION:STDIO
TS_RESP_CTX_set_signer_digest 5010 EXIST::FUNCTION:
TS_CONF_set_signer_digest 5011 EXIST::FUNCTION:
+ENGINE_load_dasync 5012 EXIST::FUNCTION:ENGINE,STATIC_ENGINE