Skip to content

repositories/http: support algorithms in hashlib.algorithms_guaranteed#6632

Closed
vfazio wants to merge 1 commit intopython-poetry:masterfrom
vfazio:vfazio-include-additional-algos
Closed

repositories/http: support algorithms in hashlib.algorithms_guaranteed#6632
vfazio wants to merge 1 commit intopython-poetry:masterfrom
vfazio:vfazio-include-additional-algos

Conversation

@vfazio
Copy link
Copy Markdown
Contributor

@vfazio vfazio commented Sep 26, 2022

PEP 503 says:

Repositories SHOULD choose a hash function from one of the ones guaranteed to be available via the hashlib module in the Python standard library (currently md5, sha1, sha224, sha256, sha384, sha512). The current recommendation is to use sha256.

It should make sense, then, to just check that the value returned is in hashlib.algorithms_guaranteed instead of a short subset of hashes.

Otherwise, the subset of hashes should be extended to those directly mentioned in the PEP though that list was compiled 7 years ago and does not reflect algorithms guaranteed to be present.

Pull Request Check List

Resolves:

  • Added tests for changed code.
  • Updated documentation for changed code.

Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
@neersighted
Copy link
Copy Markdown
Member

This does not resolve #6301 -- hash handling code is much more involved than this and there are no tests that actually make sure the intended fix really happens. I would suggest instead syncing with the authors of other attempts (e.g. #6490, #4740, #5326) to maybe combine efforts or see what is needed.

I have my own refactor spinning locally as well -- it's much more holistic and security-focused than a straight forward-port, but may take more time to cook.

@vfazio vfazio deleted the vfazio-include-additional-algos branch September 26, 2022 21:21
@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants