summaryrefslogtreecommitdiffstats
path: root/package/openssl/patches/210-use_cryptodev_by_default_if_available.patch
blob: 6bcb78601b10e6971b2a6746a7e9041766a7431f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- openssl-0.9.8h/ssl/ssl_algs.c	2007-04-24 01:50:21.000000000 +0200
+++ openssl-0.9.8h-ocf/ssl/ssl_algs.c	2008-07-12 17:34:27.000000000 +0200
@@ -57,6 +57,9 @@
  */
 
 #include <stdio.h>
+#ifndef OPENSSL_NO_ENGINE
+#include <openssl/engine.h>
+#endif
 #include <openssl/objects.h>
 #include <openssl/lhash.h>
 #include "ssl_locl.h"
@@ -127,6 +130,15 @@
 #endif
 	/* initialize cipher/digest methods table */
 	ssl_load_ciphers();
+
+#ifndef OPENSSL_NO_ENGINE
+	/* Initialize available hardware crypto engines */
+	ENGINE_load_builtin_engines();
+	ENGINE_register_all_complete();
+	/* ...and set cryptodev to be the default. */
+	ENGINE_set_default_ciphers(ENGINE_by_id("cryptodev"));
+#endif
+
 	return(1);
 	}