mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-09 02:12:50 +00:00
Add config.rejectPublicKeyAlgorithms (#1264)
- Add `config.rejectPublicKeyAlgorithms` to disallow using the given algorithms to verify, sign or encrypt new messages or third-party certifications. - Consider `config.minRsaBits` when signing, verifying and encrypting messages and third-party certifications, not just on key generation. - When verifying a message, if the verification key is not found (i.e. not provided or too weak), the corresponding `signature` will have `signature.valid=false` (used to be `signature.valid=null`). `signature.error` will detail whether the key is missing/too weak/etc. Generating and verifying key certification signatures is still permitted in all cases.
This commit is contained in:
@@ -72,7 +72,8 @@ async function testSubkeyTrust() {
|
||||
streaming: false
|
||||
});
|
||||
expect(verifyAttackerIsBatman.signatures[0].keyid.equals(victimPubKey.subKeys[0].getKeyId())).to.be.true;
|
||||
expect(verifyAttackerIsBatman.signatures[0].valid).to.be.null;
|
||||
expect(verifyAttackerIsBatman.signatures[0].valid).to.be.false;
|
||||
expect(verifyAttackerIsBatman.signatures[0].error).to.match(/Could not find valid signing key packet/);
|
||||
}
|
||||
|
||||
module.exports = () => it('Does not trust subkeys without Primary Key Binding Signature', testSubkeyTrust);
|
||||
|
||||
Reference in New Issue
Block a user