Add testcases

This commit is contained in:
Kay Lukas 2018-12-10 20:21:55 +01:00
parent 3c0b22268d
commit 2dbb8582d7
2 changed files with 293 additions and 1 deletions

View File

@ -501,7 +501,7 @@ Key.prototype.verifyPrimaryKey = async function(date=new Date(), userId={}) {
* @async
*/
Key.prototype.getExpirationTime = async function(capabilities, keyId, userId) {
const primaryUser = await this.getPrimaryUser(null);
const primaryUser = await this.getPrimaryUser(null, userId);
if (!primaryUser) {
throw new Error('Could not find primary user');
}
@ -556,6 +556,9 @@ Key.prototype.getPrimaryUser = async function(date=new Date(), userId={}) {
}
return null;
}
await Promise.all(users.map(async function (a) {
return a.user.revoked || a.user.isRevoked(primaryKey, a.selfCertification, null, date);
}));
// sort by primary user flag and signature creation time
const primaryUser = users.sort(function(a, b) {
const A = a.selfCertification;

View File

@ -1328,6 +1328,289 @@ cKFQz1DDfFCfVpSIJRGozQ==
-----END PGP PUBLIC KEY BLOCK-----
`;
const revoked_primary_user = `-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBE2V9vABCADR6780VEDx0P/Hk+qvGeDkGY/CDKkFIquksfVnWUatmN4mVfcS
yqzmyZ08kAcXQVlU1i+/EeFSQ6vXEP/ZjH9en4YjOGrvmSIrNl4j4vhlJG3Mbao0
ar8K5YNUGyCKCmvBT+R5gAJeAUE4rh36pB0Eyq5Vn9/T1kr9phIwldmi5BiqAPQb
U8OqcELl92GsCj0h0hu2jWEuSFj4lyaF9TQjMqMG9Na/CGlj1A7rc2Nb1DgQG0Up
ZoQkqqctd4Zia9iuoIn3gPW3Na+KjGyufl54lDTWuZyFiybOoc1XzYPcFKJO8EpZ
B8+N6Nyh2QGeVhTKtBqns7GSfvEL/0t0dknVABEBAAG0UEFnaWxlQml0cyBTdXBw
b3J0IChBZ2lsZSBXZWIgU29sdXRpb25zIGJlY2FtZSBBZ2lsZUJpdHMpIDxzdXBw
b3J0QGFnaWxlYml0cy5jb20+iQE8BBMBAgAmAhsDBwsJCAcDAgEGFQgCCQoLBBYC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OVc4BraLE5Ez9fsXAebh19pc3J/pvGOMkBaI
GeN9TtSKfnhmfMXlcB3BgZhRmp1D7JPJxTn/xVdBAUdcAV5Zuv4MiOvSNuP6q4/J
/V2fmNUion0/F2bJGC6MaPIjx2u44+QjXXJNsKE+8OVTrIDqoJbj4MbSpdVFjS9E
dh1PTAyfau1IRO3V/ivRaYs32jvMno6zP575CKLJOIyLREm8dbQRRd7h1+ZBxtQf
Jn9lY1FGcIqjyOYanmsOEsSsKZS/exyNIjwi0WRPze+SASRzE/8=
=qfwW
-----END PGP PUBLIC KEY BLOCK-----
`;
function versionSpecificTests() {
it('Preferences of generated key', function() {
const testPref = function(key) {
@ -1946,6 +2229,12 @@ describe('Key', function() {
expect(encryptExpirationTime.toISOString()).to.equal('2008-02-12T17:12:08.000Z');
});
it('Getting an encryption packet ', async function () {
const { keys: [pubKey] } = await openpgp.key.readArmored(revoked_primary_user);
const encPacket = await pubKey.getEncryptionKey();
expect(encPacket).to.not.be.null;
});
it('update() - throw error if fingerprints not equal', async function() {
const keys = (await openpgp.key.readArmored(twoKeys)).keys;
await expect(keys[0].update.bind(