diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-06-28 17:52:58 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-06-29 14:41:14 +0200 |
commit | 206f3ff895d3d822ac4f23426136537129f9f062 (patch) | |
tree | 59728e18437ec9308d14a50082ef831b5b158612 /src/wrapper.c | |
parent | 81b4320318966e83678641a06717c301b071971b (diff) | |
download | libssh-206f3ff895d3d822ac4f23426136537129f9f062.tar.gz libssh-206f3ff895d3d822ac4f23426136537129f9f062.tar.xz libssh-206f3ff895d3d822ac4f23426136537129f9f062.zip |
Rest in Peace SSHv1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/wrapper.c')
-rw-r--r-- | src/wrapper.c | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/src/wrapper.c b/src/wrapper.c index 7d771030..bba2c45b 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -353,39 +353,9 @@ static int crypt_set_algorithms2(ssh_session session){ return SSH_OK; } -static int crypt_set_algorithms1(ssh_session session, enum ssh_des_e des_type) { - int i = 0; - struct ssh_cipher_struct *ssh_ciphertab=ssh_get_ciphertab(); - - /* right now, we force 3des-cbc to be taken */ - while (ssh_ciphertab[i].name && strcmp(ssh_ciphertab[i].name, - des_type == SSH_DES ? "des-cbc-ssh1" : "3des-cbc-ssh1")) { - i++; - } - - if (ssh_ciphertab[i].name == NULL) { - ssh_set_error(session, SSH_FATAL, "cipher 3des-cbc-ssh1 or des-cbc-ssh1 not found!"); - return SSH_ERROR; - } - - session->next_crypto->out_cipher = cipher_new(i); - if (session->next_crypto->out_cipher == NULL) { - ssh_set_error_oom(session); - return SSH_ERROR; - } - - session->next_crypto->in_cipher = cipher_new(i); - if (session->next_crypto->in_cipher == NULL) { - ssh_set_error_oom(session); - return SSH_ERROR; - } - - return SSH_OK; -} - -int crypt_set_algorithms(ssh_session session, enum ssh_des_e des_type) { - return (session->version == 1) ? crypt_set_algorithms1(session, des_type) : - crypt_set_algorithms2(session); +int crypt_set_algorithms_client(ssh_session session) +{ + return crypt_set_algorithms2(session); } #ifdef WITH_SERVER |