X-Git-Url: http://git.hcoop.net/hcoop/debian/courier-authlib.git/blobdiff_plain/330026da191ad124643fae36d739652130ea9e79..781cfcb8fd50934c470e0dabf79d32ab333dec68:/checkpassword.c diff --git a/checkpassword.c b/checkpassword.c index b71fe14..f403188 100644 --- a/checkpassword.c +++ b/checkpassword.c @@ -1,5 +1,5 @@ /* -** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for +** Copyright 1998 - 2008 Double Precision, Inc. See COPYING for ** distribution information. */ @@ -16,7 +16,7 @@ #include "auth.h" #include "courierauthdebug.h" -static const char rcsid[]="$Id: checkpassword.c,v 1.16 2007/10/07 02:50:45 mrsam Exp $"; +static const char rcsid[]="$Id: checkpassword.c,v 1.19 2008/12/18 12:08:25 mrsam Exp $"; #if HAVE_CRYPT #if NEED_CRYPT_PROTOTYPE @@ -24,30 +24,23 @@ extern char *crypt(const char *, const char *); #endif #endif -#if HAVE_MD5LIB extern int authcheckpasswordmd5(const char *, const char *); -#endif - -#if HAVE_SHA1LIB extern int authcheckpasswordsha1(const char *, const char *); -#endif static int do_authcheckpassword(const char *password, const char *encrypted_password) { -#if HAVE_MD5LIB if (strncmp(encrypted_password, "$1$", 3) == 0 || strncasecmp(encrypted_password, "{MD5}", 5) == 0 || strncasecmp(encrypted_password, "{MD5RAW}", 8) == 0 ) return (authcheckpasswordmd5(password, encrypted_password)); -#endif -#if HAVE_SHA1LIB if (strncasecmp(encrypted_password, "{SHA}", 5) == 0 || - strncasecmp(encrypted_password, "{SHA256}", 8) == 0 - ) + strncasecmp(encrypted_password, "{SHA256}", 8) == 0 || + strncasecmp(encrypted_password, "{SHA512}", 8) == 0 || + strncasecmp(encrypted_password, "{SSHA}", 6) == 0) return (authcheckpasswordsha1(password, encrypted_password)); -#endif + #if HAVE_CRYPT if (strncasecmp(encrypted_password, "{CRYPT}", 7) == 0)