[BACK]Return to auth2.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/auth2.c between version 1.166 and 1.167

version 1.166, 2023/03/08 04:43:12 version 1.167, 2023/08/28 09:48:11
Line 208 
Line 208 
 }  }
   
 #define MIN_FAIL_DELAY_SECONDS 0.005  #define MIN_FAIL_DELAY_SECONDS 0.005
   #define MAX_FAIL_DELAY_SECONDS 5.0
 static double  static double
 user_specific_delay(const char *user)  user_specific_delay(const char *user)
 {  {
Line 233 
Line 234 
         struct timespec ts;          struct timespec ts;
         double elapsed = monotime_double() - start, req = seconds, remain;          double elapsed = monotime_double() - start, req = seconds, remain;
   
           if (elapsed > MAX_FAIL_DELAY_SECONDS) {
                   debug3_f("elapsed %0.3lfms exceeded the max delay "
                       "requested %0.3lfms)", elapsed*1000, req*1000);
                   return;
           }
   
         /* if we've already passed the requested time, scale up */          /* if we've already passed the requested time, scale up */
         while ((remain = seconds - elapsed) < 0.0)          while ((remain = seconds - elapsed) < 0.0)
                 seconds *= 2;                  seconds *= 2;
Line 317 
Line 324 
                 debug2("input_userauth_request: try method %s", method);                  debug2("input_userauth_request: try method %s", method);
                 authenticated = m->userauth(ssh, method);                  authenticated = m->userauth(ssh, method);
         }          }
         if (!authctxt->authenticated)          if (!authctxt->authenticated && strcmp(method, "none") != 0)
                 ensure_minimum_time_since(tstart,                  ensure_minimum_time_since(tstart,
                     user_specific_delay(authctxt->user));                      user_specific_delay(authctxt->user));
         userauth_finish(ssh, authenticated, method, NULL);          userauth_finish(ssh, authenticated, method, NULL);

Legend:
Removed from v.1.166  
changed lines
  Added in v.1.167