Merge remote-tracking branch 'dgoulet/ticket23305_032_01'

This commit is contained in:
Nick Mathewson 2017-09-20 08:36:11 -04:00
commit 9e0587f806
3 changed files with 7 additions and 4 deletions

View File

@ -73,6 +73,9 @@
/** Length of our DH keys. */ /** Length of our DH keys. */
#define DH_BYTES (1024/8) #define DH_BYTES (1024/8)
/** Length of a sha1 message digest when encoded in base32 with trailing =
* signs removed. */
#define BASE32_DIGEST_LEN 32
/** Length of a sha1 message digest when encoded in base64 with trailing = /** Length of a sha1 message digest when encoded in base64 with trailing =
* signs removed. */ * signs removed. */
#define BASE64_DIGEST_LEN 27 #define BASE64_DIGEST_LEN 27

View File

@ -1453,7 +1453,7 @@ hs_lookup_last_hid_serv_request(routerstatus_t *hs_dir,
const char *req_key_str, const char *req_key_str,
time_t now, int set) time_t now, int set)
{ {
char hsdir_id_base32[REND_DESC_ID_V2_LEN_BASE32 + 1]; char hsdir_id_base32[BASE32_DIGEST_LEN + 1];
char *hsdir_desc_comb_id = NULL; char *hsdir_desc_comb_id = NULL;
time_t *last_request_ptr; time_t *last_request_ptr;
strmap_t *last_hid_serv_requests = get_last_hid_serv_requests(); strmap_t *last_hid_serv_requests = get_last_hid_serv_requests();

View File

@ -747,15 +747,15 @@ typedef enum {
#define REND_NUMBER_OF_CONSECUTIVE_REPLICAS 3 #define REND_NUMBER_OF_CONSECUTIVE_REPLICAS 3
/** Length of v2 descriptor ID (32 base32 chars = 160 bits). */ /** Length of v2 descriptor ID (32 base32 chars = 160 bits). */
#define REND_DESC_ID_V2_LEN_BASE32 32 #define REND_DESC_ID_V2_LEN_BASE32 BASE32_DIGEST_LEN
/** Length of the base32-encoded secret ID part of versioned hidden service /** Length of the base32-encoded secret ID part of versioned hidden service
* descriptors. */ * descriptors. */
#define REND_SECRET_ID_PART_LEN_BASE32 32 #define REND_SECRET_ID_PART_LEN_BASE32 BASE32_DIGEST_LEN
/** Length of the base32-encoded hash of an introduction point's /** Length of the base32-encoded hash of an introduction point's
* identity key. */ * identity key. */
#define REND_INTRO_POINT_ID_LEN_BASE32 32 #define REND_INTRO_POINT_ID_LEN_BASE32 BASE32_DIGEST_LEN
/** Length of the descriptor cookie that is used for client authorization /** Length of the descriptor cookie that is used for client authorization
* to hidden services. */ * to hidden services. */