summaryrefslogtreecommitdiffstats
path: root/src/wrapper.c
diff options
context:
space:
mode:
authorDmitriy Kuznetsov <dk@yandex.ru>2012-09-07 12:19:43 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-09-07 12:19:43 +0200
commit320951f42ff5def186da70d2e52457b7c1d06f50 (patch)
treeb8dbd3e27959c3694c8639e3cd11335137a3a378 /src/wrapper.c
parenta3f83e72740bfc0062ab8232e5a0325354ecc1a8 (diff)
downloadlibssh-320951f42ff5def186da70d2e52457b7c1d06f50.tar.gz
libssh-320951f42ff5def186da70d2e52457b7c1d06f50.tar.xz
libssh-320951f42ff5def186da70d2e52457b7c1d06f50.zip
kex: Add simple DES support for SSHv1.
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);
}