-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with GnuPG 1.x and 2.x, auto-detect GnuPG version #779
Conversation
Codecov Report
@@ Coverage Diff @@
## master #779 +/- ##
==========================================
- Coverage 64.08% 64.06% -0.03%
==========================================
Files 50 51 +1
Lines 6446 6506 +60
==========================================
+ Hits 4131 4168 +37
- Misses 1810 1831 +21
- Partials 505 507 +2
Continue to review full report at Codecov.
|
8976db8
to
73c1c2b
Compare
There are some code coverage issues in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good code wise. Question is though shoudln't we not also run the system tests with gpg2 to be sure that it works?
@sliverc good point, I will add detection of gpg1/2 to system tests and I will add tests on signing/verifying with gpg2 |
* aptly can sign and verify without issues with GnuPG 1.x and 2.x * aptly auto-detects GnuPG version and adapts accordingly * aptly automatically finds suitable GnuPG version Majority of the work was to get unit-tests which can work with GnuPG 1.x & 2.x. Locally I've verified that aptly supports GnuPG 1.4.x & 2.2.x. Travis CI environment is based on trusty, so it runs gpg2 tests with GnuPG 2.0.x. Configuration parameter gpgProvider now supports three values for GnuPG: * gpg (same as before, default): use GnuPG 1.x if available (checks gpg, gpg1), otherwise uses GnuPG 2.x; for aptly users who already have GnuPG 1.x environment (as it was the only supported version) nothing should change; new users might start with GnuPG 2.x if that's their installed version * gpg1 looks for GnuPG 1.x only, fails otherwise * gpg2 looks for GnuPG 2.x only, fails otherwise
Travis is running Trusty with GPG 2.0.x, which is much different from 2.1.x. Add tests for default key signing. Add test for gpg1/2 in functional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Kudo. Can't wait for next aptly release :-) |
Not sure where to post this, but it took me ages to figure out why gpg signing wouldn't work. I always got the following error when trying to publish via the API:
I tried all kinds of things with configuring gpg. In the end, it turns out I was just using the API wrongly.
when instead I should have put the GPG signing parameters into a sub-field:
It would be very nice if the API gave an error for unknown/unexpected parameters. |
Fixes #741
Fixes #699
Fixes #657
Requirements
aptly should support transparently GnuPG 1.x and 2.x via
gpg
PGP provider. Internal PGP provider only supports GnuPG 1.x keyring format (as openpgp Go library doesn't support GnuPG 2.1+ kerying format).Description of the Change
Majority of the work was to get unit-tests which can work with GnuPG 1.x & 2.x. Locally I've verified that aptly supports GnuPG 1.4.x & 2.2.x. Travis CI environment is based on trusty, so it runs gpg2 tests with GnuPG 2.0.x.
Configuration parameter
gpgProvider
now supports three values for GnuPG:gpg
(same as before, default): use GnuPG 1.x if available (checksgpg
,gpg1
), otherwise uses GnuPG 2.x; for aptly users who already have GnuPG 1.x environment (as it was the only supported version) nothing should change; new users might start with GnuPG 2.x if that's their installed versiongpg1
looks for GnuPG 1.x only, fails otherwisegpg2
looks for GnuPG 2.x only, fails otherwiseChecklist
AUTHORS