diff options
author | Ryo Nakamura <upa@haeena.net> | 2022-12-02 21:13:13 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2022-12-02 21:13:13 +0900 |
commit | 03b857b51a53763ce4fecff935bd98f79aae77db (patch) | |
tree | 4c7285061b9b64bae5bc19c1f1390eb8aa227222 /src/ssh.c | |
parent | d646fc1f894e1a408cba0a31a35901ac78ab4de3 (diff) |
add -M hmac option
Diffstat (limited to 'src/ssh.c')
-rw-r--r-- | src/ssh.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -32,11 +32,23 @@ static int ssh_set_opts(ssh_session ssh, struct ssh_opts *opts) if (opts->cipher) { if (ssh_options_set(ssh, SSH_OPTIONS_CIPHERS_C_S, opts->cipher) < 0) { - pr_err("failed to set cipher client to server\n"); + pr_err("failed to set cipher for client to server\n"); return -1; } if (ssh_options_set(ssh, SSH_OPTIONS_CIPHERS_S_C, opts->cipher) < 0) { - pr_err("failed to set cipher client to server\n"); + pr_err("failed to set cipher for server to client\n"); + return -1; + } + } + + if (opts->hmac) { + pr_warn("%s\n", opts->hmac); + if (ssh_options_set(ssh, SSH_OPTIONS_HMAC_C_S, opts->hmac) < 0) { + pr_err("failed to set hmac for client to server\n"); + return -1; + } + if (ssh_options_set(ssh, SSH_OPTIONS_HMAC_S_C, opts->hmac) < 0) { + pr_err("failed to set hmac for server to client\n"); return -1; } } |