Ejemplo 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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
 protected override void Write(EndianBinaryWriter writer)
 {
 }
Ejemplo n.º 4
0
 protected override void Write(EndianBinaryWriter writer)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 protected override void Write(EndianBinaryWriter writer)
 {
     writer.Write(VerifyData);
 }
Ejemplo n.º 6
0
 protected abstract void WriteHello(EndianBinaryWriter writer);
Ejemplo n.º 7
0
 protected override void WriteHello(EndianBinaryWriter writer)
 {
     writer.Write(CipherSuite);
     writer.Write(CompressionMethod);
 }