mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-11-23 22:52:08 +00:00
fix: crypto additional byte check
This commit is contained in:
parent
e6420244dc
commit
2b35ed072a
@ -72,10 +72,9 @@ module.exports = class Crypto {
|
||||
const mod = new BigNumber(key.n());
|
||||
const buffer = modPow(base, power, mod).toBEBuffer();
|
||||
|
||||
if (buffer.byteLength !== 257 || buffer[0] === 0x00)
|
||||
if (buffer.byteLength !== 257 && buffer[0] === 0x00)
|
||||
return buffer.slice(1).toString('base64');
|
||||
|
||||
// console.log('hex string of key starts with "00" and is 514 bytes long, fixing it to be 512 bytes long by stripping leading "00"');
|
||||
return buffer.toString('base64');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user