Community
Participate
Working Groups
I was testing out a workaround for bug309059 that involved setting the osgi configuration property org.osgi.framework.trust.repositories to point to a local keystore that contained the root certificate used by the foundation to sign jars. Basically I set the property to an older 1.5 sun VM cacerts that contains the necessary trusted root certificate for the Eclipse jars. This causes the framework to register another TrustEngine service that can be used to establish trust for signers. This issue is the p2 engine only gets a single TrustEngine service when checking for trust. By default, it will always get the first TrustEngine registered (unless someone uses a higher service ranking). The first one registered is for the cacerts of the running VM. If on the latest 1.5 or 1.6 Sun/Oracle VMs then this cacerts does not contain the necessary cert. Looking at the CertificateChecker code it seems that it should depend on the SignerInfo.isTrusted() method to determine trust. This allows the framework to determine the trust, and the framework does check all registered trust engines. The CertificateChecker is also attempting to save the decision of the user to trust a particular certificate. This code also has some issues, it needs to first check if the TrustEngine is read-only. I will attach a patch that fixes this.
Created attachment 167388 [details] patch And here is the patch.
I had discussed this with John yesterday. John, could you review this patch. I think it is rather important to get a workaround for bug309059.
Created attachment 167391 [details] patch Sorry, the last patch was not a workspace patch. Here is a full patch.
I'll take this for review.
This patch looks good. I tested with this repository that contains untrusted software with self-signed certs: http://eclipse.org/equinox/p2/testing/selfsignedsite We don't currently have any writable trust engines so it's hard to verify that part. However the only difference in this patch is that we persist trust to *all* writable trust engines rather than the first one we find.