diff options
author | 2000-10-11 20:27:23 +0000 | |
---|---|---|
committer | 2000-10-11 20:27:23 +0000 | |
commit | 8612b276e433abfd30b3a388e2889f83f46ecdaa (patch) | |
tree | 3c7eb5dcc0097a3d2a0ab5a6139fb991e30a25c4 /usr.bin/ssh/sshconnect2.c | |
parent | add support for s/key (kbd-interactive) to ssh2, based on work by mkiernan@avantgo.com and me (diff) | |
download | wireguard-openbsd-8612b276e433abfd30b3a388e2889f83f46ecdaa.tar.xz wireguard-openbsd-8612b276e433abfd30b3a388e2889f83f46ecdaa.zip |
new cipher framework
Diffstat (limited to 'usr.bin/ssh/sshconnect2.c')
-rw-r--r-- | usr.bin/ssh/sshconnect2.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c index f8bbc600322..0785548a486 100644 --- a/usr.bin/ssh/sshconnect2.c +++ b/usr.bin/ssh/sshconnect2.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect2.c,v 1.23 2000/10/11 20:14:39 markus Exp $"); +RCSID("$OpenBSD: sshconnect2.c,v 1.24 2000/10/11 20:27:24 markus Exp $"); #include <openssl/bn.h> #include <openssl/rsa.h> @@ -37,7 +37,6 @@ RCSID("$OpenBSD: sshconnect2.c,v 1.23 2000/10/11 20:14:39 markus Exp $"); #include "rsa.h" #include "buffer.h" #include "packet.h" -#include "cipher.h" #include "uidswap.h" #include "compat.h" #include "readconf.h" @@ -76,17 +75,16 @@ ssh_kex2(char *host, struct sockaddr *hostaddr) Buffer *client_kexinit, *server_kexinit; char *sprop[PROPOSAL_MAX]; + if (options.ciphers == NULL) { + if (options.cipher == SSH_CIPHER_3DES) { + options.ciphers = "3des-cbc"; + } else if (options.cipher == SSH_CIPHER_BLOWFISH) { + options.ciphers = "blowfish-cbc"; + } + } if (options.ciphers != NULL) { myproposal[PROPOSAL_ENC_ALGS_CTOS] = myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers; - } else if (options.cipher == SSH_CIPHER_3DES) { - myproposal[PROPOSAL_ENC_ALGS_CTOS] = - myproposal[PROPOSAL_ENC_ALGS_STOC] = - (char *) cipher_name(SSH_CIPHER_3DES_CBC); - } else if (options.cipher == SSH_CIPHER_BLOWFISH) { - myproposal[PROPOSAL_ENC_ALGS_CTOS] = - myproposal[PROPOSAL_ENC_ALGS_STOC] = - (char *) cipher_name(SSH_CIPHER_BLOWFISH_CBC); } if (options.compression) { myproposal[PROPOSAL_COMP_ALGS_CTOS] = "zlib"; @@ -313,7 +311,7 @@ ssh_dhgex_client(Kex *kex, char *host, struct sockaddr *hostaddr, unsigned char *kbuf; unsigned char *hash; - nbits = dh_estimate(kex->enc[MODE_OUT].key_len * 8); + nbits = dh_estimate(kex->enc[MODE_OUT].cipher->key_len * 8); debug("Sending SSH2_MSG_KEX_DH_GEX_REQUEST."); packet_start(SSH2_MSG_KEX_DH_GEX_REQUEST); |