summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-03-10 15:31:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-03-10 15:31:01 +0000
commit1df3d6b94b06c017d1bd1ed4e1ce48271355df8d (patch)
treead9024ea10239b23aaf4bca835dae09376a03876 /usr.bin/ssh
parent5a0d83e22a9f5644c10bbfbcb1525512180e3bc6 (diff)
all known netscreen ssh versions, and older versions of OSU ssh cannot
handle password padding (newer OSU is fixed)
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/compat.c20
-rw-r--r--usr.bin/ssh/compat.h3
-rw-r--r--usr.bin/ssh/sshconnect.c6
3 files changed, 20 insertions, 9 deletions
diff --git a/usr.bin/ssh/compat.c b/usr.bin/ssh/compat.c
index a47324e766f..16c5c926814 100644
--- a/usr.bin/ssh/compat.c
+++ b/usr.bin/ssh/compat.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: compat.c,v 1.37 2001/03/08 21:42:31 markus Exp $");
+RCSID("$OpenBSD: compat.c,v 1.38 2001/03/10 15:31:00 deraadt Exp $");
#include <regex.h>
@@ -76,13 +76,19 @@ compat_datafellows(const char *version)
SSH_OLD_SESSIONID|SSH_BUG_DEBUG|
SSH_BUG_PKSERVICE|SSH_BUG_X11FWD|
SSH_BUG_PKAUTH|SSH_BUG_PKOK },
- { "^2\\.[23]\\.0", SSH_BUG_HMAC},
+ { "^2\\.[23]\\.0", SSH_BUG_HMAC },
{ "^2\\.[2-9]\\.", 0 },
- { "^2\\.4$", SSH_OLD_SESSIONID}, /* Van Dyke */
- { "^3\\.0 SecureCRT", SSH_OLD_SESSIONID},
- { "^1\\.7 SecureFX", SSH_OLD_SESSIONID},
- { "^1\\.2\\.1[89]", SSH_BUG_IGNOREMSG},
- { "^1\\.2\\.2[012]", SSH_BUG_IGNOREMSG},
+ { "^2\\.4$", SSH_OLD_SESSIONID }, /* Van Dyke */
+ { "^3\\.0 SecureCRT", SSH_OLD_SESSIONID },
+ { "^1\\.7 SecureFX", SSH_OLD_SESSIONID },
+ { "^1\\.2\\.1[89]", SSH_BUG_IGNOREMSG },
+ { "^1\\.2\\.2[012]", SSH_BUG_IGNOREMSG },
+ { "^SSH Compatible Server", /* Netscreen */
+ SSH_BUG_PASSWORDPAD },
+ { "^OSU_0", SSH_BUG_PASSWORDPAD },
+ { "^OSU_1\\.[0-4]", SSH_BUG_PASSWORDPAD },
+ { "^OSU_1\\.5alpha[1-3]",
+ SSH_BUG_PASSWORDPAD },
{ NULL, 0 }
};
/* process table, return first match */
diff --git a/usr.bin/ssh/compat.h b/usr.bin/ssh/compat.h
index 9359d4b797f..a1fdbe764b7 100644
--- a/usr.bin/ssh/compat.h
+++ b/usr.bin/ssh/compat.h
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* RCSID("$OpenBSD: compat.h,v 1.16 2001/03/08 21:42:32 markus Exp $"); */
+/* RCSID("$OpenBSD: compat.h,v 1.17 2001/03/10 15:31:00 deraadt Exp $"); */
#ifndef COMPAT_H
#define COMPAT_H
@@ -41,6 +41,7 @@
#define SSH_BUG_BANNER 0x0080
#define SSH_BUG_IGNOREMSG 0x0100
#define SSH_BUG_PKOK 0x0200
+#define SSH_BUG_PASSWORDPAD 0x0400
void enable_compat13(void);
void enable_compat20(void);
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index 2534743a534..62a3aee17e3 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -13,7 +13,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.98 2001/03/04 17:42:28 millert Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.99 2001/03/10 15:31:00 deraadt Exp $");
#include <openssl/bn.h>
@@ -769,6 +769,10 @@ ssh_put_password(char *password)
int size;
char *padded;
+ if (datafellows & SSH_BUG_PASSWORDPAD) {
+ packet_put_string(password, strlen(password));
+ return;
+ }
size = roundup(strlen(password) + 1, 32);
padded = xmalloc(size);
memset(padded, 0, size);