Skip to content

#6280 Improve validation of OpenPGP revocation signatures for contact keys - #6281

Merged
sosnovsky merged 3 commits into
masterfrom
issue-6280-improve-validation-of-opengpg-revocation-signatures
Aug 25, 2026
Merged

#6280 Improve validation of OpenPGP revocation signatures for contact keys#6281
sosnovsky merged 3 commits into
masterfrom
issue-6280-improve-validation-of-opengpg-revocation-signatures

Conversation

@martgil

@martgil martgil commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

This PR improves validation of OpenPGP revocation signatures for contact keys.

Closes #6280


Tests (delete all except exactly one):

  • Tests added or updated

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities
  • is documented clearly and usefully, or doesn't need documentation

@martgil
martgil requested a review from sosnovsky as a code owner August 24, 2026 06:59
@martgil martgil changed the title fix: improve validation of OpenPGP revocation signatures for contact keys #6280 Improve validation of OpenPGP revocation signatures for contact keys Aug 24, 2026
Comment on lines +227 to +234
let records: StoredRevocation[] = [];
{
const tx = db.transaction(['revocations'], 'readonly');
records = await new Promise((resolve, reject) => {
const search = tx.objectStore('revocations').getAll();
ContactStore.setReqPipe(search, resolve, reject);
});
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's simplify it and just use const instead of let for records:

const tx = db.transaction(['revocations'], 'readonly');
const records = await new Promise<StoredRevocation[]>((resolve, reject) => {
    const search = tx.objectStore('revocations').getAll();
    ContactStore.setReqPipe(search, resolve, reject);
  });

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sosnovsky - I'll check it out and push the necessary changes.

Comment on lines +241 to +243
if (!(await KeyUtil.parse(record.armoredKey)).revoked) {
bogusFingerprints.push(record.fingerprint);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here we should also check that parsed key is pgp key and compare it's fingerprint, like this:

const key = await KeyUtil.parse(record.armoredKey);
if (key.family === 'openpgp' && (key.id !== record.fingerprint || !key.revoked)) {
    bogusFingerprints.push(record.fingerprint);
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on this one. I'll update it accordingly. Thank you for your feedback, Roma.

@martgil
martgil requested a review from sosnovsky August 25, 2026 11:01
@martgil

martgil commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @sosnovsky - Just requesting for another review. It looks good though overall but feel free to re-check. Thank you!

@sosnovsky sosnovsky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sosnovsky
sosnovsky merged commit fd8857e into master Aug 25, 2026
12 checks passed
@sosnovsky
sosnovsky deleted the issue-6280-improve-validation-of-opengpg-revocation-signatures branch August 25, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve validation of OpenPGP revocation signatures for contact keys

2 participants