Changeset ec0355f for irc_commands.c


Ignore:
Timestamp:
2008-03-16T16:31:27Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
c029350
Parents:
4e8db1c
Message:

Passwords in bitlbee.conf can now be (properly salted) MD5 hashes, for
just that little bit extra security.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    r4e8db1c rec0355f  
    3030static void irc_cmd_pass( irc_t *irc, char **cmd )
    3131{
    32         if( global.conf->auth_pass && strcmp( cmd[1], global.conf->auth_pass ) == 0 )
     32        if( global.conf->auth_pass &&
     33            strncmp( global.conf->auth_pass, "md5:", 4 ) == 0 ?
     34              md5_verify_password( cmd[1], global.conf->auth_pass + 4 ) == 0 :
     35              strcmp( cmd[1], global.conf->auth_pass ) == 0 )
    3336        {
    3437                irc->status |= USTATUS_AUTHORIZED;
     
    8891static void irc_cmd_oper( irc_t *irc, char **cmd )
    8992{
    90         if( global.conf->oper_pass && strcmp( cmd[2], global.conf->oper_pass ) == 0 )
     93        if( global.conf->oper_pass &&
     94            strncmp( global.conf->oper_pass, "md5:", 4 ) == 0 ?
     95              md5_verify_password( cmd[2], global.conf->oper_pass + 4 ) == 0 :
     96              strcmp( cmd[2], global.conf->oper_pass ) == 0 )
    9197        {
    9298                irc_umode_set( irc, "+o", 1 );
Note: See TracChangeset for help on using the changeset viewer.