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

Diff for /src/usr.bin/ssh/kex.c between version 1.133 and 1.134

version 1.133, 2017/05/30 14:23:52 version 1.134, 2017/06/13 12:13:59
Line 366 
Line 366 
 {  {
         struct kex *kex = ssh->kex;          struct kex *kex = ssh->kex;
         u_int32_t i, ninfo;          u_int32_t i, ninfo;
         char *name, *val, *found;          char *name, *found;
           u_char *val;
           size_t vlen;
         int r;          int r;
   
         debug("SSH2_MSG_EXT_INFO received");          debug("SSH2_MSG_EXT_INFO received");
Line 376 
Line 378 
         for (i = 0; i < ninfo; i++) {          for (i = 0; i < ninfo; i++) {
                 if ((r = sshpkt_get_cstring(ssh, &name, NULL)) != 0)                  if ((r = sshpkt_get_cstring(ssh, &name, NULL)) != 0)
                         return r;                          return r;
                 if ((r = sshpkt_get_cstring(ssh, &val, NULL)) != 0) {                  if ((r = sshpkt_get_string(ssh, &val, &vlen)) != 0) {
                         free(name);                          free(name);
                         return r;                          return r;
                 }                  }
                 debug("%s: %s=<%s>", __func__, name, val);  
                 if (strcmp(name, "server-sig-algs") == 0) {                  if (strcmp(name, "server-sig-algs") == 0) {
                           /* Ensure no \0 lurking in value */
                           if (memchr(val, '\0', vlen) != NULL) {
                                   error("%s: nul byte in %s", __func__, name);
                                   return SSH_ERR_INVALID_FORMAT;
                           }
                           debug("%s: %s=<%s>", __func__, name, val);
                         found = match_list("rsa-sha2-256", val, NULL);                          found = match_list("rsa-sha2-256", val, NULL);
                         if (found) {                          if (found) {
                                 kex->rsa_sha2 = 256;                                  kex->rsa_sha2 = 256;
Line 392 
Line 399 
                                 kex->rsa_sha2 = 512;                                  kex->rsa_sha2 = 512;
                                 free(found);                                  free(found);
                         }                          }
                 }                  } else
                           debug("%s: %s (unrecognised)", __func__, name);
                 free(name);                  free(name);
                 free(val);                  free(val);
         }          }

Legend:
Removed from v.1.133  
changed lines
  Added in v.1.134