1 diff -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
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();
13 #if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
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) {
25 bsd_cryptodev_default_loaded=1;
28 diff -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
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
38 # if (OpenBSD >= 200110)
39 # define HAVE_SYSLOG_R
43 +#if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041) || defined(__linux__)
44 +# define HAVE_CRYPTODEV
47 #ifndef HAVE_CRYPTODEV
53 #include <sys/types.h>
54 -#include <crypto/cryptodev.h>
55 +#if defined(__linux__)
56 +# include <linux/cryptodev.h>
57 +# define HAVE_CRYPTODEV_NAME
59 +# include <crypto/cryptodev.h>
61 #include <sys/ioctl.h>
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);
72 + static char *cipher_nid_to_cryptodev_name(int nid);
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);
77 diff -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
82 void *ENGINE_get_static_state(void);
84 -#if defined(__OpenBSD__) || defined(__FreeBSD__)
85 void ENGINE_setup_bsd_cryptodev(void);
88 /* BEGIN ERROR CODES */
89 /* The following lines are auto generated by the script mkerr.pl. Any changes
90 diff -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
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();