From 63b6d215e3599ea8862324161fc82c0445894fbf Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Wed, 22 Apr 2020 22:04:26 +0200 Subject: [PATCH] Allow key.validate() to pass if it has a GNU dummy primary key A valid signing subkey is required, in this case. --- test/general/key.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/general/key.js b/test/general/key.js index f7fedc26..7527f7dc 100644 --- a/test/general/key.js +++ b/test/general/key.js @@ -2846,7 +2846,8 @@ describe('Key', function() { it('clearPrivateParams() - detect that private key parameters were removed', async function() { const key = await openpgp.key.readArmored(priv_key_rsa); await key.decrypt('hello world'); - const params = key.primaryKey.params; + const signingKeyPacket = key.subKeys[0].keyPacket; + const params = signingKeyPacket.params; await key.clearPrivateParams(); key.primaryKey.isEncrypted = false; key.primaryKey.params = params; @@ -2858,7 +2859,8 @@ describe('Key', function() { it('clearPrivateParams() - detect that private key parameters were zeroed out', async function() { const { keys: [key] } = await openpgp.key.readArmored(priv_key_rsa); await key.decrypt('hello world'); - const params = key.primaryKey.params.slice(); + const signingKeyPacket = key.subKeys[0].keyPacket; + const params = signingKeyPacket.params.slice(); await key.clearPrivateParams(); key.primaryKey.isEncrypted = false; key.primaryKey.params = params;