summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-05-08 14:00:44 +0200
committerAlexander Færøy <ahf@torproject.org>2017-05-12 17:18:45 +0200
commit61b6de5906b92fa1354efe60aa1506ab215d60b3 (patch)
tree81cb465b2afedca081fb9d9ba10567225d91e990 /src
parentfbef257c43b90bd5d80831808e162c57ce876283 (diff)
downloadtor-61b6de5906b92fa1354efe60aa1506ab215d60b3.tar.gz
tor-61b6de5906b92fa1354efe60aa1506ab215d60b3.zip
Handle Zstandard and LZMA in our check for correct guessed compression.
See: https://bugs.torproject.org/21667
Diffstat (limited to 'src')
-rw-r--r--src/or/directory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index c7c3d38e8a..3df5be9d34 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2309,6 +2309,10 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
description1 = "as deflated";
else if (compression == GZIP_METHOD)
description1 = "as gzipped";
+ else if (compression == ZSTD_METHOD)
+ description1 = "as Zstandard compressed";
+ else if (compression == LZMA_METHOD)
+ description1 = "as LZMA compressed";
else if (compression == NO_METHOD)
description1 = "as uncompressed";
else
@@ -2317,6 +2321,10 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
description2 = "deflated";
else if (guessed == GZIP_METHOD)
description2 = "gzipped";
+ else if (guessed == ZSTD_METHOD)
+ description2 = "Zstandard compressed";
+ else if (guessed == LZMA_METHOD)
+ description2 = "LZMA compressed";
else if (!plausible)
description2 = "confusing binary junk";
else