* Adapted from shadow-19990607 by Tudor Bosman, tudorb@jm.nu
*/
-#include "config.h"
+#include "includes.h"
-#ifdef HAVE_MD5_PASSWORDS
+RCSID("$Id$");
-#include <unistd.h>
-#include <string.h>
+#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
-#ifdef HAVE_OPENSSL
#include <openssl/md5.h>
-#endif
-
-#ifdef HAVE_SSL
-#include <ssl/md5.h>
-#endif
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static char *magic = "$1$"; /*
- * This string is magic for
- * this algorithm. Having
- * it this way, we can get
- * get better later on
- */
+ * This string is magic for
+ * this algorithm. Having
+ * it this way, we can get
+ * get better later on
+ */
static void
to64(char *s, unsigned long v, int n)
int
is_md5_salt(const char *salt)
{
- return (!strncmp(salt, magic, strlen(magic)));
+ return (!strncmp(salt, magic, strlen(magic)));
}
/*
return passwd;
}
-#endif /* HAVE_MD5_PASSWORDS */
+#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */