From e04e0129cd5e4e53b99fb6daae47a8c44bff50e2 Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Mon, 2 Oct 2017 22:10:20 +0200 Subject: [PATCH] Added partialSuccessLimit argument to ClientAuthentication ctor. --- src/Renci.SshNet/ClientAuthentication.cs | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Renci.SshNet/ClientAuthentication.cs b/src/Renci.SshNet/ClientAuthentication.cs index 2efadc5a8..4b734b4c8 100644 --- a/src/Renci.SshNet/ClientAuthentication.cs +++ b/src/Renci.SshNet/ClientAuthentication.cs @@ -6,6 +6,34 @@ namespace Renci.SshNet { internal class ClientAuthentication : IClientAuthentication { + private readonly int _partialSuccessLimit; + + /// + /// Initializes a new instance. + /// + /// The number of times an authentication attempt with any given can result in before it is disregarded. + /// is less than one. + public ClientAuthentication(int partialSuccessLimit) + { + if (partialSuccessLimit < 1) + throw new ArgumentOutOfRangeException("partialSuccessLimit", "Cannot be less than one."); + + _partialSuccessLimit = partialSuccessLimit; + } + + /// + /// Gets the number of times an authentication attempt with any given can + /// result in before it is disregarded. + /// + /// + /// The number of times an authentication attempt with any given can result + /// in before it is disregarded. + /// + internal int PartialSuccessLimit + { + get { return _partialSuccessLimit; } + } + public void Authenticate(IConnectionInfoInternal connectionInfo, ISession session) { if (connectionInfo == null)