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

Diff for /src/usr.bin/ssh/dh.c between version 1.67 and 1.68

version 1.67, 2018/09/13 02:08:33 version 1.68, 2018/09/17 15:40:14
Line 182 
Line 182 
                 logit("WARNING: no suitable primes in %s", _PATH_DH_MODULI);                  logit("WARNING: no suitable primes in %s", _PATH_DH_MODULI);
                 return (dh_new_group_fallback(max));                  return (dh_new_group_fallback(max));
         }          }
           which = arc4random_uniform(bestcount);
   
         linenum = 0;          linenum = 0;
         which = arc4random_uniform(bestcount);          bestcount = 0;
         while (getline(&line, &linesize, f) != -1) {          while (getline(&line, &linesize, f) != -1) {
                   linenum++;
                 if (!parse_prime(linenum, line, &dhg))                  if (!parse_prime(linenum, line, &dhg))
                         continue;                          continue;
                 if ((dhg.size > max || dhg.size < min) ||                  if ((dhg.size > max || dhg.size < min) ||
                     dhg.size != best ||                      dhg.size != best ||
                     linenum++ != which) {                      bestcount++ != which) {
                         BN_clear_free(dhg.g);                          BN_clear_free(dhg.g);
                         BN_clear_free(dhg.p);                          BN_clear_free(dhg.p);
                         continue;                          continue;
Line 200 
Line 202 
         free(line);          free(line);
         line = NULL;          line = NULL;
         fclose(f);          fclose(f);
         if (linenum != which+1) {          if (bestcount != which + 1) {
                 logit("WARNING: line %d disappeared in %s, giving up",                  logit("WARNING: selected prime disappeared in %s, giving up",
                     which, _PATH_DH_MODULI);                      _PATH_DH_MODULI);
                 return (dh_new_group_fallback(max));                  return (dh_new_group_fallback(max));
         }          }
   

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68