< Summary

Information
Class: Renci.SshNet.Security.GroupExchangeHashData
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\GroupExchangeHashData.cs
Line coverage
90%
Covered lines: 55
Uncovered lines: 6
Coverable lines: 61
Total lines: 115
Line coverage: 90.1%
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_ServerVersion()100%10%
set_ServerVersion(...)100%1100%
get_ClientVersion()100%10%
set_ClientVersion(...)100%1100%
get_ClientPayload()100%1100%
get_ServerPayload()100%1100%
get_HostKey()100%1100%
get_MinimumGroupSize()100%1100%
get_PreferredGroupSize()100%1100%
get_MaximumGroupSize()100%1100%
get_Prime()100%10%
set_Prime(...)100%1100%
get_SubGroup()100%10%
set_SubGroup(...)100%1100%
get_ClientExchangeValue()100%1100%
get_ServerExchangeValue()100%1100%
get_SharedKey()100%1100%
get_BufferCapacity()100%1100%
LoadData()100%10%
SaveData()100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\GroupExchangeHashData.cs

#LineLine coverage
 1using System;
 2using Renci.SshNet.Common;
 3
 4namespace Renci.SshNet.Security
 5{
 6    internal sealed class GroupExchangeHashData : SshData
 7    {
 8        private byte[] _serverVersion;
 9        private byte[] _clientVersion;
 10        private byte[] _prime;
 11        private byte[] _subGroup;
 12
 13        public string ServerVersion
 14        {
 015            private get { return Utf8.GetString(_serverVersion, 0, _serverVersion.Length); }
 3616            set { _serverVersion = Utf8.GetBytes(value); }
 17        }
 18
 19        public string ClientVersion
 20        {
 021            private get { return Utf8.GetString(_clientVersion, 0, _clientVersion.Length); }
 3622            set { _clientVersion = Utf8.GetBytes(value); }
 23        }
 24
 3625        public byte[] ClientPayload { get; set; }
 26
 3627        public byte[] ServerPayload { get; set; }
 28
 3629        public byte[] HostKey { get; set; }
 30
 2431        public uint MinimumGroupSize { get; set; }
 32
 2433        public uint PreferredGroupSize { get; set; }
 34
 2435        public uint MaximumGroupSize { get; set; }
 36
 37        public BigInteger Prime
 38        {
 039            private get { return _prime.ToBigInteger(); }
 3640            set { _prime = value.ToByteArray().Reverse(); }
 41        }
 42
 43        public BigInteger SubGroup
 44        {
 045            private get { return _subGroup.ToBigInteger(); }
 3646            set { _subGroup = value.ToByteArray().Reverse(); }
 47        }
 48
 3649        public byte[] ClientExchangeValue { get; set; }
 50
 3651        public byte[] ServerExchangeValue { get; set; }
 52
 3653        public byte[] SharedKey { get; set; }
 54
 55        /// <summary>
 56        /// Gets the size of the message in bytes.
 57        /// </summary>
 58        /// <value>
 59        /// The size of the messages in bytes.
 60        /// </value>
 61        protected override int BufferCapacity
 62        {
 63            get
 1264            {
 1265                var capacity = base.BufferCapacity;
 1266                capacity += 4; // ClientVersion length
 1267                capacity += _clientVersion.Length; // ClientVersion
 1268                capacity += 4; // ServerVersion length
 1269                capacity += _serverVersion.Length; // ServerVersion
 1270                capacity += 4; // ClientPayload length
 1271                capacity += ClientPayload.Length; // ClientPayload
 1272                capacity += 4; // ServerPayload length
 1273                capacity += ServerPayload.Length; // ServerPayload
 1274                capacity += 4; // HostKey length
 1275                capacity += HostKey.Length; // HostKey
 1276                capacity += 4; // MinimumGroupSize
 1277                capacity += 4; // PreferredGroupSize
 1278                capacity += 4; // MaximumGroupSize
 1279                capacity += 4; // Prime length
 1280                capacity += _prime.Length; // Prime
 1281                capacity += 4; // SubGroup length
 1282                capacity += _subGroup.Length; // SubGroup
 1283                capacity += 4; // ClientExchangeValue length
 1284                capacity += ClientExchangeValue.Length; // ClientExchangeValue
 1285                capacity += 4; // ServerExchangeValue length
 1286                capacity += ServerExchangeValue.Length; // ServerExchangeValue
 1287                capacity += 4; // SharedKey length
 1288                capacity += SharedKey.Length; // SharedKey
 1289                return capacity;
 1290            }
 91        }
 92
 93        protected override void LoadData()
 094        {
 095            throw new NotImplementedException();
 96        }
 97
 98        protected override void SaveData()
 1299        {
 12100            WriteBinaryString(_clientVersion);
 12101            WriteBinaryString(_serverVersion);
 12102            WriteBinaryString(ClientPayload);
 12103            WriteBinaryString(ServerPayload);
 12104            WriteBinaryString(HostKey);
 12105            Write(MinimumGroupSize);
 12106            Write(PreferredGroupSize);
 12107            Write(MaximumGroupSize);
 12108            WriteBinaryString(_prime);
 12109            WriteBinaryString(_subGroup);
 12110            WriteBinaryString(ClientExchangeValue);
 12111            WriteBinaryString(ServerExchangeValue);
 12112            WriteBinaryString(SharedKey);
 12113        }
 114    }
 115}