Fix verifying RSA signatures with leading zero in Web Crypto

This commit is contained in:
Daniel Huigens 2019-11-29 11:17:19 +01:00
parent ad0fdcc4da
commit 5a24bc7698

View File

@ -36,9 +36,9 @@ export default {
case enums.publicKey.rsa_encrypt_sign:
case enums.publicKey.rsa_encrypt:
case enums.publicKey.rsa_sign: {
const m = msg_MPIs[0].toUint8Array();
const n = pub_MPIs[0].toUint8Array();
const e = pub_MPIs[1].toUint8Array();
const m = msg_MPIs[0].toUint8Array('be', n.length);
return publicKey.rsa.verify(hash_algo, data, m, n, e, hashed);
}
case enums.publicKey.dsa: {