<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7510-signed-commit.sh, branch v2.24.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.24.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.24.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-01-22T19:08:35Z</updated>
<entry>
<title>commit-tree: add missing --gpg-sign flag</title>
<updated>2019-01-22T19:08:35Z</updated>
<author>
<name>Brandon Richardson</name>
<email>brandon1024.br@gmail.com</email>
</author>
<published>2019-01-19T23:23:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=70ddbd7767c24076975a176e734767facd3b5380'/>
<id>urn:sha1:70ddbd7767c24076975a176e734767facd3b5380</id>
<content type='text'>
Add --gpg-sign option in commit-tree, which was documented, but not
implemented, in 55ca3f99ae. Add tests for the --gpg-sign option.

Signed-off-by: Brandon Richardson &lt;brandon1024.br@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t7510: invoke git as part of &amp;&amp;-chain</title>
<updated>2019-01-22T19:08:33Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2019-01-19T23:23:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41a74bd01301d2976e7f9ab1ef55733f9ea1a919'/>
<id>urn:sha1:41a74bd01301d2976e7f9ab1ef55733f9ea1a919</id>
<content type='text'>
If `git commit-tree HEAD^{tree}` fails on us and produces no output on
stdout, we will substitute that empty string and execute `git tag
ninth-unsigned`, i.e., we will tag HEAD rather than a newly created
object. But we are lucky: we have a signature on HEAD, so we should
eventually fail the next test, where we verify that "ninth-unsigned" is
indeed unsigned.

We have a similar problem a few lines later. If `git commit-tree -S`
fails with no output, we will happily tag HEAD as "tenth-signed". Here,
we are not so lucky. The tag ends up on the same commit as
"eighth-signed-alt", and that's a signed commit, so t7510-signed-commit
will pass, despite `git commit-tree -S` failing.

Make these `git commit-tree` invocations a direct part of the &amp;&amp;-chain,
so that we can rely less on luck and set a better example for future
tests modeled after this one. Fix a 9/10 copy/paste error while at it.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Brandon Richardson &lt;brandon1024.br@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/t7510-signed-commit.sh: add signing subkey to Eris Discordia key</title>
<updated>2018-11-05T02:00:58Z</updated>
<author>
<name>Michał Górny</name>
<email>mgorny@gentoo.org</email>
</author>
<published>2018-11-04T09:47:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e690847d14034072379fb1382ef09fda3ed12bc'/>
<id>urn:sha1:1e690847d14034072379fb1382ef09fda3ed12bc</id>
<content type='text'>
Add a dedicated signing subkey to the key identified as 'Eris
Discordia', and update tests appropriately.  GnuPG will now sign commits
using the dedicated signing subkey, changing the value of %GK and %GF,
and effectively creating a test case for %GF!=%GP.

Signed-off-by: Michał Górny &lt;mgorny@gentoo.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/t7510-signed-commit.sh: Add %GP to custom format checks</title>
<updated>2018-11-05T02:00:56Z</updated>
<author>
<name>Michał Górny</name>
<email>mgorny@gentoo.org</email>
</author>
<published>2018-11-04T09:47:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a550529b123f1b45334b6ed3d9b2c3e94e319e2'/>
<id>urn:sha1:1a550529b123f1b45334b6ed3d9b2c3e94e319e2</id>
<content type='text'>
Test %GP in addition to %GF in custom format checks.  With current
keyring, both have the same value.

Signed-off-by: Michał Górny &lt;mgorny@gentoo.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface.c: support getting key fingerprint via %GF format</title>
<updated>2018-10-22T23:00:09Z</updated>
<author>
<name>Michał Górny</name>
<email>mgorny@gentoo.org</email>
</author>
<published>2018-10-22T16:38:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3daaaabe7ed22c17bff04d19c711be427bd2e225'/>
<id>urn:sha1:3daaaabe7ed22c17bff04d19c711be427bd2e225</id>
<content type='text'>
Support processing VALIDSIG status that provides additional information
for valid signatures.  Use this information to propagate signing key
fingerprint and expose it via %GF pretty format.  This format can be
used to build safer key verification systems that verify the key via
complete fingerprint rather than short/long identifier provided by %GK.

Signed-off-by: Michał Górny &lt;mgorny@gentoo.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface.c: detect and reject multiple signatures on commits</title>
<updated>2018-10-22T03:42:30Z</updated>
<author>
<name>Michał Górny</name>
<email>mgorny@gentoo.org</email>
</author>
<published>2018-10-20T19:30:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=da6cf1b3360eefdce3dbde7632eca57177327f37'/>
<id>urn:sha1:da6cf1b3360eefdce3dbde7632eca57177327f37</id>
<content type='text'>
GnuPG supports creating signatures consisting of multiple signature
packets.  If such a signature is verified, it outputs all the status
messages for each signature separately.  However, git currently does not
account for such scenario and gets terribly confused over getting
multiple *SIG statuses.

For example, if a malicious party alters a signed commit and appends
a new untrusted signature, git is going to ignore the original bad
signature and report untrusted commit instead.  However, %GK and %GS
format strings may still expand to the data corresponding
to the original signature, potentially tricking the scripts into
trusting the malicious commit.

