private void MeasureCryptoMessage(NetworkIncomingMessage message) { HandshakeKey decryptor = keys.Remote.Clone(); NetworkIncomingMessage decrypted = decryptor.Decrypt(message); int size = HandshakeCryptoPayload.GetSize(decrypted); connection.Receive(HandleCryptoMessage, size); }
private void HandleCryptoMessage(NetworkIncomingMessage message) { HandshakeKey decryptor = keys.Remote.Clone(); NetworkIncomingMessage decrypted = decryptor.Decrypt(message); int size = HandshakeCryptoPayload.GetSize(decrypted); message.Acknowledge(size); keys.Remote.Acknowledge(size); connection.Send(new HandshakeMessage(context.Peer, context.Hash, context.Options), keys.Local); connection.Receive(MeasureHandshakeMessage, HandshakeMessage.MinSize); }
private void HandleCryptoPayloadMessage(NetworkIncomingMessage message) { HandshakeKey decryptor = keys.Remote.Clone(); NetworkIncomingMessage decrypted = decryptor.Decrypt(message); int size = HandshakeCryptoPayload.GetSize(decrypted); int method = HandshakeCryptoPayload.GetMethod(decrypted); message.Acknowledge(size); keys.Remote.Acknowledge(size); connection.Receive(MeasureCryptoMessage, HandshakeCryptoMessage.MinimumSize, method); }