[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.59 and 1.60

version 1.59, 2001/05/30 12:55:06 version 1.60, 2001/05/30 23:31:14
Line 243 
Line 243 
 void  void
 userauth_finish(Authctxt *authctxt, int authenticated, char *method)  userauth_finish(Authctxt *authctxt, int authenticated, char *method)
 {  {
           char *methods;
   
         if (!authctxt->valid && authenticated)          if (!authctxt->valid && authenticated)
                 fatal("INTERNAL ERROR: authenticated invalid user %s",                  fatal("INTERNAL ERROR: authenticated invalid user %s",
                     authctxt->user);                      authctxt->user);
Line 255 
Line 257 
         /* Log before sending the reply */          /* Log before sending the reply */
         auth_log(authctxt, authenticated, method, " ssh2");          auth_log(authctxt, authenticated, method, " ssh2");
   
         if (!authctxt->postponed)          if (authctxt->postponed)
                 userauth_reply(authctxt, authenticated);                  return;
   
           /* XXX todo: check if multiple auth methods are needed */
           if (authenticated == 1) {
                   /* turn off userauth */
                   dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &protocol_error);
                   packet_start(SSH2_MSG_USERAUTH_SUCCESS);
                   packet_send();
                   packet_write_wait();
                   /* now we can break out */
                   authctxt->success = 1;
           } else {
                   if (authctxt->failures++ > AUTH_FAIL_MAX)
                           packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
                   methods = authmethods_get();
                   packet_start(SSH2_MSG_USERAUTH_FAILURE);
                   packet_put_cstring(methods);
                   packet_put_char(0);     /* XXX partial success, unused */
                   packet_send();
                   packet_write_wait();
                   xfree(methods);
           }
 }  }
   
 void  void
Line 288 
Line 311 
                 xfree(banner);                  xfree(banner);
         close(fd);          close(fd);
         return;          return;
 }  
   
 void  
 userauth_reply(Authctxt *authctxt, int authenticated)  
 {  
         char *methods;  
   
         /* XXX todo: check if multiple auth methods are needed */  
         if (authenticated == 1) {  
                 /* turn off userauth */  
                 dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &protocol_error);  
                 packet_start(SSH2_MSG_USERAUTH_SUCCESS);  
                 packet_send();  
                 packet_write_wait();  
                 /* now we can break out */  
                 authctxt->success = 1;  
         } else {  
                 if (authctxt->failures++ > AUTH_FAIL_MAX)  
                         packet_disconnect(AUTH_FAIL_MSG, authctxt->user);  
                 methods = authmethods_get();  
                 packet_start(SSH2_MSG_USERAUTH_FAILURE);  
                 packet_put_cstring(methods);  
                 packet_put_char(0);     /* XXX partial success, unused */  
                 packet_send();  
                 packet_write_wait();  
                 xfree(methods);  
         }  
 }  }
   
 int  int

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60