version 1.518, 2018/11/16 03:26:01 |
version 1.519, 2018/11/19 04:12:32 |
|
|
break; |
break; |
case 'h': |
case 'h': |
servconf_add_hostkey("[command-line]", 0, |
servconf_add_hostkey("[command-line]", 0, |
&options, optarg); |
&options, optarg, 1); |
break; |
break; |
case 't': |
case 't': |
test_flag = 1; |
test_flag = 1; |
|
|
} |
} |
|
|
for (i = 0; i < options.num_host_key_files; i++) { |
for (i = 0; i < options.num_host_key_files; i++) { |
|
int ll = options.host_key_file_userprovided[i] ? |
|
SYSLOG_LEVEL_ERROR : SYSLOG_LEVEL_DEBUG1; |
|
|
if (options.host_key_files[i] == NULL) |
if (options.host_key_files[i] == NULL) |
continue; |
continue; |
if ((r = sshkey_load_private(options.host_key_files[i], "", |
if ((r = sshkey_load_private(options.host_key_files[i], "", |
&key, NULL)) != 0 && r != SSH_ERR_SYSTEM_ERROR) |
&key, NULL)) != 0 && r != SSH_ERR_SYSTEM_ERROR) |
error("Error loading host key \"%s\": %s", |
do_log2(ll, "Unable to load host key \"%s\": %s", |
options.host_key_files[i], ssh_err(r)); |
options.host_key_files[i], ssh_err(r)); |
if ((r = sshkey_load_public(options.host_key_files[i], |
if ((r = sshkey_load_public(options.host_key_files[i], |
&pubkey, NULL)) != 0 && r != SSH_ERR_SYSTEM_ERROR) |
&pubkey, NULL)) != 0 && r != SSH_ERR_SYSTEM_ERROR) |
error("Error loading host key \"%s\": %s", |
do_log2(ll, "Unable to load host key \"%s\": %s", |
options.host_key_files[i], ssh_err(r)); |
options.host_key_files[i], ssh_err(r)); |
if (pubkey == NULL && key != NULL) |
if (pubkey == NULL && key != NULL) |
if ((r = sshkey_from_private(key, &pubkey)) != 0) |
if ((r = sshkey_from_private(key, &pubkey)) != 0) |
|
|
keytype = key->type; |
keytype = key->type; |
accumulate_host_timing_secret(cfg, key); |
accumulate_host_timing_secret(cfg, key); |
} else { |
} else { |
error("Could not load host key: %s", |
do_log2(ll, "Unable to load host key: %s", |
options.host_key_files[i]); |
options.host_key_files[i]); |
sensitive_data.host_keys[i] = NULL; |
sensitive_data.host_keys[i] = NULL; |
sensitive_data.host_pubkeys[i] = NULL; |
sensitive_data.host_pubkeys[i] = NULL; |