mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
hs: Use v3 maximum intro points value when decoding v3
Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
parent
765ed5dac1
commit
74193b9321
@ -11,6 +11,9 @@
|
|||||||
|
|
||||||
#include "or.h"
|
#include "or.h"
|
||||||
|
|
||||||
|
/* Maximum number of intro points per version 3 services. */
|
||||||
|
#define HS_CONFIG_V3_MAX_INTRO_POINTS 20
|
||||||
|
|
||||||
/* API */
|
/* API */
|
||||||
|
|
||||||
int hs_config_service_all(const or_options_t *options, int validate_only);
|
int hs_config_service_all(const or_options_t *options, int validate_only);
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
#include "parsecommon.h"
|
#include "parsecommon.h"
|
||||||
#include "rendcache.h"
|
#include "rendcache.h"
|
||||||
#include "hs_cache.h"
|
#include "hs_cache.h"
|
||||||
|
#include "hs_config.h"
|
||||||
#include "torcert.h" /* tor_cert_encode_ed22519() */
|
#include "torcert.h" /* tor_cert_encode_ed22519() */
|
||||||
|
|
||||||
/* Constant string value used for the descriptor format. */
|
/* Constant string value used for the descriptor format. */
|
||||||
@ -2035,10 +2036,11 @@ desc_decode_encrypted_v3(const hs_descriptor_t *desc,
|
|||||||
decode_intro_points(desc, desc_encrypted_out, message);
|
decode_intro_points(desc, desc_encrypted_out, message);
|
||||||
|
|
||||||
/* Validation of maximum introduction points allowed. */
|
/* Validation of maximum introduction points allowed. */
|
||||||
if (smartlist_len(desc_encrypted_out->intro_points) > MAX_INTRO_POINTS) {
|
if (smartlist_len(desc_encrypted_out->intro_points) >
|
||||||
|
HS_CONFIG_V3_MAX_INTRO_POINTS) {
|
||||||
log_warn(LD_REND, "Service descriptor contains too many introduction "
|
log_warn(LD_REND, "Service descriptor contains too many introduction "
|
||||||
"points. Maximum allowed is %d but we have %d",
|
"points. Maximum allowed is %d but we have %d",
|
||||||
MAX_INTRO_POINTS,
|
HS_CONFIG_V3_MAX_INTRO_POINTS,
|
||||||
smartlist_len(desc_encrypted_out->intro_points));
|
smartlist_len(desc_encrypted_out->intro_points));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user