You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should consider allowing repositories to specify, in metadata, the algorithm used when generating path hashed paths in section 4.5 of the specification
KEYIDS is currently fixed to SHA-256 in the specification. Should we allow flexibility in this case?
As opposed to allowing one to use different hash algorithms for different
packages or to allow one to have multiple hashes used on the same package?
I think the intent is that both of the above cases should be supported by
TUF. (In practice, it's not clear if either will occur.)
We do need to clearly describe what clients should do when encountering a
hash type they do not know how to check. I do not think this is clearly
stated now.
On Fri, May 1, 2015 at 10:46 AM, Vladimir Diaz [email protected]
wrote:
Should the TUF specification restrict repositories to one particular hash
algorithm?
For the generation of KEYIDS and path hash prefixes, the specification restricts the hash algorithm to SHA-256. I think we should be more flexible in this case.
I'm not sure yet where we should list the hash algorithm used to generate path hash prefixes and the digest prepended to consistent snapshots. I think listing the algorithm in root.json metadata here is one option.
I've a question! I never understood that example. There seems to be one
keyid, but two hash algorithms. Is the client supposed to try both
algorithms to see which one yields the key id?
The client first extracts the key object on lines 18-20 and generates SHA256 and SHA512 digests (because that's what's specified on lines 14-16). It should then verify that the default keyid listed on line 13 matches the digest the client generated locally. If it does, the client associates this key with the SHA256 and SHA512 digests that it generated. In the future, the client can lookup a key and validate signatures by querying for either of these two KEYIDs.
Either the SHA256 or SHA512 keyid can be listed in signatures fields, or the "keyids" field of delegations. The client can identify a keyid and its associated key by calling tuf.keydb.get_key(keyid). If it finds it... good. If not, that keyid / key / signature is not trusted.
Activity
JustinCappos commentedon May 1, 2015
As opposed to allowing one to use different hash algorithms for different
packages or to allow one to have multiple hashes used on the same package?
I think the intent is that both of the above cases should be supported by
TUF. (In practice, it's not clear if either will occur.)
We do need to clearly describe what clients should do when encountering a
hash type they do not know how to check. I do not think this is clearly
stated now.
On Fri, May 1, 2015 at 10:46 AM, Vladimir Diaz [email protected]
wrote:
vladimir-v-diaz commentedon May 1, 2015
For the generation of KEYIDS and path hash prefixes, the specification restricts the hash algorithm to SHA-256. I think we should be more flexible in this case.
JustinCappos commentedon May 1, 2015
Are you proposing we would list the hash algorithm there too?
On Fri, May 1, 2015 at 1:59 PM, Vladimir Diaz [email protected]
wrote:
vladimir-v-diaz commentedon May 1, 2015
I'm not sure yet where we should list the hash algorithm used to generate path hash prefixes and the digest prepended to consistent snapshots. I think listing the algorithm in
root.jsonmetadata here is one option.vladimir-v-diaz commentedon May 1, 2015
For KEYIDS, I think saying that SHA-256 is an option should be fine.
JustinCappos commentedon May 1, 2015
Yes, the root.json seems like the most logical thing to me too.
On Fri, May 1, 2015 at 2:47 PM, Vladimir Diaz [email protected]
wrote:
vladimir-v-diaz commentedon Oct 28, 2016
We now allow metadata to specify the hash algorithm(s) that are used to generate keyids.
writing...
https://github.com/theupdateframework/tuf/blob/0ce016b7b19a0fc15443eed657a90246ec5df0aa/tuf/keys.py#L514-L529
loading...
https://github.com/theupdateframework/tuf/blob/0ce016b7b19a0fc15443eed657a90246ec5df0aa/tuf/client/updater.py#L538-L561
metadata example...
https://github.com/theupdateframework/tuf/blob/0ce016b7b19a0fc15443eed657a90246ec5df0aa/tests/repository_data/repository/metadata/root.json#L47-L55
trishankkarthik commentedon Oct 28, 2016
Hello Vlad,
On 28 October 2016 at 12:53, Vladimir Diaz [email protected] wrote:
I've a question! I never understood that example. There seems to be one
keyid, but two hash algorithms. Is the client supposed to try both
algorithms to see which one yields the key id?
Thanks,
Trishank
vladimir-v-diaz commentedon Oct 28, 2016
That's correct, one keyid is listed in metadata (along with 1 or more hashing algorithms). The keyid(s) are generated by hashing a key object:
{"keytype": "ed25519", "keyval": { "public": "0692a846935833d685168ae8c98fee951d52d8aa76685b8ba55b8e1eada217c2"}Let's look at an example...
https://github.com/theupdateframework/tuf/blob/0ce016b7b19a0fc15443eed657a90246ec5df0aa/tests/repository_data/repository/metadata.staged/targets.json#L11-L22
The client first extracts the key object on lines 18-20 and generates SHA256 and SHA512 digests (because that's what's specified on lines 14-16). It should then verify that the default keyid listed on line 13 matches the digest the client generated locally. If it does, the client associates this key with the SHA256 and SHA512 digests that it generated. In the future, the client can lookup a key and validate signatures by querying for either of these two KEYIDs.
Either the SHA256 or SHA512 keyid can be listed in signatures fields, or the "keyids" field of delegations. The client can identify a keyid and its associated key by calling tuf.keydb.get_key(keyid). If it finds it... good. If not, that keyid / key / signature is not trusted.
trishankkarthik commentedon Oct 28, 2016