From 698ee1542557209d415ca15a3c9707d830dab2a5 Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Mon, 11 Sep 2017 21:02:19 +0200 Subject: [PATCH] Please our mock tests. --- src/Renci.SshNet/ClientAuthentication.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Renci.SshNet/ClientAuthentication.cs b/src/Renci.SshNet/ClientAuthentication.cs index 24c462dc..2efadc5a 100644 --- a/src/Renci.SshNet/ClientAuthentication.cs +++ b/src/Renci.SshNet/ClientAuthentication.cs @@ -42,7 +42,6 @@ namespace Renci.SshNet session.UnRegisterMessage("SSH_MSG_USERAUTH_SUCCESS"); session.UnRegisterMessage("SSH_MSG_USERAUTH_BANNER"); } - } private static bool TryAuthenticate(ISession session, @@ -114,9 +113,11 @@ namespace Renci.SshNet foreach (var supportedAuthenticationMethod in authenticationState.SupportedAuthenticationMethods) { + var nameOfSupportedAuthenticationMethod = supportedAuthenticationMethod.Name; + for (var i = 0; i < allowedAuthenticationMethods.Length; i++) { - if (allowedAuthenticationMethods[i] == supportedAuthenticationMethod.Name) + if (allowedAuthenticationMethods[i] == nameOfSupportedAuthenticationMethod) { result.Add(supportedAuthenticationMethod); break;