<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/gpg-interface.c, branch v2.34.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.34.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.34.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-11-03T20:32:28Z</updated>
<entry>
<title>Merge branch 'jx/message-fixes'</title>
<updated>2021-11-03T20:32:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-11-03T20:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2a33ef9e280def6f593b6dc7b9d07421c35b3db'/>
<id>urn:sha1:e2a33ef9e280def6f593b6dc7b9d07421c35b3db</id>
<content type='text'>
Fixes to recently added messages.

* jx/message-fixes:
  i18n: fix typos found during l10n for git 2.34.0
</content>
</entry>
<entry>
<title>gpg-interface: avoid buffer overrun in parse_ssh_output()</title>
<updated>2021-11-02T00:00:41Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-10-30T17:07:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65db97b4fa6b03059f2f14f313e07ca799d4ef3f'/>
<id>urn:sha1:65db97b4fa6b03059f2f14f313e07ca799d4ef3f</id>
<content type='text'>
If the string "key" we found in the output of ssh-keygen happens to be
located at the very end of the line, then going four characters further
leaves us beyond the end of the string.  Explicitly search for the
space after "key" to handle a missing one gracefully.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Acked-by: Fabian Stelzer &lt;fs@gigacodes.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: handle missing " with " gracefully in parse_ssh_output()</title>
<updated>2021-11-02T00:00:41Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-10-30T17:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18b18503e3b3721e0a513cbc83971a960e944c19'/>
<id>urn:sha1:18b18503e3b3721e0a513cbc83971a960e944c19</id>
<content type='text'>
If the output of ssh-keygen starts with "Good \"git\" signature for ",
but is not followed by " with " for some reason, then parse_ssh_output()
uses -1 as the len parameter of xmemdupz(), which in turn will end the
program.  Reject the signature and carry on instead in that case.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Acked-by: Fabian Stelzer &lt;fs@gigacodes.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: fix typos found during l10n for git 2.34.0</title>
<updated>2021-11-01T05:49:49Z</updated>
<author>
<name>Jiang Xin</name>
<email>worldhello.net@gmail.com</email>
</author>
<published>2021-11-01T02:14:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f73371931686f16c2b5df49cb6a4b16c5fdfe79c'/>
<id>urn:sha1:f73371931686f16c2b5df49cb6a4b16c5fdfe79c</id>
<content type='text'>
Emir and Jean-Noël reported typos in some i18n messages when preparing
l10n for git 2.34.0.

* Fix unstable spelling of config variable "gpg.ssh.defaultKeyCommand"
  which was introduced in commit fd9e226776 (ssh signing: retrieve a
  default key from ssh-agent, 2021-09-10).

* Add missing space between "with" and "--python" which was introduced
  in commit bd0708c7eb (ref-filter: add %(raw) atom, 2021-07-26).

* Fix unmatched single quote in 'builtin/index-pack.c' which was
  introduced in commit 8737dab346 (index-pack: refactor renaming in
  final(), 2021-09-09)

[1] https://github.com/git-l10n/git-po/pull/567

Reported-by: Emir Sarı &lt;bitigchi@me.com&gt;
Reported-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Jiang Xin &lt;worldhello.net@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: fix leak of strbufs in get_ssh_key_fingerprint()</title>
<updated>2021-10-18T20:16:53Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-10-18T17:15:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3af71c947cdf2e5acd16cacf50586b829a68f6e'/>
<id>urn:sha1:f3af71c947cdf2e5acd16cacf50586b829a68f6e</id>
<content type='text'>
We read stdout from gpg into a strbuf, then split it into a list of
strbufs, pull out one element, and return it. But we don't free either
the original stdout buffer, nor the list returned from strbuf_split().

This patch fixes both. Note that we have to detach the returned string
from its strbuf before calling strbuf_list_free(), as that would
otherwise throw it away.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: fix leak of "line" in parse_ssh_output()</title>
<updated>2021-10-18T20:16:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-10-18T17:15:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78d468f1a9c7bf9d1724840ff322b9144061b308'/>
<id>urn:sha1:78d468f1a9c7bf9d1724840ff322b9144061b308</id>
<content type='text'>
We xmemdupz() this buffer, but never free it. Let's do so. We'll use a
cleanup label, since there are multiple exits from the function.

