tycho icon indicating copy to clipboard operation
tycho copied to clipboard

sign-p2-artifacts does not PGP sign features

Open yafred opened this issue 2 years ago • 10 comments

Hi,

I am trying to sign a p2 with tycho-gpg-plugin:sign-p2-artifacts (I tried 2.73 and 3.0.4)

It is only signing the plugins, not the features.

The plugin are artifacts with classifier osgi.bundle in artifacts.xml and are properly updated with gpg properties The features are artifacts with classifier org.eclipse.update.feature and are not updated with gpg properties

Maven logs show nothing interesting.

What can I do to understand why the features are not signed ?

Thanks

yafred avatar Jun 07 '23 16:06 yafred

Can you provide an integration-test to demonstrate the issue? I'm not sure if signing of features is actually supported (@merks ?) in the P2 UI but technically it would be possible of course, I just think there is no test for this at the moment.

laeubi avatar Jun 07 '23 16:06 laeubi

Feature jars are “normally” jar-signed. I’ve never tried to pgp sign such things. It’s not something an Eclipse project would ever seem to need. But it nevertheless ought to be supported. A test case will be needed for sure.

merks avatar Jun 07 '23 17:06 merks

You say 'Feature jars are “normally” jar-signed'. Do you have a link to how to sign a p2 (allowing the Trust dialog to display to the user that everything is signed) ?

yafred avatar Jun 07 '23 22:06 yafred

Eclipse projects use this:

https://www.eclipse.org/cbi/sitedocs/eclipse-jarsigner-plugin/sign-mojo.html

But if you're not an Eclipse-hosted project, that's not very helpful advice.

I'm not sure how to use this one:

https://maven.apache.org/plugins/maven-jarsigner-plugin/

I would expect this to work on features:

https://tycho.eclipseprojects.io/doc/latest/tycho-gpg-plugin/sign-p2-artifacts-mojo.html

If that doesn't work, I'd expect it to be relatively straight-forward to fix it...

merks avatar Jun 08 '23 04:06 merks

We are trying to move the Spring Tools to GPG signing as well and stumbled upon this as well, so the regular bundles gets GPG signed, but not the features. Unless we sign then the "regular jar signing way", they show up as unsigned in the install dialog.

martinlippert avatar Jun 09 '23 06:06 martinlippert

While the solution was designed ignoring features (the story was to be able to consume 3rd-party bundles directly and get them signed without altering them), the mojo could most likely be improved to also read and sign feature artifacts. A PR to add that support would be very welcome.

mickaelistria avatar Jun 09 '23 07:06 mickaelistria

@martinlippert can you describe how you proceed to make the unsigned warning disappear ? (do you modify the artifacts.xml file ?) Thanks

I have tried to jarsign the feature jar file to no avail. I have tried to gpg sign the feature jar file too (including updating artifacts.xml to add the properties pgp.signatures and pgp.publicKeys)

(By the way how is it that the properties are called pgp and not gpg ?)

yafred avatar Jun 28 '23 14:06 yafred

If signing of features with PGP means only adding: <property name='pgp.publicKeys' value='MY-PGP-KEY'/> under the proper artifact descriptor for a feature (i.e. classifier='org.eclipse.update.feature') then I think it is working... Or is there more than just artifacts.xml file?

BoykoAlex avatar Jun 29 '23 21:06 BoykoAlex

@BoykoAlex The page https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_pgp.html should tell it all.

(By the way how is it that the properties are called pgp and not gpg ?)

PGP is the cryptography strategy, gpg is one implementation, which we're not even using in Eclipse p2.

mickaelistria avatar Jun 30 '23 06:06 mickaelistria

If an artifact has been PGP signed, its artifact metadata will have both pgp.signatures and pgp.publicKeys properties like this one:

<artifact classifier='osgi.bundle' id='slf4j.api.source' version='2.0.7'>
  <properties size='13'>
    <property name='maven-groupId' value='org.slf4j'/>
    <property name='maven-artifactId' value='slf4j-api'/>
    <property name='maven-version' value='2.0.7'/>
    <property name='maven-classifier' value='sources'/>
    <property name='maven-repository' value='eclipse.maven.central.mirror'/>
    <property name='maven-type' value='jar'/>
    <property name='download.size' value='72932'/>
    <property name='artifact.size' value='72932'/>
    <property name='download.checksum.sha-512' value='0bf2f5807dedcc81b23c9dcd341c59e81339a1ef898f39a257b76c8a0ebdf7f4e94b8fda6e5c4c1e5981843a922a712b6f113b74435fc10485d7943d41d62563'/>
    <property name='download.checksum.sha-1' value='a017c6fd9ea69485bb22198ec8d5dd3d5805d467'/>
    <property name='download.checksum.sha-256' value='e75c0f77298ceaa7a5be9a43b5cc3af27067c0ce39c8c048cde2f50d0efd839b'/>
    <property name='pgp.signatures' value='-----BEGIN PGP SIGNATURE-----&#xA;&#xA;iQIzBAABCgAdFi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