| | | 1 | | namespace Renci.SshNet.Messages.Transport |
| | | 2 | | { |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents SSH_MSG_KEX_DH_GEX_INIT message. |
| | | 5 | | /// </summary> |
| | | 6 | | [Message("SSH_MSG_KEX_DH_GEX_INIT", 32)] |
| | | 7 | | internal sealed class KeyExchangeDhGroupExchangeInit : Message, IKeyExchangedAllowed |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Gets the E value. |
| | | 11 | | /// </summary> |
| | 18 | 12 | | public byte[] E { get; private set; } |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Gets the size of the message in bytes. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <value> |
| | | 18 | | /// The size of the messages in bytes. |
| | | 19 | | /// </value> |
| | | 20 | | protected override int BufferCapacity |
| | | 21 | | { |
| | | 22 | | get |
| | 6 | 23 | | { |
| | 6 | 24 | | var capacity = base.BufferCapacity; |
| | 6 | 25 | | capacity += 4; // E length |
| | 6 | 26 | | capacity += E.Length; // E |
| | 6 | 27 | | return capacity; |
| | 6 | 28 | | } |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Initializes a new instance of the <see cref="KeyExchangeDhGroupExchangeInit"/> class. |
| | | 33 | | /// </summary> |
| | | 34 | | /// <param name="clientExchangeValue">The client exchange value.</param> |
| | 6 | 35 | | public KeyExchangeDhGroupExchangeInit(byte[] clientExchangeValue) |
| | 6 | 36 | | { |
| | 6 | 37 | | E = clientExchangeValue; |
| | 6 | 38 | | } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// Called when type specific data need to be loaded. |
| | | 42 | | /// </summary> |
| | | 43 | | protected override void LoadData() |
| | 0 | 44 | | { |
| | 0 | 45 | | E = ReadBinary(); |
| | 0 | 46 | | } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Called when type specific data need to be saved. |
| | | 50 | | /// </summary> |
| | | 51 | | protected override void SaveData() |
| | 6 | 52 | | { |
| | 6 | 53 | | WriteBinaryString(E); |
| | 6 | 54 | | } |
| | | 55 | | |
| | | 56 | | internal override void Process(Session session) |
| | 0 | 57 | | { |
| | 0 | 58 | | throw new System.NotImplementedException(); |
| | | 59 | | } |
| | | 60 | | } |
| | | 61 | | } |