コード例 #1
0
        private void MeasureCryptoMessage(NetworkIncomingMessage message)
        {
            HandshakeKey           decryptor = keys.Remote.Clone();
            NetworkIncomingMessage decrypted = decryptor.Decrypt(message);

            int size = HandshakeCryptoPayload.GetSize(decrypted);

            connection.Receive(HandleCryptoMessage, size);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }