commit 6f3208670a11cc7f0c5917852d28890b07ab87d2 Merge: 257f50b22 6be0e2867 Author: Nick Mathewson nickm@torproject.org Date: Mon Aug 21 14:20:38 2017 -0400
Merge branch 'maint-0.3.1'
changes/bug23233 | 4 + src/or/hs_descriptor.c | 5 +- src/test/test_hs_descriptor.c | 31 ++++++ src/test/test_hs_descriptor.inc | 224 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 262 insertions(+), 2 deletions(-)
diff --cc src/test/test_hs_descriptor.c index 77bdd4be5,8f8da361d..ab6a43ec7 --- a/src/test/test_hs_descriptor.c +++ b/src/test/test_hs_descriptor.c @@@ -551,9 -553,30 +559,30 @@@ test_decode_invalid_intro_point(void *a
done: hs_descriptor_free(desc); - desc_intro_point_free(ip); + hs_desc_intro_point_free(ip); }
+ /** Make sure we fail gracefully when decoding the bad desc from #23233. */ + static void + test_decode_bad_signature(void *arg) + { + hs_desc_plaintext_data_t desc_plaintext; + int ret; + + (void) arg; + + /* Update approx time to dodge cert expiration */ + update_approx_time(1502661599); + + setup_full_capture_of_logs(LOG_WARN); + ret = hs_desc_decode_plaintext(HS_DESC_BAD_SIG, &desc_plaintext); + tt_int_op(ret, OP_EQ, -1); + expect_log_msg_containing("Malformed signature line. Rejecting."); + teardown_capture_of_logs(); + + done: ; + } + static void test_decode_plaintext(void *arg) {
tor-commits@lists.torproject.org