| | | 1 | | namespace Renci.SshNet.Messages.Transport |
| | | 2 | | { |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents SSH_MSG_KEX_DH_GEX_REQUEST message. |
| | | 5 | | /// </summary> |
| | | 6 | | [Message("SSH_MSG_KEX_DH_GEX_REQUEST", MessageNumber)] |
| | | 7 | | internal sealed class KeyExchangeDhGroupExchangeRequest : Message, IKeyExchangedAllowed |
| | | 8 | | { |
| | | 9 | | internal const byte MessageNumber = 34; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Gets the minimum size, in bits, of an acceptable group. |
| | | 13 | | /// </summary> |
| | | 14 | | /// <value> |
| | | 15 | | /// The minimum. |
| | | 16 | | /// </value> |
| | 33 | 17 | | public uint Minimum { get; private set; } |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// Gets the preferred size, in bits, of the group the server will send. |
| | | 21 | | /// </summary> |
| | | 22 | | /// <value> |
| | | 23 | | /// The preferred. |
| | | 24 | | /// </value> |
| | 33 | 25 | | public uint Preferred { get; private set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Gets the maximum size, in bits, of an acceptable group. |
| | | 29 | | /// </summary> |
| | | 30 | | /// <value> |
| | | 31 | | /// The maximum. |
| | | 32 | | /// </value> |
| | 33 | 33 | | public uint Maximum { get; private set; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Gets the size of the message in bytes. |
| | | 37 | | /// </summary> |
| | | 38 | | /// <value> |
| | | 39 | | /// The size of the messages in bytes. |
| | | 40 | | /// </value> |
| | | 41 | | protected override int BufferCapacity |
| | | 42 | | { |
| | | 43 | | get |
| | 12 | 44 | | { |
| | 12 | 45 | | var capacity = base.BufferCapacity; |
| | 12 | 46 | | capacity += 4; // Minimum |
| | 12 | 47 | | capacity += 4; // Preferred |
| | 12 | 48 | | capacity += 4; // Maximum |
| | 12 | 49 | | return capacity; |
| | 12 | 50 | | } |
| | | 51 | | } |
| | | 52 | | |
| | | 53 | | /// <summary> |
| | | 54 | | /// Initializes a new instance of the <see cref="KeyExchangeDhGroupExchangeRequest"/> class. |
| | | 55 | | /// </summary> |
| | | 56 | | /// <param name="minimum">The minimum.</param> |
| | | 57 | | /// <param name="preferred">The preferred.</param> |
| | | 58 | | /// <param name="maximum">The maximum.</param> |
| | 15 | 59 | | public KeyExchangeDhGroupExchangeRequest(uint minimum, uint preferred, uint maximum) |
| | 15 | 60 | | { |
| | 15 | 61 | | Minimum = minimum; |
| | 15 | 62 | | Preferred = preferred; |
| | 15 | 63 | | Maximum = maximum; |
| | 15 | 64 | | } |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// Called when type specific data need to be loaded. |
| | | 68 | | /// </summary> |
| | | 69 | | protected override void LoadData() |
| | 3 | 70 | | { |
| | 3 | 71 | | Minimum = ReadUInt32(); |
| | 3 | 72 | | Preferred = ReadUInt32(); |
| | 3 | 73 | | Maximum = ReadUInt32(); |
| | 3 | 74 | | } |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// Called when type specific data need to be saved. |
| | | 78 | | /// </summary> |
| | | 79 | | protected override void SaveData() |
| | 12 | 80 | | { |
| | 12 | 81 | | Write(Minimum); |
| | 12 | 82 | | Write(Preferred); |
| | 12 | 83 | | Write(Maximum); |
| | 12 | 84 | | } |
| | | 85 | | |
| | | 86 | | internal override void Process(Session session) |
| | 0 | 87 | | { |
| | 0 | 88 | | throw new System.NotImplementedException(); |
| | | 89 | | } |
| | | 90 | | } |
| | | 91 | | } |