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

[tor-commits] [tor/master] fixup! prop224: Fix length check when purging hidserv requests.



commit e94f68e301caf2d01659e7ba24fb1ba678ad3233
Author: George Kadianakis <desnacked@xxxxxxxxxx>
Date:   Mon Aug 28 19:55:26 2017 +0300

    fixup! prop224: Fix length check when purging hidserv requests.
    
    Improve doc based on david's comments.
---
 src/or/hs_common.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/or/hs_common.c b/src/or/hs_common.c
index a4b8ba3e8..d866ab6a8 100644
--- a/src/or/hs_common.c
+++ b/src/or/hs_common.c
@@ -1357,7 +1357,7 @@ hs_hsdir_requery_period(const or_options_t *options)
  *
  * where 'hsdir_identity' is the identity digest of the HSDir node, and
  * 'hs_identity' is the descriptor ID of the HS in the v2 case, or the ed25519
- * identity public key of the HS in the v3 case. */
+ * blinded public key of the HS in the v3 case. */
 static strmap_t *last_hid_serv_requests_ = NULL;
 
 /** Returns last_hid_serv_requests_, initializing it to a new strmap if
@@ -1454,10 +1454,11 @@ hs_purge_hid_serv_from_last_hid_serv_requests(const char *req_key_str)
      * semantic, see #23305. */
 
     /* This strmap contains variable-sized elements so this is a basic length
-     * check on the strings we are about to compare. The "key" contains both
-     * the base32 HSDir identity digest and the requested key at the
-     * directory. The "req_key_str" can either be a base32 descriptor ID or a
-     * base64 blinded key which should be the second part of "key". */
+     * check on the strings we are about to compare. The key is variable sized
+     * since it's composed as follows:
+     *   key = base32(hsdir_identity) + base32(req_key_str)
+     * where 'req_key_str' is the descriptor ID of the HS in the v2 case, or
+     * the ed25519 blinded public key of the HS in the v3 case. */
     if (strlen(key) < REND_DESC_ID_V2_LEN_BASE32 + strlen(req_key_str)) {
       iter = strmap_iter_next(last_hid_serv_requests, iter);
       continue;



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