Skip to content

Commit 8872dfd

Browse files
committed
Add hash algorithm transition plan
Add subsection to section "Managing Future Changes to the Update Process" that explains how to transition from an old (weak) to a new (stronger) hashing algorithm without disrupting client workflows.
1 parent dfbb24e commit 8872dfd

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

pep-0458.txt

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,8 @@ Managing Future Changes to the Update Process
11711171
=============================================
11721172

11731173
If breaking changes are made to the update process, PyPI should implement these
1174-
changes without disrupting existing clients. For guidance on how to do so,
1175-
see the ongoing discussion in the TAP repository__.
1174+
changes without disrupting existing clients. For general guidance on how to do
1175+
so, see the ongoing discussion in the TAP repository__.
11761176

11771177
__ https://github.com/theupdateframework/taps/pull/107
11781178

@@ -1183,6 +1183,45 @@ This PEP adds the ability for clients to use TUF metadata to improve the
11831183
security of the update process.
11841184

11851185

1186+
Hash Algorithm Transition Plan
1187+
------------------------------
1188+
1189+
If the algorithm used to hash target and metadata files becomes vulnerable, it
1190+
SHOULD be replaced by a stronger hash algorithm.
1191+
1192+
The TUF metadata format allows to list digests from different hash algorithms
1193+
alongside each other, together with an algorithm identifier, so that clients
1194+
can seamlessly switch between algorithms.
1195+
1196+
However, once support for an old algorithm is turned off, clients that don't
1197+
support the new algorithm will only be able to install or update packages,
1198+
including the client itself, by disabling TUF verification. To allow clients to
1199+
transition without temporarily losing TUF security guarantees, we recommend
1200+
the following procedure.
1201+
1202+
1. Implement new algorithm in Warehouse.
1203+
1204+
2. Re-generate existing TUF metadata to include both old and new algorithm
1205+
hashes, and include both old and new algorithm hashes in new metadata in
1206+
Warehouse.
1207+
Note, only TUF metadata that lists hash digests for target files or other
1208+
metadata needs to be renewed, that is *bin-n*, *snapshot* and *timestamp*.
1209+
Thus, only online keys are required to sign renewed metadata.
1210+
1211+
3. Announce transition on high-visibility channels.
1212+
1213+
4. Give popular clients such as pip and bandersnatch the chance to adopt new
1214+
hash algorithm.
1215+
1216+
5. Give end-users the chance to update clients.
1217+
1218+
6. Get rough consensus to remove old hash algorithm from PyPI maintainers.
1219+
1220+
7. Remove Warehouse support for old algorithm and only support new algorithm.
1221+
1222+
1223+
1224+
11861225
Appendix A: Repository Attacks Prevented by TUF
11871226
===============================================
11881227

0 commit comments

Comments
 (0)