diff options
Diffstat (limited to 'openbsd-compat/openssl-compat.h')
-rw-r--r-- | openbsd-compat/openssl-compat.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 8a015ec43..9b5ccff5f 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openssl-compat.h,v 1.3 2005/12/19 06:40:40 dtucker Exp $ */ | 1 | /* $Id: openssl-compat.h,v 1.7 2007/03/05 07:25:20 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> | 4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> |
@@ -46,6 +46,11 @@ extern const EVP_CIPHER *evp_acss(void); | |||
46 | # endif | 46 | # endif |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | /* OpenSSL 0.9.8e returns cipher key len not context key len */ | ||
50 | #if (OPENSSL_VERSION_NUMBER == 0x0090805fL) | ||
51 | # define EVP_CIPHER_CTX_key_length(c) ((c)->key_len) | ||
52 | #endif | ||
53 | |||
49 | /* | 54 | /* |
50 | * We overload some of the OpenSSL crypto functions with ssh_* equivalents | 55 | * We overload some of the OpenSSL crypto functions with ssh_* equivalents |
51 | * which cater for older and/or less featureful OpenSSL version. | 56 | * which cater for older and/or less featureful OpenSSL version. |
@@ -54,21 +59,27 @@ extern const EVP_CIPHER *evp_acss(void); | |||
54 | * define SSH_DONT_OVERLOAD_OPENSSL_FUNCS before including this file and | 59 | * define SSH_DONT_OVERLOAD_OPENSSL_FUNCS before including this file and |
55 | * implement the ssh_* equivalents. | 60 | * implement the ssh_* equivalents. |
56 | */ | 61 | */ |
57 | #ifdef SSH_OLD_EVP | 62 | #ifndef SSH_DONT_OVERLOAD_OPENSSL_FUNCS |
58 | |||
59 | # ifndef SSH_DONT_REDEF_EVP | ||
60 | 63 | ||
64 | # ifdef SSH_OLD_EVP | ||
61 | # ifdef EVP_Cipher | 65 | # ifdef EVP_Cipher |
62 | # undef EVP_Cipher | 66 | # undef EVP_Cipher |
63 | # endif | 67 | # endif |
64 | |||
65 | # define EVP_CipherInit(a,b,c,d,e) ssh_EVP_CipherInit((a),(b),(c),(d),(e)) | 68 | # define EVP_CipherInit(a,b,c,d,e) ssh_EVP_CipherInit((a),(b),(c),(d),(e)) |
66 | # define EVP_Cipher(a,b,c,d) ssh_EVP_Cipher((a),(b),(c),(d)) | 69 | # define EVP_Cipher(a,b,c,d) ssh_EVP_Cipher((a),(b),(c),(d)) |
67 | # define EVP_CIPHER_CTX_cleanup(a) ssh_EVP_CIPHER_CTX_cleanup((a)) | 70 | # define EVP_CIPHER_CTX_cleanup(a) ssh_EVP_CIPHER_CTX_cleanup((a)) |
68 | # endif | 71 | # endif /* SSH_OLD_EVP */ |
72 | |||
73 | # ifdef USE_OPENSSL_ENGINE | ||
74 | # ifdef SSLeay_add_all_algorithms | ||
75 | # undef SSLeay_add_all_algorithms | ||
76 | # endif | ||
77 | # define SSLeay_add_all_algorithms() ssh_SSLeay_add_all_algorithms() | ||
78 | #endif | ||
69 | 79 | ||
70 | int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, | 80 | int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, |
71 | unsigned char *, int); | 81 | unsigned char *, int); |
72 | int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); | 82 | int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); |
73 | int ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *); | 83 | int ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *); |
74 | #endif | 84 | void ssh_SSLeay_add_all_algorithms(void); |
85 | #endif /* SSH_DONT_OVERLOAD_OPENSSL_FUNCS */ | ||