diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/feature/hs/hs_service.c | 1 | ||||
-rw-r--r-- | src/lib/compress/compress.c | 10 | ||||
-rw-r--r-- | src/lib/compress/compress_zstd.c | 5 | ||||
-rw-r--r-- | src/test/test_util.c | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c index 777cc85fea..3cc8c23e0b 100644 --- a/src/feature/hs/hs_service.c +++ b/src/feature/hs/hs_service.c @@ -1821,6 +1821,7 @@ build_service_desc_encrypted(const hs_service_t *service, tor_assert(desc); encrypted = &desc->desc->encrypted_data; + encrypted->sendme_inc = congestion_control_sendme_inc(); encrypted->create2_ntor = 1; encrypted->single_onion_service = service->config.is_single_onion; diff --git a/src/lib/compress/compress.c b/src/lib/compress/compress.c index 83e63905cc..346e77f07d 100644 --- a/src/lib/compress/compress.c +++ b/src/lib/compress/compress.c @@ -66,7 +66,15 @@ tor_compress_is_compression_bomb,(size_t size_in, size_t size_out)) if (size_in == 0 || size_out < CHECK_FOR_COMPRESSION_BOMB_AFTER) return 0; - return (size_out / size_in > MAX_UNCOMPRESSION_FACTOR); + if (size_out / size_in > MAX_UNCOMPRESSION_FACTOR) { + log_warn(LD_GENERAL, + "Detected possible compression bomb with " + "input size = %"TOR_PRIuSZ " and output size = %"TOR_PRIuSZ, + size_in, size_out); + return 1; + } + + return 0; } /** Guess the size that <b>in_len</b> will be after compression or diff --git a/src/lib/compress/compress_zstd.c b/src/lib/compress/compress_zstd.c index 85c2bb3bfa..9b18930d16 100644 --- a/src/lib/compress/compress_zstd.c +++ b/src/lib/compress/compress_zstd.c @@ -522,9 +522,10 @@ tor_zstd_warn_if_version_mismatched(void) tor_zstd_format_version(runtime_version, sizeof(runtime_version), ZSTD_versionNumber()); - log_warn(LD_GENERAL, + log_info(LD_GENERAL, "Tor was compiled with zstd %s, but is running with zstd %s. " - "For safety, we'll avoid using advanced zstd functionality.", + "For ABI compatibility reasons, we'll avoid using advanced zstd " + "functionality.", header_version, runtime_version); } #endif /* defined(HAVE_ZSTD) && defined(ENABLE_ZSTD_ADVANCED_APIS) */ diff --git a/src/test/test_util.c b/src/test/test_util.c index 1dae2c617e..391c3d07c1 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -2945,7 +2945,7 @@ test_util_gzip_compression_bomb(void *arg) tt_int_op(-1, OP_EQ, tor_compress(&result, &result_len, one_mb, one_million, ZLIB_METHOD)); - expect_single_log_msg_containing( + expect_log_msg_containing( "We compressed something and got an insanely high " "compression factor; other Tors would think this " "was a compression bomb."); |