uptane / uptane-standard

standard for Uptane
https://uptane.github.io
Other
37 stars 31 forks source link

Clarify hash-checking logic of images. #164

Closed pattivacek closed 4 years ago

pattivacek commented 4 years ago

There was some inconsistency in how we discuss checking hashes of images. Most parts of the Standard make it clear that all specified hashes must be checked, so I have changed an outlier to reflect that.

Section 5.4.2.4 (Download and verify images) is still a bit confusing, though. First it says that "Images SHALL be verified by checking that the hash of the image file matches the hash specified in the Director’s Targets metadata for that image." and then it says that "If the primary has received multiple hashes for a given image binary via the Targets role (see Section 5.2.3.1) then it SHALL verify every hash for this image despite the fact that just one hash is enough to obtain the image itself." This "despite the fact" section is especially confusing. Is the implication that it is acceptable for one repo to only list one hash while the other lists multiple, and if so, that the image has to be checked against all of them? If so, we should make that clearer. If not, what does it mean?

pattivacek commented 4 years ago

The point is that you need to download a file corresponding to only one of those hashes. Can you think of better wording to get that meaning across?

Oh, now I get it. I've added a second commit that tries to clarify that. What do you think?

Now I'm wondering about the preceding paragraph, though, which reads: "Images SHALL be verified by checking that the hash of the image file matches the hash specified in the Director's Targets metadata for that image." This should also make it clear that all hashes need to be checked, right?

trishankatdatadog commented 4 years ago

Oh, now I get it. I've added a second commit that tries to clarify that. What do you think?

I think it's good.

This should also make it clear that all hashes need to be checked, right?

Yes.