< Summary

Information
Class: Renci.SshNet.Messages.Transport.KeyExchangeDhGroupExchangeReply
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\KeyExchangeDhGroupExchangeReply.cs
Line coverage
42%
Covered lines: 11
Uncovered lines: 15
Coverable lines: 26
Total lines: 76
Line coverage: 42.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_HostKey()100%1100%
get_F()100%1100%
get_Signature()100%1100%
get_BufferCapacity()100%10%
LoadData()100%1100%
SaveData()100%10%
Process(...)100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\KeyExchangeDhGroupExchangeReply.cs

#LineLine coverage
 1namespace Renci.SshNet.Messages.Transport
 2{
 3    /// <summary>
 4    /// Represents SSH_MSG_KEX_DH_GEX_REPLY message.
 5    /// </summary>
 6    [Message("SSH_MSG_KEX_DH_GEX_REPLY", MessageNumber)]
 7    internal sealed class KeyExchangeDhGroupExchangeReply : Message
 8    {
 9        internal const byte MessageNumber = 33;
 10
 11        /// <summary>
 12        /// Gets server public host key and certificates.
 13        /// </summary>
 14        /// <value>
 15        /// The host key.
 16        /// </value>
 1817        public byte[] HostKey { get; private set; }
 18
 19        /// <summary>
 20        /// Gets the F value.
 21        /// </summary>
 1822        public byte[] F { get; private set; }
 23
 24        /// <summary>
 25        /// Gets the signature of H.
 26        /// </summary>
 27        /// <value>The signature.</value>
 1828        public byte[] Signature { get; private set; }
 29
 30        /// <summary>
 31        /// Gets the size of the message in bytes.
 32        /// </summary>
 33        /// <value>
 34        /// The size of the messages in bytes.
 35        /// </value>
 36        protected override int BufferCapacity
 37        {
 38            get
 039            {
 040                var capacity = base.BufferCapacity;
 041                capacity += 4; // HostKey length
 042                capacity += HostKey.Length; // HostKey
 043                capacity += 4; // F length
 044                capacity += F.Length; // F
 045                capacity += 4; // Signature length
 046                capacity += Signature.Length; // Signature
 047                return capacity;
 048            }
 49        }
 50
 51        /// <summary>
 52        /// Called when type specific data need to be loaded.
 53        /// </summary>
 54        protected override void LoadData()
 955        {
 956            HostKey = ReadBinary();
 957            F = ReadBinary();
 958            Signature = ReadBinary();
 959        }
 60
 61        /// <summary>
 62        /// Called when type specific data need to be saved.
 63        /// </summary>
 64        protected override void SaveData()
 065        {
 066            WriteBinaryString(HostKey);
 067            WriteBinaryString(F);
 068            WriteBinaryString(Signature);
 069        }
 70
 71        internal override void Process(Session session)
 672        {
 673            session.OnKeyExchangeDhGroupExchangeReplyReceived(this);
 674        }
 75    }
 76}