Skip to content

Commit 5bbcc32

Browse files
committed
updated the buffer function for security issues
1 parent 9a88847 commit 5bbcc32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/authentication/http/SignatureParameterGenerator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ exports.getSignatureParameter = function (merchantConfig, logger) {
7171
{
7272
signatureString += Constants.V_C_MERCHANTID + ': ' + merchantConfig.getMerchantID();
7373
}
74-
var data = new Buffer(signatureString, 'utf8');
74+
var data = Buffer.from(signatureString,'utf8');
7575
/* Decoding scecret key */
76-
var key = new Buffer(merchantConfig.getMerchantsecretKey(), 'base64');
76+
var key = Buffer.from(merchantConfig.getMerchantsecretKey(), 'base64');
7777
var base64EncodedSignature = crypto.createHmac('sha256', key)
7878
.update(data)
7979
.digest('base64');

0 commit comments

Comments
 (0)