[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.40 and 1.40.2.2

version 1.40, 2002/04/10 08:21:47 version 1.40.2.2, 2002/10/11 14:51:52
Line 116 
Line 116 
   
                                 if (kdata[0] == 4) { /* KRB_PROT_VERSION */                                  if (kdata[0] == 4) { /* KRB_PROT_VERSION */
 #ifdef KRB4  #ifdef KRB4
                                         KTEXT_ST tkt;                                          KTEXT_ST tkt, reply;
   
                                         tkt.length = dlen;                                          tkt.length = dlen;
                                         if (tkt.length < MAX_KTXT_LEN)                                          if (tkt.length < MAX_KTXT_LEN)
                                                 memcpy(tkt.dat, kdata, tkt.length);                                                  memcpy(tkt.dat, kdata, tkt.length);
   
                                         if (auth_krb4(authctxt, &tkt, &client_user)) {                                          if (PRIVSEP(auth_krb4(authctxt, &tkt,
                                               &client_user, &reply))) {
                                                 authenticated = 1;                                                  authenticated = 1;
                                                 snprintf(info, sizeof(info),                                                  snprintf(info, sizeof(info),
                                                     " tktuser %.100s",                                                      " tktuser %.100s",
                                                     client_user);                                                      client_user);
   
                                                   packet_start(
                                                       SSH_SMSG_AUTH_KERBEROS_RESPONSE);
                                                   packet_put_string((char *)
                                                       reply.dat, reply.length);
                                                   packet_send();
                                                   packet_write_wait();
   
                                                 xfree(client_user);                                                  xfree(client_user);
                                         }                                          }
 #endif /* KRB4 */  #endif /* KRB4 */
                                 } else {                                  } else {
 #ifdef KRB5  #ifdef KRB5
                                         krb5_data tkt;                                          krb5_data tkt, reply;
                                         tkt.length = dlen;                                          tkt.length = dlen;
                                         tkt.data = kdata;                                          tkt.data = kdata;
   
                                         if (auth_krb5(authctxt, &tkt, &client_user)) {                                          if (PRIVSEP(auth_krb5(authctxt, &tkt,
                                               &client_user, &reply))) {
                                                 authenticated = 1;                                                  authenticated = 1;
                                                 snprintf(info, sizeof(info),                                                  snprintf(info, sizeof(info),
                                                     " tktuser %.100s",                                                      " tktuser %.100s",
                                                     client_user);                                                      client_user);
   
                                                   /* Send response to client */
                                                   packet_start(
                                                       SSH_SMSG_AUTH_KERBEROS_RESPONSE);
                                                   packet_put_string((char *)
                                                       reply.data, reply.length);
                                                   packet_send();
                                                   packet_write_wait();
   
                                                   if (reply.length)
                                                           xfree(reply.data);
                                                 xfree(client_user);                                                  xfree(client_user);
                                         }                                          }
 #endif /* KRB5 */  #endif /* KRB5 */
Line 204 
Line 224 
                         if (bits != BN_num_bits(client_host_key->rsa->n))                          if (bits != BN_num_bits(client_host_key->rsa->n))
                                 verbose("Warning: keysize mismatch for client_host_key: "                                  verbose("Warning: keysize mismatch for client_host_key: "
                                     "actual %d, announced %d",                                      "actual %d, announced %d",
                                      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(pw, client_user,
Line 295 
Line 315 
                             authctxt->user);                              authctxt->user);
   
                 /* Special handling for root */                  /* Special handling for root */
                 if (authenticated && authctxt->pw->pw_uid == 0 &&                  if (!use_privsep &&
                       authenticated && authctxt->pw->pw_uid == 0 &&
                     !auth_root_allowed(get_authname(type)))                      !auth_root_allowed(get_authname(type)))
                         authenticated = 0;                          authenticated = 0;
   

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.40.2.2