Skip to content

Commit

Permalink
Merge pull request PAYONE-GmbH#542 from FatchipRobert/MAG2-310-Server…
Browse files Browse the repository at this point in the history
…-API-hash

MAG2-310 - Changed default hash algorithm for key param to sha2-384
  • Loading branch information
janteuber authored Jun 18, 2024
2 parents f9b9922 + f9926fd commit b2f2baa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Helper/Toolkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function isKeyValid($sKey)
{
$aKeyValues = $this->getAllPayoneSecurityKeys();
foreach ($aKeyValues as $sConfigKey) {
if ($this->hashString($sConfigKey ?? '') == $sKey) {
if ($this->hashString($sConfigKey ?? '', 'md5') == $sKey) {
return true;
}
}
Expand Down Expand Up @@ -266,7 +266,7 @@ public function generateUUIDv4()
* @param string $sString
* @return string
*/
public function hashString($sString, $sAlgorithm = 'md5', $sKey = false)
public function hashString($sString, $sAlgorithm = 'sha384', $sKey = false)
{
if ($sAlgorithm == "sha384" && $sKey !== false) {
return hash_hmac($sAlgorithm, $sString, $sKey);
Expand Down

0 comments on commit b2f2baa

Please sign in to comment.