Exemplo n.º 1
0
        protected sealed override void Write(EndianBinaryWriter writer)
        {
            writer.Write(Version);
            writer.Write(RandomBytes);
            writer.WriteVariable(1, SessionId);
            WriteHello(writer);

            // TODO extensions
            SecurityAssert.SAssert(Extensions.Length == 0);
        }
        protected override void Write(EndianBinaryWriter baseWriter)
        {
            var stream = state.GetSignatureStream(baseWriter.BaseStream);
            var writer = new EndianBinaryWriter(baseWriter.BitConverter, stream);

            // signature needs these but the output doesn't
            stream.HashAlgorithm.Update(state.ClientRandom, 0, 32);
            stream.HashAlgorithm.Update(state.ServerRandom, 0, 32);

            var pBuffer = P.ToTlsBytes();
            var gBuffer = G.ToTlsBytes();
            var pubBuffer = Y.ToTlsBytes();

            writer.Write((short)pBuffer.Length);
            writer.Write(pBuffer);
            writer.Write((short)gBuffer.Length);
            writer.Write(gBuffer);
            writer.Write((short)pubBuffer.Length);
            writer.Write(pubBuffer);

            stream.Flush();
            stream.WriteTlsSignature(state);
        }
Exemplo n.º 3
0
 protected override void Write(EndianBinaryWriter writer)
 {
 }
 protected override void Write(EndianBinaryWriter writer)
 {
     throw new NotImplementedException();
 }
 protected override void Write(EndianBinaryWriter writer)
 {
     writer.Write(VerifyData);
 }
Exemplo n.º 6
0
 protected abstract void WriteHello(EndianBinaryWriter writer);
Exemplo n.º 7
0
 protected override void WriteHello(EndianBinaryWriter writer)
 {
     writer.Write(CipherSuite);
     writer.Write(CompressionMethod);
 }