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

Diff for /src/usr.bin/ssh/auth-passwd.c between version 1.23 and 1.23.2.2

version 1.23, 2001/06/26 16:15:23 version 1.23.2.2, 2002/06/22 07:23:16
Line 39 
Line 39 
 RCSID("$OpenBSD$");  RCSID("$OpenBSD$");
   
 #include "packet.h"  #include "packet.h"
 #include "xmalloc.h"  
 #include "log.h"  #include "log.h"
 #include "servconf.h"  #include "servconf.h"
 #include "auth.h"  #include "auth.h"
Line 55 
Line 54 
 auth_password(Authctxt *authctxt, const char *password)  auth_password(Authctxt *authctxt, const char *password)
 {  {
         struct passwd * pw = authctxt->pw;          struct passwd * pw = authctxt->pw;
         char *encrypted_password;  
   
         /* deny if no user. */          /* deny if no user. */
         if (pw == NULL)          if (pw == NULL)
Line 86 
Line 84 
                 return 0;                  return 0;
         else          else
                 return 1;                  return 1;
 #endif  #else
         /* Check for users with no password. */          /* Check for users with no password. */
         if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0)          if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0)
                 return 1;                  return 1;
         /* Encrypt the candidate password using the proper salt. */          else {
         encrypted_password = crypt(password,                  /* Encrypt the candidate password using the proper salt. */
             (pw->pw_passwd[0] && pw->pw_passwd[1]) ? pw->pw_passwd : "xx");                  char *encrypted_password = crypt(password,
                       (pw->pw_passwd[0] && pw->pw_passwd[1]) ?
         /* Authentication is accepted if the encrypted passwords are identical. */                      pw->pw_passwd : "xx");
         return (strcmp(encrypted_password, pw->pw_passwd) == 0);                  /*
                    * Authentication is accepted if the encrypted passwords
                    * are identical.
                    */
                   return (strcmp(encrypted_password, pw->pw_passwd) == 0);
           }
   #endif
 }  }

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.23.2.2