< Summary

Information
Class: Renci.SshNet.Security.KeyExchangeHashData
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\KeyExchangeHashData.cs
Line coverage
90%
Covered lines: 38
Uncovered lines: 4
Coverable lines: 42
Total lines: 84
Line coverage: 90.4%
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_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\KeyExchangeHashData.cs

#LineLine coverage
 1using System;
 2
 3using Renci.SshNet.Common;
 4
 5namespace Renci.SshNet.Security
 6{
 7    internal sealed class KeyExchangeHashData : SshData
 8    {
 9        private byte[] _serverVersion;
 10        private byte[] _clientVersion;
 11
 12        public string ServerVersion
 13        {
 014            private get { return Utf8.GetString(_serverVersion, 0, _serverVersion.Length); }
 715515            set { _serverVersion = Utf8.GetBytes(value); }
 16        }
 17
 18        public string ClientVersion
 19        {
 020            private get { return Utf8.GetString(_clientVersion, 0, _clientVersion.Length); }
 715521            set { _clientVersion = Utf8.GetBytes(value); }
 22        }
 23
 715524        public byte[] ClientPayload { get; set; }
 25
 715526        public byte[] ServerPayload { get; set; }
 27
 715528        public byte[] HostKey { get; set; }
 29
 715530        public byte[] ClientExchangeValue { get; set; }
 31
 715532        public byte[] ServerExchangeValue { get; set; }
 33
 715534        public byte[] SharedKey { get; set; }
 35
 36        /// <summary>
 37        /// Gets the size of the message in bytes.
 38        /// </summary>
 39        /// <value>
 40        /// The size of the messages in bytes.
 41        /// </value>
 42        protected override int BufferCapacity
 43        {
 44            get
 238545            {
 238546                var capacity = base.BufferCapacity;
 238547                capacity += 4; // ClientVersion length
 238548                capacity += _clientVersion.Length; // ClientVersion
 238549                capacity += 4; // ServerVersion length
 238550                capacity += _serverVersion.Length; // ServerVersion
 238551                capacity += 4; // ClientPayload length
 238552                capacity += ClientPayload.Length; // ClientPayload
 238553                capacity += 4; // ServerPayload length
 238554                capacity += ServerPayload.Length; // ServerPayload
 238555                capacity += 4; // HostKey length
 238556                capacity += HostKey.Length; // HostKey
 238557                capacity += 4; // ClientExchangeValue length
 238558                capacity += ClientExchangeValue.Length; // ClientExchangeValue
 238559                capacity += 4; // ServerExchangeValue length
 238560                capacity += ServerExchangeValue.Length; // ServerExchangeValue
 238561                capacity += 4; // SharedKey length
 238562                capacity += SharedKey.Length; // SharedKey
 238563                return capacity;
 238564            }
 65        }
 66
 67        protected override void LoadData()
 068        {
 069            throw new NotImplementedException();
 70        }
 71
 72        protected override void SaveData()
 238573        {
 238574            WriteBinaryString(_clientVersion);
 238575            WriteBinaryString(_serverVersion);
 238576            WriteBinaryString(ClientPayload);
 238577            WriteBinaryString(ServerPayload);
 238578            WriteBinaryString(HostKey);
 238579            WriteBinaryString(ClientExchangeValue);
 238580            WriteBinaryString(ServerExchangeValue);
 238581            WriteBinaryString(SharedKey);
 238582        }
 83    }
 84}