summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2000-12-15 22:17:13 +0000
committerbeck <beck@openbsd.org>2000-12-15 22:17:13 +0000
commit7acfcc6ef7097c423221e7146f2548694d46e418 (patch)
treead55175b8677d0db7a2bdb8070582fb27c28ce6d /usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c
parentDefine BUS_SPACE_BARRIER_{READ,WRITE} as synonmys for BUS_BARRIER_{READ,WRITE} (diff)
downloadwireguard-openbsd-7acfcc6ef7097c423221e7146f2548694d46e418.tar.xz
wireguard-openbsd-7acfcc6ef7097c423221e7146f2548694d46e418.zip
apache 1.3.14 + mod_ssl 2.7.1 merge
Diffstat (limited to 'usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c')
-rw-r--r--usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c b/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c
index d2c8d55ad73..c17414c1ca2 100644
--- a/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c
+++ b/usr.sbin/httpd/src/modules/ssl/ssl_engine_init.c
@@ -266,6 +266,13 @@ void ssl_init_Module(server_rec *s, pool *p)
#endif
/*
+ * SSL external crypto device ("engine") support
+ */
+#ifdef SSL_EXPERIMENTAL_ENGINE
+ ssl_init_Engine(s, p);
+#endif
+
+ /*
* Warn the user that he should use the session cache.
* But we can operate without it, of course.
*/
@@ -351,6 +358,35 @@ void ssl_init_SSLLibrary(void)
}
/*
+ * Support for external a Crypto Device ("engine"), usually
+ * a hardware accellerator card for crypto operations.
+ */
+#ifdef SSL_EXPERIMENTAL_ENGINE
+void ssl_init_Engine(server_rec *s, pool *p)
+{
+ SSLModConfigRec *mc = myModConfig();
+ ENGINE *e;
+
+ if (mc->szCryptoDevice != NULL) {
+ if ((e = ENGINE_by_id(mc->szCryptoDevice)) == NULL) {
+ ssl_log(s, SSL_LOG_ERROR, "Init: Failed to load Crypto Device API `%s'",
+ mc->szCryptoDevice);
+ ssl_die();
+ }
+ if (strEQ(mc->szCryptoDevice, "chil"))
+ ENGINE_ctrl(e, ENGINE_CTRL_CHIL_SET_FORKCHECK, 1, 0, 0);
+ if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
+ ssl_log(s, SSL_LOG_ERROR, "Init: Failed to enable Crypto Device API `%s'",
+ mc->szCryptoDevice);
+ ssl_die();
+ }
+ ENGINE_free(e);
+ }
+ return;
+}
+#endif
+
+/*
* Handle the Temporary RSA Keys and DH Params
*/
void ssl_init_TmpKeysHandle(int action, server_rec *s, pool *p)