1 diff -Naur openssl-0.9.8n.org/crypto/engine/eng_all.c openssl-0.9.8n/crypto/engine/eng_all.c
2 --- openssl-0.9.8n.org/crypto/engine/eng_all.c 2010-03-01 01:30:11.000000000 +0100
3 +++ openssl-0.9.8n/crypto/engine/eng_all.c 2010-03-30 08:11:26.000000000 +0200
8 -#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
9 ENGINE_load_cryptodev();
11 #if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
17 -#if defined(__OpenBSD__) || defined(__FreeBSD__)
18 void ENGINE_setup_bsd_cryptodev(void) {
19 static int bsd_cryptodev_default_loaded = 0;
20 if (!bsd_cryptodev_default_loaded) {
23 bsd_cryptodev_default_loaded=1;
26 diff -Naur openssl-0.9.8n.org/crypto/engine/eng_cryptodev.c openssl-0.9.8n/crypto/engine/eng_cryptodev.c
27 --- openssl-0.9.8n.org/crypto/engine/eng_cryptodev.c 2010-03-03 16:30:05.000000000 +0100
28 +++ openssl-0.9.8n/crypto/engine/eng_cryptodev.c 2010-03-30 08:01:11.000000000 +0200
30 #if (defined(__unix__) || defined(unix)) && !defined(USG) && \
31 (defined(OpenBSD) || defined(__FreeBSD__))
32 #include <sys/param.h>
33 -# if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041)
34 -# define HAVE_CRYPTODEV
36 # if (OpenBSD >= 200110)
37 # define HAVE_SYSLOG_R
41 +#if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041) || defined(__linux__)
42 +# define HAVE_CRYPTODEV
45 #ifndef HAVE_CRYPTODEV
51 #include <sys/types.h>
52 -#include <crypto/cryptodev.h>
53 +#if defined(__linux__)
54 +# include <linux/cryptodev.h>
55 +# define HAVE_CRYPTODEV_NAME
57 +# include <crypto/cryptodev.h>
59 #include <sys/ioctl.h>
63 static int get_dev_crypto(void);
64 static int cryptodev_max_iv(int cipher);
65 static int cryptodev_key_length_valid(int cipher, int len);
66 -static int cipher_nid_to_cryptodev(int nid);
67 +#ifndef HAVE_CRYPTODEV_NAME
68 + static int cipher_nid_to_cryptodev(int nid);
70 + static char *cipher_nid_to_cryptodev_name(int nid);
72 static int get_cryptodev_ciphers(const int **cnids);
73 /*static int get_cryptodev_digests(const int **cnids);*/
74 static int cryptodev_usable_ciphers(const int **nids);
75 diff -Naur openssl-0.9.8n.org/crypto/engine/engine.h openssl-0.9.8n/crypto/engine/engine.h
76 --- openssl-0.9.8n.org/crypto/engine/engine.h 2010-02-09 15:18:15.000000000 +0100
77 +++ openssl-0.9.8n/crypto/engine/engine.h 2010-03-30 08:01:11.000000000 +0200
80 void *ENGINE_get_static_state(void);
82 -#if defined(__OpenBSD__) || defined(__FreeBSD__)
83 void ENGINE_setup_bsd_cryptodev(void);
86 /* BEGIN ERROR CODES */
87 /* The following lines are auto generated by the script mkerr.pl. Any changes
88 diff -Naur openssl-0.9.8n.org/crypto/evp/c_all.c openssl-0.9.8n/crypto/evp/c_all.c
89 --- openssl-0.9.8n.org/crypto/evp/c_all.c 2004-08-29 18:36:04.000000000 +0200
90 +++ openssl-0.9.8n/crypto/evp/c_all.c 2010-03-30 08:01:11.000000000 +0200
92 OpenSSL_add_all_ciphers();
93 OpenSSL_add_all_digests();
94 #ifndef OPENSSL_NO_ENGINE
95 -# if defined(__OpenBSD__) || defined(__FreeBSD__)
96 ENGINE_setup_bsd_cryptodev();