summaryrefslogtreecommitdiff
path: root/libfetch/ftp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-05-02fetch: enable --timeout to set network progress timeoutTimo Teräs1-1/+1
implement it also for connecting to hosts fixes #10869
2021-07-26libfetch: fix range checking for http/ftp protocol parsingTimo Teräs1-7/+11
Various parsing of numeric strings were not having adequate range checking causing information leak or potential crash. CVE-2021-36159 fixes #10749 Co-authored-by: Ariadne Conill <ariadne@dereferenced.org> Reported-by: Samanta Navarro <ferivoz@riseup.net>
2021-07-23libfetch: simplify code by merging protocol error handling branchesTimo Teräs1-22/+13
removes some code duplication
2021-01-19libfetch: fix connection pooling for proxied http/https requestsTimo Teräs1-2/+2
The connection pooling was broken in two ways: 1. The original URL was always used as the connection pool URL, resulting in duplicate connections to the proxy for http URLs (each http URL would get separate proxy connection) 2. The cache_url stored was always the socket level connect URL. In case of HTTPS, the lookup was done done with the real URL, but the proxy URL was stored as the "cache URL". Thus HTTPS CONNECT connections were never re-used. This fixes the code with following logic: 1. The cache key url is the real URL when no-proxy, or when HTTPS with proxy (the socket is connected to proxy, but logically it is connected to the real URL due to HTTP CONNECT request). And for HTTP with proxy, it's the proxy URL so same proxy connection can be reused for all requests going through it. 2. fetch_connect() now gets cache key URL separately, and it always gets the same value as the fetch_cache_get() calls.
2018-09-05libfetch: do not give out user/hostname as ftp anonymous passwordTimo Teräs1-15/+5
This is unwanted information disclosure. Reported-by: Max Justicz <max@justi.cz>
2017-10-05libfetch: remove unwanted code conditionalsTimo Teräs1-12/+0
2017-10-05build and use bundled libfetch nativelyTimo Teräs1-15/+0
2017-10-05import libfetch-2.38 from NetBSDTimo Teräs1-0/+1310
ftp://ftp.fu-berlin.de/unix/NetBSD/packages/current-src/pkgsrc/net/libfetch/files libfetch comes (at least) in netbsd and freebsd flavors which differing functionality. Alpine and Arch package netbsd one, but it's not widely packaged across other distributions. We need NetBSD version as it does not use funopen(3) which is not supported in musl, and supports connection pooling. FreeBSD seems to be the orignal and better maintained version with support for SSL CAs, client certificate authentication, proxy authentication, and improved http redirect handling. So this imports NetBSD version, and future commits will pick up the needed improvements from FreeBSD tree. Incidentally, this also fixes #7857 and likes for good.