refactor: migrate to openpgp/v3 library - #676
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Migrates pkg/keystorage from github.com/ProtonMail/gopenpgp/v2 to github.com/ProtonMail/gopenpgp/v3 for encrypting/decrypting key slots, and introduces a golden v2-produced keystorage blob to validate post-migration readability.
Changes:
- Replace gopenpgp/v2 helper-based slot encryption/decryption with gopenpgp/v3
cryptoAPIs, using a lazily-initialized PGP handle. - Store armored ciphertext as
[]bytedirectly (instead of converting fromstring) in protobuf key slots. - Add a v2 marshaled keystorage test vector and a test ensuring v2-produced data can be unmarshaled and decrypted after the migration.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/keystorage/testdata/keystorage-v2.bin | Adds a golden v2-produced serialized keystorage payload used for compatibility testing. |
| pkg/keystorage/keystorage.go | Switches slot encryption/decryption implementation to gopenpgp/v3 and introduces encryptSlot/decryptSlot helpers. |
| pkg/keystorage/keystorage_test.go | Embeds the v2 golden payload and adds a test for reading v2-produced keystorage. |
| go.mod | Updates dependency from gopenpgp/v2 to gopenpgp/v3. |
| go.sum | Adjusts module checksums to reflect the dependency migration and indirect dependency changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
rsmitty
approved these changes
Aug 12, 2026
The v2 library is in maintenance mode, good time to move on to the new library. Provides tests on backwards compatibility, the protobuf marshaling is compatible v2->v3 and v3->v2. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
smira
force-pushed
the
refactor/openpgp-v3
branch
from
August 13, 2026 12:47
921c4d5 to
c7cf050
Compare
Member
Author
|
/m |
Collaborator
|
@smira merge was not performed: no reviews found |
1 similar comment
Collaborator
|
@smira merge was not performed: no reviews found |
Member
Author
|
/m |
Collaborator
|
@smira merge was not performed: no reviews found |
1 similar comment
Collaborator
|
@smira merge was not performed: no reviews found |
frezbo
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v2 library is in maintenance mode, good time to move on to the new library.
Provides tests on backwards compatibility, the protobuf marshaling is compatible v2->v3 and v3->v2.