Ignore:
Timestamp:
Mar 24, 2009, 1:39:06 AM (13 years ago)
Author:
jhujhiti
Message:

(trunk libT) #1276 - hash rpc password with sha1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc-server.c

    r8072 r8080  
    466466                user = p;
    467467                *pass++ = '\0';
    468                 pass = tr_crypt( pass );
    469468            }
    470469        }
     
    480479        else if( server->isPasswordEnabled
    481480                 && ( !pass || !user || strcmp( server->username, user )
    482                                      || strcmp( server->password, pass ) ) )
     481                                     || !tr_ssha1_matches( server->password,
     482                                                           pass ) ) )
    483483        {
    484484            evhttp_add_header( req->output_headers,
     
    512512        }
    513513
    514         tr_free( pass );
    515514        tr_free( user );
    516515    }
     
    672671{
    673672    tr_free( server->password );
    674     server->password = tr_crypt( password );
     673    if( *password != '{' )
     674        server->password = tr_ssha1( password );
     675    else
     676        server->password = strdup( password );
    675677    dbgmsg( "setting our Password to [%s]", server->password );
    676678}
     
    763765    found = tr_bencDictFindStr( settings, TR_PREFS_KEY_RPC_PASSWORD, &str );
    764766    assert( found );
    765     s->password = tr_strdup( str );
     767    if( *str != '{' )
     768        s->password = tr_ssha1( str );
     769    else
     770        s->password = strdup( str );
    766771
    767772#ifdef HAVE_ZLIB
Note: See TracChangeset for help on using the changeset viewer.