2 ** Copyright 2001 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
13 #include "sha1/sha1.h"
16 static const char rcsid
[]="$Id: checkpasswordsha1.c,v 1.4 2005/07/10 00:47:37 mrsam Exp $";
18 int authcheckpasswordsha1(const char *password
, const char *encrypted_password
)
20 if (strncasecmp(encrypted_password
, "{SHA}", 5) == 0)
22 return (strcmp(encrypted_password
+5, sha1_hash(password
)));
24 if (strncasecmp(encrypted_password
, "{SHA256}", 8) == 0)
26 return (strcmp(encrypted_password
+8, sha256_hash(password
)));