All pastes #466858 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-02 04:20 UTC
rendered paste body

		memset(tmp_buf,0,16); // VC are 8 0x00's
		if (Globals::instance().getServer().unencryptedConnectionsAllowed())
			tmp_buf[11] = 0x03; // we support both plain text and rc4
		else
			tmp_buf[11] = 0x02;
		WriteUint16(tmp_buf,12,0x0000); // no padC
		WriteUint16(tmp_buf,14,68); // length of IA, which will be the bittorrent handshake
		// send IA which is the handshake
		makeHandshake(tmp_buf+16,info_hash,our_peer_id);
>> wrong	sock->sendData(our_rc4->encrypt(tmp_buf,84),84); 

handshake should be sent /after/ the pre-handshake (the length of the handshake and such)

3 A->B: HASH('req1', S), HASH('req2', SKEY) xor HASH('req3', S), ENCRYPT(VC, crypto_provide, len(PadC), PadC, len(IA)), ENCRYPT(IA)