Skip to content
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

Fix tuf/tuf#736: Rebuild roledb in refresh() even if root unchanged #13

Merged
merged 1 commit into from
Jun 20, 2018

Conversation

awwad
Copy link
Owner

@awwad awwad commented Jun 20, 2018

In order to avoid freezes if role info is deleted due to prior validation failures, make sure that roledb is rebuilt during client tuf.client.updater.refresh(), even if root did not need to be updated.

If, for example, snapshot.json is deleted because timestamp has indicated that there is a newer version but that newer version cannot be obtained, we should still not fail to try to update snapshot next time.
See theupdateframework#736

This is a patch for the immediate issue on this fork. A broader change is called for; see theupdateframework#736 and theupdateframework#660. That should be fixed on the main repository (theupdateframework/tuf) and this fork should be merged back.

even if root has not been updated.
In order to avoid freezes if role info is deleted due to prior
validation failures, make sure that roledb is rebuilt during
client tuf.client.updater.refresh(), even if root did not need
to be updated.

If, for example, snapshot.json is deleted because timestamp has
indicated that there is a newer version but that newer version
cannot be obtained, we should still not fail to try to update
snapshot next time.
See https://github.com/theupdateframework/tuf/issue/736

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
@awwad
Copy link
Owner Author

awwad commented Jun 20, 2018

Demo still functions. Uptane tests all succeed. Similar set merged in TUF proper.

@awwad awwad merged commit 815a5ed into develop Jun 20, 2018
awwad added a commit that referenced this pull request Jul 24, 2018
test_repository_lib fix:
Some time ago in PR #5 #5
I changed signature code such that tuf.keys.create_signature
and verify_signature accept already-encoded bytes instead of
assuming what the encodings should look like, and moved
encoding up a bit in the stack (often to tuf.sig). This
test wasn't updated at that point, and now it is being
updated to deal with this (by encoding first, then calling
the tuf.keys.create_signature function).

test_mix_and_match_attack fix:
A fix to the way that role files are retained if validation
fails (possibly from #13 )
broke this test, I think, though I'm not certain. In any
event, this demonstrates passable behavior for now, with the
role info loaded correctly.

These tests in the TUF fork are not regarded as critical,
given that testing occurs at the Uptane level and Uptane will
be migrating to the main TUF repository when possible;
however, these fixes may be helpful in the interim.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
@awwad awwad deleted the fix_tuftuf_736 branch March 4, 2019 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant