Visitar URL original
Support HTTP digest authentication algorithm SHA-256 as per RFC-7617 · Issue #128192 · python/cpython · GitHub
Skip to content

Support HTTP digest authentication algorithm SHA-256 as per RFC-7617 #128192

Closed

Description

@calvinbui

Feature or enhancement

Proposal:

Support SHA-256 digest authentication following RFC7616 - https://datatracker.ietf.org/doc/html/rfc7616

CPython currently supports MD5 and SHA1 only.

Other possible methods include SHA-256-ness, SHA-512-256 and SHA-512-256-sess which hashlib doesn't currently appear to support out of the box.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. rruuaanng commented on Dec 24, 2024

    @rruuaanng
    Contributor

    I think we only need SHA256. That is say.

    from RFC-7616

       This specification defines the following algorithms:
    
       o  SHA2-256 (mandatory to implement)
    
       o  SHA2-512/256 (as a backup algorithm)
    
       o  MD5 (for backward compatibility).
    
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Dec 24, 2024
  3. changed the title [-]Support digest authentication algorithm SHA-256[/-] [+]Support HTTP digest authentication algorithm SHA-256 as per RFC-7617[/+] on Dec 24, 2024
  4. picnixz commented on Dec 24, 2024

    @picnixz
    Member

    We do support SHA-512-256 in hashlib if the underlying OpenSSL library implements it. This is the truncated SHA-2-512. This can be constructed via hashlib.new('SHA512_256') (other names are available, see https://docs.openssl.org/3.3/man7/EVP_MD-SHA2/#identities) (there is no dedicated constructor for this function though).

    As for SHA-256-ness and SHA-512-sess are similar to SHA-256/512 and only differ in how A1 is computed (see https://datatracker.ietf.org/doc/html/rfc7616#section-3.4.2).

  5. added a commit that references this issue on Dec 28, 2024
  6. picnixz commented on Dec 28, 2024

    @picnixz
    Member

    @calvinbui If you're interested in the follow-up PR for tests and docs, we can keep the issue opened.

  7. gpshead commented on Dec 29, 2024

    @gpshead
    Member

    I suggest just opening a new issue for test/doc improvements as those wouldn't strictly be related to this feature.

  8. added 2 commits that reference this issue on Dec 29, 2024
  9. added 2 commits that reference this issue on Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions