summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/xcrypt.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2021-05-06 10:08:30 +1000
committerDamien Miller <djm@mindrot.org>2021-10-28 16:16:13 +1100
commita5ab4882348d26addc9830a44e053238dfa2cb58 (patch)
tree82ee92feaa15fa4c3e33f4ae43107fcbbd2885e8 /openbsd-compat/xcrypt.c
parentc5de1fffa6328b8246b87da28fa9df05813f76a3 (diff)
remove built-in support for md5crypt()
Users of MD5-hashed password should arrange for ./configure to link against libxcrypt or similar. Though it would be better to avoid use of MD5 password hashing entirely, it's arguably worse than DEScrypt. feedback and ok dtucker@
Diffstat (limited to 'openbsd-compat/xcrypt.c')
-rw-r--r--openbsd-compat/xcrypt.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c
index 360b187a..e493dd31 100644
--- a/openbsd-compat/xcrypt.c
+++ b/openbsd-compat/xcrypt.c
@@ -54,10 +54,6 @@
# include <pwdadj.h>
# endif
-# if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
-# include "md5crypt.h"
-# endif
-
# if defined(WITH_OPENSSL) && !defined(HAVE_CRYPT) && defined(HAVE_DES_CRYPT)
# include <openssl/des.h>
# define crypt DES_crypt
@@ -108,12 +104,7 @@ xcrypt(const char *password, const char *salt)
if (salt == NULL)
salt = pick_salt();
-# ifdef HAVE_MD5_PASSWORDS
- if (is_md5_salt(salt))
- crypted = md5_crypt(password, salt);
- else
- crypted = crypt(password, salt);
-# elif defined(__hpux) && !defined(HAVE_SECUREWARE)
+#if defined(__hpux) && !defined(HAVE_SECUREWARE)
if (iscomsec())
crypted = bigcrypt(password, salt);
else
@@ -122,7 +113,7 @@ xcrypt(const char *password, const char *salt)
crypted = bigcrypt(password, salt);
# else
crypted = crypt(password, salt);
-# endif
+#endif
return crypted;
}