From: Andre Noll Date: Sun, 3 Jul 2016 10:45:15 +0000 (+0200) Subject: server: Do not fail if client does not request sideband. X-Git-Tag: v0.5.7~22^2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=a8786a08cf7cd65db89ee9ffa495e5282720082a;ds=sidebyside server: Do not fail if client does not request sideband. Currently we insist that clients request the sideband feature during the initial handshake. This check was introduced long ago to detect incompatible 0.4.x clients and fail the connection early and gracefully for those clients. These days the check is no longer needed and can be removed. para_server still announces the sideband feature and accepts the sideband request, although it makes no difference any more whether or not the client requests the feature. Therefore this change has no impact on compatibility with 0.5.x clients. --- diff --git a/command.c b/command.c index 93de2d2d..0eb4efc2 100644 --- a/command.c +++ b/command.c @@ -807,7 +807,6 @@ static void reset_signals(void) } struct connection_features { - bool sideband_requested; bool aes_ctr128_requested; }; @@ -835,8 +834,8 @@ static int parse_auth_request(char *buf, int len, struct user **u, create_argv(p, ",", &features); for (i = 0; features[i]; i++) { if (strcmp(features[i], "sideband") == 0) - cf->sideband_requested = true; - else if (strcmp(features[i], "aes_ctr128") == 0) + continue; + if (strcmp(features[i], "aes_ctr128") == 0) cf->aes_ctr128_requested = true; else { ret = -E_BAD_FEATURE; @@ -949,11 +948,6 @@ __noreturn void handle_connect(int fd, const char *peername) ret = parse_auth_request(buf, ret, &cc->u, &cf); if (ret < 0) goto net_err; - if (!cf.sideband_requested) { /* sideband is mandatory */ - PARA_ERROR_LOG("client did not request sideband\n"); - ret = -E_BAD_FEATURE; - goto net_err; - } if (cc->u) { get_random_bytes_or_die(rand_buf, sizeof(rand_buf)); ret = pub_encrypt(cc->u->pubkey, rand_buf, sizeof(rand_buf),