Ignore:
Timestamp:
Aug 14, 2008, 11:11:25 AM (13 years ago)
Author:
muks
Message:

Replace random number generation code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/handshake.c

    r6496 r6517  
    278278sendYa( tr_handshake * handshake )
    279279{
    280     int i;
    281280    int len;
    282281    const uint8_t * public_key;
     
    291290
    292291    /* add some bullshit padding */
    293     len = tr_rand( PadA_MAXLEN );
    294     for( i=0; i<len; ++i )
    295         pad_a[i] = tr_rand( UCHAR_MAX );
     292    len = tr_cryptoRandInt( PadA_MAXLEN );
     293    tr_cryptoRandBuf(pad_a, len);
    296294    evbuffer_add( outbuf, pad_a, len );
    297295
     
    705703    tr_sha1( handshake->myReq1, "req1", 4, secret, KEY_LEN, NULL );
    706704
    707 dbgmsg( handshake, "sending B->A: Diffie Hellman Yb, PadB" );
     705    dbgmsg( handshake, "sending B->A: Diffie Hellman Yb, PadB" );
    708706    /* send our public key to the peer */
    709707    walk = outbuf;
     
    711709    memcpy( walk, myKey, len );
    712710    walk += len;
    713     len = tr_rand( PadB_MAXLEN );
    714     while( len-- )
    715         *walk++ = tr_rand( UCHAR_MAX );
     711    len = tr_cryptoRandInt( PadB_MAXLEN );
     712    tr_cryptoRandBuf( walk, len );
     713    walk += len;
    716714
    717715    setReadState( handshake, AWAITING_PAD_A );
Note: See TracChangeset for help on using the changeset viewer.