From: Andre Noll Date: Sun, 4 Dec 2016 10:10:36 +0000 (+0100) Subject: Merge branch 'refs/heads/t/sideband-cleanup' X-Git-Tag: v0.5.7~22 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f80453b693e6d3ce5450755310faf5e5d6e5c143;hp=33692c33f2effa9620064aec44c6196a8d830d05 Merge branch 'refs/heads/t/sideband-cleanup' started on 2016-07-03, cooking since 2016-07-16 para_server announces sideband as an optional feature, which is pointless since sideband connections have become mandatory in paraslash-0.5.x, so they are always used. This patch set removes the feature negitiation during the initial handshake. The sideband protocol remains and is not affected. Overwiew of the handshake in v0.5.x: (SA) server announces sideband (CC) client fails connection if server did not announce sideband (CR) client requests sideband (SC) server fails connection if sideband was not requested already broken - client-0.4/server-0.5 (!CR, SC) - client-0.5/server-0.4 (!SA, CC) Conversion plan: rm (CC): breaks nothing rm (SC): breaks nothing rm (CR): breaks cl-0.6/server-0.5 (!CR, SC) rm (SA): breaks cl-0.5/server-0.6 (!SA, CC) server fails connection if client requests sideband In this series only the first two conversion steps are done as they can be merged early without breaking anything. * refs/heads/t/sideband-cleanup: server: Do not fail if client does not request sideband. client: No longer fail connection if sideband was not announced. --- diff --git a/client_common.c b/client_common.c index cd1ccc61..eea7510f 100644 --- a/client_common.c +++ b/client_common.c @@ -292,11 +292,6 @@ static int client_post_select(struct sched *s, void *context) if (ret < 0 || n == 0) goto out; ct->features = parse_features(buf); - if (!has_feature("sideband", ct)) { - PARA_ERROR_LOG("server has no sideband support\n"); - ret = -E_INCOMPAT_FEAT; - goto out; - } ct->status = CL_RECEIVED_WELCOME; return 0; case CL_RECEIVED_WELCOME: /* send auth command */ 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), diff --git a/error.h b/error.h index 337160c9..3fda5787 100644 --- a/error.h +++ b/error.h @@ -306,7 +306,6 @@ extern const char **para_errlist[]; PARA_ERROR(SERVER_EOF, "connection closed by para_server"), \ PARA_ERROR(SERVER_CMD_SUCCESS, "command terminated successfully"), \ PARA_ERROR(SERVER_CMD_FAILURE, "command failed"), \ - PARA_ERROR(INCOMPAT_FEAT, "client/server incompatibility"), \ #define NET_ERRORS \