<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/gpg-interface.c, branch v2.19.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.19.0</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.19.0'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2018-08-20T18:33:50Z</updated>
<entry>
<title>Merge branch 'jc/gpg-status'</title>
<updated>2018-08-20T18:33:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-20T18:33:50Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4d34122eef19c39415d38b4963572770f96a9317'/>
<id>urn:sha1:4d34122eef19c39415d38b4963572770f96a9317</id>
<content type='text'>
"git verify-tag" and "git verify-commit" have been taught to use
the exit status of underlying "gpg --verify" to signal bad or
untrusted signature they found.

* jc/gpg-status:
  gpg-interface: propagate exit status from gpg back to the callers
</content>
</entry>
<entry>
<title>gpg-interface: propagate exit status from gpg back to the callers</title>
<updated>2018-08-09T22:34:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-09T18:40:27Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4e5dc9ca179931b4dc39b32f06facc5a31091403'/>
<id>urn:sha1:4e5dc9ca179931b4dc39b32f06facc5a31091403</id>
<content type='text'>
When gpg-interface API unified support for signature verification
codepaths for signed tags and signed commits in mid 2015 at around
v2.6.0-rc0~114, we accidentally loosened the GPG signature
verification.

Before that change, signed commits were verified by looking for
"G"ood signature from GPG, while ignoring the exit status of "gpg
--verify" process, while signed tags were verified by simply passing
the exit status of "gpg --verify" through.  The unified code we
currently have ignores the exit status of "gpg --verify" and returns
successful verification when the signature matches an unexpired key
regardless of the trust placed on the key (i.e. in addition to "G"ood
ones, we accept "U"ntrusted ones).

Make these commands signal failure with their exit status when
underlying "gpg --verify" (or the custom command specified by
"gpg.program" configuration variable) does so.  This essentially
changes their behaviour in a backward incompatible way to reject
signatures that have been made with untrusted keys even if they
correctly verify, as that is how "gpg --verify" behaves.

Note that the code still overrides a zero exit status obtained from
"gpg" (or gpg.program) if the output does not say the signature is
good or computes correctly but made with untrusted keys, to catch
a poorly written wrapper around "gpg" the user may give us.

We could exclude "U"ntrusted support from this fallback code, but
that would be making two backward incompatible changes in a single
commit, so let's avoid that for now.  A follow-up change could do so
if desired.

Helped-by: Vojtech Myslivec &lt;vojtech.myslivec@nic.cz&gt;
Helped-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Helped-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: introduce new signature format "x509" using gpgsm</title>
<updated>2018-07-18T17:02:23Z</updated>
<author>
<name>Henning Schild</name>
<email>henning.schild@siemens.com</email>
</author>
<published>2018-07-17T12:50:12Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1e7adb97566bff7d3431ce64b8d0d854a6863ed5'/>
<id>urn:sha1:1e7adb97566bff7d3431ce64b8d0d854a6863ed5</id>
<content type='text'>
This commit allows git to create and check x509 type signatures using
gpgsm.

Signed-off-by: Henning Schild &lt;henning.schild@siemens.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: introduce new config to select per gpg format program</title>
<updated>2018-07-18T17:02:21Z</updated>
<author>
<name>Henning Schild</name>
<email>henning.schild@siemens.com</email>
</author>
<published>2018-07-17T12:50:11Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=b02f51b196deec70867d9616872e533e2633473c'/>
<id>urn:sha1:b02f51b196deec70867d9616872e533e2633473c</id>
<content type='text'>
Supporting multiple signing formats we will have the need to configure a
custom program each. Add a new config value to cater for that.

