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 @@ */ #include "includes.h" -RCSID("$Id: compat.c,v 1.6 2000/04/12 08:45:06 damien Exp $"); +RCSID("$Id: compat.c,v 1.7 2000/04/12 10:17:39 damien Exp $"); #include "ssh.h" #include "packet.h" +#include "xmalloc.h" +#include "compat.h" int compat13 = 0; int compat20 = 0; @@ -65,9 +67,36 @@ compat_datafellows(const char *version) len = strlen(check[i]); if (strlen(version) >= len && (strncmp(version, check[i], len) == 0)) { - log("datafellows: %.200s", version); + verbose("datafellows: %.200s", version); datafellows = 1; return; } } } + +#define SEP "," +int +proto_spec(const char *spec) +{ + char *s = xstrdup(spec); + char *p; + int ret = SSH_PROTO_UNKNOWN; + + for ((p = strtok(s, SEP)); p; (p = strtok(NULL, SEP))) { + switch(atoi(p)) { + case 1: + if (ret == SSH_PROTO_UNKNOWN) + ret |= SSH_PROTO_1_PREFERRED; + ret |= SSH_PROTO_1; + break; + case 2: + ret |= SSH_PROTO_2; + break; + default: + log("ignoring bad proto spec: '%s'.", p); + break; + } + } + xfree(s); + return ret; +} |