summaryrefslogtreecommitdiff
path: root/sshconnect1.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect1.c')
-rw-r--r--sshconnect1.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sshconnect1.c b/sshconnect1.c
index 227e10b4b..709329713 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect1.c,v 1.9 2000/11/12 19:50:38 markus Exp $"); 16RCSID("$OpenBSD: sshconnect1.c,v 1.11 2000/11/25 16:42:53 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include <openssl/dsa.h> 19#include <openssl/dsa.h>
@@ -833,13 +833,14 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
833 RSA_free(public_key); 833 RSA_free(public_key);
834 RSA_free(host_key); 834 RSA_free(host_key);
835 835
836 if (options.cipher == SSH_CIPHER_ILLEGAL) { 836 if (options.cipher == SSH_CIPHER_NOT_SET) {
837 if (cipher_mask_ssh1(1) & supported_ciphers & (1 << ssh_cipher_default))
838 options.cipher = ssh_cipher_default;
839 } else if (options.cipher == SSH_CIPHER_ILLEGAL ||
840 !(cipher_mask_ssh1(1) & (1 << options.cipher))) {
837 log("No valid SSH1 cipher, using %.100s instead.", 841 log("No valid SSH1 cipher, using %.100s instead.",
838 cipher_name(ssh_cipher_default)); 842 cipher_name(ssh_cipher_default));
839 options.cipher = ssh_cipher_default; 843 options.cipher = ssh_cipher_default;
840 } else if (options.cipher == SSH_CIPHER_NOT_SET) {
841 if (cipher_mask_ssh1(1) & supported_ciphers & (1 << ssh_cipher_default))
842 options.cipher = ssh_cipher_default;
843 } 844 }
844 /* Check that the selected cipher is supported. */ 845 /* Check that the selected cipher is supported. */
845 if (!(supported_ciphers & (1 << options.cipher))) 846 if (!(supported_ciphers & (1 << options.cipher)))