/[shishi]/inetutils/rlogind/rlogind.c
ViewVC logotype

Diff of /inetutils/rlogind/rlogind.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by npo, Wed Sep 24 15:17:58 2003 UTC revision 1.7 by npo, Wed Sep 24 21:30:35 2003 UTC
# Line 1029  do_shishi_login (int infd, struct auth_d Line 1029  do_shishi_login (int infd, struct auth_d
1029    int error = 0;    int error = 0;
1030    int keylen, keytype;    int keylen, keytype;
1031    struct passwd *pwd = NULL;    struct passwd *pwd = NULL;
1032    /*int cksumtype, cksumlen = 30;    int cksumtype, cksumlen = 30;
1033    char cksum[30];    char cksum[30];
1034      char * compcksum;
1035      size_t compcksumlen;
1036    char cksumdata[100];    char cksumdata[100];
1037    */    struct sockaddr_in sock;
1038      size_t socklen;    
1039      
1040  #ifdef ENCRYPTION    #ifdef ENCRYPTION  
1041    rc = get_auth (infd, &ad->h, &ad->enckey, err_msg, &ad->protocol    rc = get_auth (infd, &ad->h, &ad->enckey, err_msg, &ad->protocol,
1042                   /*&cksumtype, cksum, &cksumlen*/);                   &cksumtype, cksum, &cksumlen);
1043  #else  #else
1044    rc = get_auth (infd, &ad->h, NULL, err_msg, &ad->protocol    rc = get_auth (infd, &ad->h, NULL, err_msg, &ad->protocol
1045                   /*&cksumtype, cksum, &cksumlen*/);                   &cksumtype, cksum, &cksumlen);
1046  #endif  #endif
1047    if (rc != SHISHI_OK)    if (rc != SHISHI_OK)
1048      return rc;      return rc;
# Line 1124  do_shishi_login (int infd, struct auth_d Line 1128  do_shishi_login (int infd, struct auth_d
1128            "Kerberos V login from %s on %s\n",            "Kerberos V login from %s on %s\n",
1129            ad->lusername, ad->hostname);            ad->lusername, ad->hostname);
1130        
1131    /* ADD CHECKSUM VERIFICATION CODE !!!!!!!!!!!!!! */    /* verify checksum */
   /*  
   snprintf (cksumdata, 100, "%u:%s%s", ntohs(port), ad->term + 5, ad->lusername);    
   shishi_checksum (Shishi * handle,  
               Shishi_key * key,  
               int keyusage,  
               int cksumtype,  
               const char *in, size_t inlen, char **out, size_t * outlen)  
   */  
1132    
1133    free (pwd);   if (getsockname (infd, (struct sockaddr *)&sock, &socklen) < 0)
1134        {
1135          syslog (LOG_ERR, "Can't get sock name");
1136          fatal (infd, "Can't get sockname", 1);
1137        }
1138    
1139      snprintf (cksumdata, 100, "%u:%s%s", ntohs(sock.sin_port), ad->term + 5, ad->lusername);  
1140      rc = shishi_checksum (ad->h, ad->enckey, 0, cksumtype, cksumdata,
1141                            strlen (cksumdata), &compcksum, &compcksumlen);
1142      if ((rc != SHISHI_OK) || (compcksumlen != cksumlen) || (memcmp (compcksum, cksum, cksumlen) != 0))
1143        {
1144          /* err_msg crash ? */
1145          /* *err_msg = "checksum verify failed"; */
1146          syslog (LOG_ERR, "checksum verify failed: %s", shishi_error (ad->h));
1147          free (compcksum);
1148          return 1;
1149        }
1150      
1151      free (pwd);
1152      free (compcksum);
1153          
1154    return SHISHI_OK;    return SHISHI_OK;
1155  }  }
1156  #endif  #endif

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26