From 14e380c6e7645b1221f289794454dd8f66468e57 Mon Sep 17 00:00:00 2001 From: dtucker Date: Sat, 7 Mar 2009 11:22:35 +0000 Subject: [PATCH] - (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}] EVP_DigestUpdate does not exactly match the other OLD_EVP functions (eg in openssl 0.9.6) so add an explicit test for it. --- ChangeLog | 3 +++ configure.ac | 17 +++++++++++++++++ openbsd-compat/openssl-compat.c | 2 ++ openbsd-compat/openssl-compat.h | 5 ++++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1c982f5d..be302d9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ to use them. Allows building with older OpenSSL versions. - (dtucker) [configure.ac defines.h] Check for in_port_t and typedef if needed. - (dtucker) [configure.ac] Missing comma in type list. + - (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}] + EVP_DigestUpdate does not exactly match the other OLD_EVP functions (eg + in openssl 0.9.6) so add an explicit test for it. 20090306 - (djm) OpenBSD CVS Sync diff --git a/configure.ac b/configure.ac index fa4d2257..571166e9 100644 --- a/configure.ac +++ b/configure.ac @@ -2076,6 +2076,23 @@ int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);} ] ) +AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) +AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +int main(void) { if(EVP_DigestUpdate(NULL, NULL,0)) exit(0); } + ]])], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + AC_DEFINE(OPENSSL_EVP_DIGESTUPDATE_VOID, 1, + [Define if EVP_DigestUpdate returns void]) + ] +) + # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, # because the system crypt() is more featureful. if test "x$check_for_libcrypt_before" = "x1"; then diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c index 002aa0ad..f5018512 100644 --- a/openbsd-compat/openssl-compat.c +++ b/openbsd-compat/openssl-compat.c @@ -47,7 +47,9 @@ ssh_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *evp) EVP_CIPHER_CTX_cleanup(evp); return 1; } +#endif +#ifdef OPENSSL_EVP_DIGESTUPDATE_VOID int 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 ee37b037..09939960 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h @@ -78,9 +78,12 @@ extern const EVP_CIPHER *evp_acss(void); # define EVP_CipherInit(a,b,c,d,e) ssh_EVP_CipherInit((a),(b),(c),(d),(e)) # define EVP_Cipher(a,b,c,d) ssh_EVP_Cipher((a),(b),(c),(d)) # define EVP_CIPHER_CTX_cleanup(a) ssh_EVP_CIPHER_CTX_cleanup((a)) -# define EVP_DigestUpdate(a,b,c) ssh_EVP_DigestUpdate((a),(b),(c)) # endif /* SSH_OLD_EVP */ +# ifdef OPENSSL_EVP_DIGESTUPDATE_VOID +# define EVP_DigestUpdate(a,b,c) ssh_EVP_DigestUpdate((a),(b),(c)) +# endif + # ifdef USE_OPENSSL_ENGINE # ifdef SSLeay_add_all_algorithms # undef SSLeay_add_all_algorithms -- 2.45.2