Hi Todd,

On Mon, Jun 25, 2018 at 03:43:46PM -0600, Todd C. Miller wrote:
| Actually, it appears that the code accounts for which being one
| less.  The problem is the additional linenum++ introduced in rev
| 1.64 along with the getline() changes.  We should only be incrementing
| linenum for each suitable prime, not every line.

I think this is correct.  While looking at that piece of code, I
completely missed the incrementing of linenum.  Now that you point it
out explicitly, it's quite obvious that this was the problem all
along.  I'll put this on my ssh jump host tonight.

Thanks!

Paul

|  - todd
| 
| Index: usr.bin/ssh/dh.c
| ===================================================================
| RCS file: /cvs/src/usr.bin/ssh/dh.c,v
| retrieving revision 1.64
| diff -u -p -u -r1.64 dh.c
| --- usr.bin/ssh/dh.c  6 Jun 2018 18:29:18 -0000       1.64
| +++ usr.bin/ssh/dh.c  25 Jun 2018 21:41:52 -0000
| @@ -186,7 +186,6 @@ choose_dh(int min, int wantbits, int max
|       linenum = 0;
|       which = arc4random_uniform(bestcount);
|       while (getline(&line, &linesize, f) != -1) {
| -             linenum++;
|               if (!parse_prime(linenum, line, &dhg))
|                       continue;
|               if ((dhg.size > max || dhg.size < min) ||

-- 
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/                 

Reply via email to