Skip to content

Commit

Permalink
OX6-161: Replace key hash algorithm from md5 to sha384
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepayone committed May 17, 2024
1 parent dc6a9df commit dba92b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/fcporequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function __construct()

$this->addParameter('mid', $oConfig->getConfigParam('sFCPOMerchantID')); //PayOne Merchant ID
$this->addParameter('portalid', $oConfig->getConfigParam('sFCPOPortalID')); //PayOne Portal ID
$this->addParameter('key', md5($oConfig->getConfigParam('sFCPOPortalKey'))); //PayOne Portal Key
$this->addParameter('key', hash('sha384', $oConfig->getConfigParam('sFCPOPortalKey'))); //PayOne Portal Key
if ($oConfig->isUtf()) {
$this->addParameter('encoding', 'UTF-8'); //Encoding
}
Expand Down Expand Up @@ -638,7 +638,7 @@ protected function _fcpoAddSecInvoiceParameters($oOrder) {
$oConfig = $this->getConfig();

$sSecinvoicePortalId = $oConfig->getConfigParam('sFCPOSecinvoicePortalId');
$sSecinvoicePortalKeyHash = md5($oConfig->getConfigParam('sFCPOSecinvoicePortalKey'));
$sSecinvoicePortalKeyHash = hash('sha384', $oConfig->getConfigParam('sFCPOSecinvoicePortalKey'));
$this->addParameter('portalid', $sSecinvoicePortalId);
$this->addParameter('key', $sSecinvoicePortalKeyHash);

Expand All @@ -659,7 +659,7 @@ protected function _fcpoAddBNPLPortalParameters() {
$oConfig = $this->getConfig();

$sPortalId = $oConfig->getConfigParam('sFCPOPLPortalId');
$sPortalKeyHash = md5($oConfig->getConfigParam('sFCPOPLPortalKey'));
$sPortalKeyHash = hash('sha384', $oConfig->getConfigParam('sFCPOPLPortalKey'));
$this->addParameter('portalid', $sPortalId);
$this->addParameter('key', $sPortalKeyHash);
}
Expand Down Expand Up @@ -2629,7 +2629,7 @@ protected function _fcpoSetSecurePayPortal($oOrder)
}

$this->addParameter('portalid', $sFCPOSecinvoicePortalId);
$this->addParameter('key', md5($sFCPOSecinvoicePortalKey));
$this->addParameter('key', hash('sha384', $sFCPOSecinvoicePortalKey));
}

/**
Expand Down

0 comments on commit dba92b8

Please sign in to comment.