bitcore-lib icon indicating copy to clipboard operation
bitcore-lib copied to clipboard

Wrong length check in HMAC function

Open alexdupre opened this issue 7 years ago • 0 comments

https://github.com/bitpay/bitcore-lib/blob/026ddb4d393ee5f1daa2688483a13e274d5df3ed/lib/crypto/hash.js#L56

The above check always returns false, since it's missing .length, so the buffer copy/padding is never performed. Luckily/Accidentally accessing an out-of-index array in Javascript returns an undefined type that has the same property of a 0, in regard of the XOR operation.

alexdupre avatar Mar 20 '18 08:03 alexdupre