Given that the use of multiple signatures is quite rare, git does not
support creating them without jumping through a few hoops, and finally
supporting them properly would require extensive API improvement, it
seems reasonable to just reject them at the moment.

Signed-off-by: Michał Górny &lt;mgorny@gentoo.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/t7510: check the validation of the new config gpg.format</title>
<updated>2018-07-18T17:02:00Z</updated>
<author>
<name>Henning Schild</name>
<email>henning.schild@siemens.com</email>
</author>
<published>2018-07-18T09:30:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1865a647c3d8bb6367be4b799dd95217ccfbe26e'/>
<id>urn:sha1:1865a647c3d8bb6367be4b799dd95217ccfbe26e</id>
<content type='text'>
Test setting gpg.format to both invalid and valid values.

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>tests: make forging GPG signed commits and tags more robust</title>
<updated>2018-06-11T17:19:03Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2018-06-04T13:39:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f3cbcd8c5a00dc043aabc13f2af221c7c0e89ad'/>
<id>urn:sha1:2f3cbcd8c5a00dc043aabc13f2af221c7c0e89ad</id>
<content type='text'>
A couple of test scripts create forged GPG signed commits or tags to
check that such forgery can't fool various git commands' signature
verification.  All but one of those test scripts are prone to
occasional failures because the forgery creates a bogus GPG signature,
and git commands error out with an unexpected error message, e.g.
"Commit deadbeef does not have a GPG signature" instead of "...  has a
bad GPG signature".

't5573-pull-verify-signatures.sh', 't7510-signed-commit.sh' and
't7612-merge-verify-signatures.sh' create forged signed commits like
this:

  git commit -S -m "bad on side" &amp;&amp;
  git cat-file commit side-bad &gt;raw &amp;&amp;
  sed -e "s/bad/forged bad/" raw &gt;forged &amp;&amp;
  git hash-object -w -t commit forged &gt;forged.commit

On rare occasions the given pattern occurs not only in the commit
message but in the GPG signature as well, and after it's replaced in
the signature the resulting signature becomes invalid, GPG will report
CRC error and that it couldn't find any signature, which will then
ultimately cause the test failure.

Since in all three cases the pattern to be replaced during the forgery
is the first word of the commit message's subject line, and since the
GPG signature in the commit object is indented by a space, let's just
anchor those patterns to the beginning of the line to prevent this
issue.

The test script 't7030-verify-tag.sh' creates a forged signed tag
object in a similar way by replacing the pattern "seventh", but the
GPG signature in tag objects is not indented by a space, so the above
solution is not applicable in this case.  However, in the tag object
in question the pattern "seventh" occurs not only in the tag message
but in the 'tag' header as well.  To create a forged tag object it's
sufficient to replace only one of the two occurences, so modify the
sed script to limit the pattern to the 'tag' header (i.e. a line
beginning with "tag ", which, because of the space character, can
never occur in the base64-encoded GPG signature).

Note that the forgery in 't7004-tag.sh' is not affected by this issue:
while 't7004' does create a forged signed tag kind of the same way,
it replaces "signed-tag" in the tag object, which, because of the '-'
character, can never occur in the base64-encoded GPG signarute.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t7510-signed-commit: use 'test_must_fail'</title>
<updated>2018-06-11T17:19:03Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2018-06-04T13:39:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9dd39821e3d0adf3f160642589291965c73a529e'/>
<id>urn:sha1:9dd39821e3d0adf3f160642589291965c73a529e</id>
<content type='text'>
The two tests 'detect fudged signature' and 'detect fudged signature
with NUL' in 't7510-signed-commit.sh' check that 'git verify-commit'
errors out when encountering a forged commit, but they do so by
running

  ! git verify-commit ...

Use 'test_must_fail' instead, because that would catch potential
unexpected errors like a segfault as well.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gpg-interface: use more status letters</title>
<updated>2016-10-12T17:41:59Z</updated>
<author>
<name>Michael J Gruber</name>
<email>git@drmicha.warpmail.net</email>
</author>
<published>2016-10-12T13:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=661a1806819ca98c446f82b19e6c98fa174d33a4'/>
<id>urn:sha1:661a1806819ca98c446f82b19e6c98fa174d33a4</id>
<content type='text'>
According to gpg2's doc/DETAILS:

    For each signature only one of the codes GOODSIG, BADSIG,
    EXPSIG, EXPKEYSIG, REVKEYSIG or ERRSIG will be emitted.

gpg1 ("classic") behaves the same (although doc/DETAILS differs).

Currently, we parse gpg's status output for GOODSIG, BADSIG and
trust information and translate that into status codes G, B, U, N
for the %G?  format specifier.

git-verify-* returns success in the GOODSIG case only. This is
somewhat in disagreement with gpg, which considers the first 5 of
the 6 above as VALIDSIG, but we err on the very safe side.

Introduce additional status codes E, X, Y, R for ERRSIG, EXPSIG,
EXPKEYSIG, and REVKEYSIG so that a user of %G? gets more information
about the absence of a 'G' on first glance.

Requested-by: Alex &lt;agrambot@gmail.com&gt;
Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
