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

Collapse All | Expand All

(-)a/krl.c (-2 / +3 lines)
Lines 1089-1095 ssh_krl_from_blob(struct sshbuf *buf, struct ssh_krl **krlp, Link Here
1089
			break;
1089
			break;
1090
		case KRL_SECTION_SIGNATURE:
1090
		case KRL_SECTION_SIGNATURE:
1091
			/* Handled above, but still need to stay in synch */
1091
			/* Handled above, but still need to stay in synch */
1092
			sshbuf_reset(sect);
1092
			sshbuf_free(sect);
1093
			sect = NULL;
1093
			sect = NULL;
1094
			if ((r = sshbuf_skip_string(copy)) != 0)
1094
			if ((r = sshbuf_skip_string(copy)) != 0)
1095
				goto out;
1095
				goto out;
Lines 1288-1294 ssh_krl_file_contains_key(const char *path, const struct sshkey *key) Link Here
1288
	debug2("%s: checking KRL %s", __func__, path);
1288
	debug2("%s: checking KRL %s", __func__, path);
1289
	r = ssh_krl_check_key(krl, key);
1289
	r = ssh_krl_check_key(krl, key);
1290
 out:
1290
 out:
1291
	close(fd);
1291
	if (fd != -1)
1292
		close(fd);
1292
	sshbuf_free(krlbuf);
1293
	sshbuf_free(krlbuf);
1293
	ssh_krl_free(krl);
1294
	ssh_krl_free(krl);
1294
	if (r != 0)
1295
	if (r != 0)
(-)a/readconf.c (-6 / +6 lines)
Lines 1185-1191 parse_int: Link Here
1185
		value = cipher_number(arg);
1185
		value = cipher_number(arg);
1186
		if (value == -1)
1186
		if (value == -1)
1187
			fatal("%.200s line %d: Bad cipher '%s'.",
1187
			fatal("%.200s line %d: Bad cipher '%s'.",
1188
			    filename, linenum, arg ? arg : "<NONE>");
1188
			    filename, linenum, arg);
1189
		if (*activep && *intptr == -1)
1189
		if (*activep && *intptr == -1)
1190
			*intptr = value;
1190
			*intptr = value;
1191
		break;
1191
		break;
Lines 1196-1202 parse_int: Link Here
1196
			fatal("%.200s line %d: Missing argument.", filename, linenum);
1196
			fatal("%.200s line %d: Missing argument.", filename, linenum);
1197
		if (*arg != '-' && !ciphers_valid(*arg == '+' ? arg + 1 : arg))
1197
		if (*arg != '-' && !ciphers_valid(*arg == '+' ? arg + 1 : arg))
1198
			fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.",
1198
			fatal("%.200s line %d: Bad SSH2 cipher spec '%s'.",
1199
			    filename, linenum, arg ? arg : "<NONE>");
1199
			    filename, linenum, arg);
1200
		if (*activep && options->ciphers == NULL)
1200
		if (*activep && options->ciphers == NULL)
1201
			options->ciphers = xstrdup(arg);
1201
			options->ciphers = xstrdup(arg);
1202
		break;
1202
		break;
Lines 1207-1213 parse_int: Link Here
1207
			fatal("%.200s line %d: Missing argument.", filename, linenum);
1207
			fatal("%.200s line %d: Missing argument.", filename, linenum);
1208
		if (*arg != '-' && !mac_valid(*arg == '+' ? arg + 1 : arg))
1208
		if (*arg != '-' && !mac_valid(*arg == '+' ? arg + 1 : arg))
1209
			fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.",
1209
			fatal("%.200s line %d: Bad SSH2 Mac spec '%s'.",
1210
			    filename, linenum, arg ? arg : "<NONE>");
1210
			    filename, linenum, arg);
1211
		if (*activep && options->macs == NULL)
1211
		if (*activep && options->macs == NULL)
1212
			options->macs = xstrdup(arg);
1212
			options->macs = xstrdup(arg);
1213
		break;
1213
		break;
Lines 1220-1226 parse_int: Link Here
1220
		if (*arg != '-' &&
1220
		if (*arg != '-' &&
1221
		    !kex_names_valid(*arg == '+' ? arg + 1 : arg))
1221
		    !kex_names_valid(*arg == '+' ? arg + 1 : arg))
1222
			fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.",
1222
			fatal("%.200s line %d: Bad SSH2 KexAlgorithms '%s'.",
1223
			    filename, linenum, arg ? arg : "<NONE>");
