Merge branch 'debian'
[hcoop/debian/courier-authlib.git] / cryptpassword.c
index 6229fd6..b185e4b 100644 (file)
@@ -31,20 +31,6 @@ extern char *crypt(const char *, const char *);
 
 static const char crypt_salt[65]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./";
 
-static const char *crypt_hash(const char *pw)
-{
-       random128binbuf randbuf;
-       char salt[3];
-
-       random128_binary(&randbuf);
-
-       salt[0]=crypt_salt[ randbuf[0] % 64 ];
-       salt[1]=crypt_salt[ randbuf[1] % 64 ];
-       salt[2]=0;
-
-       return (crypt(pw, salt));
-}
-
 static const char *ssha_hash_int(const char *pw)
 {
        random128binbuf randbuf;
@@ -132,8 +118,8 @@ char *authcryptpasswd(const char *password, const char *encryption_hint)
 
        if (!hash_func)
        {
-               hash_func= &crypt_hash;
-               pfix="{CRYPT}";
+               hash_func= &ssha_hash_int;
+               pfix="{SSHA}";
        }
 
        p= (*hash_func)(password);