Bug 564428 - GPG: signature in commit object has trailing empty line
Summary: GPG: signature in commit object has trailing empty line
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.8   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 5.9   Edit
Assignee: Thomas Wolf CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-18 09:30 EDT by Thomas Wolf CLA
Modified: 2020-07-08 04:05 EDT (History)
2 users (show)

See Also:


Attachments
JGit commit with trailing empty line in gpgsig (768 bytes, text/plain)
2020-06-18 12:33 EDT, Thomas Wolf CLA
no flags Details
git/gpg commit without this trailing line (746 bytes, text/plain)
2020-06-18 12:33 EDT, Thomas Wolf CLA
no flags Details
JGit signed commit after fix (745 bytes, text/plain)
2020-06-18 12:36 EDT, Thomas Wolf CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2020-06-18 09:30:07 EDT
CommitBuilder.writeGpgSignatureString() produces output that ends with
" -----END PGP SIGNATURE-----\n \n". While the extra empty line is properly prefixed with a blank and thus part of the header, and while this does not cause any trouble for standard git/gpg, it is a bit unexpected and might be one cause for Gitlab not being able to verify signatures created by JGit. See bug 564386 comment 4.

It's fairly simple to avoid this extra empty line, so we should do so.
Comment 1 Thomas Wolf CLA 2020-06-18 12:33:12 EDT
Created attachment 283345 [details]
JGit commit with trailing empty line in gpgsig
Comment 2 Thomas Wolf CLA 2020-06-18 12:33:56 EDT
Created attachment 283346 [details]
git/gpg commit without this trailing line
Comment 3 Eclipse Genie CLA 2020-06-18 12:35:27 EDT
New Gerrit change created: https://git.eclipse.org/r/165173
Comment 4 Thomas Wolf CLA 2020-06-18 12:36:49 EDT
Created attachment 283347 [details]
JGit signed commit after fix

(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/165173
Comment 5 aminla lai CLA 2020-06-19 01:42:41 EDT
finally it's verified :)

from the link you provided in #564386 comment 4,
i think it's caused by https://gitlab.com/gitlab-org/gitaly/-/issues/2545
so i upgrade our gitlab from 12.8.1 to 12.10.11
and problem solved.

again, thanks for you effort

-------------------
eclipse 4.7.1a, egit 5.8.0, gitlab 12.10.11 -> ok
eclipse committer 2020-03, egit 5.8.0 + patch #564386, #564428, gitlab 12.10.11 -> ok
Comment 6 Thomas Wolf CLA 2020-06-19 02:47:51 EDT
Good find; thanks a lot for digging deeper, and for verifying that the JGit changes are fine.