diff options
author | George Kadianakis <desnacked@riseup.net> | 2016-12-23 14:48:05 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-01-09 15:02:56 +0200 |
commit | e1d7661412325bb8c81a3a7f4d5cc25efdee5a78 (patch) | |
tree | 333dc5ef254638d6ba72a42cf18f9268fd5ad626 /src/or/hs_descriptor.c | |
parent | 7456677a50d1c4c9f0f2e6b63259905f694d329a (diff) | |
download | tor-e1d7661412325bb8c81a3a7f4d5cc25efdee5a78.tar.gz tor-e1d7661412325bb8c81a3a7f4d5cc25efdee5a78.zip |
Max HS descriptor size is now 50kb and also consensus param.
Diffstat (limited to 'src/or/hs_descriptor.c')
-rw-r--r-- | src/or/hs_descriptor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c index 75ad205890..2e92c89354 100644 --- a/src/or/hs_descriptor.c +++ b/src/or/hs_descriptor.c @@ -15,6 +15,7 @@ #include "ed25519_cert.h" /* Trunnel interface. */ #include "parsecommon.h" #include "rendcache.h" +#include "hs_cache.h" #include "torcert.h" /* tor_cert_encode_ed22519() */ /* Constant string value used for the descriptor format. */ @@ -1700,8 +1701,9 @@ hs_desc_decode_plaintext(const char *encoded, tor_assert(encoded); tor_assert(plaintext); + /* Check that descriptor is within size limits. */ encoded_len = strlen(encoded); - if (encoded_len >= HS_DESC_MAX_LEN) { + if (encoded_len >= hs_cache_get_max_descriptor_size()) { log_warn(LD_REND, "Service descriptor is too big (%lu bytes)", (unsigned long) encoded_len); goto err; |