refs #5174 Hotfix
gitea/salix/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Juan Ferrer 2023-01-30 20:22:52 +01:00
parent 339cdab3c4
commit 64d8ae1f49
1 changed files with 3 additions and 3 deletions

View File

@ -66,17 +66,17 @@ module.exports = Self => {
const secretKey = Buffer.from(merchant.secretKey, 'base64');
const iv = Buffer.alloc(8, 0);
const cipher = crypto.createDecipheriv('des-ede3-cbc', secretKey, iv);
const cipher = crypto.createCipheriv('des-ede3-cbc', secretKey, iv);
cipher.setAutoPadding(false);
const orderKey = cipher.update(zeroPad(orderId, 8), 'utf8', 'base64')
+ cipher.final();
+ cipher.final('base64');
const res = crypto.createHmac('sha256', Buffer.from(orderKey, 'base64'))
.update(merchantParameters)
.digest('base64');
const base64Res = base64url.encode(res, 'base64');
// if (base64Res !== signature)
// if (res !== signature)
// throw new UserError('Invalid signature');
console.debug('Payment signature:', {