summaryrefslogtreecommitdiffstats
path: root/src/wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrapper.c')
-rw-r--r--src/wrapper.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wrapper.c b/src/wrapper.c
index edce03d..e27579d 100644
--- a/src/wrapper.c
+++ b/src/wrapper.c
@@ -228,18 +228,18 @@ error:
return rc;
}
-static int crypt_set_algorithms1(ssh_session session) {
+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,
- "3des-cbc-ssh1")) {
+ 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 not found!");
+ ssh_set_error(session, SSH_FATAL, "cipher 3des-cbc-ssh1 or des-cbc-ssh1 not found!");
return SSH_ERROR;
}
@@ -258,8 +258,8 @@ static int crypt_set_algorithms1(ssh_session session) {
return SSH_OK;
}
-int crypt_set_algorithms(ssh_session session) {
- return (session->version == 1) ? crypt_set_algorithms1(session) :
+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);
}