public override void ChannelActive(IChannelHandlerContext context)
        {
            _channel = context.Channel;

            if (_role == HandshakeRole.Initiator)
            {
                Packet auth = _service.Auth(RemoteId, _handshake);

                if (_logger.IsTrace)
                {
                    _logger.Trace($"Sending AUTH to {RemoteId} @ {context.Channel.RemoteAddress}");
                }
                IByteBuffer buffer = PooledByteBufferAllocator.Default.Buffer();
                buffer.WriteBytes(auth.Data);
                context.WriteAndFlushAsync(buffer);
            }

            _session.RemoteHost = ((IPEndPoint)context.Channel.RemoteAddress).Address.ToString();
            _session.RemotePort = ((IPEndPoint)context.Channel.RemoteAddress).Port;

            CheckHandshakeInitTimeout().ContinueWith(x =>
            {
                if (x.IsFaulted && _logger.IsError)
                {
                    _logger.Error("Error during handshake timeout logic", x.Exception);
                }
            });
        }
 private void Auth()
 {
     _initiatorHandshake = new EncryptionHandshake();                                          // 80B
     _auth = _initiatorService.Auth(NetTestVectors.StaticKeyB.PublicKey, _initiatorHandshake); // 64B
 }
Example #3
0
 private void Auth(bool preEip8Format = false)
 {
     _auth = _initiatorService.Auth(NetTestVectors.StaticKeyB.PublicKey, _initiatorHandshake, preEip8Format);
 }
Example #4
0
 private void Auth()
 {
     _auth = _initiatorService.Auth(NetTestVectors.StaticKeyB.PublicKey, _initiatorHandshake);
 }