-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updater: target hash calculation should not read the whole file in memory #1215
Comments
Good find, thanks! On top of that, shouldn't securesystemslib already offer a function for checking hashes? |
Yes my last example uses a sslib function for calculating a fileobject hash, I just forgot to include 'securesystemslib.hash.' prefix there (now fixed) Or do you mean actually comparing the hashes? |
jku
pushed a commit
to jku/python-tuf
that referenced
this issue
Nov 22, 2020
We don't want to read the whole file in memory as it can be huge. Use digest_fileobject() instead: This way Securesystemslib will read the file in chunks. Securesystemslib already takes care of seeking to beginning of file. Fixes theupdateframework#1215 Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
jku
pushed a commit
to jku/python-tuf
that referenced
this issue
Nov 23, 2020
We don't want to read the whole file in memory as it can be huge. Use digest_fileobject() instead: This way Securesystemslib will read the file in chunks. Securesystemslib already takes care of seeking to beginning of file. Fixes theupdateframework#1215 Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of issue or feature request:
This is not a bug (although it could be on memory limited client device), but a performance improvement:
After PR #1202 there is only one place where the updater loads the whole target file in memory. We should avoid doing that as targets could be very large and memory could be limited.
Current behavior:
_check_hashes()
does this:Expected behavior:
something like handwaves
or even more simply just let SSLib handle this with its default chunk size:
The text was updated successfully, but these errors were encountered: