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

Diff for /src/usr.bin/ssh/Attic/auth1.c between version 1.52 and 1.52.2.2

version 1.52, 2003/08/28 12:54:34 version 1.52.2.2, 2004/08/19 22:37:30
Line 17 
Line 17 
 #include "ssh1.h"  #include "ssh1.h"
 #include "packet.h"  #include "packet.h"
 #include "buffer.h"  #include "buffer.h"
 #include "mpaux.h"  
 #include "log.h"  #include "log.h"
 #include "servconf.h"  #include "servconf.h"
 #include "compat.h"  #include "compat.h"
Line 70 
Line 69 
         u_int dlen;          u_int dlen;
         u_int ulen;          u_int ulen;
         int type = 0;          int type = 0;
         struct passwd *pw = authctxt->pw;  
   
         debug("Attempting authentication for %s%.100s.",          debug("Attempting authentication for %s%.100s.",
             authctxt->valid ? "" : "illegal user ", authctxt->user);              authctxt->valid ? "" : "invalid user ", authctxt->user);
   
         /* If the user has no password, accept authentication immediately. */          /* If the user has no password, accept authentication immediately. */
         if (options.password_authentication &&          if (options.password_authentication &&
Line 125 
Line 123 
                                     BN_num_bits(client_host_key->rsa->n), bits);                                      BN_num_bits(client_host_key->rsa->n), bits);
                         packet_check_eom();                          packet_check_eom();
   
                         authenticated = auth_rhosts_rsa(pw, client_user,                          authenticated = auth_rhosts_rsa(authctxt, client_user,
                             client_host_key);                              client_host_key);
                         key_free(client_host_key);                          key_free(client_host_key);
   
Line 143 
Line 141 
                                 fatal("do_authloop: BN_new failed");                                  fatal("do_authloop: BN_new failed");
                         packet_get_bignum(n);                          packet_get_bignum(n);
                         packet_check_eom();                          packet_check_eom();
                         authenticated = auth_rsa(pw, n);                          authenticated = auth_rsa(authctxt, n);
                         BN_clear_free(n);                          BN_clear_free(n);
                         break;                          break;
   
Line 222 
Line 220 
                 if (authenticated)                  if (authenticated)
                         return;                          return;
   
                 if (authctxt->failures++ > AUTH_FAIL_MAX)                  if (authctxt->failures++ > options.max_authtries)
                         packet_disconnect(AUTH_FAIL_MSG, authctxt->user);                          packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
   
                 packet_start(SSH_SMSG_FAILURE);                  packet_start(SSH_SMSG_FAILURE);
Line 235 
Line 233 
  * Performs authentication of an incoming connection.  Session key has already   * Performs authentication of an incoming connection.  Session key has already
  * been exchanged and encryption is enabled.   * been exchanged and encryption is enabled.
  */   */
 Authctxt *  void
 do_authentication(void)  do_authentication(Authctxt *authctxt)
 {  {
         Authctxt *authctxt;  
         u_int ulen;          u_int ulen;
         char *user, *style = NULL;          char *user, *style = NULL;
   
Line 252 
Line 249 
         if ((style = strchr(user, ':')) != NULL)          if ((style = strchr(user, ':')) != NULL)
                 *style++ = '\0';                  *style++ = '\0';
   
         authctxt = authctxt_new();  
         authctxt->user = user;          authctxt->user = user;
         authctxt->style = style;          authctxt->style = style;
   
Line 260 
Line 256 
         if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)          if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)
                 authctxt->valid = 1;                  authctxt->valid = 1;
         else {          else {
                 debug("do_authentication: illegal user %s", user);                  debug("do_authentication: invalid user %s", user);
                 authctxt->pw = fakepw();                  authctxt->pw = fakepw();
         }          }
   
         setproctitle("%s%s", authctxt->pw ? user : "unknown",          setproctitle("%s%s", authctxt->valid ? user : "unknown",
             use_privsep ? " [net]" : "");              use_privsep ? " [net]" : "");
   
         /*          /*
Line 285 
Line 281 
         packet_start(SSH_SMSG_SUCCESS);          packet_start(SSH_SMSG_SUCCESS);
         packet_send();          packet_send();
         packet_write_wait();          packet_write_wait();
   
         return (authctxt);  
 }  }

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.52.2.2