- (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.
diff --git a/ChangeLog b/ChangeLog
index 1c982f5..be302d9 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 a2cb7a2..51fee9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.417 2009/03/07 07:06:22 dtucker Exp $
+# $Id: configure.ac,v 1.418 2009/03/07 11:22:35 dtucker Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
-AC_REVISION($Revision: 1.417 $)
+AC_REVISION($Revision: 1.418 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_CONFIG_HEADER(config.h)
@@ -2076,6 +2076,23 @@
]
)
+AC_MSG_CHECKING([if EVP_DigestUpdate returns an int])
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <string.h>
+#include <openssl/evp.h>
+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 f543578..dd326c0 100644
--- a/openbsd-compat/openssl-compat.c
+++ b/openbsd-compat/openssl-compat.c
@@ -1,4 +1,4 @@
-/* $Id: openssl-compat.c,v 1.7 2009/03/07 01:01:47 dtucker Exp $ */
+/* $Id: openssl-compat.c,v 1.8 2009/03/07 11:22:35 dtucker Exp $ */
/*
* Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au>
@@ -47,7 +47,9 @@
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 945a7a3..fcc7628 100644
--- a/openbsd-compat/openssl-compat.h
+++ b/openbsd-compat/openssl-compat.h
@@ -1,4 +1,4 @@
-/* $Id: openssl-compat.h,v 1.13 2009/03/07 01:01:47 dtucker Exp $ */
+/* $Id: openssl-compat.h,v 1.14 2009/03/07 11:22:35 dtucker Exp $ */
/*
* Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au>
@@ -78,9 +78,12 @@
# 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