[tor-commits] [tor/release-0.3.2] fuzzing: Make hsdescv3 use the decoding API correctly

nickm at torproject.org nickm at torproject.org
Thu Oct 26 14:43:15 UTC 2017


commit c4ef21ff5eff26182428d388e0614b4f0c5eed58
Author: David Goulet <dgoulet at torproject.org>
Date:   Thu Oct 26 09:52:15 2017 -0400

    fuzzing: Make hsdescv3 use the decoding API correctly
    
    Fixes #21509
    
    Signed-off-by: David Goulet <dgoulet at torproject.org>
---
 changes/bug21509              | 3 +++
 src/test/fuzz/fuzz_hsdescv3.c | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug21509 b/changes/bug21509
new file mode 100644
index 000000000..593a01ef2
--- /dev/null
+++ b/changes/bug21509
@@ -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.
diff --git a/src/test/fuzz/fuzz_hsdescv3.c b/src/test/fuzz/fuzz_hsdescv3.c
index 3fd21148f..03c509e2e 100644
--- a/src/test/fuzz/fuzz_hsdescv3.c
+++ b/src/test/fuzz/fuzz_hsdescv3.c
@@ -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);



More information about the tor-commits mailing list