diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-03-02 23:39:26 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-03-02 23:39:26 +0100 |
commit | cf4b6ebd6de3370da4b16d2f1ef19a2a3d3d0b12 (patch) | |
tree | eeec41a888f4f9cbdb77d6f01844ef20fccc2a43 /src/restclient/anastasis_api_curl_defaults.c | |
parent | 81311476b804c054e4ee19c9b182f3b34357f88f (diff) | |
download | anastasis-cf4b6ebd6de3370da4b16d2f1ef19a2a3d3d0b12.tar.gz anastasis-cf4b6ebd6de3370da4b16d2f1ef19a2a3d3d0b12.tar.bz2 anastasis-cf4b6ebd6de3370da4b16d2f1ef19a2a3d3d0b12.zip |
push new /truth/ API through the entire implementation
Diffstat (limited to 'src/restclient/anastasis_api_curl_defaults.c')
-rw-r--r-- | src/restclient/anastasis_api_curl_defaults.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/restclient/anastasis_api_curl_defaults.c b/src/restclient/anastasis_api_curl_defaults.c index e052517..33665e0 100644 --- a/src/restclient/anastasis_api_curl_defaults.c +++ b/src/restclient/anastasis_api_curl_defaults.c @@ -42,5 +42,17 @@ ANASTASIS_curl_easy_get_ (const char *url) curl_easy_setopt (eh, CURLOPT_TCP_FASTOPEN, 1L)); + /* limit MAXREDIRS to 5 as a simple security measure against + a potential infinite loop caused by a malicious target */ + GNUNET_assert (CURLE_OK == + curl_easy_setopt (eh, + CURLOPT_MAXREDIRS, + 5L)); + /* Enable compression (using whatever curl likes), see + https://curl.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html */ + GNUNET_break (CURLE_OK == + curl_easy_setopt (eh, + CURLOPT_ACCEPT_ENCODING, + "")); return eh; } |