`delegate_hashed_bins` must hash a target path as it appears in metadata
See original GitHub issueDescription of issue or feature request: Fix in accordance with https://github.com/theupdateframework/tuf/issues/957 (and #963)!!
The repository tool’s delegate_hashed_bins
creates hash bins (delegated targets roles) and assigns passed target file paths based on their hash. Later it calls delegate
for each bin passing the relevant paths. delegate
then might left-strip the targets directory path from each targets path, changing the targets path in a way that it no longer is in the right bin.
Current behavior:
delegate_hashed_bins
might hash target path based on a different path than the one that will appear in the (delegated) targets metadata.
Expected behavior:
delegate_hashed_bins
must hash a target path as it appears in metadata.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
While obtaining hash files, some folders and files from the ...
My code was working just fine before adding the hash function. I was getting the list of all folders and files in my...
Read more >Configuring hash settings - IBM
For metadata based hashes, clear the Compute data object hash checkbox. For creating a hash for email, select what email attributes are considered...
Read more >Get-FileHash (Microsoft.PowerShell.Utility)
The Get-FileHash cmdlet computes the hash value for a file by using a specified hash algorithm. A hash value is a unique value...
Read more >What is hashing and how does it work? - TechTarget
A hash table stores key and value pairs in a list that is accessible through its index. Because key and value pairs are...
Read more >URLs and Hashing | Safe Browsing APIs (v4)
The Safe Browsing lists consist of variable length SHA256 hashes (see List ... The URL must include a path component; that is, it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@trishankatdatadog, you were right. The variables in the division were switched plus two other minor issues (see edit history of comment). For my defense I only quickly wrote this up today from some pen and paper notes I took last week. Apologies. 😃 You should be able to copy-paste the updated snippet into your interpreter now and it should show that it works.
Also, as hinted above, this snippet should not be copy-pasted as is. It will need some fleshing out to replace the existing functionality in repository_tool. I just wanted to outline the algorithm I had in mind, for distributing targets in an ordered list of bins, where the index equals the bin size divided by the lower bound of the hash prefix range served by the bin.