diff options
author | millert@openbsd.org <millert@openbsd.org> | 2018-06-26 11:23:59 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2018-07-03 11:08:29 +1000 |
commit | 6f56fe4b9578b0627667f8bce69d4d938a88324c (patch) | |
tree | 5155d28de869d169798f1624591fbe0fd6a7586b | |
parent | 1eee79a11c1b3594f055b01e387c49c9a6e80005 (diff) |
upstream: Fix "WARNING: line 6 disappeared in /etc/moduli, giving up"
when choosing a prime. An extra increment of linenum snuck in as part of the
conversion to getline(). OK djm@ markus@
OpenBSD-Commit-ID: 0019225cb52ed621b71cd9f19ee2e78e57e3dd38
-rw-r--r-- | dh.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh.c,v 1.64 2018/06/06 18:29:18 markus Exp $ */ | 1 | /* $OpenBSD: dh.c,v 1.65 2018/06/26 11:23:59 millert Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Niels Provos. All rights reserved. | 3 | * Copyright (c) 2000 Niels Provos. All rights reserved. |
4 | * | 4 | * |
@@ -190,7 +190,6 @@ choose_dh(int min, int wantbits, int max) | |||
190 | linenum = 0; | 190 | linenum = 0; |
191 | which = arc4random_uniform(bestcount); | 191 | which = arc4random_uniform(bestcount); |
192 | while (getline(&line, &linesize, f) != -1) { | 192 | while (getline(&line, &linesize, f) != -1) { |
193 | linenum++; | ||
194 | if (!parse_prime(linenum, line, &dhg)) | 193 | if (!parse_prime(linenum, line, &dhg)) |
195 | continue; | 194 | continue; |
196 | if ((dhg.size > max || dhg.size < min) || | 195 | if ((dhg.size > max || dhg.size < min) || |