diff --git a/ssh.c b/ssh.c index 6e55107d..7031a554 100644 --- a/ssh.c +++ b/ssh.c @@ -47,23 +47,6 @@ static const char *const ssh2_disconnect_reasons[] = { "illegal user name", }; -/* - * Various remote-bug flags. - */ -#define BUG_CHOKES_ON_SSH1_IGNORE 1 -#define BUG_SSH2_HMAC 2 -#define BUG_NEEDS_SSH1_PLAIN_PASSWORD 4 -#define BUG_CHOKES_ON_RSA 8 -#define BUG_SSH2_RSA_PADDING 16 -#define BUG_SSH2_DERIVEKEY 32 -#define BUG_SSH2_REKEY 64 -#define BUG_SSH2_PK_SESSIONID 128 -#define BUG_SSH2_MAXPKT 256 -#define BUG_CHOKES_ON_SSH2_IGNORE 512 -#define BUG_CHOKES_ON_WINADJ 1024 -#define BUG_SENDS_LATE_REQUEST_REPLY 2048 -#define BUG_SSH2_OLDGEX 4096 - #define DH_MIN_SIZE 1024 #define DH_MAX_SIZE 8192 diff --git a/ssh.h b/ssh.h index 8a411710..7dbd31fe 100644 --- a/ssh.h +++ b/ssh.h @@ -1266,3 +1266,29 @@ const char *ssh2_pkt_type(Pkt_KCtx pkt_kctx, Pkt_ACtx pkt_actx, int type); * format. */ void old_keyfile_warning(void); + +/* + * Flags indicating implementation bugs that we know how to mitigate + * if we think the other end has them. + */ +#define SSH_IMPL_BUG_LIST(X) \ + X(BUG_CHOKES_ON_SSH1_IGNORE) \ + X(BUG_SSH2_HMAC) \ + X(BUG_NEEDS_SSH1_PLAIN_PASSWORD) \ + X(BUG_CHOKES_ON_RSA) \ + X(BUG_SSH2_RSA_PADDING) \ + X(BUG_SSH2_DERIVEKEY) \ + X(BUG_SSH2_REKEY) \ + X(BUG_SSH2_PK_SESSIONID) \ + X(BUG_SSH2_MAXPKT) \ + X(BUG_CHOKES_ON_SSH2_IGNORE) \ + X(BUG_CHOKES_ON_WINADJ) \ + X(BUG_SENDS_LATE_REQUEST_REPLY) \ + X(BUG_SSH2_OLDGEX) \ + /* end of list */ +#define TMP_DECLARE_LOG2_ENUM(thing) log2_##thing, +enum { SSH_IMPL_BUG_LIST(TMP_DECLARE_LOG2_ENUM) }; +#undef TMP_DECLARE_LOG2_ENUM +#define TMP_DECLARE_REAL_ENUM(thing) thing = 1 << log2_##thing, +enum { SSH_IMPL_BUG_LIST(TMP_DECLARE_REAL_ENUM) }; +#undef TMP_DECLARE_REAL_ENUM