View | Details | Raw Unified | Return to bug 2559 | Differences between
and this patch

Collapse All | Expand All

(-)openssh-7.2p2/dh.c (-7 / +15 lines)
Lines 151-161 choose_dh(int min, int wantbits, int max Link Here
151
	int linenum;
151
	int linenum;
152
	struct dhgroup dhg;
152
	struct dhgroup dhg;
153
153
154
	if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL &&
154
	const char *moduli_path;
155
	    (f = fopen(_PATH_DH_PRIMES, "r")) == NULL) {
155
	
156
		logit("WARNING: %s does not exist, using fixed modulus",
156
	moduli_path = _PATH_DH_MODULI;
157
		    _PATH_DH_MODULI);
157
158
		return (dh_new_group_fallback(max));
158
	if ((f = fopen(moduli_path, "r")) == NULL) {
159
	  logit("WARNING: %s does not exist, trying %s",
160
		moduli_path, _PATH_DH_PRIMES);
161
	  moduli_path = _PATH_DH_PRIMES;
162
	  if ((f = fopen(moduli_path, "r")) == NULL) {
163
	    logit("WARNING: %s does not exist, using fixed modulus",
164
		  moduli_path);
165
	    return (dh_new_group_fallback(max));
166
	  }
159
	}
167
	}
160
168
161
	linenum = 0;
169
	linenum = 0;
Lines 182-188 choose_dh(int min, int wantbits, int max Link Here
182
190
183
	if (bestcount == 0) {
191
	if (bestcount == 0) {
184
		fclose(f);
192
		fclose(f);
185
		logit("WARNING: no suitable primes in %s", _PATH_DH_PRIMES);
193
		logit("WARNING: no suitable primes in %s", moduli_path);
186
		return (dh_new_group_fallback(max));
194
		return (dh_new_group_fallback(max));
187
	}
195
	}
188
196
Lines 203-209 choose_dh(int min, int wantbits, int max Link Here
203
	fclose(f);
211
	fclose(f);
204
	if (linenum != which+1) {
212
	if (linenum != which+1) {
205
		logit("WARNING: line %d disappeared in %s, giving up",
213
		logit("WARNING: line %d disappeared in %s, giving up",
206
		    which, _PATH_DH_PRIMES);
214
		    which, moduli_path);
207
		return (dh_new_group_fallback(max));
215
		return (dh_new_group_fallback(max));
208
	}
216
	}
209
217

Return to bug 2559