configure and have crypt or DES_crypt

Damien Miller djm at mindrot.org
Wed Mar 4 05:02:35 AEDT 2015


On Tue, 3 Mar 2015, Roumen Petrov wrote:

> Damien Miller wrote:
>
> > I think that might break some systems that configure --without-openssl,
> > so it probably better to move the test out of the if-else entirely.
> I take this into account. This is reason to point to code where is used - only
> lines
> # if defined(WITH_OPENSSL) && !defined(HAVE_CRYPT) && defined(HAVE_DES_CRYPT)
> #  include <openssl/des.h>
> #  define crypt DES_crypt
> # endif
> 
> Build without openssl should not be impacted. On those system SSH cannot be
> build without libcrypto.

ok, I've committed this because it might be surprising that HAVE_CRYPT
is not defined on platforms that do have it.

diff --git a/configure.ac b/configure.ac
index 2ef9db6..b4d6598 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2572,6 +2572,7 @@ if test "x$openssl" = "xyes" ; then
 	if test "x$check_for_libcrypt_later" = "x1"; then
 		AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"])
 	fi
+	AC_CHECK_FUNCS([crypt DES_crypt])
 
 	# Search for SHA256 support in libc and/or OpenSSL
 	AC_CHECK_FUNCS([SHA256_Update EVP_sha256], ,
@@ -2710,7 +2711,7 @@ if test "x$openssl" = "xyes" ; then
 	AC_SUBST([COMMENT_OUT_ECC])
 else
 	AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"])
-	AC_CHECK_FUNCS([crypt DES_crypt])
+	AC_CHECK_FUNCS([crypt])
 fi
 
 AC_CHECK_FUNCS([ \


More information about the openssh-unix-dev mailing list