diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-03-16 16:31:27 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-03-16 16:31:27 +0000 |
commit | ec0355f6998eb5dee254e4bc60a3207bb661c854 (patch) | |
tree | 007b9ce5c15ba1a5e8b000e3039fba2c238acff0 /irc_commands.c | |
parent | 4e8db1c0141f74dc6156a57739613483344b358d (diff) |
Passwords in bitlbee.conf can now be (properly salted) MD5 hashes, for
just that little bit extra security.
Diffstat (limited to 'irc_commands.c')
-rw-r--r-- | irc_commands.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/irc_commands.c b/irc_commands.c index 68db4617..14209732 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -29,7 +29,10 @@ static void irc_cmd_pass( irc_t *irc, char **cmd ) { - if( global.conf->auth_pass && strcmp( cmd[1], global.conf->auth_pass ) == 0 ) + if( global.conf->auth_pass && + strncmp( global.conf->auth_pass, "md5:", 4 ) == 0 ? + md5_verify_password( cmd[1], global.conf->auth_pass + 4 ) == 0 : + strcmp( cmd[1], global.conf->auth_pass ) == 0 ) { irc->status |= USTATUS_AUTHORIZED; irc_check_login( irc ); @@ -87,7 +90,10 @@ static void irc_cmd_ping( irc_t *irc, char **cmd ) static void irc_cmd_oper( irc_t *irc, char **cmd ) { - if( global.conf->oper_pass && strcmp( cmd[2], global.conf->oper_pass ) == 0 ) + if( global.conf->oper_pass && + strncmp( global.conf->oper_pass, "md5:", 4 ) == 0 ? + md5_verify_password( cmd[2], global.conf->oper_pass + 4 ) == 0 : + strcmp( cmd[2], global.conf->oper_pass ) == 0 ) { irc_umode_set( irc, "+o", 1 ); irc_reply( irc, 381, ":Password accepted" ); |