Signed-off-by: Henning Schild &lt;henning.schild@siemens.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: do not hardcode the key string len anymore</title>
<updated>2018-07-18T17:02:20Z</updated>
<author>
<name>Henning Schild</name>
<email>henning.schild@siemens.com</email>
</author>
<published>2018-07-17T12:50:10Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=42149d7f4b1424b29c0bae4f564d5f50a856bcea'/>
<id>urn:sha1:42149d7f4b1424b29c0bae4f564d5f50a856bcea</id>
<content type='text'>
gnupg does print the keyid followed by a space and the signer comes
next. The same pattern is also used in gpgsm, but there the key length
would be 40 instead of 16. Instead of hardcoding the expected length,
find the first space and calculate it.
Input that does not match the expected format will be ignored now,
before we jumped to found+17 which might have been behind the end of an
unexpected string.

Signed-off-by: Henning Schild &lt;henning.schild@siemens.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: introduce an abstraction for multiple gpg formats</title>
<updated>2018-07-18T17:02:18Z</updated>
<author>
<name>Henning Schild</name>
<email>henning.schild@siemens.com</email>
</author>
<published>2018-07-17T12:50:09Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=58af57e1c886a7c9fed7fb35f2dd8dd14cc5e4e0'/>
<id>urn:sha1:58af57e1c886a7c9fed7fb35f2dd8dd14cc5e4e0</id>
<content type='text'>
Create a struct that holds the format details for the supported formats.
At the moment that is still just "openpgp". This commit prepares for the
introduction of more formats, that might use other programs and match
other signatures.

Signed-off-by: Henning Schild &lt;henning.schild@siemens.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: add new config to select how to sign a commit</title>
<updated>2018-07-17T19:14:11Z</updated>
<author>
<name>Henning Schild</name>
<email>henning.schild@siemens.com</email>
</author>
<published>2018-07-17T12:50:07Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=57a8dd75df4e1d716d60fc95bd0acaab45465d68'/>
<id>urn:sha1:57a8dd75df4e1d716d60fc95bd0acaab45465d68</id>
<content type='text'>
Add "gpg.format" where the user can specify which type of signature to
use for commits. At the moment only "openpgp" is supported and the value is
not even used. This commit prepares for a new types of signatures.

Signed-off-by: Henning Schild &lt;henning.schild@siemens.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: make parse_gpg_output static and remove from interface header</title>
<updated>2018-07-11T17:05:22Z</updated>
<author>
<name>Henning Schild</name>
<email>henning.schild@siemens.com</email>
</author>
<published>2018-07-11T08:38:25Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=fbd0f16610362fda5d2093a590a80d693f610594'/>
<id>urn:sha1:fbd0f16610362fda5d2093a590a80d693f610594</id>
<content type='text'>
Turn parse_gpg_output into a static function, the only outside user was
migrated in an earlier commit.

Signed-off-by: Henning Schild &lt;henning.schild@siemens.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: find the last gpg signature line</title>
<updated>2018-04-16T05:15:03Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-04-13T21:18:35Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=8b44b2be89bf59c0fada6095bdfea66ff53c6074'/>
<id>urn:sha1:8b44b2be89bf59c0fada6095bdfea66ff53c6074</id>
<content type='text'>
A signed tag has a detached signature like this:

  object ...
  [...more header...]

  This is the tag body.

  -----BEGIN PGP SIGNATURE-----
  [opaque gpg data]
  -----END PGP SIGNATURE-----

Our parser finds the _first_ line that appears to start a
PGP signature block, meaning we may be confused by a
signature (or a signature-like line) in the actual body.
Let's keep parsing and always find the final block, which
should be the detached signature over all of the preceding
content.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Ben Toews &lt;mastahyeti@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: extract gpg line matching helper</title>
<updated>2018-04-16T05:15:03Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-04-13T21:18:34Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f68f2dd57f55e0b1782b20b615dd7a96d7fb6a41'/>
<id>urn:sha1:f68f2dd57f55e0b1782b20b615dd7a96d7fb6a41</id>
<content type='text'>
Let's separate the actual line-by-line parsing of signatures
from the notion of "is this a gpg signature line". That will
make it easier to do more refactoring of this loop in future
patches.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Ben Toews &lt;mastahyeti@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
