[PATCH] configure.ac/cipher.c: Check for OpenSSL with EVP_des_ede3_cbc

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



While compiling openssl with option `no-des', it caused the openssh
build failure
...
cipher.c:85:41: error: 'EVP_des_ede3_cbc' undeclared here (not in a function);
...

Signed-off-by: Hongxu Jia <hongxu.jia@xxxxxxxxxxxxx>
---
 cipher.c     |  2 ++
 configure.ac | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/cipher.c b/cipher.c
index c3cd5dc..41dacfb 100644
--- a/cipher.c
+++ b/cipher.c
@@ -82,7 +82,9 @@ struct sshcipher {
 
 static const struct sshcipher ciphers[] = {
 #ifdef WITH_OPENSSL
+#ifdef OPENSSL_HAVE_DES
 	{ "3des-cbc",		8, 24, 0, 0, CFLAG_CBC, EVP_des_ede3_cbc },
+#endif
 	{ "aes128-cbc",		16, 16, 0, 0, CFLAG_CBC, EVP_aes_128_cbc },
 	{ "aes192-cbc",		16, 24, 0, 0, CFLAG_CBC, EVP_aes_192_cbc },
 	{ "aes256-cbc",		16, 32, 0, 0, CFLAG_CBC, EVP_aes_256_cbc },
diff --git a/configure.ac b/configure.ac
index 889f506..6c664ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2672,6 +2672,26 @@ if test "x$openssl" = "xyes" ; then
 		]
 	)
 
+	# Check for OpenSSL with EVP_des_ede3_cbc
+	AC_MSG_CHECKING([whether OpenSSL has DES support])
+	AC_LINK_IFELSE(
+		[AC_LANG_PROGRAM([[
+	#include <string.h>
+	#include <openssl/evp.h>
+	]], [[
+		exit(EVP_des_ede3_cbc() == NULL);
+	]])],
+	[
+		AC_MSG_RESULT([yes])
+		AC_DEFINE([OPENSSL_HAVE_DES], [1],
+		[libcrypto has DES support])
+	],
+	[
+		AC_MSG_RESULT([no])
+	]
+	)
+
+
 	# Check for OpenSSL with EVP_aes_*ctr
 	AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP])
 	AC_LINK_IFELSE(
-- 
2.7.4

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux