Skip to content

PGPPublicKey.join modifies the key passed in #2508

Closed

Description

@winne42

PGPPublicKey.join(key, copy, …), and through it PGPPublicKeyRing.join and OpenPGPCertificate's merging, copies key.idSigs only shallowly and then merges the copy's certifications into the inner lists. As a result, joining also adds certifications to the caller's key, or replaces them in it. For example, after PGPPublicKeyRing.join(base, cert2SignsBase) (the Sequoia merge vectors in PGPPublicKeyMergeTest), base.getEncoded() has changed.

This has been the behavior since join was added in 1.71.

Fix: copy each user ID's signature list as well, as the PGPPublicKey copy constructor already does.

Activity

  1. winne42 commented on Oct 25, 2026

    @winne42
    ContributorAuthor

    solved in 5122510, thx!

  2. added a commit that references this issue on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions