diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/openssl-compat.c | 30 | ||||
-rw-r--r-- | openbsd-compat/openssl-compat.h | 18 |
2 files changed, 46 insertions, 2 deletions
diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c index 5189cab61..52c7183f1 100644 --- a/openbsd-compat/openssl-compat.c +++ b/openbsd-compat/openssl-compat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openssl-compat.c,v 1.14 2011/05/10 01:13:38 dtucker Exp $ */ | 1 | /* $Id: openssl-compat.c,v 1.15 2014/01/17 06:32:31 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> |
@@ -59,6 +59,34 @@ ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *evp) | |||
59 | } | 59 | } |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | #ifndef HAVE_EVP_DIGESTINIT_EX | ||
63 | int | ||
64 | EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *md, void *engine) | ||
65 | { | ||
66 | if (engine != NULL) | ||
67 | fatal("%s: ENGINE is not supported", __func__); | ||
68 | # ifdef OPENSSL_EVP_DIGESTUPDATE_VOID | ||
69 | EVP_DigestInit(ctx, md); | ||
70 | return 1; | ||
71 | # else | ||
72 | return EVP_DigestInit(ctx, md); | ||
73 | # endif | ||
74 | } | ||
75 | #endif | ||
76 | |||
77 | #ifndef HAVE_EVP_DISESTFINAL_EX | ||
78 | int | ||
79 | EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s) | ||
80 | { | ||
81 | # ifdef OPENSSL_EVP_DIGESTUPDATE_VOID | ||
82 | EVP_DigestFinal(ctx, md, s); | ||
83 | return 1; | ||
84 | # else | ||
85 | return EVP_DigestFinal(ctx, md, s); | ||
86 | # endif | ||
87 | } | ||
88 | #endif | ||
89 | |||
62 | #ifdef OPENSSL_EVP_DIGESTUPDATE_VOID | 90 | #ifdef OPENSSL_EVP_DIGESTUPDATE_VOID |
63 | int | 91 | int |
64 | ssh_EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt) | 92 | ssh_EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt) |
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index e7439b4e7..021ea98f5 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openssl-compat.h,v 1.24 2013/02/12 00:00:40 djm Exp $ */ | 1 | /* $Id: openssl-compat.h,v 1.25 2014/01/17 06:32:31 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> |
@@ -148,6 +148,14 @@ int DSA_generate_parameters_ex(DSA *, int, const unsigned char *, int, int *, | |||
148 | int RSA_generate_key_ex(RSA *, int, BIGNUM *, void *); | 148 | int RSA_generate_key_ex(RSA *, int, BIGNUM *, void *); |
149 | # endif | 149 | # endif |
150 | 150 | ||
151 | # ifndef HAVE_EVP_DIGESTINIT_EX | ||
152 | int EVP_DigestInit_ex(EVP_MD_CTX *, const EVP_MD *, void *); | ||
153 | # endif | ||
154 | |||
155 | # ifndef HAVE_EVP_DISESTFINAL_EX | ||
156 | int EVP_DigestFinal_ex(EVP_MD_CTX *, unsigned char *, unsigned int *); | ||
157 | # endif | ||
158 | |||
151 | int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, | 159 | int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, |
152 | unsigned char *, int); | 160 | unsigned char *, int); |
153 | int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); | 161 | int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); |
@@ -158,5 +166,13 @@ void ssh_OpenSSL_add_all_algorithms(void); | |||
158 | # define HMAC_CTX_init(a) | 166 | # define HMAC_CTX_init(a) |
159 | # endif | 167 | # endif |
160 | 168 | ||
169 | # ifndef HAVE_EVP_MD_CTX_INIT | ||
170 | # define EVP_MD_CTX_init(a) | ||
171 | # endif | ||
172 | |||
173 | # ifndef HAVE_EVP_MD_CTX_CLEANUP | ||
174 | # define EVP_MD_CTX_cleanup(a) | ||
175 | # endif | ||
176 | |||
161 | #endif /* SSH_DONT_OVERLOAD_OPENSSL_FUNCS */ | 177 | #endif /* SSH_DONT_OVERLOAD_OPENSSL_FUNCS */ |
162 | 178 | ||