An expired signature is accepted when its signing key has expired too #193

Closed
opened 2026-10-12 11:17:37 +02:00 by clawbot · 1 comment
Collaborator

verifySignature in mfer/openpgp.go treats ErrKeyExpired from the OpenPGP library as success, so that a manifest outlives its key. The library checks key expiry before signature expiry (checkMessageSignatureDetails in go-crypto's openpgp/read.go), so for an expired key it never reports an expired signature. A signature carrying its own expiry time, as gpg --sig-expire writes, is therefore refused while the key is live (signature expired) and accepted once the key has expired as well. The signer's statement that the signature is void after a date is honoured only while the key is still good.

Confirmed on next (0fbb3da) with a scratch test: a 2020 key with a one-day lifetime and a one-hour signature lifetime verifies; the same signature lifetime on a key with no expiry is refused.

Correct: a signature past its own expiry is refused whatever the state of the key. verifySignature reads the one signature packet (it already counts them) and checks its expiry before tolerating ErrKeyExpired. In docs/FORMAT.md terms: one good, unexpired signature by a key that may have expired since.

Definition of done

  • Failing test first: expired key plus expired signature is refused; expired key plus unexpiring signature still verifies (TestVerifySignatureKeyExpiredSince).
  • The fix in mfer/openpgp.go.
  • docs/FORMAT.md Signature Scheme states the rule.
  • make check passes.

Model: fable-5-1

`verifySignature` in `mfer/openpgp.go` treats `ErrKeyExpired` from the OpenPGP library as success, so that a manifest outlives its key. The library checks key expiry before signature expiry (`checkMessageSignatureDetails` in go-crypto's `openpgp/read.go`), so for an expired key it never reports an expired signature. A signature carrying its own expiry time, as `gpg --sig-expire` writes, is therefore refused while the key is live (`signature expired`) and accepted once the key has expired as well. The signer's statement that the signature is void after a date is honoured only while the key is still good. Confirmed on `next` (0fbb3da) with a scratch test: a 2020 key with a one-day lifetime and a one-hour signature lifetime verifies; the same signature lifetime on a key with no expiry is refused. Correct: a signature past its own expiry is refused whatever the state of the key. `verifySignature` reads the one signature packet (it already counts them) and checks its expiry before tolerating `ErrKeyExpired`. In `docs/FORMAT.md` terms: one good, unexpired signature by a key that may have expired since. ## Definition of done - Failing test first: expired key plus expired signature is refused; expired key plus unexpiring signature still verifies (`TestVerifySignatureKeyExpiredSince`). - The fix in `mfer/openpgp.go`. - `docs/FORMAT.md` Signature Scheme states the rule. - `make check` passes. Model: fable-5-1
clawbot self-assigned this 2026-10-12 11:17:37 +02:00
Author
Collaborator

Fixed in #201: a signature past its own expiry time is now refused even when its key has expired too, and docs/FORMAT.md Signature Scheme states the rule.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/mfer/pulls/201: a signature past its own expiry time is now refused even when its key has expired too, and `docs/FORMAT.md` Signature Scheme states the rule. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/mfer#193