Skip to content

Fix signing failure after importing public key with updated expiry#2384

Open
kaie wants to merge 2 commits into
rnpgp:mainfrom
kaie:fix-secring-expiry-update
Open

Fix signing failure after importing public key with updated expiry#2384
kaie wants to merge 2 commits into
rnpgp:mainfrom
kaie:fix-secring-expiry-update

Conversation

@kaie
Copy link
Copy Markdown
Contributor

@kaie kaie commented Mar 24, 2026

When importing an updated public key, sync it into the secring if a matching secret key exists, so the secring reflects the new expiration and signing succeeds.

Fixes: #2383

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.46%. Comparing base (6f8a677) to head (8eb3ed8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2384   +/-   ##
=======================================
  Coverage   85.46%   85.46%           
=======================================
  Files         126      126           
  Lines       22711    22717    +6     
=======================================
+ Hits        19409    19415    +6     
  Misses       3302     3302           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

kaie and others added 2 commits May 19, 2026 15:24
When importing an updated public key, sync it into the secring if
a matching secret key exists, so the secring reflects the new
expiration and signing succeeds.

Fixes: rnpgp#2383

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kaie kaie force-pushed the fix-secring-expiry-update branch from 1265348 to 8eb3ed8 Compare May 19, 2026 13:25
Comment thread src/lib/rnp.cpp
// public key was new or updated: sync into secring if a secret key exists there
auto *expub = ffi->pubring->get_key(key.fp());
if (expub && ffi->secring->get_key(key.fp())) {
ffi->secring->import_key(*expub, true);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is it necessary to minimize the public key, strip attributes from it, prior to importing it into secring?

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.

GPG storage: Importing public key with updated expiration doesn't update metadata in secret storage file, signing fails

1 participant