Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Läubrich2021-08-18 13:58:56 -0400
committerMickael Istria2021-08-20 11:11:37 -0400
commit4be403ff429f6afccd3fb217b427161bdfb38bfa (patch)
tree93203dc62a14de97087710d2400bfcb3624a58ee
parent9dc7cd4c3662d7245006a4b880a5403d1b5a6616 (diff)
downloadrt.equinox.p2-I20210823-1800.tar.gz
rt.equinox.p2-I20210823-1800.tar.xz
rt.equinox.p2-I20210823-1800.zip
Change-Id: Id64a16886b9a0d66a9ae98748dedb0b9b4d7981e Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de> Also-By: Mickael Istria <mistria@redhat.com> Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/184213 Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-by: Mickael Istria <mistria@redhat.com> Reviewed-by: Thomas Watson <tjwatson@us.ibm.com> Tested-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pgp/PGPSignatureVerifier.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/PGPTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/artifacts.xml25
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/content.xml49
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/blah_1.0.0.123456.jarbin0 -> 408 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/blah_1.0.0.123456.jar.asc14
7 files changed, 101 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pgp/PGPSignatureVerifier.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pgp/PGPSignatureVerifier.java
index 38439d650..cc5304b1a 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pgp/PGPSignatureVerifier.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/processors/pgp/PGPSignatureVerifier.java
@@ -129,6 +129,9 @@ public final class PGPSignatureVerifier extends ProcessingStep {
if (value == null) {
return null;
}
+ if (value.contains("\n") || value.contains("\r")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return value;
+ }
return value.replace(' ', '\n').replace("-----BEGIN\nPGP\nSIGNATURE-----", "-----BEGIN PGP SIGNATURE-----") //$NON-NLS-1$ //$NON-NLS-2$
.replace("-----END\nPGP\nSIGNATURE-----", "-----END PGP SIGNATURE-----") //$NON-NLS-1$ //$NON-NLS-2$
.replace("-----BEGIN\nPGP\nPUBLIC\nKEY\nBLOCK-----", "-----BEGIN PGP PUBLIC KEY BLOCK-----") //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/PGPTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/PGPTest.java
index 595a6239f..8a935e4b5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/PGPTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/PGPTest.java
@@ -46,6 +46,12 @@ public class PGPTest extends AbstractProvisioningTest {
assertOK(mirrorStatus);
}
+ @Test
+ public void testAllGoodWithEncodedProperties() throws Exception {
+ IStatus mirrorStatus = performMirrorFrom("repoPGPOK_encoded");
+ assertOK(mirrorStatus);
+ }
+
private IStatus performMirrorFrom(String repoName) throws Exception {
loadPGPTestRepo(repoName);
ArtifactKey key = new ArtifactKey("osgi.bundle", "blah", Version.create("1.0.0.123456"));
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/artifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/artifacts.xml
new file mode 100644
index 000000000..43557706b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/artifacts.xml
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?artifactRepository version='1.1.0'?>
+<repository name='file:/home/mistria/sandbox/repo/ - artifacts' type='org.eclipse.equinox.p2.artifact.repository.simpleRepository' version='1'>
+ <properties size='3'>
+ <property name='p2.timestamp' value='1618433231272'/>
+ <property name='p2.compressed' value='false'/>
+ <!-- See PGPSignatureVerifierTest about this public key -->
+ <!-- encoded with org.eclipse.equinox.internal.p2.persistence.XMLWriter.escape() -->
+ <property name='pgp.publicKeys' value='-----BEGIN PGP PUBLIC KEY BLOCK-----&#xA;&#xA;mQGNBGB1bugBDADQ5l7YnS9hNFRkBKSrvVNHt/TxeHaNNIHkdTC56I1QdThsOt4Y&#xA;oQRI27AEOaY1GFEi6+QqwxALcMMMSTgkCRs2NFGqlWMVzNYE7bJMWChVa7uQ/9CG&#xA;1HRbXwVwQx3hFgU4kmw1Kl/IH4LX76d9gAMyFANPjYZJSjbAv54wOlKruDRgpQFF&#xA;pZeuXW7SnerL6sgd/+ZroikdkrjIs5t18C2ofzf6YnOokYkEEJSAEoQK5svVzT4G&#xA;H3sw6FlE41RvnYKpuhvvyQhKjISDYfRaIL4JIpvR9Uko48eN9x654lJaucbMiLP4&#xA;ROI9q7RQ6t1IMCiIN9QKgS+nVtHnN9MnXS0czGxfLdStv6bB+xgUoyBc7Uiqf4X0&#xA;x8z9PE6O1L6Rgy2JMJHPgLWCF8h/u1FO88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A;'/>
+ </properties>
+ <mappings size='3'>
+ <rule filter='(&amp; (classifier=osgi.bundle))' output='${repoUrl}/plugins/${id}_${version}.jar'/>
+ <rule filter='(&amp; (classifier=binary))' output='${repoUrl}/binary/${id}_${version}'/>
+ <rule filter='(&amp; (classifier=org.eclipse.update.feature))' output='${repoUrl}/features/${id}_${version}.jar'/>
+ </mappings>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='blah' version='1.0.0.123456'>
+ <properties size='1'>
+ <!-- gpg -u signer1@fakeuser.eclipse.org -a -detach-sig plugins/blah_1.0.0.123456.jar -->
+ <!-- encoded with org.eclipse.equinox.internal.p2.persistence.XMLWriter.escape() -->
+ <property name='pgp.signatures' value='-----BEGIN PGP SIGNATURE-----&#xA;&#xA;iQHRBAABCAA7FiEE6ZbGcKp/ZUCb9dtWE5442Q3tEfAFAmB4Bf8dHHNpZ25lcjFA&#xA;ZmFrZXVzZXIuZWNsaXBzZS5vcmcACgkQE5442Q3tEfBPuAwAhE4zA7BswKFhEtzm&#xA;DS3EbyRr/U13sV01YxqGtxYDCfrOt8TGVPXJSvo0AVP4vLFc5b+0jtVFoarFJNBu&#xA;xhbVuyC72YdqudNbncSlW6KG5SgeWIM//ThKfl95pOWRWvJEoKJhmDwbDqhZYtL5&#xA;SECegnWGtGx/klFtZihzHYJE/nfSnhySDaz5lCvXFFYRhIbNmNm2Yq7ztCOsN4Ys&#xA;3uN+GEdoXGvv1DFg/xZPvwCOhZGsSQfkl1jmUwVltgKrw9OCFbdfYz7H6dbGWhRu&#xA;2XpuKxPXGavKfpSvssVQIZ6aWi5W6wp5lZAQQddZvYAv3Gi5CZZcUT7ayFJYdD23&#xA;p9jz76G7MXm0f0uNT9B57T72QryokUIEIJYsCb6lNjWUQB4cd0+JesM7sHwweOQ3&#xA;7iTFc+WgVJkP0e695mm1tcvtQHUPbIItYJUsndyLgGInzglxN8+F4U4k8uapydI9&#xA;RmV2NVAifYp8z95Am5AnlG8lqjwrWk5bMbJH82QsQESrNT/h&#xA;=8Vrn&#xA;-----END PGP SIGNATURE-----&#xA;'/>
+ </properties>
+ </artifact>
+ </artifacts>
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/content.xml
new file mode 100644
index 000000000..db8f67ba2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/content.xml
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.2.0'?>
+<repository name='file:/home/mistria/sandbox/repo/ - metadata' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>
+ <properties size='2'>
+ <property name='p2.timestamp' value='1618433231272'/>
+ <property name='p2.compressed' value='false'/>
+ </properties>
+ <units size='2'>
+ <unit id='blah' version='1.0.0.123456' singleton='false'>
+ <update id='blah' range='[0.0.0,1.0.0.123456)' severity='0'/>
+ <provides size='4'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='blah' version='1.0.0.123456'/>
+ <provided namespace='osgi.bundle' name='blah' version='1.0.0.123456'/>
+ <provided namespace='osgi.identity' name='blah' version='1.0.0.123456'>
+ <properties size='1'>
+ <property name='type' value='osgi.bundle'/>
+ </properties>
+ </provided>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
+ </provides>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='blah' version='1.0.0.123456'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='2'>
+ <instruction key='zipped'>
+ true
+ </instruction>
+ <instruction key='manifest'>
+ Bundle-SymbolicName: blah&#xA;Bundle-Version: 1.0.0.qualifier&#xA;
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+ <unit id='Category' version='0.0.0'>
+ <properties size='3'>
+ <property name='org.eclipse.equinox.p2.type.category' value='true'/>
+ </properties>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='Category' version='0.0.0'/>
+ </provides>
+ <requires size='1'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='blah' range='[1.0.0.123456,1.0.0.123456]'/>
+ </requires>
+ <touchpoint id='null' version='0.0.0'/>
+ </unit>
+ </units>
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..b9fdcbf2f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/META-INF/MANIFEST.MF
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: blah
+Bundle-Version: 1.0.0.qualifier
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/blah_1.0.0.123456.jar b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/blah_1.0.0.123456.jar
new file mode 100644
index 000000000..9cc7b8da0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/blah_1.0.0.123456.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/blah_1.0.0.123456.jar.asc b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/blah_1.0.0.123456.jar.asc
new file mode 100644
index 000000000..1489f2552
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/pgp/repoPGPOK_encoded/plugins/blah_1.0.0.123456.jar.asc
@@ -0,0 +1,14 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQHRBAABCAA7FiEE6ZbGcKp/ZUCb9dtWE5442Q3tEfAFAmB4Bf8dHHNpZ25lcjFA
+ZmFrZXVzZXIuZWNsaXBzZS5vcmcACgkQE5442Q3tEfBPuAwAhE4zA7BswKFhEtzm
+DS3EbyRr/U13sV01YxqGtxYDCfrOt8TGVPXJSvo0AVP4vLFc5b+0jtVFoarFJNBu
+xhbVuyC72YdqudNbncSlW6KG5SgeWIM//ThKfl95pOWRWvJEoKJhmDwbDqhZYtL5
+SECegnWGtGx/klFtZihzHYJE/nfSnhySDaz5lCvXFFYRhIbNmNm2Yq7ztCOsN4Ys
+3uN+GEdoXGvv1DFg/xZPvwCOhZGsSQfkl1jmUwVltgKrw9OCFbdfYz7H6dbGWhRu
+2XpuKxPXGavKfpSvssVQIZ6aWi5W6wp5lZAQQddZvYAv3Gi5CZZcUT7ayFJYdD23
+p9jz76G7MXm0f0uNT9B57T72QryokUIEIJYsCb6lNjWUQB4cd0+JesM7sHwweOQ3
+7iTFc+WgVJkP0e695mm1tcvtQHUPbIItYJUsndyLgGInzglxN8+F4U4k8uapydI9
+RmV2NVAifYp8z95Am5AnlG8lqjwrWk5bMbJH82QsQESrNT/h
+=8Vrn
+-----END PGP SIGNATURE-----

Back to the top