1223
			    filename, linenum, arg);
1224
		if (*activep && options->kex_algorithms == NULL)
1224
		if (*activep && options->kex_algorithms == NULL)
1225
			options->kex_algorithms = xstrdup(arg);
1225
			options->kex_algorithms = xstrdup(arg);
1226
		break;
1226
		break;
Lines 1235-1241 parse_keytypes: Link Here
1235
		if (*arg != '-' &&
1235
		if (*arg != '-' &&
1236
		    !sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1))
1236
		    !sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1))
1237
			fatal("%s line %d: Bad key types '%s'.",
1237
			fatal("%s line %d: Bad key types '%s'.",
1238
				filename, linenum, arg ? arg : "<NONE>");
1238
				filename, linenum, arg);
1239
		if (*activep && *charptr == NULL)
1239
		if (*activep && *charptr == NULL)
1240
			*charptr = xstrdup(arg);
1240
			*charptr = xstrdup(arg);
1241
		break;
1241
		break;
Lines 1248-1254 parse_keytypes: Link Here
1248
		value = proto_spec(arg);
1248
		value = proto_spec(arg);
1249
		if (value == SSH_PROTO_UNKNOWN)
1249
		if (value == SSH_PROTO_UNKNOWN)
1250
			fatal("%.200s line %d: Bad protocol spec '%s'.",
1250
			fatal("%.200s line %d: Bad protocol spec '%s'.",
1251
			    filename, linenum, arg ? arg : "<NONE>");
1251
			    filename, linenum, arg);
1252
		if (*activep && *intptr == SSH_PROTO_UNKNOWN)
1252
		if (*activep && *intptr == SSH_PROTO_UNKNOWN)
1253
			*intptr = value;
1253
			*intptr = value;
1254
		break;
1254
		break;
(-)a/servconf.c (-4 / +4 lines)
Lines 1217-1223 process_server_config_line_depth(ServerOptions *options, char *line, Link Here
1217
		if (*arg != '-' &&
1217
		if (*arg != '-' &&
1218
		    !sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1))
1218
		    !sshkey_names_valid2(*arg == '+' ? arg + 1 : arg, 1))
1219
			fatal("%s line %d: Bad key types '%s'.",
1219
			fatal("%s line %d: Bad key types '%s'.",
1220
			    filename, linenum, arg ? arg : "<NONE>");
1220
			    filename, linenum, arg);
1221
		if (*activep && *charptr == NULL)
1221
		if (*activep && *charptr == NULL)
1222
			*charptr = xstrdup(arg);
1222
			*charptr = xstrdup(arg);
1223
		break;
1223
		break;
