aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--linux-pam-conf6
-rw-r--r--openpam-conf11
3 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 312a6fe..fc230b3 100644
--- a/Makefile
+++ b/Makefile
@@ -44,6 +44,10 @@ ifeq "$(PAM_SSH)" "yes"
PAMFLAGS += -DHAVE_PAM_SSH=1
endif
+ifeq "$(SHA512)" "yes"
+PAMFLAGS += -DWANT_SHA512=1
+endif
+
ifeq "$(DEBUG)" "yes"
PAMFLAGS += -DDEBUG=debug
endif
diff --git a/linux-pam-conf b/linux-pam-conf
index 44087d8..ee34768 100644
--- a/linux-pam-conf
+++ b/linux-pam-conf
@@ -9,7 +9,11 @@
#define SUPPORT_NOLOGIN_ACCOUNT 1
#define SUPPORT_NOLOGIN_AUTH 1
-#define UNIX_EXTENDED_ENCRYPTION md5 shadow
+#if WANT_SHA512
+# define UNIX_EXTENDED_ENCRYPTION sha512 shadow
+#else
+# define UNIX_EXTENDED_ENCRYPTION md5 shadow
+#endif
#define LIKEAUTH likeauth
#define DEBUG_NOLOGIN
diff --git a/openpam-conf b/openpam-conf
index 8c384d5..a60581b 100644
--- a/openpam-conf
+++ b/openpam-conf
@@ -5,20 +5,23 @@
// OpenPAM only provides basic modules, it's FreeBSD that provides the
// extended modules, so check for FreeBSD building first.
#ifdef __FreeBSD__
-# define HAVE_LOGIN_ACCESS 1
+# define HAVE_LOGIN_ACCESS 1
+# define SUPPORT_UNIX_SESSION 0
# if defined(DEBUG)
# define DEBUG_NOLOGIN DEBUG
# endif
# if __FreeBSD__ < 7
-# define SUPPORT_UNIX_SESSION 1
# define SUPPORT_NOLOGIN_ACCOUNT 1
# define SUPPORT_NOLOGIN_AUTH 0
# else
-# define SUPPORT_UNIX_SESSION 0
# define SUPPORT_NOLOGIN_ACCOUNT 0
# define SUPPORT_NOLOGIN_AUTH 1
# endif
-#endif
+# if defined(WANT_SHA512)
+# error "SHA512 support is not present for FreeBSD!"
+# endif
+
+#endif /* __FreeBSD__ */