diff options
author | Damien Miller <djm@mindrot.org> | 2000-04-12 20:17:38 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-04-12 20:17:38 +1000 |
commit | 78928793fb23a3a4c80ae62eca6a7826b2987690 (patch) | |
tree | add8a953ac4cf06877b91624fe7f647b17e6cf6f /compat.c | |
parent | efb4afe0265333ce554f699c2a19ae249dd8d1b5 (diff) |
- OpenBSD CVS updates:
- [channels.c]
repair x11-fwd
- [sshconnect.c]
fix passwd prompt for ssh2, less debugging output.
- [clientloop.c compat.c dsa.c kex.c sshd.c]
less debugging output
- [kex.c kex.h sshconnect.c sshd.c]
check for reasonable public DH values
- [README.openssh2 cipher.c cipher.h compat.c compat.h readconf.c]
[readconf.h servconf.c servconf.h ssh.c ssh.h sshconnect.c sshd.c]
add Cipher and Protocol options to ssh/sshd, e.g.:
ssh -o 'Protocol 1,2' if you prefer proto 1, ssh -o 'Ciphers
arcfour,3des-cbc'
- [sshd.c]
print 1.99 only if server supports both
Diffstat (limited to 'compat.c')
-rw-r--r-- | compat.c | 33 |
1 files changed, 31 insertions, 2 deletions
@@ -28,10 +28,12 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "includes.h" | 30 | #include "includes.h" |
31 | RCSID("$Id: compat.c,v 1.6 2000/04/12 08:45:06 damien Exp $"); | 31 | RCSID("$Id: compat.c,v 1.7 2000/04/12 10:17:39 damien Exp $"); |
32 | 32 | ||
33 | #include "ssh.h" | 33 | #include "ssh.h" |
34 | #include "packet.h" | 34 | #include "packet.h" |
35 | #include "xmalloc.h" | ||
36 | #include "compat.h" | ||
35 | 37 | ||
36 | int compat13 = 0; | 38 | int compat13 = 0; |
37 | int compat20 = 0; | 39 | int compat20 = 0; |
@@ -65,9 +67,36 @@ compat_datafellows(const char *version) | |||
65 | len = strlen(check[i]); | 67 | len = strlen(check[i]); |
66 | if (strlen(version) >= len && | 68 | if (strlen(version) >= len && |
67 | (strncmp(version, check[i], len) == 0)) { | 69 | (strncmp(version, check[i], len) == 0)) { |
68 | log("datafellows: %.200s", version); | 70 | verbose("datafellows: %.200s", version); |
69 | datafellows = 1; | 71 | datafellows = 1; |
70 | return; | 72 | return; |
71 | } | 73 | } |
72 | } | 74 | } |
73 | } | 75 | } |
76 | |||
77 | #define SEP "," | ||
78 | int | ||
79 | proto_spec(const char *spec) | ||
80 | { | ||
81 | char *s = xstrdup(spec); | ||
82 | char *p; | ||
83 | int ret = SSH_PROTO_UNKNOWN; | ||
84 | |||
85 | for ((p = strtok(s, SEP)); p; (p = strtok(NULL, SEP))) { | ||
86 | switch(atoi(p)) { | ||
87 | case 1: | ||
88 | if (ret == SSH_PROTO_UNKNOWN) | ||
89 | ret |= SSH_PROTO_1_PREFERRED; | ||
90 | ret |= SSH_PROTO_1; | ||
91 | break; | ||
92 | case 2: | ||
93 | ret |= SSH_PROTO_2; | ||
94 | break; | ||
95 | default: | ||
96 | log("ignoring bad proto spec: '%s'.", p); | ||
97 | break; | ||
98 | } | ||
99 | } | ||
100 | xfree(s); | ||
101 | return ret; | ||
102 | } | ||