[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Make HSFETCH take the decoded length into account, not the base32 one



commit c8fd7b7040b9c036438afc493352fbccb4c1d357
Author: Neel Chauhan <neel@xxxxxxxxx>
Date:   Tue Jun 16 14:38:08 2020 -0700

    Make HSFETCH take the decoded length into account, not the base32 one
---
 changes/bug34400                  | 5 +++++
 src/feature/control/control_cmd.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug34400 b/changes/bug34400
new file mode 100644
index 000000000..e2b56688b
--- /dev/null
+++ b/changes/bug34400
@@ -0,0 +1,5 @@
+  o Minor bugfixes (v2 onion services):
+    - For HSFETCH commands on v2 onion services addresses, check the length of
+      bytes decoded, not the base32 length. This takes the behavior introduced
+      in commit a517daa56f5848d25ba79617a1a7b82ed2b0a7c0 into consideration.
+      Fixes bug 34400; bugfix on 0.4.1.1-alpha. Patch by Neel Chauhan.
diff --git a/src/feature/control/control_cmd.c b/src/feature/control/control_cmd.c
index d9a38011d..eb14f101e 100644
--- a/src/feature/control/control_cmd.c
+++ b/src/feature/control/control_cmd.c
@@ -1430,7 +1430,7 @@ handle_control_hsfetch(control_connection_t *conn,
              rend_valid_descriptor_id(arg1 + v2_str_len) &&
              base32_decode(digest, sizeof(digest), arg1 + v2_str_len,
                            REND_DESC_ID_V2_LEN_BASE32) ==
-                REND_DESC_ID_V2_LEN_BASE32) {
+                sizeof(digest)) {
     /* We have a well formed version 2 descriptor ID. Keep the decoded value
      * of the id. */
     desc_id = digest;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits