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

Diff for /src/usr.bin/ssh/monitor.c between version 1.120 and 1.121

version 1.120, 2012/12/11 22:16:21 version 1.121, 2013/03/07 00:19:59
Line 951 
Line 951 
 monitor_valid_userblob(u_char *data, u_int datalen)  monitor_valid_userblob(u_char *data, u_int datalen)
 {  {
         Buffer b;          Buffer b;
         char *p;          char *p, *userstyle;
         u_int len;          u_int len;
         int fail = 0;          int fail = 0;
   
Line 976 
Line 976 
         }          }
         if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST)          if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST)
                 fail++;                  fail++;
         p = buffer_get_string(&b, NULL);          p = buffer_get_cstring(&b, NULL);
         if (strcmp(authctxt->user, p) != 0) {          xasprintf(&userstyle, "%s%s%s", authctxt->user,
               authctxt->style ? ":" : "",
               authctxt->style ? authctxt->style : "");
           if (strcmp(userstyle, p) != 0) {
                 logit("wrong user name passed to monitor: expected %s != %.100s",                  logit("wrong user name passed to monitor: expected %s != %.100s",
                     authctxt->user, p);                      userstyle, p);
                 fail++;                  fail++;
         }          }
           xfree(userstyle);
         xfree(p);          xfree(p);
         buffer_skip_string(&b);          buffer_skip_string(&b);
         if (datafellows & SSH_BUG_PKAUTH) {          if (datafellows & SSH_BUG_PKAUTH) {
                 if (!buffer_get_char(&b))                  if (!buffer_get_char(&b))
                         fail++;                          fail++;
         } else {          } else {
                 p = buffer_get_string(&b, NULL);                  p = buffer_get_cstring(&b, NULL);
                 if (strcmp("publickey", p) != 0)                  if (strcmp("publickey", p) != 0)
                         fail++;                          fail++;
                 xfree(p);                  xfree(p);
Line 1008 
Line 1012 
     char *chost)      char *chost)
 {  {
         Buffer b;          Buffer b;
         char *p;          char *p, *userstyle;
         u_int len;          u_int len;
         int fail = 0;          int fail = 0;
   
Line 1024 
Line 1028 
   
         if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST)          if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST)
                 fail++;                  fail++;
         p = buffer_get_string(&b, NULL);          p = buffer_get_cstring(&b, NULL);
         if (strcmp(authctxt->user, p) != 0) {          xasprintf(&userstyle, "%s%s%s", authctxt->user,
               authctxt->style ? ":" : "",
               authctxt->style ? authctxt->style : "");
           if (strcmp(userstyle, p) != 0) {
                 logit("wrong user name passed to monitor: expected %s != %.100s",                  logit("wrong user name passed to monitor: expected %s != %.100s",
                     authctxt->user, p);                      userstyle, p);
                 fail++;                  fail++;
         }          }
           free(userstyle);
         xfree(p);          xfree(p);
         buffer_skip_string(&b); /* service */          buffer_skip_string(&b); /* service */
         p = buffer_get_string(&b, NULL);          p = buffer_get_cstring(&b, NULL);
         if (strcmp(p, "hostbased") != 0)          if (strcmp(p, "hostbased") != 0)
                 fail++;                  fail++;
         xfree(p);          xfree(p);

Legend:
Removed from v.1.120  
changed lines
  Added in v.1.121