test_hs_descriptor: Add a test case that fails without the fix for 40793
This adds a bit more to hs_descriptor/test_decode_descriptor, mostly
testing pow-params and triggering the tor_assert() in issue #40793.
There was no mechanism for adding arbitrary test strings to the
encrypted portion of the desc without duplicating encode logic. One
option might be to publicize get_inner_encrypted_layer_plaintext enough
to add a mock implementation. In this patch I opt for what seems like
the simplest solution, at the cost of a small amount of #ifdef noise.
The unpacked descriptor grows a new test-only member that's used for
dropping arbitrary data in at encode time.
Signed-off-by:
Micah Elizabeth Scott <beth@torproject.org>
Showing
- src/feature/hs/hs_descriptor.c 16 additions, 3 deletionssrc/feature/hs/hs_descriptor.c
- src/feature/hs/hs_descriptor.h 7 additions, 0 deletionssrc/feature/hs/hs_descriptor.h
- src/test/hs_test_helpers.c 12 additions, 0 deletionssrc/test/hs_test_helpers.c
- src/test/test_hs_descriptor.c 69 additions, 0 deletionssrc/test/test_hs_descriptor.c
Please register or sign in to comment