Browse Source

Code formatting.

drieseng 9 năm trước cách đây
mục cha
commit
07c2a6001f

+ 2 - 5
src/Renci.SshNet/Security/KeyExchangeDiffieHellman.cs

@@ -65,17 +65,14 @@ namespace Renci.SshNet.Security
         {
             var exchangeHash = CalculateHash();
 
-            var length = (uint)(_hostKey[0] << 24 | _hostKey[1] << 16 | _hostKey[2] << 8 | _hostKey[3]);
-
+            var length = (uint) (_hostKey[0] << 24 | _hostKey[1] << 16 | _hostKey[2] << 8 | _hostKey[3]);
             var algorithmName = Encoding.UTF8.GetString(_hostKey, 4, (int)length);
-
             var key = Session.ConnectionInfo.HostKeyAlgorithms[algorithmName](_hostKey);
 
             Session.ConnectionInfo.CurrentHostKeyAlgorithm = algorithmName;
 
             if (CanTrustHostKey(key))
             {
-
                 return key.VerifySignature(exchangeHash, _signature);
             }
             return false;
@@ -113,7 +110,7 @@ namespace Renci.SshNet.Security
 
                 _clientExchangeValue = BigInteger.ModPow(_group, _randomValue, _prime);
 
-            } while (_clientExchangeValue < 1 || _clientExchangeValue > ((_prime - 1)));
+            } while (_clientExchangeValue < 1 || _clientExchangeValue > (_prime - 1));
         }
 
         /// <summary>

+ 0 - 2
src/Renci.SshNet/Security/KeyExchangeDiffieHellmanGroupSha1.cs

@@ -55,13 +55,11 @@ namespace Renci.SshNet.Security
             Session.MessageReceived += Session_MessageReceived;
 
             _prime = GroupPrime;
-
             _group = new BigInteger(new byte[] { 2 });
 
             PopulateClientExchangeValue();
 
             SendMessage(new KeyExchangeDhInitMessage(_clientExchangeValue));
-
         }
 
         /// <summary>