diff options
Diffstat (limited to 'openbsd-compat/openssl-compat.h')
-rw-r--r-- | openbsd-compat/openssl-compat.h | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 9e0264c04..917bc6f7c 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h | |||
@@ -21,16 +21,32 @@ | |||
21 | #ifdef WITH_OPENSSL | 21 | #ifdef WITH_OPENSSL |
22 | 22 | ||
23 | #include <openssl/opensslv.h> | 23 | #include <openssl/opensslv.h> |
24 | #include <openssl/crypto.h> | ||
24 | #include <openssl/evp.h> | 25 | #include <openssl/evp.h> |
25 | #include <openssl/rsa.h> | 26 | #include <openssl/rsa.h> |
26 | #include <openssl/dsa.h> | 27 | #include <openssl/dsa.h> |
28 | #ifdef OPENSSL_HAS_ECC | ||
27 | #include <openssl/ecdsa.h> | 29 | #include <openssl/ecdsa.h> |
30 | #endif | ||
28 | #include <openssl/dh.h> | 31 | #include <openssl/dh.h> |
29 | 32 | ||
30 | int ssh_compatible_openssl(long, long); | 33 | int ssh_compatible_openssl(long, long); |
34 | void ssh_libcrypto_init(void); | ||
35 | |||
36 | #if (OPENSSL_VERSION_NUMBER < 0x1000100fL) | ||
37 | # error OpenSSL 1.0.1 or greater is required | ||
38 | #endif | ||
39 | |||
40 | #ifndef OPENSSL_VERSION | ||
41 | # define OPENSSL_VERSION SSLEAY_VERSION | ||
42 | #endif | ||
43 | |||
44 | #ifndef HAVE_OPENSSL_VERSION | ||
45 | # define OpenSSL_version(x) SSLeay_version(x) | ||
46 | #endif | ||
31 | 47 | ||
32 | #if (OPENSSL_VERSION_NUMBER <= 0x0090805fL) | 48 | #ifndef HAVE_OPENSSL_VERSION_NUM |
33 | # error OpenSSL 0.9.8f or greater is required | 49 | # define OpenSSL_version_num SSLeay |
34 | #endif | 50 | #endif |
35 | 51 | ||
36 | #if OPENSSL_VERSION_NUMBER < 0x10000001L | 52 | #if OPENSSL_VERSION_NUMBER < 0x10000001L |
@@ -77,27 +93,6 @@ void ssh_aes_ctr_iv(EVP_CIPHER_CTX *, int, u_char *, size_t); | |||
77 | # endif | 93 | # endif |
78 | #endif | 94 | #endif |
79 | 95 | ||
80 | /* | ||
81 | * We overload some of the OpenSSL crypto functions with ssh_* equivalents | ||
82 | * to automatically handle OpenSSL engine initialisation. | ||
83 | * | ||
84 | * In order for the compat library to call the real functions, it must | ||
85 | * define SSH_DONT_OVERLOAD_OPENSSL_FUNCS before including this file and | ||
86 | * implement the ssh_* equivalents. | ||
87 | */ | ||
88 | #ifndef SSH_DONT_OVERLOAD_OPENSSL_FUNCS | ||
89 | |||
90 | # ifdef USE_OPENSSL_ENGINE | ||
91 | # ifdef OpenSSL_add_all_algorithms | ||
92 | # undef OpenSSL_add_all_algorithms | ||
93 | # endif | ||
94 | # define OpenSSL_add_all_algorithms() ssh_OpenSSL_add_all_algorithms() | ||
95 | # endif | ||
96 | |||
97 | void ssh_OpenSSL_add_all_algorithms(void); | ||
98 | |||
99 | #endif /* SSH_DONT_OVERLOAD_OPENSSL_FUNCS */ | ||
100 | |||
101 | /* LibreSSL/OpenSSL 1.1x API compat */ | 96 | /* LibreSSL/OpenSSL 1.1x API compat */ |
102 | #ifndef HAVE_DSA_GET0_PQG | 97 | #ifndef HAVE_DSA_GET0_PQG |
103 | void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, | 98 | void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, |
@@ -161,6 +156,7 @@ void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); | |||
161 | int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s); | 156 | int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s); |
162 | #endif /* DSA_SIG_SET0 */ | 157 | #endif /* DSA_SIG_SET0 */ |
163 | 158 | ||
159 | #ifdef OPENSSL_HAS_ECC | ||
164 | #ifndef HAVE_ECDSA_SIG_GET0 | 160 | #ifndef HAVE_ECDSA_SIG_GET0 |
165 | void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); | 161 | void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); |
166 | #endif /* HAVE_ECDSA_SIG_GET0 */ | 162 | #endif /* HAVE_ECDSA_SIG_GET0 */ |
@@ -168,6 +164,7 @@ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); | |||
168 | #ifndef HAVE_ECDSA_SIG_SET0 | 164 | #ifndef HAVE_ECDSA_SIG_SET0 |
169 | int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s); | 165 | int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s); |
170 | #endif /* HAVE_ECDSA_SIG_SET0 */ | 166 | #endif /* HAVE_ECDSA_SIG_SET0 */ |
167 | #endif /* OPENSSL_HAS_ECC */ | ||
171 | 168 | ||
172 | #ifndef HAVE_DH_GET0_PQG | 169 | #ifndef HAVE_DH_GET0_PQG |
173 | void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, | 170 | void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, |