diff options
Diffstat (limited to 'dh.c')
-rw-r--r-- | dh.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: dh.c,v 1.12 2001/04/03 19:53:29 markus Exp $"); | 26 | RCSID("$OpenBSD: dh.c,v 1.13 2001/04/04 23:09:17 markus Exp $"); |
27 | 27 | ||
28 | #include "xmalloc.h" | 28 | #include "xmalloc.h" |
29 | 29 | ||
@@ -151,11 +151,9 @@ choose_dh(int min, int wantbits, int max) | |||
151 | while (fgets(line, sizeof(line), f)) { | 151 | while (fgets(line, sizeof(line), f)) { |
152 | if (!parse_prime(linenum, line, &dhg)) | 152 | if (!parse_prime(linenum, line, &dhg)) |
153 | continue; | 153 | continue; |
154 | if (dhg.size > max || dhg.size < min) | 154 | if ((dhg.size > max || dhg.size < min) || |
155 | continue; | 155 | dhg.size != best || |
156 | if (dhg.size != best) | 156 | linenum++ != which) { |
157 | continue; | ||
158 | if (linenum++ != which) { | ||
159 | BN_free(dhg.g); | 157 | BN_free(dhg.g); |
160 | BN_free(dhg.p); | 158 | BN_free(dhg.p); |
161 | continue; | 159 | continue; |
@@ -163,6 +161,9 @@ choose_dh(int min, int wantbits, int max) | |||
163 | break; | 161 | break; |
164 | } | 162 | } |
165 | fclose(f); | 163 | fclose(f); |
164 | if (linenum != which+1) | ||
165 | fatal("WARNING: line %d disappeared in %s, giving up", | ||
166 | which, _PATH_DH_PRIMES); | ||
166 | 167 | ||
167 | return (dh_new_group(dhg.g, dhg.p)); | 168 | return (dh_new_group(dhg.g, dhg.p)); |
168 | } | 169 | } |