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

Diff for /src/usr.bin/ssh/sshconnect2.c between version 1.118 and 1.119

version 1.118, 2003/05/14 02:15:47 version 1.119, 2003/05/15 00:28:28
Line 199 
Line 199 
 void    userauth(Authctxt *, char *);  void    userauth(Authctxt *, char *);
   
 static int sign_and_send_pubkey(Authctxt *, Identity *);  static int sign_and_send_pubkey(Authctxt *, Identity *);
 static void clear_auth_state(Authctxt *);  
 static void pubkey_prepare(Authctxt *);  static void pubkey_prepare(Authctxt *);
 static void pubkey_cleanup(Authctxt *);  static void pubkey_cleanup(Authctxt *);
 static Key *load_identity_file(char *);  static Key *load_identity_file(char *);
Line 294 
Line 293 
         dispatch_run(DISPATCH_BLOCK, &authctxt.success, &authctxt);     /* loop until success */          dispatch_run(DISPATCH_BLOCK, &authctxt.success, &authctxt);     /* loop until success */
   
         pubkey_cleanup(&authctxt);          pubkey_cleanup(&authctxt);
           dispatch_range(SSH2_MSG_USERAUTH_MIN, SSH2_MSG_USERAUTH_MAX, NULL);
   
         debug("Authentication succeeded (%s).", authctxt.method->name);          debug("Authentication succeeded (%s).", authctxt.method->name);
 }  }
   
 void  void
 userauth(Authctxt *authctxt, char *authlist)  userauth(Authctxt *authctxt, char *authlist)
 {  {
Line 311 
Line 313 
                 if (method == NULL)                  if (method == NULL)
                         fatal("Permission denied (%s).", authlist);                          fatal("Permission denied (%s).", authlist);
                 authctxt->method = method;                  authctxt->method = method;
   
                   /* reset the per method handler */
                   dispatch_range(SSH2_MSG_USERAUTH_PER_METHOD_MIN,
                       SSH2_MSG_USERAUTH_PER_METHOD_MAX, NULL);
   
                   /* and try new method */
                 if (method->userauth(authctxt) != 0) {                  if (method->userauth(authctxt) != 0) {
                         debug2("we sent a %s packet, wait for reply", method->name);                          debug2("we sent a %s packet, wait for reply", method->name);
                         break;                          break;
Line 348 
Line 356 
                 fatal("input_userauth_success: no authentication context");                  fatal("input_userauth_success: no authentication context");
         if (authctxt->authlist)          if (authctxt->authlist)
                 xfree(authctxt->authlist);                  xfree(authctxt->authlist);
         clear_auth_state(authctxt);  
         authctxt->success = 1;                  /* break out */          authctxt->success = 1;                  /* break out */
 }  }
   
Line 370 
Line 377 
                 logit("Authenticated with partial success.");                  logit("Authenticated with partial success.");
         debug("Authentications that can continue: %s", authlist);          debug("Authentications that can continue: %s", authlist);
   
         clear_auth_state(authctxt);  
         userauth(authctxt, authlist);          userauth(authctxt, authlist);
 }  }
 void  void
Line 433 
Line 439 
         xfree(pkalg);          xfree(pkalg);
         xfree(pkblob);          xfree(pkblob);
   
         /* unregister */  
         clear_auth_state(authctxt);  
         dispatch_set(SSH2_MSG_USERAUTH_PK_OK, NULL);  
   
         /* try another method if we did not send a packet */          /* try another method if we did not send a packet */
         if (sent == 0)          if (sent == 0)
                 userauth(authctxt, NULL);                  userauth(authctxt, NULL);
Line 551 
Line 553 
   
         dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ,          dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ,
             &input_userauth_passwd_changereq);              &input_userauth_passwd_changereq);
 }  
   
 static void  
 clear_auth_state(Authctxt *authctxt)  
 {  
         /* XXX clear authentication state */  
         dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, NULL);  
 }  }
   
 static int  static int

Legend:
Removed from v.1.118  
changed lines
  Added in v.1.119