Problem/Motivation

I have switched to php 8.1 and on the status page gettings the below error about deprecation
Deprecated function : hash_hmac(): Passing null to parameter #3 ($key) of type string is deprecated in Drupal\acquia_search\EventSubscriber\SearchSubscriber->validateResponse() (line 231 of modules/contrib/acquia_search/src/EventSubscriber/SearchSubscriber .php ).

CommentFileSizeAuthor
#6 hash-hmac-deprecated.patch586 bytescapysara
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arshadkhan35 created an issue. See original summary.

japerry’s picture

Status: Active » Fixed

If you're getting a null derived key, then the hmac value will be false. I added some checks to ensure the derived key exists before passing it to the comparison. This -should- only occur if you don't have a connection to Acquia search, which would cause a few other issues as well.

  • japerry committed fefe74e on 3.x
    Issue #3309595 by japerry: Check derived key before comparing hmac...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

capysara’s picture

I just updated to 3.1.0, and I'm hitting this error. Was this fixed in 3.1, or just 3.0?

capysara’s picture

FileSize
586 bytes

Here's a patch against 3.1. Should I create a new issue for this?