Skip to content

Commit e427f86

Browse files
committed
Remove format checks
Remove format checking of download_file() parameters. The function is internal and receives trusted input from updater.py. Signed-off-by: Teodora Sechkova <[email protected]>
1 parent a0e987a commit e427f86

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

tuf/ngclient/_internal/download.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
import tempfile
2828
from urllib import parse
2929

30-
from securesystemslib import formats as sslib_formats
31-
32-
from tuf import exceptions, formats
30+
from tuf import exceptions
3331

3432
# See 'log.py' to learn how logging is handled in TUF.
3533
logger = logging.getLogger(__name__)
@@ -56,19 +54,11 @@ def download_file(url, required_length, fetcher):
5654
exceptions.DownloadLengthMismatchError, if there was a
5755
mismatch of observed vs expected lengths while downloading the file.
5856
59-
securesystemslib.exceptions.FormatError, if any of the arguments are
60-
improperly formatted.
61-
6257
Any other unforeseen runtime exception.
6358
6459
<Returns>
6560
A file object that points to the contents of 'url'.
6661
"""
67-
# Do all of the arguments have the appropriate format?
68-
# Raise 'securesystemslib.exceptions.FormatError' if there is a mismatch.
69-
sslib_formats.URL_SCHEMA.check_match(url)
70-
formats.LENGTH_SCHEMA.check_match(required_length)
71-
7262
# 'url.replace('\\', '/')' is needed for compatibility with Windows-based
7363
# systems, because they might use back-slashes in place of forward-slashes.
7464
# This converts it to the common format. unquote() replaces %xx escapes in

0 commit comments

Comments
 (0)