Changeset 8083


Ignore:
Timestamp:
Mar 24, 2009, 9:49:19 PM (13 years ago)
Author:
jhujhiti
Message:

(trunk libT) fix a couple warnings from r8080

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/crypto.c

    r8080 r8083  
    365365    static const size_t saltval_len = 8;
    366366
    367     int i;
     367    size_t i;
    368368    char salt[saltval_len];
    369     char sha[SHA_DIGEST_LENGTH];
     369    uint8_t sha[SHA_DIGEST_LENGTH];
    370370    char buf[2*SHA_DIGEST_LENGTH + saltval_len + 2];
    371371
     
    374374
    375375    tr_sha1( sha, plaintext, strlen( plaintext ), salt, saltval_len, NULL );
    376     tr_sha1_to_hex( &buf[1], &sha );
     376    tr_sha1_to_hex( &buf[1], sha );
    377377    memcpy( &buf[1+2*SHA_DIGEST_LENGTH], &salt, saltval_len );
    378378    buf[1+2*SHA_DIGEST_LENGTH + saltval_len] = '\0';
     
    389389    size_t saltlen;
    390390    char * hashed;
    391     char buf[SHA_DIGEST_LENGTH];
     391    uint8_t buf[SHA_DIGEST_LENGTH];
    392392    tr_bool result;
    393393
     
    399399    /* hash pass + salt */
    400400    hashed = tr_malloc( 2*SHA_DIGEST_LENGTH + saltlen + 2 );
    401     tr_sha1( &buf, pass, strlen( pass ), salt, saltlen, NULL );
    402     tr_sha1_to_hex( &hashed[1], &buf );
     401    tr_sha1( buf, pass, strlen( pass ), salt, saltlen, NULL );
     402    tr_sha1_to_hex( &hashed[1], buf );
    403403    memcpy( hashed + 1+2*SHA_DIGEST_LENGTH, salt, saltlen );
    404404    hashed[1+2*SHA_DIGEST_LENGTH + saltlen] = '\0';
Note: See TracChangeset for help on using the changeset viewer.