diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-12-09 21:48:45 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2005-12-09 21:48:45 +0100 |
commit | 9df916f7d178f5b87e8ca35e3eb44343f3d2d955 (patch) | |
tree | ce5e73987972e937a13b07adddcba4d6540807b0 /crypting.c | |
parent | c2295f7eeac263dbcc19f84e9a61abbe778aa9f8 (diff) | |
parent | 87c24bab5738824aba97a824b4c02f7a96b555a0 (diff) |
Merge my storage abstraction changes
Diffstat (limited to 'crypting.c')
-rw-r--r-- | crypting.c | 26 |
1 files changed, 4 insertions, 22 deletions
@@ -51,8 +51,6 @@ typedef struct irc #include <stdio.h> #include <stdlib.h> -#define irc_usermsg - #endif /*\ @@ -61,21 +59,7 @@ typedef struct irc * correctness. \*/ -/* USE WITH CAUTION! - Sets pass without checking */ -void setpassnc (irc_t *irc, const char *pass) -{ - if (irc->password) g_free (irc->password); - - if (pass) { - irc->password = g_strdup (pass); - irc_usermsg (irc, "Password successfully changed"); - } else { - irc->password = NULL; - } -} - -int setpass (irc_t *irc, const char *pass, const char* md5sum) +int checkpass (const char *pass, const char *md5sum) { md5_state_t md5state; md5_byte_t digest[16]; @@ -93,13 +77,11 @@ int setpass (irc_t *irc, const char *pass, const char* md5sum) if (digits[0] != md5sum[j]) return (-1); if (digits[1] != md5sum[j + 1]) return (-1); } - - /* If pass is correct, we end up here and we set the pass */ - setpassnc (irc, pass); - - return (0); + + return( 0 ); } + char *hashpass (irc_t *irc) { md5_state_t md5state; md5_byte_t digest[16]; |