Commit 040092c
authored
fix: abandon updates if timestamp.json isn't new (#387)
Adds a new test for this case: if a client sees a new `timestamp.json`
file with the same version as its current `timestamp.json` file, it
should do nothing (no update, but also no error).
A few other tests were implicitly relying on the fact that the client
did a full update each time, so they've been updated to commit a new
timestamp.
This updates go-tuf for TUF specification v1.0.30 (fixes #321). The
only substantive change was
[theupdateframework/specification#209][tuf-spec-209], which clarifies
the intended behavior for updating metadata files.
Updates for other roles were already in compliance:
- Root metadata: https://github.com/theupdateframework/go-tuf/blob/13eff30efd6c61f165e1bf06e8c0e72f5a0e5703/client/client.go#L258
- Timestamp, checking snapshot version: https://github.com/theupdateframework/go-tuf/blob/13eff30efd6c61f165e1bf06e8c0e72f5a0e5703/client/client.go#L751
- Snapshot, must match version from timestamp: https://github.com/theupdateframework/go-tuf/blob/13eff30efd6c61f165e1bf06e8c0e72f5a0e5703/client/client.go#L667
- Snapshot, no rollback of targets: https://github.com/theupdateframework/go-tuf/blob/13eff30efd6c61f165e1bf06e8c0e72f5a0e5703/client/client.go#L685
- Targets: https://github.com/theupdateframework/go-tuf/blob/13eff30efd6c61f165e1bf06e8c0e72f5a0e5703/client/client.go#L643
[tuf-spec-209]: (theupdateframework/specification#209).
Signed-off-by: Zachary Newman <[email protected]>
Signed-off-by: Zachary Newman <[email protected]>1 parent 13eff30 commit 040092c
2 files changed
+60
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
| |||
740 | 746 | | |
741 | 747 | | |
742 | 748 | | |
743 | | - | |
744 | | - | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
745 | 753 | | |
| 754 | + | |
746 | 755 | | |
747 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
748 | 763 | | |
749 | 764 | | |
750 | 765 | | |
751 | 766 | | |
752 | | - | |
| 767 | + | |
753 | 768 | | |
754 | | - | |
| 769 | + | |
755 | 770 | | |
756 | 771 | | |
757 | 772 | | |
758 | | - | |
| 773 | + | |
759 | 774 | | |
760 | 775 | | |
761 | 776 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| 899 | + | |
899 | 900 | | |
900 | 901 | | |
901 | 902 | | |
| |||
909 | 910 | | |
910 | 911 | | |
911 | 912 | | |
| 913 | + | |
912 | 914 | | |
913 | 915 | | |
914 | 916 | | |
| |||
964 | 966 | | |
965 | 967 | | |
966 | 968 | | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
967 | 1004 | | |
968 | 1005 | | |
969 | 1006 | | |
| |||
998 | 1035 | | |
999 | 1036 | | |
1000 | 1037 | | |
| 1038 | + | |
1001 | 1039 | | |
1002 | 1040 | | |
1003 | 1041 | | |
| |||
0 commit comments