File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
app/code/LiqpayMagento/LiqPay/Helper Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -118,11 +118,15 @@ public function checkOrderIsLiqPayPayment(\Magento\Sales\Api\Data\OrderInterface
118
118
public function securityOrderCheck ($ data , $ receivedPublicKey , $ receivedSignature )
119
119
{
120
120
if ($ this ->isSecurityCheck ()) {
121
- $ privateKey = $ this ->getPrivateKey ();
122
121
$ publicKey = $ this ->getPublicKey ();
122
+ if ($ publicKey !== $ receivedPublicKey ) {
123
+ return false ;
124
+ }
125
+
126
+ $ privateKey = $ this ->getPrivateKey ();
123
127
$ generatedSignature = base64_encode (sha1 ($ privateKey . $ data . $ privateKey , 1 ));
124
- return $ privateKey && $ publicKey
125
- && $ receivedSignature == $ generatedSignature || $ publicKey == $ receivedPublicKey ;
128
+
129
+ return $ receivedSignature === $ generatedSignature ;
126
130
} else {
127
131
return true ;
128
132
}
@@ -132,4 +136,4 @@ public function getLogger()
132
136
{
133
137
return $ this ->_logger ;
134
138
}
135
- }
139
+ }
You can’t perform that action at this time.
0 commit comments