{"thread":{"id":"66487","subject":"ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","startedAt":"2026-10-08T06:56:22Z","lastAt":"2026-11-13T23:28:24Z","messageCount":19,"participants":["Christian Noé Ramos López","Phillip Wood","Patrick Steinhardt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"554445","messageId":"CAHGSfbZ_Q8Ujt3om0POapkjWZed1pZVUrB-mV-e+UjmPgCNvWQ@mail.gmail.com","threadId":"66487","inReplyTo":null,"subject":"ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-10-08T06:56:22Z","receivedAt":"2026-10-08T06:56:22Z","isPatch":false,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"Two things that, together, mean an SSH signing key cannot be reliably\nstopped from being trusted. git 2.47.3, OpenSSH 10.0p2, Debian 13;\nsource read at v2.47.3 and at master (c46c1e37724f).\n\n1. valid-before is checked at a date the signer writes.\n\nSSH signatures carry no time of their own, so git passes -Overify-time\nfrom the committer or tagger line (gpg-interface.c,\nparse_payload_metadata). alice's key is in the allowed signers file\nwith valid-before=\"20260101\":\n\n    ssh-old        %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n    ssh-backdated  %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n    ssh-honest     %G?=U 2026-10-08 02:15:15 -0400 verify-commit=1 merge=128\n\nssh-backdated was signed today, with only the committer and author\ndates set to 2025-06-01. Nothing distinguishes it from ssh-old except\nwhen it was made, which only its author knows. ssh-honest, signed and\ndated today, is refused: \"key has expired: verify time ... >\nvalid-before 2026-01-01T00:00:00\".\n\nThe GPG backend refuses both:\n\n    gpg-old        %G?=Y verify-commit=1 merge=128\n    gpg-backdated  %G?=Y verify-commit=1 merge=128\n\nThe documentation for gpg.ssh.allowedSignersFile says \"Git will mark\nsignatures as valid if the signing key was valid at the time of the\nsignature's creation\", which is the intent, but does not say the time\ncomes from the commit. So valid-before rotates a key; it does not\nretire one.\n\n2. A configured revocation file that does not exist fails open.\n\ngpg-interface.c:568-574 at v2.47.3 (579-586 at master): if the\nrevocation file exists, pass -r; otherwise warn and verify without it.\nThe same file, present and listing alice's key, refuses:\n\n    S2-revoked       %G?=B verify-commit=1 merged=no\n    S3-revfile-gone  %G?=G verify-commit=0 merged=yes\n                     warning: ssh signing revocation file configured\nbut not found\n\nS3 merged under `git merge --ff-only --verify-signatures`. An\nunreadable file and a directory both fail closed:\n\n    S4-revfile-0000  %G?=B verify-commit=1 merged=no\n    S6-revfile-dir   %G?=B verify-commit=1 merged=no\n\nssh-keygen, given the same missing path, refuses: exit 255, \"Could not\nverify signature\". git avoids that by not passing -r. OpenSSH's\nRevokedKeys says, in sshd_config(5), \"Note that if this file is not\nreadable, then public key authentication will be refused for all\nusers.\"\n\nNo test in git exercises gpg.ssh.revocationFile; it appears only in\nDocumentation/config/gpg.adoc and gpg-interface.c.\n\nControls for both runs, fixed beforehand: a good signature gives G and\nmerges; an unsigned commit gives N and is refused; the revocation file\npresent and listing the key gives B and is refused; a commit with its\nmessage changed and the signature kept gives B and is refused.\n\nTogether: the two ways to stop trusting an SSH signing key are\nvalid-before, which the signer can date around, and revocationFile,\nwhich does nothing if its path is wrong. Either would be enough on its\nown if it held.\n\nWhat I would ask for: refuse when the revocation file is configured and\nmissing, as ssh-keygen and sshd do, or say in the documentation that it\nis ignored; and say, under valid-before, where the time compared\nagainst it comes from.\n\nOn prior art: the ssh signing series (Fabian Stelzer, 2021) carried the\nwarning from before v4, and the review raised the config name's case,\nnot what a missing file should do. The key-lifetime series (RFC\n2021-10-15 to v6 2021-12-09) passes the commit date to the check, and\nthe replies are about style. The N for an unconfigured allowed signers\nfile is already on the list (Grayson Tinker, 2026-06-25) and is not\npart of this.\n\nChristian Ramos\nNorte Software\nchris@nortesoftware.dev\n\n"},{"id":"554500","messageId":"ec4de165-c7d1-43d9-979b-08c1cb67022d@gmail.com","threadId":"66487","inReplyTo":"CAHGSfbZ_Q8Ujt3om0POapkjWZed1pZVUrB-mV-e+UjmPgCNvWQ@mail.gmail.com","subject":"Re: ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-08T13:42:42Z","receivedAt":"2026-10-08T13:42:42Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Christian\n\nHaving waded through this here is a human readable summary:\n\n(1) Our documentation implies that we check the expiry date of the key (which is recorded in the allowed signers file) against the date the commit was signed, but we actually use the committer date which can easily be faked.\n\n(2) If the revocation file does not exist we print a warning rather than failing the operation like the gpg backend does.\n\nFor (1) I'd be happy to see a patch that tightens the wording, but we should also note that the timestamp in the gpg signature can also be faked.\n\nFor (2) I agree failing seems like the safer option.\n\nThanks\n\nPhillip\n\nOn 08/10/2026 07:56, Christian Noé Ramos López wrote:\n> Two things that, together, mean an SSH signing key cannot be reliably\n> stopped from being trusted. git 2.47.3, OpenSSH 10.0p2, Debian 13;\n> source read at v2.47.3 and at master (c46c1e37724f).\n> > 1. valid-before is checked at a date the signer writes.\n> > SSH signatures carry no time of their own, so git passes -Overify-time\n> from the committer or tagger line (gpg-interface.c,\n> parse_payload_metadata). alice's key is in the allowed signers file\n> with valid-before=\"20260101\":\n> >      ssh-old        %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n>      ssh-backdated  %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n>      ssh-honest     %G?=U 2026-10-08 02:15:15 -0400 verify-commit=1 merge=128\n> > ssh-backdated was signed today, with only the committer and author\n> dates set to 2025-06-01. Nothing distinguishes it from ssh-old except\n> when it was made, which only its author knows. ssh-honest, signed and\n> dated today, is refused: \"key has expired: verify time ... >\n> valid-before 2026-01-01T00:00:00\".\n> > The GPG backend refuses both:\n> >      gpg-old        %G?=Y verify-commit=1 merge=128\n>      gpg-backdated  %G?=Y verify-commit=1 merge=128\n> > The documentation for gpg.ssh.allowedSignersFile says \"Git will mark\n> signatures as valid if the signing key was valid at the time of the\n> signature's creation\", which is the intent, but does not say the time\n> comes from the commit. So valid-before rotates a key; it does not\n> retire one.\n> > 2. A configured revocation file that does not exist fails open.\n> > gpg-interface.c:568-574 at v2.47.3 (579-586 at master): if the\n> revocation file exists, pass -r; otherwise warn and verify without it.\n> The same file, present and listing alice's key, refuses:\n> >      S2-revoked       %G?=B verify-commit=1 merged=no\n>      S3-revfile-gone  %G?=G verify-commit=0 merged=yes\n>                       warning: ssh signing revocation file configured\n> but not found\n> > S3 merged under `git merge --ff-only --verify-signatures`. An\n> unreadable file and a directory both fail closed:\n> >      S4-revfile-0000  %G?=B verify-commit=1 merged=no\n>      S6-revfile-dir   %G?=B verify-commit=1 merged=no\n> > ssh-keygen, given the same missing path, refuses: exit 255, \"Could not\n> verify signature\". git avoids that by not passing -r. OpenSSH's\n> RevokedKeys says, in sshd_config(5), \"Note that if this file is not\n> readable, then public key authentication will be refused for all\n> users.\"\n> > No test in git exercises gpg.ssh.revocationFile; it appears only in\n> Documentation/config/gpg.adoc and gpg-interface.c.\n> > Controls for both runs, fixed beforehand: a good signature gives G and\n> merges; an unsigned commit gives N and is refused; the revocation file\n> present and listing the key gives B and is refused; a commit with its\n> message changed and the signature kept gives B and is refused.\n> > Together: the two ways to stop trusting an SSH signing key are\n> valid-before, which the signer can date around, and revocationFile,\n> which does nothing if its path is wrong. Either would be enough on its\n> own if it held.\n> > What I would ask for: refuse when the revocation file is configured and\n> missing, as ssh-keygen and sshd do, or say in the documentation that it\n> is ignored; and say, under valid-before, where the time compared\n> against it comes from.\n> > On prior art: the ssh signing series (Fabian Stelzer, 2021) carried the\n> warning from before v4, and the review raised the config name's case,\n> not what a missing file should do. The key-lifetime series (RFC\n> 2021-10-15 to v6 2021-12-09) passes the commit date to the check, and\n> the replies are about style. The N for an unconfigured allowed signers\n> file is already on the list (Grayson Tinker, 2026-06-25) and is not\n> part of this.\n> > Christian Ramos\n> Norte Software\n> chris@nortesoftware.dev\n\n\n"},{"id":"554593","messageId":"asjbyBvnFuYuE0CH@pks.im","threadId":"66487","inReplyTo":"ec4de165-c7d1-43d9-979b-08c1cb67022d@gmail.com","subject":"Re: ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-10-09T12:19:20Z","receivedAt":"2026-10-09T12:19:20Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Thu, Oct 08, 2026 at 02:42:42PM +0100, Phillip Wood wrote:\n> Hi Christian\n> \n> Having waded through this here is a human readable summary:\n\nthanks a lot for the summary, I really appreciate it as I already lost\ninterest after having read the first sentence.\n\n> (1) Our documentation implies that we check the expiry date of the key\n> (which is recorded in the allowed signers file) against the date the commit\n> was signed, but we actually use the committer date which can easily be\n> faked.\n\nRight. I think there isn't even a proper fix for this as we have no way\nto establish the actual time the data was signed. I think this is a\nsimple fact in a distributed system, as without coordination there is\nbasically nothing that the contributor can give us that would make us\ntrust the claimed signature time.\n\nYou may be able to create upper bounds if there are subsequent signed\ncommits that you trust and that have the untrusted commit as child. But\nthat is not going to be always useful.\n\n> (2) If the revocation file does not exist we print a warning rather than\n> failing the operation like the gpg backend does.\n> \n> For (1) I'd be happy to see a patch that tightens the wording, but we should\n> also note that the timestamp in the gpg signature can also be faked.\n\nYeah, agreed. This mode is only safe if the signing key has never\nleaked, but once it has leaked you can basically not guarantee anything\nvia \"valid-before\" and \"valid-after\". And documenting that would be a\ngood idea to not give a sense of false trustworthiness.\n\n> For (2) I agree failing seems like the safer option.\n\nMaybe this is another usecase where we can use the \":(optional)\" prefix\nthat we introduced recently for some of the other pathname options? So\nwe'd fail by default, but give the user an escape hatch if they really\nwant one.\n\nPatrick\n\n"},{"id":"554597","messageId":"6e921d1d-b7d8-4f42-add3-67931e4ffba8@gmail.com","threadId":"66487","inReplyTo":"CAHGSfba9Td+Lg=Nf+nfwZY2r1_eq2Mcejn__6X=VPQkmcJttfQ@mail.gmail.com","subject":"Re: ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-09T13:29:27Z","receivedAt":"2026-10-09T13:29:27Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Chirstian\n\nI've add back the the mailing list cc so others can comment as well.\n\nOn 08/10/2026 20:40, Christian Noé Ramos López wrote:\n> >> Having waded through this here is a human readable summary:\n> > Fair -- your summary is the shape I should have sent. Next time.\n> > (1) You are right, and I did not test it. gpg takes the signature's own\n> creation time, so a manipulated clock moves that too. What I measured is\n> narrower: backdating the committer and author dates does not move it --\n> ssh-backdated is accepted, gpg-backdated is refused. A difference in cost,\n> not in kind.\n> > So the wording should say two things: that the time compared against\n> valid-before comes from the commit, and that a signature timestamp is not\n> evidence of when the signing happened. That covers both backends. I will\n> send that patch.\n\nThat sounds sensible - a valid signature doesn't tell us anything about when the commit was signed.\n\n> (2) One thing before I write it. Failing closed changes behaviour for\n> anyone whose configured path is already wrong, from a warning to a failed\n> verification. I think that is the right trade, but it is a behaviour\n> change and not only a fix. There is no test for gpg.ssh.revocationFile\n> today, so the patch should add one either way.\n\nA test would be very welcome. Patrick had a good suggestion for allowing the path to be optional if the user wanted.\n\nThanks\n\nPhillip\n\n> Christian Ramos\n> Norte Software\n> chris@nortesoftware.dev\n> > > El jue, 8 oct 2026 a la(s) 7:42 a.m., Phillip Wood\n> (phillip.wood123@gmail.com) escribió:\n>>\n>> Hi Christian\n>>\n>> Having waded through this here is a human readable summary:\n>>\n>> (1) Our documentation implies that we check the expiry date of the key\n>> (which is recorded in the allowed signers file) against the date the\n>> commit was signed, but we actually use the committer date which can\n>> easily be faked.\n>>\n>> (2) If the revocation file does not exist we print a warning rather than\n>> failing the operation like the gpg backend does.\n>>\n>> For (1) I'd be happy to see a patch that tightens the wording, but we\n>> should also note that the timestamp in the gpg signature can also be faked.\n>>\n>> For (2) I agree failing seems like the safer option.\n>>\n>> Thanks\n>>\n>> Phillip\n>>\n>> On 08/10/2026 07:56, Christian Noé Ramos López wrote:\n>>> Two things that, together, mean an SSH signing key cannot be reliably\n>>> stopped from being trusted. git 2.47.3, OpenSSH 10.0p2, Debian 13;\n>>> source read at v2.47.3 and at master (c46c1e37724f).\n>>>\n>>> 1. valid-before is checked at a date the signer writes.\n>>>\n>>> SSH signatures carry no time of their own, so git passes -Overify-time\n>>> from the committer or tagger line (gpg-interface.c,\n>>> parse_payload_metadata). alice's key is in the allowed signers file\n>>> with valid-before=\"20260101\":\n>>>\n>>>       ssh-old        %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n>>>       ssh-backdated  %G?=G 2025-06-01 12:00:00 +0000 verify-commit=0 merge=0\n>>>       ssh-honest     %G?=U 2026-10-08 02:15:15 -0400 verify-commit=1 merge=128\n>>>\n>>> ssh-backdated was signed today, with only the committer and author\n>>> dates set to 2025-06-01. Nothing distinguishes it from ssh-old except\n>>> when it was made, which only its author knows. ssh-honest, signed and\n>>> dated today, is refused: \"key has expired: verify time ... >\n>>> valid-before 2026-01-01T00:00:00\".\n>>>\n>>> The GPG backend refuses both:\n>>>\n>>>       gpg-old        %G?=Y verify-commit=1 merge=128\n>>>       gpg-backdated  %G?=Y verify-commit=1 merge=128\n>>>\n>>> The documentation for gpg.ssh.allowedSignersFile says \"Git will mark\n>>> signatures as valid if the signing key was valid at the time of the\n>>> signature's creation\", which is the intent, but does not say the time\n>>> comes from the commit. So valid-before rotates a key; it does not\n>>> retire one.\n>>>\n>>> 2. A configured revocation file that does not exist fails open.\n>>>\n>>> gpg-interface.c:568-574 at v2.47.3 (579-586 at master): if the\n>>> revocation file exists, pass -r; otherwise warn and verify without it.\n>>> The same file, present and listing alice's key, refuses:\n>>>\n>>>       S2-revoked       %G?=B verify-commit=1 merged=no\n>>>       S3-revfile-gone  %G?=G verify-commit=0 merged=yes\n>>>                        warning: ssh signing revocation file configured\n>>> but not found\n>>>\n>>> S3 merged under `git merge --ff-only --verify-signatures`. An\n>>> unreadable file and a directory both fail closed:\n>>>\n>>>       S4-revfile-0000  %G?=B verify-commit=1 merged=no\n>>>       S6-revfile-dir   %G?=B verify-commit=1 merged=no\n>>>\n>>> ssh-keygen, given the same missing path, refuses: exit 255, \"Could not\n>>> verify signature\". git avoids that by not passing -r. OpenSSH's\n>>> RevokedKeys says, in sshd_config(5), \"Note that if this file is not\n>>> readable, then public key authentication will be refused for all\n>>> users.\"\n>>>\n>>> No test in git exercises gpg.ssh.revocationFile; it appears only in\n>>> Documentation/config/gpg.adoc and gpg-interface.c.\n>>>\n>>> Controls for both runs, fixed beforehand: a good signature gives G and\n>>> merges; an unsigned commit gives N and is refused; the revocation file\n>>> present and listing the key gives B and is refused; a commit with its\n>>> message changed and the signature kept gives B and is refused.\n>>>\n>>> Together: the two ways to stop trusting an SSH signing key are\n>>> valid-before, which the signer can date around, and revocationFile,\n>>> which does nothing if its path is wrong. Either would be enough on its\n>>> own if it held.\n>>>\n>>> What I would ask for: refuse when the revocation file is configured and\n>>> missing, as ssh-keygen and sshd do, or say in the documentation that it\n>>> is ignored; and say, under valid-before, where the time compared\n>>> against it comes from.\n>>>\n>>> On prior art: the ssh signing series (Fabian Stelzer, 2021) carried the\n>>> warning from before v4, and the review raised the config name's case,\n>>> not what a missing file should do. The key-lifetime series (RFC\n>>> 2021-10-15 to v6 2021-12-09) passes the commit date to the check, and\n>>> the replies are about style. The N for an unconfigured allowed signers\n>>> file is already on the list (Grayson Tinker, 2026-06-25) and is not\n>>> part of this.\n>>>\n>>> Christian Ramos\n>>> Norte Software\n>>> chris@nortesoftware.dev\n>>\n> > "},{"id":"554598","messageId":"0a63a10d-aa9d-4997-888e-2fda82802f59@gmail.com","threadId":"66487","inReplyTo":"asjbyBvnFuYuE0CH@pks.im","subject":"Re: ssh signing: valid-before is checked at the signer's own date, and a missing revocationFile fails open","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-09T13:30:03Z","receivedAt":"2026-10-09T13:30:03Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Patrick\n\nOn 09/10/2026 13:19, Patrick Steinhardt wrote:\n> On Thu, Oct 08, 2026 at 02:42:42PM +0100, Phillip Wood wrote:\n>>\n>> Having waded through this here is a human readable summary:\n> > thanks a lot for the summary, I really appreciate it as I already lost\n> interest after having read the first sentence.\n> >> (1) Our documentation implies that we check the expiry date of the key\n>> (which is recorded in the allowed signers file) against the date the commit\n>> was signed, but we actually use the committer date which can easily be\n>> faked.\n> > Right. I think there isn't even a proper fix for this as we have no way\n> to establish the actual time the data was signed. I think this is a\n> simple fact in a distributed system, as without coordination there is\n> basically nothing that the contributor can give us that would make us\n> trust the claimed signature time.\n\nIndeed\n\n> You may be able to create upper bounds if there are subsequent signed\n> commits that you trust and that have the untrusted commit as child. But\n> that is not going to be always useful.\n\nYes, on its own checking the signature just tells you that the commit was signed by that key, it does not tell you when it was signed.\n\n>> (2) If the revocation file does not exist we print a warning rather than\n>> failing the operation like the gpg backend does.\n>>\n>> For (1) I'd be happy to see a patch that tightens the wording, but we should\n>> also note that the timestamp in the gpg signature can also be faked.\n> > Yeah, agreed. This mode is only safe if the signing key has never\n> leaked, but once it has leaked you can basically not guarantee anything\n> via \"valid-before\" and \"valid-after\". And documenting that would be a\n> good idea to not give a sense of false trustworthiness.\n> >> For (2) I agree failing seems like the safer option.\n> > Maybe this is another usecase where we can use the \":(optional)\" prefix\n> that we introduced recently for some of the other pathname options? So\n> we'd fail by default, but give the user an escape hatch if they really\n> want one.\n\nOh, I'd not though of that - that's a good idea\n\nThanks\n\nPhillip\n\n\n"},{"id":"555644","messageId":"20261021030347.565306-1-chris@nortesoftware.dev","threadId":"66487","inReplyTo":"ec4de165-c7d1-43d9-979b-08c1cb67022d@gmail.com","subject":"[PATCH] doc: gpg: say which date SSH key lifetimes are checked against","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-10-21T03:03:47Z","receivedAt":"2026-10-21T03:03:47Z","isPatch":true,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"The description of gpg.ssh.allowedSignersFile says that Git marks a\nsignature as valid if the signing key was valid at the time of the\nsignature's creation. An SSH signature does not record when it was\nmade, though. When verifying a commit or a tag, Git passes the\ncommitter or tagger date to ssh-keygen with -Overify-time, so the\nvalid-after and valid-before options of a key are checked against a\ndate that whoever creates the commit or tag can set to any value.\n\nSay which date is used, and that it is not evidence of when the\nsignature was made. The same holds for the creation time in a GPG\nsignature, which comes from the signer's clock, so say that too.\nSince whoever holds the key chooses the date, also say that a key\nlifetime is only safe as long as the key has never leaked.\n\nWhile at it, fix the spelling of \"OpenSSH\" in the same paragraph.\n\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Christian Noé Ramos López <chris@nortesoftware.dev>\n---\n Documentation/config/gpg.adoc | 13 +++++++++----\n 1 file changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config/gpg.adoc b/Documentation/config/gpg.adoc\nindex 240e46c05..714dd1457 100644\n--- a/Documentation/config/gpg.adoc\n+++ b/Documentation/config/gpg.adoc\n@@ -70,10 +70,15 @@ A repository that only allows signed commits can store the file\n in the repository itself using a path relative to the top-level of the working tree.\n This way only committers with an already valid key can add or change keys in the keyring.\n +\n-Since OpensSSH 8.8 this file allows specifying a key lifetime using valid-after &\n-valid-before options. Git will mark signatures as valid if the signing key was\n-valid at the time of the signature's creation. This allows users to change a\n-signing key without invalidating all previously made signatures.\n+Since OpenSSH 8.8 this file allows specifying a key lifetime using valid-after &\n+valid-before options. When verifying a commit or a tag, Git checks that lifetime\n+against the committer or tagger date recorded in the commit or tag. This allows\n+users to change a signing key without invalidating all previously made\n+signatures. That date is chosen by whoever creates the commit or tag, so it is\n+not evidence of when the signature was made; the same is true of the creation\n+time in a GPG signature, which is set by the signer's clock. Relying on a key\n+lifetime is therefore only safe as long as the signing key has never leaked;\n+once it has, valid-after and valid-before guarantee nothing.\n +\n Using a SSH CA key with the cert-authority option\n (see ssh-keygen(1) \"CERTIFICATES\") is also valid.\n\nbase-commit: 47fdf2208c5b94c8cc01c106b8f7c85efb91c926\n-- \n2.47.3\n\n\n"},{"id":"555648","messageId":"20261021041720.572035-1-chris@nortesoftware.dev","threadId":"66487","inReplyTo":"ec4de165-c7d1-43d9-979b-08c1cb67022d@gmail.com","subject":"[PATCH] gpg-interface: fail when the ssh revocation file is missing","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-10-21T04:17:20Z","receivedAt":"2026-10-21T04:17:20Z","isPatch":true,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"When gpg.ssh.revocationFile names a file that does not exist, Git\nwarns and runs ssh-keygen without it, so a signature made with a key\nlisted in the intended revocation file verifies as good. A revocation\nfile that exists but cannot be read already makes ssh-keygen refuse,\nand the signature shows as bad; sshd likewise refuses all public key\nauthentication when its RevokedKeys file is not readable.\n\nFail the verification in the same way when the file is missing, and\nturn the warning into an error so that the reason is shown. Users who\nwant verification to go on without the file when it is absent can\nprefix the path with \":(optional)\", which makes Git treat the variable\nas unset if the file does not exist.\n\nA setup whose configured path is wrong now fails to verify where it\nused to warn; until now its signatures were verified without any\nrevocation check.\n\ngpg.ssh.revocationFile had no tests. Add tests for a revoked key, with\nand without \":(optional)\", and for a missing file, with and without\nthe prefix.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nSigned-off-by: Christian Noé Ramos López <chris@nortesoftware.dev>\n---\nWith or without this patch, a local `:(optional)` value naming a\nmissing file drops a gpg.ssh.revocationFile set in the global config.\nThat is existing `:(optional)` behavior, not introduced here.\n\n Documentation/config/gpg.adoc |  3 +++\n gpg-interface.c               | 15 ++++++---------\n t/t7528-signed-commit-ssh.sh  | 28 ++++++++++++++++++++++++++++\n 3 files changed, 37 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/config/gpg.adoc b/Documentation/config/gpg.adoc\nindex 240e46c05..cce49d53e 100644\n--- a/Documentation/config/gpg.adoc\n+++ b/Documentation/config/gpg.adoc\n@@ -83,3 +83,6 @@ gpg.ssh.revocationFile::\n \tSee ssh-keygen(1) for details.\n \tIf a public key is found in this file then it will always be treated\n \tas having trust level \"never\" and signatures will show as invalid.\n+\tIf the file does not exist, signature verification fails, unless\n+\tthe path is prefixed with `:(optional)` (see the `pathname` type in\n+\tlinkgit:git-config[1]).\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 60c315fba..ddbb29e78 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -533,6 +533,9 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \t\t * we still call check-novalidate to display the signature info\n \t\t */\n \t\tret = -1;\n+\t} else if (ssh_revocation_file && !file_exists(ssh_revocation_file)) {\n+\t\tret = error(_(\"ssh signing revocation file configured but not found: %s\"),\n+\t\t\t    ssh_revocation_file);\n \t} else {\n \t\t/* Check every principal we found (one per line) */\n \t\tconst char *next;\n@@ -576,15 +579,9 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \t\t\t\t     verify_time.buf,\n \t\t\t\t     NULL);\n \n-\t\t\tif (ssh_revocation_file) {\n-\t\t\t\tif (file_exists(ssh_revocation_file)) {\n-\t\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n-\t\t\t\t\t\t     ssh_revocation_file, NULL);\n-\t\t\t\t} else {\n-\t\t\t\t\twarning(_(\"ssh signing revocation file configured but not found: %s\"),\n-\t\t\t\t\t\tssh_revocation_file);\n-\t\t\t\t}\n-\t\t\t}\n+\t\t\tif (ssh_revocation_file)\n+\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n+\t\t\t\t\t     ssh_revocation_file, NULL);\n \n \t\t\tsigchain_push(SIGPIPE, SIG_IGN);\n \t\t\tret = pipe_command(&ssh_keygen, sigc->payload, sigc->payload_len,\ndiff --git a/t/t7528-signed-commit-ssh.sh b/t/t7528-signed-commit-ssh.sh\nindex 991678264..080ebf9db 100755\n--- a/t/t7528-signed-commit-ssh.sh\n+++ b/t/t7528-signed-commit-ssh.sh\n@@ -211,6 +211,34 @@ test_expect_success GPGSSH 'verify-commit exits failure with high minTrustLevel'\n \ttest_must_fail git verify-commit eighth-signed-alt\n '\n \n+test_expect_success GPGSSH 'verify-commit exits failure on revoked signing key' '\n+\ttest_when_finished \"rm -f revoked_keys\" &&\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\tcp \"${GPGSSH_KEY_PRIMARY}.pub\" revoked_keys &&\n+\ttest_config gpg.ssh.revocationFile \"$(pwd)/revoked_keys\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual &&\n+\ttest_config gpg.ssh.revocationFile \":(optional)$(pwd)/revoked_keys\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual\n+'\n+\n+test_expect_success GPGSSH 'verify-commit exits failure on missing revocation file' '\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\ttest_config gpg.ssh.revocationFile \"$(pwd)/no-such-file\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep \"revocation file configured but not found\" actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual\n+'\n+\n+test_expect_success GPGSSH 'verify-commit ignores missing optional revocation file' '\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\ttest_config gpg.ssh.revocationFile \":(optional)$(pwd)/no-such-file\" &&\n+\tgit verify-commit sixth-signed 2>actual &&\n+\ttest_grep \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual &&\n+\ttest_grep ! \"revocation file\" actual\n+'\n+\n test_expect_success GPGSSH 'verify signatures with --raw' '\n \ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n \t(\n\nbase-commit: 47fdf2208c5b94c8cc01c106b8f7c85efb91c926\n-- \n2.47.3\n\n\n"},{"id":"555770","messageId":"xmqqqzhior8t.fsf@gitster.g","threadId":"66487","inReplyTo":"20261021030347.565306-1-chris@nortesoftware.dev","subject":"Re: [PATCH] doc: gpg: say which date SSH key lifetimes are checked against","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-21T18:14:42Z","receivedAt":"2026-10-21T18:14:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Noé Ramos López <chris@nortesoftware.dev> writes:\n\n> -Since OpensSSH 8.8 this file allows specifying a key lifetime using valid-after &\n> -valid-before options. Git will mark signatures as valid if the signing key was\n> -valid at the time of the signature's creation. This allows users to change a\n> -signing key without invalidating all previously made signatures.\n> +Since OpenSSH 8.8 this file allows specifying a key lifetime using valid-after &\n> +valid-before options. When verifying a commit or a tag, Git checks that lifetime\n> +against the committer or tagger date recorded in the commit or tag. This allows\n> +users to change a signing key without invalidating all previously made\n> +signatures. That date is chosen by whoever creates the commit or tag, so it is\n> +not evidence of when the signature was made; the same is true of the creation\n> +time in a GPG signature, which is set by the signer's clock. Relying on a key\n> +lifetime is therefore only safe as long as the signing key has never leaked;\n> +once it has, valid-after and valid-before guarantee nothing.\n\nSaying what we compare against may be valuable, but everything else\nsounds more like an empty fluff to me.  Isn't it self evident that\nvalidity time range is a useless concept unless you cannot tell when\nthe signature was made?  In other words, instead of the long\ndiscussion of how useless the validity checks are, something\nsuccinct like\n\n    Since OpensSSH 8.8 this file allows specifying a key lifetime using\n    valid-after & valid-before options. Git validates the signature by\n    checking the committer or tagger timestamp is within the validity\n    time range.  This allows users to change a signing key without\n    invalidating all previously made signatures.\n\nshould be sufficient, I would have to say.  Or am I missing\nsomething?\n\n"},{"id":"555778","messageId":"xmqqa4o6oq1y.fsf@gitster.g","threadId":"66487","inReplyTo":"20261021041720.572035-1-chris@nortesoftware.dev","subject":"Re: [PATCH] gpg-interface: fail when the ssh revocation file is missing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-21T18:40:25Z","receivedAt":"2026-10-21T18:40:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Noé Ramos López <chris@nortesoftware.dev> writes:\n\n> diff --git a/gpg-interface.c b/gpg-interface.c\n> index 60c315fba..ddbb29e78 100644\n> --- a/gpg-interface.c\n> +++ b/gpg-interface.c\n> @@ -533,6 +533,9 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n>  \t\t * we still call check-novalidate to display the signature info\n>  \t\t */\n>  \t\tret = -1;\n> +\t} else if (ssh_revocation_file && !file_exists(ssh_revocation_file)) {\n> +\t\tret = error(_(\"ssh signing revocation file configured but not found: %s\"),\n> +\t\t\t    ssh_revocation_file);\n>  \t} else {\n>  \t\t/* Check every principal we found (one per line) */\n>  \t\tconst char *next;\n> @@ -576,15 +579,9 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n>  \t\t\t\t     verify_time.buf,\n>  \t\t\t\t     NULL);\n>  \n> -\t\t\tif (ssh_revocation_file) {\n> -\t\t\t\tif (file_exists(ssh_revocation_file)) {\n> -\t\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n> -\t\t\t\t\t\t     ssh_revocation_file, NULL);\n> -\t\t\t\t} else {\n> -\t\t\t\t\twarning(_(\"ssh signing revocation file configured but not found: %s\"),\n> -\t\t\t\t\t\tssh_revocation_file);\n> -\t\t\t\t}\n> -\t\t\t}\n> +\t\t\tif (ssh_revocation_file)\n> +\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n> +\t\t\t\t\t     ssh_revocation_file, NULL);\n>  \n>  \t\t\tsigchain_push(SIGPIPE, SIG_IGN);\n>  \t\t\tret = pipe_command(&ssh_keygen, sigc->payload, sigc->payload_len,\n\nIt is a bit hard to see what really goes on with the default\ncontext, so here is an excerpt from \"git show -W\" output:\n\n> diff --git a/gpg-interface.c b/gpg-interface.c\n> index 95abf1ef4e..904165a892 100644\n> --- a/gpg-interface.c\n> +++ b/gpg-interface.c\n> @@ -461,164 +461,161 @@ static void parse_ssh_output(struct signature_check *sigc)\n> ...\n>  \t/* Find the principal from the signers */\n>  \tstrvec_pushl(&ssh_keygen.args, fmt->program,\n>  \t\t     \"-Y\", \"find-principals\",\n>  \t\t     \"-f\", ssh_allowed_signers,\n>  \t\t     \"-s\", buffer_file->filename.buf,\n>  \t\t     verify_time.buf,\n>  \t\t     NULL);\n>  \tret = pipe_command(&ssh_keygen, NULL, 0, &ssh_principals_out, 0,\n>  \t\t\t   &ssh_principals_err, 0);\n>  \tif (ret && strstr(ssh_principals_err.buf, \"usage:\")) {\n>  \t\terror(_(\"ssh-keygen -Y find-principals/verify is needed for ssh signature verification (available in openssh version 8.2p1+)\"));\n>  \t\tgoto out;\n>  \t}\n\nWe asked \"-Y find-principals\" with allowed_signers file.  There are\na few cases.\n\n>  \tif (ret || !ssh_principals_out.len) {\n>  \t\t/*\n>  \t\t * We did not find a matching principal in the allowedSigners\n>  \t\t * Check without validation\n>  \t\t */\n>  \t\tchild_process_init(&ssh_keygen);\n>  \t\tstrvec_pushl(&ssh_keygen.args, fmt->program,\n>  \t\t\t     \"-Y\", \"check-novalidate\",\n>  \t\t\t     \"-n\", \"git\",\n>  \t\t\t     \"-s\", buffer_file->filename.buf,\n>  \t\t\t     verify_time.buf,\n>  \t\t\t     NULL);\n>  \t\tpipe_command(&ssh_keygen, sigc->payload, sigc->payload_len,\n>  \t\t\t\t   &ssh_keygen_out, 0, &ssh_keygen_err, 0);\n>  \n>  \t\t/*\n>  \t\t * Fail on unknown keys\n>  \t\t * we still call check-novalidate to display the signature info\n>  \t\t */\n>  \t\tret = -1;\n\nIf we find that the signature is done with an unknown key, we run\nanother ssh-keygen with check-validate to show the signature info.\n\nBy the way, it is not a problem this patch introduces, but the\ncomment at the end of this block is a bit misleading.  I first\nthought another check-novalidate invocation will happen later in the\nfunction but \"we still call\" refers to the invocation of ssh-keygen\nwe just made before the comment.\n\n> +\t} else if (ssh_revocation_file && !file_exists(ssh_revocation_file)) {\n> +\t\tret = error(_(\"ssh signing revocation file configured but not found: %s\"),\n> +\t\t\t    ssh_revocation_file);\n\nInserting the missing revocation file check here means we do not\neven give signature information for known keys from this \"else if\"\nblock that we would have given for unknown keys in the \"if\" block,\nwhich is not quite satisfactory.\n\nI wonder if we should be able to somehow fold this into the earlier\n\"if()\" block, making it the single place that deals with failures?\n\n>  \t} else {\n>  \t\t/* Check every principal we found (one per line) */\n>  \t\tconst char *next;\n>  \t\tfor (line = ssh_principals_out.buf;\n>  \t\t     *line;\n>  \t\t     line = next) {\n>  \t\t\tconst char *end_of_text;\n\nAnd everything we do when we recognise the signing key does not\nchange, except that ...\n\n>  \t\t\t/*\n>  \t\t\t * We found principals\n>  \t\t\t * Try with each until we find a match\n>  \t\t\t */\n>  \t\t\tstrvec_pushl(&ssh_keygen.args, \"-Y\", \"verify\",\n>  \t\t\t\t     \"-n\", \"git\",\n>  \t\t\t\t     \"-f\", ssh_allowed_signers,\n>  \t\t\t\t     \"-I\", principal,\n>  \t\t\t\t     \"-s\", buffer_file->filename.buf,\n>  \t\t\t\t     verify_time.buf,\n>  \t\t\t\t     NULL);\n>  \n> -\t\t\tif (ssh_revocation_file) {\n> -\t\t\t\tif (file_exists(ssh_revocation_file)) {\n> -\t\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n> -\t\t\t\t\t\t     ssh_revocation_file, NULL);\n> -\t\t\t\t} else {\n> -\t\t\t\t\twarning(_(\"ssh signing revocation file configured but not found: %s\"),\n> -\t\t\t\t\t\tssh_revocation_file);\n> -\t\t\t\t}\n> -\t\t\t}\n> +\t\t\tif (ssh_revocation_file)\n> +\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n> +\t\t\t\t\t     ssh_revocation_file, NULL);\n\n... we no longer need to see if the file is missing, which makes sense.\n\n"},{"id":"555817","messageId":"20261022054453.761650-1-chris@nortesoftware.dev","threadId":"66487","inReplyTo":"xmqqqzhior8t.fsf@gitster.g","subject":"[PATCH v2] doc: gpg: say which date SSH key lifetimes are checked against","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-10-22T05:44:53Z","receivedAt":"2026-10-22T05:44:53Z","isPatch":true,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"The description of gpg.ssh.allowedSignersFile says that Git marks a\nsignature as valid if the signing key was valid at the time of the\nsignature's creation. An SSH signature does not record when it was\nmade, though. When verifying a commit or a tag, Git passes the\ncommitter or tagger date to ssh-keygen with -Overify-time, and the\nvalid-after and valid-before options of a key are checked against\nthat date.\n\nSay which date is used. While at it, fix the spelling of \"OpenSSH\"\nin the same paragraph.\n\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Christian Noé Ramos López <chris@nortesoftware.dev>\n---\nChanges since v1: Junio's wording, with \"OpenSSH\" spelled right. That\ndrops two sentences asked for in the thread, the one on the time in a\nGPG signature (Phillip) and the one on leaked keys (Patrick); say if\nyou want either back.\n\n Documentation/config/gpg.adoc | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config/gpg.adoc b/Documentation/config/gpg.adoc\nindex 240e46c05..f5bb3cbf3 100644\n--- a/Documentation/config/gpg.adoc\n+++ b/Documentation/config/gpg.adoc\n@@ -70,9 +70,9 @@ A repository that only allows signed commits can store the file\n in the repository itself using a path relative to the top-level of the working tree.\n This way only committers with an already valid key can add or change keys in the keyring.\n +\n-Since OpensSSH 8.8 this file allows specifying a key lifetime using valid-after &\n-valid-before options. Git will mark signatures as valid if the signing key was\n-valid at the time of the signature's creation. This allows users to change a\n+Since OpenSSH 8.8 this file allows specifying a key lifetime using valid-after &\n+valid-before options. Git validates the signature by checking the committer or\n+tagger timestamp is within the validity time range. This allows users to change a\n signing key without invalidating all previously made signatures.\n +\n Using a SSH CA key with the cert-authority option\n\nbase-commit: 47fdf2208c5b94c8cc01c106b8f7c85efb91c926\n-- \n2.47.3\n\n\n"},{"id":"555818","messageId":"20261022054607.766255-1-chris@nortesoftware.dev","threadId":"66487","inReplyTo":"xmqqa4o6oq1y.fsf@gitster.g","subject":"[PATCH v2] gpg-interface: fail when the ssh revocation file is missing","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-10-22T05:46:07Z","receivedAt":"2026-10-22T05:46:07Z","isPatch":true,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"When gpg.ssh.revocationFile names a file that does not exist, Git\nwarns and runs ssh-keygen without it, so a signature made with a key\nlisted in the intended revocation file verifies as good. A revocation\nfile that exists but cannot be read already makes ssh-keygen refuse,\nand the signature shows as bad; sshd likewise refuses all public key\nauthentication when its RevokedKeys file is not readable.\n\nFail the verification when the file is missing too, and turn the\nwarning into an error so that the reason is shown. Do it in the block\nthat already fails a key that is not in the allowed signers file, so\nthat a key that is in it still gets its signature info shown, and %G?\ngives \"U\" for both. While at it, reword the comment in that block,\nwhich read as if check-novalidate were to be called again later.\n\nUsers who want verification to go on without the file when it is\nabsent can prefix the path with \":(optional)\", which makes Git treat\nthe variable as unset if the file does not exist.\n\nA setup whose configured path is wrong now fails to verify where it\nused to warn; until now its signatures were verified without any\nrevocation check.\n\ngpg.ssh.revocationFile had no tests. Add tests for a revoked key, with\nand without \":(optional)\", and for a missing file, with and without\nthe prefix.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Christian Noé Ramos López <chris@nortesoftware.dev>\n---\nChanges since v1: the missing-file check moves into the block that\nfails an unknown key, and that block's comment is reworded. With the\nfile missing, a known key now gets the error and then its signature\ninfo, and %G? gives U instead of v1's B; an unknown key now gets the\nerror too. The missing-file test checks that the signature info is\nshown.\n\nWith or without this patch, a local `:(optional)` value naming a\nmissing file drops a gpg.ssh.revocationFile set in the global config.\nThat is existing `:(optional)` behavior, not introduced here.\n\n Documentation/config/gpg.adoc |  3 +++\n gpg-interface.c               | 30 +++++++++++++-----------------\n t/t7528-signed-commit-ssh.sh  | 29 +++++++++++++++++++++++++++++\n 3 files changed, 45 insertions(+), 17 deletions(-)\n\ndiff --git a/Documentation/config/gpg.adoc b/Documentation/config/gpg.adoc\nindex 240e46c05..cce49d53e 100644\n--- a/Documentation/config/gpg.adoc\n+++ b/Documentation/config/gpg.adoc\n@@ -83,3 +83,6 @@ gpg.ssh.revocationFile::\n \tSee ssh-keygen(1) for details.\n \tIf a public key is found in this file then it will always be treated\n \tas having trust level \"never\" and signatures will show as invalid.\n+\tIf the file does not exist, signature verification fails, unless\n+\tthe path is prefixed with `:(optional)` (see the `pathname` type in\n+\tlinkgit:git-config[1]).\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 60c315fba..f36ba8dd0 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -466,6 +466,7 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \tstruct child_process ssh_keygen = CHILD_PROCESS_INIT;\n \tstruct tempfile *buffer_file;\n \tint ret = -1;\n+\tint revocation_file_missing;\n \tconst char *line;\n \tchar *principal;\n \tstruct strbuf ssh_principals_out = STRBUF_INIT;\n@@ -513,11 +514,17 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \t\terror(_(\"ssh-keygen -Y find-principals/verify is needed for ssh signature verification (available in openssh version 8.2p1+)\"));\n \t\tgoto out;\n \t}\n-\tif (ret || !ssh_principals_out.len) {\n+\trevocation_file_missing = ssh_revocation_file &&\n+\t\t\t\t  !file_exists(ssh_revocation_file);\n+\tif (ret || !ssh_principals_out.len || revocation_file_missing) {\n \t\t/*\n-\t\t * We did not find a matching principal in the allowedSigners\n-\t\t * Check without validation\n+\t\t * We did not find a matching principal in the allowedSigners,\n+\t\t * or the revocation file is missing. Either way we fail, and\n+\t\t * check without validation only to display the signature info.\n \t\t */\n+\t\tif (revocation_file_missing)\n+\t\t\terror(_(\"ssh signing revocation file configured but not found: %s\"),\n+\t\t\t      ssh_revocation_file);\n \t\tchild_process_init(&ssh_keygen);\n \t\tstrvec_pushl(&ssh_keygen.args, fmt->program,\n \t\t\t     \"-Y\", \"check-novalidate\",\n@@ -527,11 +534,6 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \t\t\t     NULL);\n \t\tpipe_command(&ssh_keygen, sigc->payload, sigc->payload_len,\n \t\t\t\t   &ssh_keygen_out, 0, &ssh_keygen_err, 0);\n-\n-\t\t/*\n-\t\t * Fail on unknown keys\n-\t\t * we still call check-novalidate to display the signature info\n-\t\t */\n \t\tret = -1;\n \t} else {\n \t\t/* Check every principal we found (one per line) */\n@@ -576,15 +578,9 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \t\t\t\t     verify_time.buf,\n \t\t\t\t     NULL);\n \n-\t\t\tif (ssh_revocation_file) {\n-\t\t\t\tif (file_exists(ssh_revocation_file)) {\n-\t\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n-\t\t\t\t\t\t     ssh_revocation_file, NULL);\n-\t\t\t\t} else {\n-\t\t\t\t\twarning(_(\"ssh signing revocation file configured but not found: %s\"),\n-\t\t\t\t\t\tssh_revocation_file);\n-\t\t\t\t}\n-\t\t\t}\n+\t\t\tif (ssh_revocation_file)\n+\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n+\t\t\t\t\t     ssh_revocation_file, NULL);\n \n \t\t\tsigchain_push(SIGPIPE, SIG_IGN);\n \t\t\tret = pipe_command(&ssh_keygen, sigc->payload, sigc->payload_len,\ndiff --git a/t/t7528-signed-commit-ssh.sh b/t/t7528-signed-commit-ssh.sh\nindex 991678264..d67f9b489 100755\n--- a/t/t7528-signed-commit-ssh.sh\n+++ b/t/t7528-signed-commit-ssh.sh\n@@ -211,6 +211,35 @@ test_expect_success GPGSSH 'verify-commit exits failure with high minTrustLevel'\n \ttest_must_fail git verify-commit eighth-signed-alt\n '\n \n+test_expect_success GPGSSH 'verify-commit exits failure on revoked signing key' '\n+\ttest_when_finished \"rm -f revoked_keys\" &&\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\tcp \"${GPGSSH_KEY_PRIMARY}.pub\" revoked_keys &&\n+\ttest_config gpg.ssh.revocationFile \"$(pwd)/revoked_keys\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual &&\n+\ttest_config gpg.ssh.revocationFile \":(optional)$(pwd)/revoked_keys\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual\n+'\n+\n+test_expect_success GPGSSH 'verify-commit exits failure on missing revocation file' '\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\ttest_config gpg.ssh.revocationFile \"$(pwd)/no-such-file\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep \"revocation file configured but not found\" actual &&\n+\ttest_grep \"${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}\" actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual\n+'\n+\n+test_expect_success GPGSSH 'verify-commit ignores missing optional revocation file' '\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\ttest_config gpg.ssh.revocationFile \":(optional)$(pwd)/no-such-file\" &&\n+\tgit verify-commit sixth-signed 2>actual &&\n+\ttest_grep \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual &&\n+\ttest_grep ! \"revocation file\" actual\n+'\n+\n test_expect_success GPGSSH 'verify signatures with --raw' '\n \ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n \t(\n\nbase-commit: 47fdf2208c5b94c8cc01c106b8f7c85efb91c926\n-- \n2.47.3\n\n\n"},{"id":"555822","messageId":"atmsSIJrFhA0t1rH@pks.im","threadId":"66487","inReplyTo":"xmqqqzhior8t.fsf@gitster.g","subject":"Re: [PATCH] doc: gpg: say which date SSH key lifetimes are checked against","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-10-22T06:25:12Z","receivedAt":"2026-10-22T06:25:12Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Oct 21, 2026 at 11:14:42AM -0700, Junio C Hamano wrote:\n> Christian Noé Ramos López <chris@nortesoftware.dev> writes:\n> \n> > -Since OpensSSH 8.8 this file allows specifying a key lifetime using valid-after &\n> > -valid-before options. Git will mark signatures as valid if the signing key was\n> > -valid at the time of the signature's creation. This allows users to change a\n> > -signing key without invalidating all previously made signatures.\n> > +Since OpenSSH 8.8 this file allows specifying a key lifetime using valid-after &\n> > +valid-before options. When verifying a commit or a tag, Git checks that lifetime\n> > +against the committer or tagger date recorded in the commit or tag. This allows\n> > +users to change a signing key without invalidating all previously made\n> > +signatures. That date is chosen by whoever creates the commit or tag, so it is\n> > +not evidence of when the signature was made; the same is true of the creation\n> > +time in a GPG signature, which is set by the signer's clock. Relying on a key\n> > +lifetime is therefore only safe as long as the signing key has never leaked;\n> > +once it has, valid-after and valid-before guarantee nothing.\n> \n> Saying what we compare against may be valuable, but everything else\n> sounds more like an empty fluff to me.  Isn't it self evident that\n> validity time range is a useless concept unless you cannot tell when\n> the signature was made?  In other words, instead of the long\n> discussion of how useless the validity checks are, something\n> succinct like\n> \n>     Since OpensSSH 8.8 this file allows specifying a key lifetime using\n>     valid-after & valid-before options. Git validates the signature by\n>     checking the committer or tagger timestamp is within the validity\n>     time range.  This allows users to change a signing key without\n>     invalidating all previously made signatures.\n> \n> should be sufficient, I would have to say.  Or am I missing\n> something?\n\nI think explicitly pointing out that the timestamp is under control by\nthe signer would be useful context though. It's implicit to us, but it\nmay not be implicit to everyone else. So maybe something like this?\n\n     Since OpensSSH 8.8 this file allows specifying a key lifetime using\n     valid-after & valid-before options. Git validates the signature by\n     checking the committer or tagger timestamp is within the validity\n     time range.  This does not provide any security guarantees as the\n     timestamp can be chosen arbitrarily by the signer.  But it allows\n     users to change a signing key without invalidating all previously\n     made signatures.\n\nPatrick\n\n"},{"id":"555875","messageId":"xmqqh5idiv9k.fsf@gitster.g","threadId":"66487","inReplyTo":"20261022054607.766255-1-chris@nortesoftware.dev","subject":"Re: [PATCH v2] gpg-interface: fail when the ssh revocation file is missing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-22T15:56:39Z","receivedAt":"2026-10-22T15:56:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Noé Ramos López <chris@nortesoftware.dev> writes:\n\n> When gpg.ssh.revocationFile names a file that does not exist, Git\n> warns and runs ssh-keygen without it, so a signature made with a key\n> listed in the intended revocation file verifies as good. A revocation\n> ...\n> gpg.ssh.revocationFile had no tests. Add tests for a revoked key, with\n> and without \":(optional)\", and for a missing file, with and without\n> the prefix.\n>\n> Suggested-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Christian Noé Ramos López <chris@nortesoftware.dev>\n> ---\n\nCan you stick to the expected flow: (1) send v1 (2) get review\ncomments on v1 (3) respond to these review messages and then (4)\nsend v2 AS A DIRECT REPLY TO v1?\n\nSending the reroll as a response to v1 is important for automation\non the receiving end.  Thanks.\n\n"},{"id":"555880","messageId":"xmqq1p9hiszk.fsf@gitster.g","threadId":"66487","inReplyTo":"atmsSIJrFhA0t1rH@pks.im","subject":"Re: [PATCH] doc: gpg: say which date SSH key lifetimes are checked against","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-22T16:45:51Z","receivedAt":"2026-10-22T16:45:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> I think explicitly pointing out that the timestamp is under control by\n> the signer would be useful context though. It's implicit to us, but it\n> may not be implicit to everyone else. So maybe something like this?\n>\n>      Since OpensSSH 8.8 this file allows specifying a key lifetime using\n>      valid-after & valid-before options. Git validates the signature by\n>      checking the committer or tagger timestamp is within the validity\n>      time range.  This does not provide any security guarantees as the\n>      timestamp can be chosen arbitrarily by the signer.  But it allows\n>      users to change a signing key without invalidating all previously\n>      made signatures.\n\nSounds sensible.  Thanks.\n\n"},{"id":"556852","messageId":"CAHGSfbYbP=sQEG4JGFx7CPHL1+tdYQjkXz1jKsevTZA_G5wGvA@mail.gmail.com","threadId":"66487","inReplyTo":"xmqq1p9hiszk.fsf@gitster.g","subject":"Re: [PATCH] doc: gpg: say which date SSH key lifetimes are checked against","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-10-30T06:12:41Z","receivedAt":"2026-10-30T06:12:41Z","isPatch":true,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"> Can you stick to the expected flow: (1) send v1 (2) get review\n> comments on v1 (3) respond to these review messages and then (4)\n> send v2 AS A DIRECT REPLY TO v1?\n\nYes, will do. Sorry about that.\n\nAlso, in What's cooking (Oct #09), the description of\ncr/ssh-revocation-file-fail-closed seems to start with a sentence from\ncr/doc-gpg-ssh-key-lifetime.\n\n\nEl jue, 22 oct 2026 a la(s) 10:45 a.m., Junio C Hamano\n(gitster@pobox.com) escribió:\n>\n> Patrick Steinhardt <ps@pks.im> writes:\n>\n> > I think explicitly pointing out that the timestamp is under control by\n> > the signer would be useful context though. It's implicit to us, but it\n> > may not be implicit to everyone else. So maybe something like this?\n> >\n> >      Since OpensSSH 8.8 this file allows specifying a key lifetime using\n> >      valid-after & valid-before options. Git validates the signature by\n> >      checking the committer or tagger timestamp is within the validity\n> >      time range.  This does not provide any security guarantees as the\n> >      timestamp can be chosen arbitrarily by the signer.  But it allows\n> >      users to change a signing key without invalidating all previously\n> >      made signatures.\n>\n> Sounds sensible.  Thanks.\n\n\n\n-- \nChristian Ramos\nDirector general · Norte Software\nchris@nortesoftware.dev\n +52 9671456444\nnortesoftware.dev\n\n"},{"id":"556853","messageId":"20261030061528.27901-1-chris@nortesoftware.dev","threadId":"66487","inReplyTo":"20261021030347.565306-1-chris@nortesoftware.dev","subject":"[PATCH v3] doc: gpg: say which date SSH key lifetimes are checked against","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-10-30T06:15:28Z","receivedAt":"2026-10-30T06:15:28Z","isPatch":true,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"The description of gpg.ssh.allowedSignersFile says that Git marks a\nsignature as valid if the signing key was valid at the time of the\nsignature's creation. An SSH signature does not record when it was\nmade, though. When verifying a commit or a tag, Git passes the\ncommitter or tagger date to ssh-keygen with -Overify-time, and the\nvalid-after and valid-before options of a key are checked against\nthat date.\n\nSay which date is used, and that the signer chooses it. While at it,\nfix the spelling of \"OpenSSH\" in the same paragraph.\n\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nHelped-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Christian Noé Ramos López <chris@nortesoftware.dev>\n---\nChanges since v2: Patrick's wording, which also says that the signer\nchooses the timestamp.\n\n Documentation/config/gpg.adoc | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config/gpg.adoc b/Documentation/config/gpg.adoc\nindex 240e46c05..d3713e960 100644\n--- a/Documentation/config/gpg.adoc\n+++ b/Documentation/config/gpg.adoc\n@@ -70,10 +70,12 @@ A repository that only allows signed commits can store the file\n in the repository itself using a path relative to the top-level of the working tree.\n This way only committers with an already valid key can add or change keys in the keyring.\n +\n-Since OpensSSH 8.8 this file allows specifying a key lifetime using valid-after &\n-valid-before options. Git will mark signatures as valid if the signing key was\n-valid at the time of the signature's creation. This allows users to change a\n-signing key without invalidating all previously made signatures.\n+Since OpenSSH 8.8 this file allows specifying a key lifetime using valid-after &\n+valid-before options. Git validates the signature by checking the committer or\n+tagger timestamp is within the validity time range. This does not provide any\n+security guarantees as the timestamp can be chosen arbitrarily by the signer.\n+But it allows users to change a signing key without invalidating all previously\n+made signatures.\n +\n Using a SSH CA key with the cert-authority option\n (see ssh-keygen(1) \"CERTIFICATES\") is also valid.\n\nbase-commit: 47fdf2208c5b94c8cc01c106b8f7c85efb91c926\n-- \n2.47.3\n\n\n"},{"id":"556859","messageId":"auRJ5U_yYZ3c3rZG@pks.im","threadId":"66487","inReplyTo":"20261030061528.27901-1-chris@nortesoftware.dev","subject":"Re: [PATCH v3] doc: gpg: say which date SSH key lifetimes are checked against","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-10-30T07:40:21Z","receivedAt":"2026-10-30T07:40:21Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Oct 30, 2026 at 02:15:28AM -0400, Christian Noé Ramos López wrote:\n> Changes since v2: Patrick's wording, which also says that the signer\n> chooses the timestamp.\n\nThanks, this version looks good to me.\n\nPatrick\n\n"},{"id":"558435","messageId":"20261113232552.1325109-1-chris@nortesoftware.dev","threadId":"66487","inReplyTo":"xmqqa4o6oq1y.fsf@gitster.g","subject":"Re: [PATCH] gpg-interface: fail when the ssh revocation file is missing","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-11-13T23:25:09Z","receivedAt":"2026-11-13T23:25:09Z","isPatch":true,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> By the way, it is not a problem this patch introduces, but the\n> comment at the end of this block is a bit misleading.\n\nAgreed. v3 replaces it with one comment at the top of the block,\nwhich says check-novalidate runs there only to display the signature\ninfo.\n\n> I wonder if we should be able to somehow fold this into the earlier\n> \"if()\" block, making it the single place that deals with failures?\n\nYes, that is better, and v3 does it: with the file missing, a known\nkey gets the error and then its signature info, as an unknown key\ndoes, and %G? gives \"U\" for both.\n\nv2 went out as a reply to this message instead of to v1; v3 will be\na reply to v1.\n\n"},{"id":"558436","messageId":"20261113232827.1325175-1-chris@nortesoftware.dev","threadId":"66487","inReplyTo":"20261021041720.572035-1-chris@nortesoftware.dev","subject":"[PATCH v3] gpg-interface: fail when the ssh revocation file is missing","fromName":"Christian Noé Ramos López","fromEmail":"chris@nortesoftware.dev","sentAt":"2026-11-13T23:28:24Z","receivedAt":"2026-11-13T23:28:24Z","isPatch":true,"sender":{"key":"chris@nortesoftware.dev","avatar":null},"body":"When gpg.ssh.revocationFile names a file that does not exist, Git\nwarns and runs ssh-keygen without it, so a signature made with a key\nlisted in the intended revocation file verifies as good. A revocation\nfile that exists but cannot be read already makes ssh-keygen refuse,\nand the signature shows as bad; sshd likewise refuses all public key\nauthentication when its RevokedKeys file is not readable.\n\nFail the verification when the file is missing too, and turn the\nwarning into an error so that the reason is shown. Do it in the block\nthat already fails a key that is not in the allowed signers file, so\nthat a key that is in it still gets its signature info shown, and %G?\ngives \"U\" for both. While at it, reword the comment in that block,\nwhich read as if check-novalidate were to be called again later.\n\nUsers who want verification to go on without the file when it is\nabsent can prefix the path with \":(optional)\", which makes Git treat\nthe variable as unset if the file does not exist.\n\nA setup whose configured path is wrong now fails to verify where it\nused to warn; until now its signatures were verified without any\nrevocation check.\n\ngpg.ssh.revocationFile had no tests. Add tests for a revoked key, with\nand without \":(optional)\", and for a missing file, with and without\nthe prefix.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Christian Noé Ramos López <chris@nortesoftware.dev>\n---\nChanges since v2: none in the code, the tests or the documentation;\nv2 applies to the current master unchanged.\n\nWith or without this patch, a local `:(optional)` value naming a\nmissing file drops a gpg.ssh.revocationFile set in the global config.\nThat is existing `:(optional)` behavior, not introduced here.\n\n Documentation/config/gpg.adoc |  3 +++\n gpg-interface.c               | 30 +++++++++++++-----------------\n t/t7528-signed-commit-ssh.sh  | 29 +++++++++++++++++++++++++++++\n 3 files changed, 45 insertions(+), 17 deletions(-)\n\ndiff --git a/Documentation/config/gpg.adoc b/Documentation/config/gpg.adoc\nindex 240e46c05..cce49d53e 100644\n--- a/Documentation/config/gpg.adoc\n+++ b/Documentation/config/gpg.adoc\n@@ -83,3 +83,6 @@ gpg.ssh.revocationFile::\n \tSee ssh-keygen(1) for details.\n \tIf a public key is found in this file then it will always be treated\n \tas having trust level \"never\" and signatures will show as invalid.\n+\tIf the file does not exist, signature verification fails, unless\n+\tthe path is prefixed with `:(optional)` (see the `pathname` type in\n+\tlinkgit:git-config[1]).\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 60c315fba..f36ba8dd0 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -466,6 +466,7 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \tstruct child_process ssh_keygen = CHILD_PROCESS_INIT;\n \tstruct tempfile *buffer_file;\n \tint ret = -1;\n+\tint revocation_file_missing;\n \tconst char *line;\n \tchar *principal;\n \tstruct strbuf ssh_principals_out = STRBUF_INIT;\n@@ -513,11 +514,17 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \t\terror(_(\"ssh-keygen -Y find-principals/verify is needed for ssh signature verification (available in openssh version 8.2p1+)\"));\n \t\tgoto out;\n \t}\n-\tif (ret || !ssh_principals_out.len) {\n+\trevocation_file_missing = ssh_revocation_file &&\n+\t\t\t\t  !file_exists(ssh_revocation_file);\n+\tif (ret || !ssh_principals_out.len || revocation_file_missing) {\n \t\t/*\n-\t\t * We did not find a matching principal in the allowedSigners\n-\t\t * Check without validation\n+\t\t * We did not find a matching principal in the allowedSigners,\n+\t\t * or the revocation file is missing. Either way we fail, and\n+\t\t * check without validation only to display the signature info.\n \t\t */\n+\t\tif (revocation_file_missing)\n+\t\t\terror(_(\"ssh signing revocation file configured but not found: %s\"),\n+\t\t\t      ssh_revocation_file);\n \t\tchild_process_init(&ssh_keygen);\n \t\tstrvec_pushl(&ssh_keygen.args, fmt->program,\n \t\t\t     \"-Y\", \"check-novalidate\",\n@@ -527,11 +534,6 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \t\t\t     NULL);\n \t\tpipe_command(&ssh_keygen, sigc->payload, sigc->payload_len,\n \t\t\t\t   &ssh_keygen_out, 0, &ssh_keygen_err, 0);\n-\n-\t\t/*\n-\t\t * Fail on unknown keys\n-\t\t * we still call check-novalidate to display the signature info\n-\t\t */\n \t\tret = -1;\n \t} else {\n \t\t/* Check every principal we found (one per line) */\n@@ -576,15 +578,9 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,\n \t\t\t\t     verify_time.buf,\n \t\t\t\t     NULL);\n \n-\t\t\tif (ssh_revocation_file) {\n-\t\t\t\tif (file_exists(ssh_revocation_file)) {\n-\t\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n-\t\t\t\t\t\t     ssh_revocation_file, NULL);\n-\t\t\t\t} else {\n-\t\t\t\t\twarning(_(\"ssh signing revocation file configured but not found: %s\"),\n-\t\t\t\t\t\tssh_revocation_file);\n-\t\t\t\t}\n-\t\t\t}\n+\t\t\tif (ssh_revocation_file)\n+\t\t\t\tstrvec_pushl(&ssh_keygen.args, \"-r\",\n+\t\t\t\t\t     ssh_revocation_file, NULL);\n \n \t\t\tsigchain_push(SIGPIPE, SIG_IGN);\n \t\t\tret = pipe_command(&ssh_keygen, sigc->payload, sigc->payload_len,\ndiff --git a/t/t7528-signed-commit-ssh.sh b/t/t7528-signed-commit-ssh.sh\nindex 991678264..d67f9b489 100755\n--- a/t/t7528-signed-commit-ssh.sh\n+++ b/t/t7528-signed-commit-ssh.sh\n@@ -211,6 +211,35 @@ test_expect_success GPGSSH 'verify-commit exits failure with high minTrustLevel'\n \ttest_must_fail git verify-commit eighth-signed-alt\n '\n \n+test_expect_success GPGSSH 'verify-commit exits failure on revoked signing key' '\n+\ttest_when_finished \"rm -f revoked_keys\" &&\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\tcp \"${GPGSSH_KEY_PRIMARY}.pub\" revoked_keys &&\n+\ttest_config gpg.ssh.revocationFile \"$(pwd)/revoked_keys\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual &&\n+\ttest_config gpg.ssh.revocationFile \":(optional)$(pwd)/revoked_keys\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual\n+'\n+\n+test_expect_success GPGSSH 'verify-commit exits failure on missing revocation file' '\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\ttest_config gpg.ssh.revocationFile \"$(pwd)/no-such-file\" &&\n+\ttest_must_fail git verify-commit sixth-signed 2>actual &&\n+\ttest_grep \"revocation file configured but not found\" actual &&\n+\ttest_grep \"${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}\" actual &&\n+\ttest_grep ! \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual\n+'\n+\n+test_expect_success GPGSSH 'verify-commit ignores missing optional revocation file' '\n+\ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n+\ttest_config gpg.ssh.revocationFile \":(optional)$(pwd)/no-such-file\" &&\n+\tgit verify-commit sixth-signed 2>actual &&\n+\ttest_grep \"${GPGSSH_GOOD_SIGNATURE_TRUSTED}\" actual &&\n+\ttest_grep ! \"revocation file\" actual\n+'\n+\n test_expect_success GPGSSH 'verify signatures with --raw' '\n \ttest_config gpg.ssh.allowedSignersFile \"${GPGSSH_ALLOWED_SIGNERS}\" &&\n \t(\n\nbase-commit: ebdc087dc99d68bb340c282b2ba5f722def28d19\n-- \n2.47.3\n\n\n"}]}