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

Diff for /src/usr.bin/ssh/compat.c between version 1.119 and 1.120

version 1.119, 2021/09/10 05:46:09 version 1.120, 2022/07/01 03:35:45
Line 154 
Line 154 
         debug_f("no match: %s", version);          debug_f("no match: %s", version);
 }  }
   
   /* Always returns pointer to allocated memory, caller must free. */
 char *  char *
 compat_cipher_proposal(struct ssh *ssh, char *cipher_prop)  compat_cipher_proposal(struct ssh *ssh, char *cipher_prop)
 {  {
         if (!(ssh->compat & SSH_BUG_BIGENDIANAES))          if (!(ssh->compat & SSH_BUG_BIGENDIANAES))
                 return cipher_prop;                  return xstrdup(cipher_prop);
         debug2_f("original cipher proposal: %s", cipher_prop);          debug2_f("original cipher proposal: %s", cipher_prop);
         if ((cipher_prop = match_filter_denylist(cipher_prop, "aes*")) == NULL)          if ((cipher_prop = match_filter_denylist(cipher_prop, "aes*")) == NULL)
                 fatal("match_filter_denylist failed");                  fatal("match_filter_denylist failed");
Line 168 
Line 169 
         return cipher_prop;          return cipher_prop;
 }  }
   
   /* Always returns pointer to allocated memory, caller must free. */
 char *  char *
 compat_pkalg_proposal(struct ssh *ssh, char *pkalg_prop)  compat_pkalg_proposal(struct ssh *ssh, char *pkalg_prop)
 {  {
         if (!(ssh->compat & SSH_BUG_RSASIGMD5))          if (!(ssh->compat & SSH_BUG_RSASIGMD5))
                 return pkalg_prop;                  return xstrdup(pkalg_prop);
         debug2_f("original public key proposal: %s", pkalg_prop);          debug2_f("original public key proposal: %s", pkalg_prop);
         if ((pkalg_prop = match_filter_denylist(pkalg_prop, "ssh-rsa")) == NULL)          if ((pkalg_prop = match_filter_denylist(pkalg_prop, "ssh-rsa")) == NULL)
                 fatal("match_filter_denylist failed");                  fatal("match_filter_denylist failed");
Line 182 
Line 184 
         return pkalg_prop;          return pkalg_prop;
 }  }
   
   /* Always returns pointer to allocated memory, caller must free. */
 char *  char *
 compat_kex_proposal(struct ssh *ssh, char *p)  compat_kex_proposal(struct ssh *ssh, char *p)
 {  {
           char *cp = NULL;
   
         if ((ssh->compat & (SSH_BUG_CURVE25519PAD|SSH_OLD_DHGEX)) == 0)          if ((ssh->compat & (SSH_BUG_CURVE25519PAD|SSH_OLD_DHGEX)) == 0)
                 return p;                  return xstrdup(p);
         debug2_f("original KEX proposal: %s", p);          debug2_f("original KEX proposal: %s", p);
         if ((ssh->compat & SSH_BUG_CURVE25519PAD) != 0)          if ((ssh->compat & SSH_BUG_CURVE25519PAD) != 0)
                 if ((p = match_filter_denylist(p,                  if ((p = match_filter_denylist(p,
                     "curve25519-sha256@libssh.org")) == NULL)                      "curve25519-sha256@libssh.org")) == NULL)
                         fatal("match_filter_denylist failed");                          fatal("match_filter_denylist failed");
         if ((ssh->compat & SSH_OLD_DHGEX) != 0) {          if ((ssh->compat & SSH_OLD_DHGEX) != 0) {
                   cp = p;
                 if ((p = match_filter_denylist(p,                  if ((p = match_filter_denylist(p,
                     "diffie-hellman-group-exchange-sha256,"                      "diffie-hellman-group-exchange-sha256,"
                     "diffie-hellman-group-exchange-sha1")) == NULL)                      "diffie-hellman-group-exchange-sha1")) == NULL)
                         fatal("match_filter_denylist failed");                          fatal("match_filter_denylist failed");
                   free(cp);
         }          }
         debug2_f("compat KEX proposal: %s", p);          debug2_f("compat KEX proposal: %s", p);
         if (*p == '\0')          if (*p == '\0')

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