version 1.339, 2020/10/16 13:26:13 |
version 1.340, 2020/10/18 11:32:01 |
|
|
ssh_digest_update(md, portstr, strlen(portstr)) < 0 || |
ssh_digest_update(md, portstr, strlen(portstr)) < 0 || |
ssh_digest_update(md, user, strlen(user)) < 0 || |
ssh_digest_update(md, user, strlen(user)) < 0 || |
ssh_digest_final(md, conn_hash, sizeof(conn_hash)) < 0) |
ssh_digest_final(md, conn_hash, sizeof(conn_hash)) < 0) |
fatal("%s: mux digest failed", __func__); |
fatal_f("mux digest failed"); |
ssh_digest_free(md); |
ssh_digest_free(md); |
return tohex(conn_hash, ssh_digest_bytes(SSH_DIGEST_SHA1)); |
return tohex(conn_hash, ssh_digest_bytes(SSH_DIGEST_SHA1)); |
} |
} |
|
|
for (i = 0; i < options->num_certificate_files; i++) { |
for (i = 0; i < options->num_certificate_files; i++) { |
if (options->certificate_file_userprovided[i] == userprovided && |
if (options->certificate_file_userprovided[i] == userprovided && |
strcmp(options->certificate_files[i], path) == 0) { |
strcmp(options->certificate_files[i], path) == 0) { |
debug2("%s: ignoring duplicate key %s", __func__, path); |
debug2_f("ignoring duplicate key %s", path); |
return; |
return; |
} |
} |
} |
} |
|
|
for (i = 0; i < options->num_identity_files; i++) { |
for (i = 0; i < options->num_identity_files; i++) { |
if (options->identity_file_userprovided[i] == userprovided && |
if (options->identity_file_userprovided[i] == userprovided && |
strcmp(options->identity_files[i], path) == 0) { |
strcmp(options->identity_files[i], path) == 0) { |
debug2("%s: ignoring duplicate key %s", __func__, path); |
debug2_f("ignoring duplicate key %s", path); |
free(path); |
free(path); |
return; |
return; |
} |
} |
|
|
char *argv[4]; |
char *argv[4]; |
|
|
if (stdfd_devnull(1, 1, 0) == -1) |
if (stdfd_devnull(1, 1, 0) == -1) |
fatal("%s: stdfd_devnull failed", __func__); |
fatal_f("stdfd_devnull failed"); |
closefrom(STDERR_FILENO + 1); |
closefrom(STDERR_FILENO + 1); |
|
|
argv[0] = shell; |
argv[0] = shell; |
|
|
} |
} |
/* Parent. */ |
/* Parent. */ |
if (pid == -1) |
if (pid == -1) |
fatal("%s: fork: %.100s", __func__, strerror(errno)); |
fatal_f("fork: %.100s", strerror(errno)); |
|
|
while (waitpid(pid, &status, 0) == -1) { |
while (waitpid(pid, &status, 0) == -1) { |
if (errno != EINTR && errno != EAGAIN) |
if (errno != EINTR && errno != EAGAIN) |
fatal("%s: waitpid: %s", __func__, strerror(errno)); |
fatal_f("waitpid: %s", strerror(errno)); |
} |
} |
if (!WIFEXITED(status)) { |
if (!WIFEXITED(status)) { |
error("command '%.100s' exited abnormally", cmd); |
error("command '%.100s' exited abnormally", cmd); |
|
|
(u_char) arg[1] >= 64 && (u_char) arg[1] < 128) |
(u_char) arg[1] >= 64 && (u_char) arg[1] < 128) |
value = (u_char) arg[1] & 31; |
value = (u_char) arg[1] & 31; |
else { |
else { |
|
value = 0; /* Avoid compiler warning. */ |
fatal("%.200s line %d: Bad escape character.", |
fatal("%.200s line %d: Bad escape character.", |
filename, linenum); |
filename, linenum); |
/* NOTREACHED */ |
|
value = 0; /* Avoid compiler warning. */ |
|
} |
} |
if (*activep && *intptr == -1) |
if (*activep && *intptr == -1) |
*intptr = value; |
*intptr = value; |
|
|
return 0; |
return 0; |
|
|
default: |
default: |
fatal("%s: Unimplemented opcode %d", __func__, opcode); |
fatal_f("Unimplemented opcode %d", opcode); |
} |
} |
|
|
/* Check that there is no garbage at end of line. */ |
/* Check that there is no garbage at end of line. */ |
|
|
do { \ |
do { \ |
if ((r = kex_assemble_names(&options->what, \ |
if ((r = kex_assemble_names(&options->what, \ |
defaults, all)) != 0) \ |
defaults, all)) != 0) \ |
fatal("%s: %s: %s", __func__, #what, ssh_err(r)); \ |
fatal_fr(r, "%s", #what); \ |
} while (0) |
} while (0) |
ASSEMBLE(ciphers, def_cipher, all_cipher); |
ASSEMBLE(ciphers, def_cipher, all_cipher); |
ASSEMBLE(macs, def_mac, all_mac); |
ASSEMBLE(macs, def_mac, all_mac); |
|
|
all_key = sshkey_alg_list(0, 0, 1, ','); |
all_key = sshkey_alg_list(0, 0, 1, ','); |
if ((r = kex_assemble_names(&o->hostkeyalgorithms, kex_default_pk_alg(), |
if ((r = kex_assemble_names(&o->hostkeyalgorithms, kex_default_pk_alg(), |
all_key)) != 0) |
all_key)) != 0) |
fatal("%s: expand HostKeyAlgorithms: %s", __func__, ssh_err(r)); |
fatal_fr(r, "expand HostKeyAlgorithms"); |
free(all_key); |
free(all_key); |
|
|
/* Most interesting options first: user, host, port */ |
/* Most interesting options first: user, host, port */ |