Skip to content

Commit 28cc445

Browse files
lukpuehncoghlan
authored andcommitted
PEP 458: add hash algorithm transition plan (#1253)
Add subsection to section "Managing Future Changes to the Update Process" that explains how to transition from an old (e.g. because it has become weak) to a new (e.g. stronger) hashing algorithm without disrupting client workflows.
1 parent cf656ba commit 28cc445

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

pep-0458.txt

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,8 +1219,8 @@ Managing Future Changes to the Update Process
12191219
=============================================
12201220

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

12251225
__ https://github.com/theupdateframework/taps/pull/107
12261226

@@ -1231,6 +1231,47 @@ This PEP adds the ability for clients to use TUF metadata to improve the
12311231
security of the update process.
12321232

12331233

1234+
Hash Algorithm Transition Plan
1235+
------------------------------
1236+
1237+
If the algorithm used to hash target and metadata files becomes vulnerable, it
1238+
SHOULD be replaced by a stronger hash algorithm.
1239+
1240+
The TUF metadata format allows to list digests from different hash algorithms
1241+
alongside each other, together with an algorithm identifier, so that clients
1242+
can seamlessly switch between algorithms.
1243+
1244+
However, once support for an old algorithm is turned off, clients that don't
1245+
support the new algorithm will only be able to install or update packages,
1246+
including the client itself, by disabling TUF verification. To allow clients to
1247+
transition without temporarily losing TUF security guarantees, we recommend
1248+
the following procedure.
1249+
1250+
1. Implement new algorithm in Warehouse.
1251+
1252+
2. Regenerate existing, unexpired TUF metadata to include hashes using both the
1253+
old and new algorithms. All new metadata going forward shall list both hash
1254+
algorithms.
1255+
Note, only TUF metadata that lists hash digests for target files or other
1256+
metadata needs to be renewed, that is *bin-n*, *snapshot* and *timestamp*.
1257+
Thus, only online keys are required to sign renewed metadata.
1258+
1259+
3. Announce transition on high-visibility channels, such as `packaging on
1260+
Python Discourse`__ and the `PyPI changes mailing list`__.
1261+
1262+
4. Give popular clients such as pip and bandersnatch the chance to adopt new
1263+
hash algorithm.
1264+
1265+
5. Give end-users the chance to update clients.
1266+
1267+
6. Get rough consensus to remove old hash algorithm from PyPI maintainers.
1268+
1269+
7. Remove Warehouse support for old algorithm and only support new algorithm.
1270+
1271+
__ https://discuss.python.org/c/packaging
1272+
__ https://mail.python.org/mailman3/lists/pypi-announce.python.org/
1273+
1274+
12341275
Appendix A: Repository Attacks Prevented by TUF
12351276
===============================================
12361277

0 commit comments

Comments
 (0)