Commit Graph

32 Commits

Author SHA1 Message Date
André Roth
33047c2c55 cleanup gpg keys
- move gpg files to one place
- with gpg2, the secretkey parameter is ignored. aptly can also ignore it
2024-10-04 18:46:40 +02:00
André Roth
c1f7e5fe96 handle GpgDisableVerify and ignore-signatures consistently
and be less verbose
2024-07-03 18:08:58 +02:00
Paul Cacheux
aeef41bf70 add support for EdDSA keys in pubkeyAlgorithmName 2023-11-23 11:40:58 +01:00
Paul Cacheux
cfcab13c2a replace golang.org/x/crypto/openpgp with github.com/ProtonMail/go-crypto/openpgp 2023-11-23 11:40:58 +01:00
Mauro Regli
40c242f9d1 Fix: Remove Batch from API options, set to true by default, add comments
Fixes: #1106
2023-09-14 10:34:20 +02:00
Markus Muellner
352f4e8772 update golangci-lint and replace deprecated calls to io/ioutil 2022-12-12 10:21:39 +01:00
Benj Fassbind
8046fb1eb9 Fix failing checks 2022-04-05 11:41:14 +02:00
Lorenzo Bolla
0dc49d2a70 Silence unhelpful linter error
See #1012
2022-01-27 09:30:14 +01:00
Vítězslav Dvořák
174943cd0f Proposed keyserver changed to functional one #990 2021-11-02 15:01:17 +01:00
Lorenzo Bolla
3201244d9b Fix tests and fixtures relying on expired pgp keys
PGP tests relied on expired gpg keys: upgrade with newer Debian keys from
https://ftp-master.debian.org/keys.html.
Download new fixtures files from http://ftp.debian.org/debian/dists/buster/
2021-02-08 10:52:27 +01:00
Don Kuntz
24a027194e Remove unused variable 2019-10-18 18:29:38 +03:00
Don Kuntz
b7f74b4e55 Allow GPGFinder to work with nonstandard GPG version strings
Specifically, I have MacGPG installed instead of upstream GPG, which
results in the version string reading
  gpg (GnuPG/MacGPG2) 2.2.17

instead of the expected
  gpg (GnuPG) 2.2.17
2019-10-18 18:29:38 +03:00
Stephan Eicher
aa02c5cbe9 Fix #827 - passhprase typos 2019-09-02 23:26:37 +03:00
Andrey Smirnov
021b6f694b Fix flakey tests related to identity name ordering. 2019-08-07 20:47:52 +03:00
Andrey Smirnov
bb1def2910 Try Travis on xenial workers 2019-07-11 00:16:20 +03:00
Andrey Smirnov
3b5840e248 Fix linter list and fix errors discovered by new staticcheck 2019-01-20 00:01:17 +03:00
Andrey Smirnov
61e00b5fbd Test updates for Travis CI
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.
2018-10-10 01:34:58 +03:00
Andrey Smirnov
1b2fccb615 Compatibility with GnuPG 1.x and 2.x, auto-detect GnuPG version
* 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
2018-10-10 01:34:00 +03:00
Andrey Smirnov
9f7c1f90ec Support for non-armored detached signatures 2018-09-26 01:36:52 +03:00
Andrey Smirnov
58c7358113 Unit tests for PGP signing/verification
These unit-tests cover operations via both PGP providers:
built-in `openpgp` and external `gpg`.

Next step is to run these tests for gpg1 & gpg2
as separate entities.
2018-07-11 01:07:13 +03:00
Andrey Smirnov
e5acf22285 Skip GPG version check APTLY_SKIP_GPG_VERSION_CHECK=1 is set in the environment
This allows to force using GnuPG 2.x even if aptly is not 100% ready
to use it.
2018-05-25 00:23:50 +03:00
Harald Sitter
5a713534c6 fix gpg setting
Init is actually never called and I have no clue why it is there if it is
not called.
Take this opportunity to introduce a New function which only does the
helper lookup and panics iff that fails. Panic may be a bit too aggressive,
but seems the most certain way to get out of not finding a suitable gpg1
binary.
2018-04-26 09:18:06 +02:00
Harald Sitter
f89e322ece move away from assert package
we don't actually use it anywhere else
2018-04-25 15:35:01 +02:00
Harald Sitter
cd6075ba94 introduce a gpg and gpgv version compatibility check and fall back to v1
Newer versions of debian and ubuntu come with gpg pointing to gpg2.
We can currently only handle gpg1 CLIs though. Luckily the old gpg is still
available in the package gnupg1 (providing bin/gpg1).

As a bit of a stop-gap, until #657 can be resolved properly, we'll detect
the version of bin/gpg. If it is unsuitable we'll fall back and try
bin/gpg1. If neither is found to be suitable the signer/verifier will
not work.

Same applies to gpgv/gpgv1.
2018-04-25 15:05:53 +02:00
Andrey Smirnov
aa3a2ab595 New signing key for aptly repo, and small fixes
Build on Go 1.10, drop Go 1.7

Remove references to now defunct pgp.mit.edu, fix system test
2018-03-16 01:27:57 +03:00
Andrey Smirnov
68da8a674a Improve internal PGP provider
1. Print additional details about keys being used for signing
2. Skip expired keys
3. Add `\n` to logged messages
2017-07-28 00:53:50 +03:00
Andrey Smirnov
3674e1adee System tests for mirror create/update with internal PGP implementation 2017-07-21 01:09:20 +03:00
Andrey Smirnov
05a5e69483 Fix misspelling 2017-07-21 01:01:58 +03:00
Andrey Smirnov
5e9515a912 Add --batch in batch mode (fixes #519) 2017-07-21 01:01:58 +03:00
Andrey Smirnov
84a6d573f8 Implement GPG signer 2017-07-21 01:01:58 +03:00
Andrey Smirnov
07fde3177b GoVerifier implementation 2017-07-21 01:01:58 +03:00
Andrey Smirnov
1be8d39105 Refactor GPG signer/verifier
Goal is to make it easier to plug in another implementation.
2017-05-23 02:54:56 +03:00