Lines 1476-1482 process_server_config_line_depth(ServerOptions *options, char *line, Link Here
1476
			fatal("%s line %d: Missing argument.", filename, linenum);
1476
			fatal("%s line %d: Missing argument.", filename, linenum);
1477
		if (*arg != '-' && !ciphers_valid(*arg == '+' ? arg + 1 : arg))
1477
		if (*arg != '-' && !ciphers_valid(*arg == '+' ? arg + 1 : arg))
1478
			fatal("%s line %d: Bad SSH2 cipher spec '%s'.",
1478
			fatal("%s line %d: Bad SSH2 cipher spec '%s'.",
1479
			    filename, linenum, arg ? arg : "<NONE>");
1479
			    filename, linenum, arg);
1480
		if (options->ciphers == NULL)
1480
		if (options->ciphers == NULL)
1481
			options->ciphers = xstrdup(arg);
1481
			options->ciphers = xstrdup(arg);
1482
		break;
1482
		break;
Lines 1487-1493 process_server_config_line_depth(ServerOptions *options, char *line, Link Here
1487
			fatal("%s line %d: Missing argument.", filename, linenum);
1487
			fatal("%s line %d: Missing argument.", filename, linenum);
1488
		if (*arg != '-' && !mac_valid(*arg == '+' ? arg + 1 : arg))
1488
		if (*arg != '-' && !mac_valid(*arg == '+' ? arg + 1 : arg))
1489
			fatal("%s line %d: Bad SSH2 mac spec '%s'.",
1489
			fatal("%s line %d: Bad SSH2 mac spec '%s'.",
1490
			    filename, linenum, arg ? arg : "<NONE>");
1490
			    filename, linenum, arg);
1491
		if (options->macs == NULL)
1491
		if (options->macs == NULL)
1492
			options->macs = xstrdup(arg);
1492
			options->macs = xstrdup(arg);
1493
		break;
1493
		break;
Lines 1500-1506 process_server_config_line_depth(ServerOptions *options, char *line, Link Here
1500
		if (*arg != '-' &&
1500
		if (*arg != '-' &&
1501
		    !kex_names_valid(*arg == '+' ? arg + 1 : arg))
1501
		    !kex_names_valid(*arg == '+' ? arg + 1 : arg))
1502
			fatal("%s line %d: Bad SSH2 KexAlgorithms '%s'.",
1502
			fatal("%s line %d: Bad SSH2 KexAlgorithms '%s'.",
1503
			    filename, linenum, arg ? arg : "<NONE>");
1503
			    filename, linenum, arg);
1504
		if (options->kex_algorithms == NULL)
1504
		if (options->kex_algorithms == NULL)
1505
			options->kex_algorithms = xstrdup(arg);
1505
			options->kex_algorithms = xstrdup(arg);
1506
		break;
1506
		break;
(-)a/ssh-pkcs11.c (-2 / +2 lines)
Lines 536-543 pkcs11_fetch_keys_filter(struct pkcs11_provider *p, CK_ULONG slotidx, Link Here
536
				X509_free(x509);
536
				X509_free(x509);
537
		}
537
		}
538
		if (rsa && rsa->n && rsa->e &&
538
		if (rsa && rsa->n && rsa->e &&
539
		    pkcs11_rsa_wrap(p, slotidx, &attribs[0], rsa) == 0) {
539
		    pkcs11_rsa_wrap(p, slotidx, &attribs[0], rsa) == 0 &&
540
			key = sshkey_new(KEY_UNSPEC);
540
		    (key = sshkey_new(KEY_UNSPEC)) == NULL) {
541
			key->rsa = rsa;
541
			key->rsa = rsa;
542
			key->type = KEY_RSA;
542
			key->type = KEY_RSA;
543
			key->flags |= SSHKEY_FLAG_EXT;
543
			key->flags |= SSHKEY_FLAG_EXT;
(-)a/sshconnect1.c (-2 / +4 lines)
Lines 520-526 ssh_kex(char *host, struct sockaddr *hostaddr) Link Here
520
		cookie[i] = packet_get_char();
520
		cookie[i] = packet_get_char();
521
521
522
	/* Get the public key. */
522
	/* Get the public key. */
523
	server_key = key_new(KEY_RSA1);
523
	if ((server_key = key_new(KEY_RSA1)) == NULL)
524
		fatal("%s: key_new(KEY_RSA1) failed", __func__);
524
	bits = packet_get_int();
525
	bits = packet_get_int();
525
	packet_get_bignum(server_key->rsa->e);
526
	packet_get_bignum(server_key->rsa->e);
526
	packet_get_bignum(server_key->rsa->n);
527
	packet_get_bignum(server_key->rsa->n);
Lines 532-538 ssh_kex(char *host, struct sockaddr *hostaddr) Link Here
532
		logit("Warning: This may be due to an old implementation of ssh.");
533
		logit("Warning: This may be due to an old implementation of ssh.");
533
	}
534
	}
534
	/* Get the host key. */
535
	/* Get the host key. */
535
	host_key = key_new(KEY_RSA1);
536
	if ((host_key = key_new(KEY_RSA1)) == NULL)
537
		fatal("%s: key_new(KEY_RSA1) failed", __func__);
536
	bits = packet_get_int();
538
	bits = packet_get_int();
537
	packet_get_bignum(host_key->rsa->e);
539
	packet_get_bignum(host_key->rsa->e);
538
	packet_get_bignum(host_key->rsa->n);
540
	packet_get_bignum(host_key->rsa->n);
(-)a/sshkey.c (+3 lines)
Lines 1239-1244 sshkey_read(struct sshkey *ret, char **cpp) Link Here
1239
	u_long bits;
1239
	u_long bits;
1240
#endif /* WITH_SSH1 */
1240
#endif /* WITH_SSH1 */
1241
1241
1242
	if (ret == NULL)
1243
		return SSH_ERR_INVALID_ARGUMENT;
1244
1242
	cp = *cpp;
1245
	cp = *cpp;
1243
1246
1244
	switch (ret->type) {
1247
	switch (ret->type) {

Return to bug 2687