fuzzing: Make hsdescv3 use the decoding API correctly

Fixes #21509

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet 2017-10-26 09:52:15 -04:00
parent 4d2de821ce
commit c4ef21ff5e
2 changed files with 6 additions and 1 deletions

3
changes/bug21509 Normal file
View File

@ -0,0 +1,3 @@
o Minor bugfixes (hidden service v3, fuzzing):
- Fix the hidden service v3 descriptor decoding fuzzing to use the latest
decoding API correctly. Fixes bug 21509; bugfix on 0.3.2.1-alpha.

View File

@ -55,10 +55,12 @@ int
fuzz_main(const uint8_t *data, size_t sz)
{
hs_descriptor_t *desc = NULL;
uint8_t subcredential[DIGEST256_LEN];
char *fuzzing_data = tor_memdup_nulterm(data, sz);
memset(subcredential, 'A', sizeof(subcredential));
hs_desc_decode_descriptor(fuzzing_data, NULL, &desc);
hs_desc_decode_descriptor(fuzzing_data, subcredential, &desc);
if (desc) {
log_debug(LD_GENERAL, "Decoding okay");
hs_descriptor_free(desc);