Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As a follow up of #302632: Use PHP5 functionality for _openid_sha1(). Here is a patch that tests if hash extension (Default in PHP5) is available and use hash_hmac()
function in _openid_hmac()
.
See chx's comment for details on why we can't just rely on this extension being available:
Comment | File | Size | Author |
---|---|---|---|
#16 | openid_hmac-D7-3.patch | 768 bytes | c960657 |
#13 | drupal8.openid-hmac.13.patch | 1.39 KB | sun |
#10 | openid_hmac-A-3.patch | 1.4 KB | c960657 |
#7 | openid_hmac-A-2.patch | 2.14 KB | c960657 |
#7 | openid_hmac-B-2.patch | 1.2 KB | c960657 |
Comments
Comment #1
recidive CreditAttribution: recidive commentedTypo in title.
Comment #2
cburschkaThis patch looks ready to go, except for one blank line containing two spaces.
Comment #3
recidive CreditAttribution: recidive commentedOk, this time without the spaces.
Comment #4
Dries CreditAttribution: Dries commentedPersonally, I'd not bother with having two code paths. This code shouldn't be in the critical performance path, so the existing code is probably fine. I'm tempted to mark this "won't fix".
Comment #5
Dries CreditAttribution: Dries commentedMarking this as "won't fix".
Comment #6
c960657 CreditAttribution: c960657 commentedWe now require the hash extension (see system_requirements()), so we can now switch completely to hash_hmac().
openid_hmac-A-2.patch removes _openid_hmac() and OPENID_SHA1_BLOCKSIZE completely, openid_hmac-B-2.patch preserves them for backwards-compatibility. It think we should use the former—_openid_hmac() is a private function, and I doubt anybody outside of the OpenID module would use the OPENID_SHA1_BLOCKSIZE constant.
Edit: The patches are attached to the next comment.
Comment #7
c960657 CreditAttribution: c960657 commentedComment #8
recidive CreditAttribution: recidive commentedI also think the "A" patch is better.
Comment #9
c960657 CreditAttribution: c960657 commentedFor D8, openid_hmac-A-2.patch is definitely the right choice.
Comment #10
c960657 CreditAttribution: c960657 commentedComment #11
sunAwesome.
Comment #12
catch#10: openid_hmac-A-3.patch queued for re-testing.
Comment #13
sunRe-rolled against HEAD.
Comment #14
catchLooks great. Committed/pushed to 8.x.
Comment #16
c960657 CreditAttribution: c960657 commentedReroll of openid_hmac-A-2.patch for D7.