Imported Debian patch 0.60.1-1
[hcoop/debian/courier-authlib.git] / cryptpassword.c
index a7e88d2..1ad4a50 100644 (file)
@@ -17,7 +17,7 @@
 #include       "auth.h"
 #include       <sys/time.h>
 
-static const char rcsid[]="$Id: cryptpassword.c,v 1.8 2005/07/13 00:34:59 mrsam Exp $";
+static const char rcsid[]="$Id: cryptpassword.c,v 1.9 2007/10/07 18:33:22 mrsam Exp $";
 
 #if HAVE_CRYPT
 #if NEED_CRYPT_PROTOTYPE
@@ -101,6 +101,13 @@ char *authcryptpasswd(const char *password, const char *encryption_hint)
                hash_func= &md5_hash_courier;
                pfix="{MD5}";
        }
+
+       if (!encryption_hint || strncasecmp(encryption_hint, "{MD5RAW}", 5)
+           == 0)
+       {
+               hash_func= &md5_hash_raw;
+               pfix="{MD5RAW}";
+       }
 #endif
 
 #if    HAVE_SHA1LIB