diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-04-06 09:25:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-04-06 09:25:37 -0400 |
commit | fe69a7e1d7658d3202af0c2c7308d342faaa1559 (patch) | |
tree | 9a713f7649647586825075823f456d3d710a4a60 /src/or | |
parent | 3781955f079f25f8d6aa47cb746e339497076050 (diff) | |
parent | 7451b4cafededa95da0099ea2444224d941eef52 (diff) | |
download | tor-fe69a7e1d7658d3202af0c2c7308d342faaa1559.tar.gz tor-fe69a7e1d7658d3202af0c2c7308d342faaa1559.zip |
Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/rendcommon.c | 2 | ||||
-rw-r--r-- | src/or/rendservice.c | 10 | ||||
-rw-r--r-- | src/or/routerparse.c | 14 |
3 files changed, 20 insertions, 6 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index a664b5d501..bd701b217e 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -1087,7 +1087,7 @@ rend_cache_store_v2_desc_as_client(const char *desc, goto err; } /* Decode/decrypt introduction points. */ - if (intro_content) { + if (intro_content && intro_size > 0) { int n_intro_points; if (rend_query->auth_type != REND_NO_AUTH && !tor_mem_is_zero(rend_query->descriptor_cookie, diff --git a/src/or/rendservice.c b/src/or/rendservice.c index a7c1e32f15..4a8d6c5d7d 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -1819,6 +1819,16 @@ rend_service_parse_intro_for_v2( goto err; } + if (128 != crypto_pk_keysize(extend_info->onion_key)) { + if (err_msg_out) { + tor_asprintf(err_msg_out, + "invalid onion key size in version %d INTRODUCE%d cell", + intro->version, + (intro->type)); + } + + goto err; + } ver_specific_len = 7+DIGEST_LEN+2+klen; diff --git a/src/or/routerparse.c b/src/or/routerparse.c index f990cebd82..b59b0ad4f2 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -4684,7 +4684,7 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed, size_t intro_points_encoded_size) { const char *current_ipo, *end_of_intro_points; - smartlist_t *tokens; + smartlist_t *tokens = NULL; directory_token_t *tok; rend_intro_point_t *intro; extend_info_t *info; @@ -4693,8 +4693,10 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed, tor_assert(parsed); /** Function may only be invoked once. */ tor_assert(!parsed->intro_nodes); - tor_assert(intro_points_encoded); - tor_assert(intro_points_encoded_size > 0); + if (!intro_points_encoded || intro_points_encoded_size == 0) { + log_warn(LD_REND, "Empty or zero size introduction point list"); + goto err; + } /* Consider one intro point after the other. */ current_ipo = intro_points_encoded; end_of_intro_points = intro_points_encoded + intro_points_encoded_size; @@ -4798,8 +4800,10 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed, done: /* Free tokens and clear token list. */ - SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t)); - smartlist_free(tokens); + if (tokens) { + SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t)); + smartlist_free(tokens); + } if (area) memarea_drop_all(area); |