Skip to content

openpgp: use imported key metadata for key expiration - #43

Closed
clan wants to merge 2 commits into
gentoo:masterfrom
clan:verify
Closed

clan wants to merge 2 commits into
gentoo:masterfrom
clan:verify

Conversation

@clan

@clan clan commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Use the key expiration time recorded when importing keys instead of relying on the KEYEXPIRED status message.

KEYEXPIRED does not identify which key it refers to, making it unreliable when multiple expired keys are involved. The imported key metadata already contains the expiration time associated with each fingerprint, so use it directly.

Closes: https://bugs.gentoo.org/979433

Comment thread gemato/openpgp.py Resolved
Comment thread gemato/openpgp.py Resolved
Comment thread gemato/openpgp.py Resolved
Comment thread gemato/openpgp.py Resolved
Comment thread gemato/openpgp.py Resolved
Comment thread gemato/openpgp.py Resolved
Comment thread gemato/openpgp.py Resolved
@clan
clan force-pushed the verify branch 2 times, most recently from 0427461 to 3d70f11 Compare July 24, 2026 10:39
Comment thread gemato/openpgp.py Resolved
Comment thread gemato/openpgp.py Resolved
Comment thread gemato/openpgp.py Resolved
Refactor list_keys() to return structured key information instead of
mapping fingerprints to UID lists.

Introduce dedicated dataclasses for primary keys, subkeys and key
listings. Besides UIDs, the returned data now includes each key's
fingerprint, key ID, creation time and expiration time parsed from
GnuPG's --with-colons output, while explicitly preserving the
primary/subkey relationship.

Centralizing key metadata parsing in list_keys() provides a single
representation of OpenPGP keys and prepares subsequent changes that
require access to additional key metadata during signature verification.

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
@clan
clan force-pushed the verify branch 2 times, most recently from ca07015 to 80f999a Compare July 25, 2026 15:55
Use the expiration time from imported key metadata instead
of relying on KEYEXPIRED.

KEYEXPIRED status messages are not associated with a specific
fingerprint, making it unreliable when multiple expired keys are
involved. The imported key metadata already contains the expiration
time associated with each fingerprint, so use it directly.

Closes: https://bugs.gentoo.org/979433
Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
gentoo-bot pushed a commit that referenced this pull request Jul 25, 2026
Refactor list_keys() to return structured key information instead of
mapping fingerprints to UID lists.

Introduce dedicated dataclasses for primary keys, subkeys and key
listings. Besides UIDs, the returned data now includes each key's
fingerprint, key ID, creation time and expiration time parsed from
GnuPG's --with-colons output, while explicitly preserving the
primary/subkey relationship.

Centralizing key metadata parsing in list_keys() provides a single
representation of OpenPGP keys and prepares subsequent changes that
require access to additional key metadata during signature verification.

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
Part-of: #43
Signed-off-by: Michał Górny <mgorny@gentoo.org>
@clan
clan deleted the verify branch July 25, 2026 16:32
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.

2 participants