]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/openssl-0.9.8k-cryptodev.diff
Updated openssl (0.9.8n).
[ipfire-2.x.git] / src / patches / openssl-0.9.8k-cryptodev.diff
CommitLineData
fb25052f
MT
1diff -ur openssl-0.9.8k/crypto/engine/eng_all.c openssl-0.9.8k.new/crypto/engine/eng_all.c
2--- openssl-0.9.8k/crypto/engine/eng_all.c 2008-06-04 21:01:39.000000000 +0300
3+++ openssl-0.9.8k.new/crypto/engine/eng_all.c 2009-11-24 13:41:49.000000000 +0200
4@@ -104,16 +104,15 @@
5 #endif
6 #endif
7 #ifndef OPENSSL_NO_HW
8-#if defined(__OpenBSD__) || defined(__FreeBSD__)
9+# if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041) || defined(__linux__)
10 ENGINE_load_cryptodev();
11-#endif
12+# endif
13 #if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
14 ENGINE_load_capi();
15 #endif
16 #endif
17 }
18
19-#if defined(__OpenBSD__) || defined(__FreeBSD__)
20 void ENGINE_setup_bsd_cryptodev(void) {
21 static int bsd_cryptodev_default_loaded = 0;
22 if (!bsd_cryptodev_default_loaded) {
23@@ -122,4 +121,3 @@
24 }
25 bsd_cryptodev_default_loaded=1;
26 }
27-#endif
28diff -ur openssl-0.9.8k/crypto/engine/eng_cryptodev.c openssl-0.9.8k.new/crypto/engine/eng_cryptodev.c
29--- openssl-0.9.8k/crypto/engine/eng_cryptodev.c 2004-06-15 14:45:42.000000000 +0300
30+++ openssl-0.9.8k.new/crypto/engine/eng_cryptodev.c 2009-11-24 13:45:31.000000000 +0200
31@@ -34,14 +34,15 @@
32 #if (defined(__unix__) || defined(unix)) && !defined(USG) && \
33 (defined(OpenBSD) || defined(__FreeBSD_version))
34 #include <sys/param.h>
35-# if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041)
36-# define HAVE_CRYPTODEV
37-# endif
38 # if (OpenBSD >= 200110)
39 # define HAVE_SYSLOG_R
40 # endif
41 #endif
42
43+#if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041) || defined(__linux__)
44+# define HAVE_CRYPTODEV
45+#endif
46+
47 #ifndef HAVE_CRYPTODEV
48
49 void
50@@ -54,7 +55,12 @@
51 #else
52
53 #include <sys/types.h>
54-#include <crypto/cryptodev.h>
55+#if defined(__linux__)
56+# include <linux/cryptodev.h>
57+# define HAVE_CRYPTODEV_NAME
58+#else
59+# include <crypto/cryptodev.h>
60+#endif
61 #include <sys/ioctl.h>
62 #include <errno.h>
63 #include <stdio.h>
64@@ -77,7 +83,11 @@
65 static int get_dev_crypto(void);
66 static int cryptodev_max_iv(int cipher);
67 static int cryptodev_key_length_valid(int cipher, int len);
68-static int cipher_nid_to_cryptodev(int nid);
69+#ifndef HAVE_CRYPTODEV_NAME
70+ static int cipher_nid_to_cryptodev(int nid);
71+#else
72+ static char *cipher_nid_to_cryptodev_name(int nid);
73+#endif
74 static int get_cryptodev_ciphers(const int **cnids);
75 static int get_cryptodev_digests(const int **cnids);
76 static int cryptodev_usable_ciphers(const int **nids);
77diff -ur openssl-0.9.8k/crypto/engine/engine.h openssl-0.9.8k.new/crypto/engine/engine.h
78--- openssl-0.9.8k/crypto/engine/engine.h 2008-06-04 21:01:40.000000000 +0300
79+++ openssl-0.9.8k.new/crypto/engine/engine.h 2009-11-24 13:41:49.000000000 +0200
80@@ -703,9 +703,7 @@
81 * values. */
82 void *ENGINE_get_static_state(void);
83
84-#if defined(__OpenBSD__) || defined(__FreeBSD__)
85 void ENGINE_setup_bsd_cryptodev(void);
86-#endif
87
88 /* BEGIN ERROR CODES */
89 /* The following lines are auto generated by the script mkerr.pl. Any changes
90diff -ur openssl-0.9.8k/crypto/evp/c_all.c openssl-0.9.8k.new/crypto/evp/c_all.c
91--- openssl-0.9.8k/crypto/evp/c_all.c 2004-08-29 19:36:04.000000000 +0300
92+++ openssl-0.9.8k.new/crypto/evp/c_all.c 2009-11-24 13:41:49.000000000 +0200
93@@ -83,8 +83,6 @@
94 OpenSSL_add_all_ciphers();
95 OpenSSL_add_all_digests();
96 #ifndef OPENSSL_NO_ENGINE
97-# if defined(__OpenBSD__) || defined(__FreeBSD__)
98 ENGINE_setup_bsd_cryptodev();
99-# endif
100 #endif
101 }