Skip to content
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

Can't specify master key fingerprint in keys map file if sub key is used for signing. #30

Closed
m50d opened this issue Dec 28, 2017 · 10 comments
Labels
enhancement New feature or request.
Milestone

Comments

@m50d
Copy link

m50d commented Dec 28, 2017

E.g. the key used to sign junit: https://hkps.pool.sks-keyservers.net/pks/lookup?op=vindex&fingerprint=on&search=0xEFE8086F9E93774E

With junit=0xEFE8086F9E93774E in keys map file:

[INFO] junit:junit:pom:4.12 PGP Signature OK
KeyId: 0xEFE8086F9E93774E UserIds: []

With junit=0x58E79B6ABC762159DC0B1591164BD2247B936711 in keys map file:

[ERROR] Not allowed artifact junit:junit:pom:4.12 and keyID:
junit:junit:4.12=0xEFE8086F9E93774E
https://hkps.pool.sks-keyservers.net/pks/lookup?op=vindex&fingerprint=on&search=0xEFE8086F9E93774E

It seems like although for most keys the id is the last few characters of the fingerprint, this isn't always true?

@slawekjaranowski slawekjaranowski added the enhancement New feature or request. label Dec 29, 2017
@slawekjaranowski
Copy link
Member

The key ID always is a part of the fingerprint.

One pgp key can contains master key and some sub keys.
In this case artifact is signed by one of sub keys, but you try provide fingerprint for master key.

Almost all artifact are signed by master key, so problem not occured.

We should correct this.

Below outpout from gpg:

$ gpg --verify-files junit-4.12.pom.asc 
gpg: assuming signed data in 'junit-4.12.pom'
gpg: Signature made Thu Dec  4 17:17:33 2014 CET
gpg:                using RSA key EFE8086F9E93774E
gpg: Good signature from "Marc Philipp (JUnit Development, 2014) <mail@marcphilipp.de>"
Primary key fingerprint: 58E7 9B6A BC76 2159 DC0B  1591 164B D224 7B93 6711
     Subkey fingerprint: D4C8 9EA4 AAF4 55FD 88B2  2087 EFE8 086F 9E93 774E

@exabrial
Copy link

What needs to be done to support subkeys? I'm guessing on the retrieval side, you just need to iterate through the subkeys and push any keys with the signing flag set into the cache. If you can describe how you'd like it done, I could take a crack at it.

@exabrial
Copy link

exabrial commented Jul 2, 2018

@slawekjaranowski Still willing to work on supporting subkeys if you'd like :)

@m50d
Copy link
Author

m50d commented Jul 28, 2018

I had a quick look through the code but couldn't see what exactly needs to happen. The use case looks like: given an artifact, a signature, and a key fingerprint, confirm that this is a valid signature of that artifact by a key with that fingerprint. So one needs to fetch the key based on the signature, and then somehow get from that to the fingerprint of the primary key rather than the subkey. But I don't understand the API the existing code is using well enough to say what (if anything) is missing.

@slawekjaranowski
Copy link
Member

next example:

ognl:ognl:jar:3.1.12 PGP Signature OK
      KeyId: 0x8926173648953916A0A4F290F721C545D0CAA2E3 UserIds: []

@slawekjaranowski slawekjaranowski changed the title Can't specify key fingerprint in keys map file if key ID isn't the end of it Can't specify master key fingerprint in keys map file if sub key is used for signing. Dec 22, 2019
@exabrial
Copy link

Maven Central now allows signing with ECDSA and also with Subkeys. I feel like we're going to see this become more and more of a problem.

At one point I had a started a similar plugin to this one that called out to native gpg and that solved the problem.

@slawekjaranowski
Copy link
Member

@exabrial - Do you have example of artifact signing with ECDSA?

@exabrial
Copy link

Yeah. You can use one of my other project's as an example: https://repo1.maven.org/maven2/com/github/exabrial/form-binding/1.2.0/

slawekjaranowski added a commit that referenced this issue Dec 28, 2019
@slawekjaranowski
Copy link
Member

I confirm by test that ECDSA keys are working.

@exabrial
Copy link

Nice. That artifact isn't signed with a subkey, but it's great to see ECDSA working!

@slawekjaranowski slawekjaranowski added this to the v1.6.0 milestone Jan 14, 2020
slawekjaranowski added a commit that referenced this issue Jan 18, 2020
pzygielo pushed a commit to pzygielo/pgpverify-maven-plugin that referenced this issue May 31, 2024
Dependencies are now processed asynchronously by an Executor

This closes s4u#30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request.
Development

No branches or pull requests

3 participants