diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-08-28 19:55:26 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-08-28 19:55:26 +0300 |
commit | e94f68e301caf2d01659e7ba24fb1ba678ad3233 (patch) | |
tree | 804e2023d188f9bea021c76a1f274aca41f1a12c /src/or/hs_common.c | |
parent | 93a0a4a4221b5c60b3c4fe22d38c81914176dedb (diff) | |
download | tor-e94f68e301caf2d01659e7ba24fb1ba678ad3233.tar.gz tor-e94f68e301caf2d01659e7ba24fb1ba678ad3233.zip |
fixup! prop224: Fix length check when purging hidserv requests.
Improve doc based on david's comments.
Diffstat (limited to 'src/or/hs_common.c')
-rw-r--r-- | src/or/hs_common.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/hs_common.c b/src/or/hs_common.c index a4b8ba3e8d..d866ab6a8f 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; |