Note that it was also declared a "const char *". We could switch that to
"char *" to indicate that it's allocated, but that make it awkward to
use with skip_prefix(). So instead, we'll introduce an extra non-const
pointer.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ssh signing: verify signatures using ssh-keygen</title>
<updated>2021-09-10T21:15:52Z</updated>
<author>
<name>Fabian Stelzer</name>
<email>fs@gigacodes.de</email>
</author>
<published>2021-09-10T20:07:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=facca53ac3c2e8a5e2a4fe54c9c15de656c72de1'/>
<id>urn:sha1:facca53ac3c2e8a5e2a4fe54c9c15de656c72de1</id>
<content type='text'>
To verify a ssh signature we first call ssh-keygen -Y find-principal to
look up the signing principal by their public key from the
allowedSignersFile. If the key is found then we do a verify. Otherwise
we only validate the signature but can not verify the signers identity.

Verification uses the gpg.ssh.allowedSignersFile (see ssh-keygen(1) "ALLOWED
SIGNERS") which contains valid public keys and a principal (usually
user@domain). Depending on the environment this file can be managed by
the individual developer or for example generated by the central
repository server from known ssh keys with push access. This file is usually
stored outside the repository, but if the repository only allows signed
commits/pushes, the user might choose to store it in the repository.

To revoke a key put the public key without the principal prefix into
gpg.ssh.revocationKeyring or generate a KRL (see ssh-keygen(1)
"KEY REVOCATION LISTS"). The same considerations about who to trust for
verification as with the allowedSignersFile apply.

Using SSH CA Keys with these files is also possible. Add
"cert-authority" as key option between the principal and the key to mark
it as a CA and all keys signed by it as valid for this CA.
See "CERTIFICATES" in ssh-keygen(1).

Signed-off-by: Fabian Stelzer &lt;fs@gigacodes.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ssh signing: provide a textual signing_key_id</title>
<updated>2021-09-10T21:15:52Z</updated>
<author>
<name>Fabian Stelzer</name>
<email>fs@gigacodes.de</email>
</author>
<published>2021-09-10T20:07:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4838f62c8caffbfe5d7d39cad4e8aeb2a2d57da8'/>
<id>urn:sha1:4838f62c8caffbfe5d7d39cad4e8aeb2a2d57da8</id>
<content type='text'>
For ssh the user.signingkey can be a filename/path or even a literal ssh pubkey.
In push certs and textual output we prefer the ssh fingerprint instead.

Signed-off-by: Fabian Stelzer &lt;fs@gigacodes.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ssh signing: retrieve a default key from ssh-agent</title>
<updated>2021-09-10T21:15:52Z</updated>
<author>
<name>Fabian Stelzer</name>
<email>fs@gigacodes.de</email>
</author>
<published>2021-09-10T20:07:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd9e226776d1874af36b6b02fb2002b917af42fa'/>
<id>urn:sha1:fd9e226776d1874af36b6b02fb2002b917af42fa</id>
<content type='text'>
If user.signingkey is not set and a ssh signature is requested we call
gpg.ssh.defaultKeyCommand (typically "ssh-add -L") and use the first key we get

Signed-off-by: Fabian Stelzer &lt;fs@gigacodes.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ssh signing: add ssh key format and signing code</title>
<updated>2021-09-10T21:15:51Z</updated>
<author>
<name>Fabian Stelzer</name>
<email>fs@gigacodes.de</email>
</author>
<published>2021-09-10T20:07:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=29b315778e958417a411f02b6d4b5a0fc9d731e2'/>
<id>urn:sha1:29b315778e958417a411f02b6d4b5a0fc9d731e2</id>
<content type='text'>
Implements the actual sign_buffer_ssh operation and move some shared
cleanup code into a strbuf function

Set gpg.format = ssh and user.signingkey to either a ssh public key
string (like from an authorized_keys file), or a ssh key file.
If the key file or the config value itself contains only a public key
then the private key needs to be available via ssh-agent.

gpg.ssh.program can be set to an alternative location of ssh-keygen.
A somewhat recent openssh version (8.2p1+) of ssh-keygen is needed for
this feature. Since only ssh-keygen is needed it can this way be
installed seperately without upgrading your system openssh packages.

Signed-off-by: Fabian Stelzer &lt;fs@gigacodes.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
