Changeset 3166


Ignore:
Timestamp:
Sep 25, 2007, 5:56:46 PM (15 years ago)
Author:
charles
Message:

if we connect to a peer that understands the encryption handshake, try harder to continue the connection in encrypted mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/handshake.c

    r3135 r3166  
    178178        case AWAITING_HANDSHAKE:      str = "awaiting handshake"; break;
    179179        case AWAITING_YA:             str = "awaiting ya"; break;
    180         //case SENDING_YB:              str = "sending yb"; break;
    181180        case AWAITING_PAD_A:          str = "awaiting pad a"; break;
    182181        case AWAITING_CRYPTO_PROVIDE: str = "awaiting crypto_provide"; break;
    183182        case AWAITING_PAD_C:          str = "awaiting pad c"; break;
    184183        case AWAITING_IA:             str = "awaiting ia"; break;
    185         //case SENDING_YA:              str = "sending ya"; break;
    186184        case AWAITING_YB:             str = "awaiting yb"; break;
    187         //case SENDING_CRYPTO_PROVIDE:  str = "sending crypto provide"; break;
    188185        case AWAITING_VC:             str = "awaiting vc"; break;
    189186        case AWAITING_CRYPTO_SELECT:  str = "awaiting crypto select"; break;
    190187        case AWAITING_PAD_D:          str = "awaiting pad d"; break;
    191         //case SENDING_NONE: str = "sending plaintext handshake"; break;
    192188    }
    193189    return str;
     
    205201{
    206202    setState( handshake, state );
    207     //tr_peerIoSetIOMode( handshake->io, EV_READ, EV_WRITE );
    208203}
    209204
     
    385380
    386381static uint32_t
    387 getCryptoProvide( const tr_handshake * handshake )
     382getCryptoProvide( const tr_handshake * handshake UNUSED )
    388383{
    389384    uint32_t i = 0;
     
    391386    i |= CRYPTO_PROVIDE_CRYPTO; /* always allow crypto */
    392387
     388#if 0
    393389    if( handshake->allowUnencryptedPeers ) /* sometimes allow plaintext */
    394390        i |= CRYPTO_PROVIDE_PLAINTEXT;
     391#endif
    395392
    396393   return i;
     
    469466
    470467        /* crypto_provide */
    471         crypto_provide = getCryptoProvide( handshake );
    472         crypto_provide = htonl( crypto_provide );
     468        crypto_provide = htonl( getCryptoProvide( handshake ) );
    473469        tr_cryptoEncrypt( handshake->crypto, sizeof(crypto_provide), &crypto_provide, &crypto_provide );
    474470        evbuffer_add( outbuf, &crypto_provide, sizeof(crypto_provide) );
Note: See TracChangeset for help on using the changeset viewer.