[Releng] Fix problem with certificate sorting
Remove bougs debug logic.
diff --git a/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/RepositoryIntegrityAnalyzer.java b/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/RepositoryIntegrityAnalyzer.java
index 8c0cd64..87709fc 100644
--- a/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/RepositoryIntegrityAnalyzer.java
+++ b/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/RepositoryIntegrityAnalyzer.java
@@ -1921,64 +1921,6 @@
{
Certificate[] certificateChain = signerInfo.getCertificateChain();
List<Certificate> certificateList = Arrays.asList(certificateChain);
-
- if (file.toString().contains("org.eclipse.emf.databinding_1.6.0.v20220516-1117.jar"))
- {
- for (Certificate certificate : certificateChain)
- {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'-'MM'-'dd");
- X509Certificate x509Certificate = (X509Certificate)certificate;
- String notBefore = dateFormat.format(x509Certificate.getNotBefore());
- String notAfter = dateFormat.format(x509Certificate.getNotAfter());
- X500Principal subjectX500Principal = x509Certificate.getSubjectX500Principal();
- String name = subjectX500Principal.getName();
- Pattern namePattern = Pattern.compile("([A-Za-z]+)=(([^,\\\\]|\\\\,)+),");
- Matcher matcher = namePattern.matcher(name);
- Map<String, String> components = new LinkedHashMap<>();
- while (matcher.find())
- {
- components.put(matcher.group(1), matcher.group(2).replaceAll("\\\\", ""));
- }
-
- components.put("from", notBefore);
- components.put("to", notAfter);
-
- System.err.println("###1" + components);
- break;
- }
-
- for (List<Certificate> list : certificates.keySet())
- {
- if (list.equals(certificateList))
- {
- System.err.println("###");
- }
-
- for (Certificate certificate : list)
- {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'-'MM'-'dd");
- X509Certificate x509Certificate = (X509Certificate)certificate;
- String notBefore = dateFormat.format(x509Certificate.getNotBefore());
- String notAfter = dateFormat.format(x509Certificate.getNotAfter());
- X500Principal subjectX500Principal = x509Certificate.getSubjectX500Principal();
- String name = subjectX500Principal.getName();
- Pattern namePattern = Pattern.compile("([A-Za-z]+)=(([^,\\\\]|\\\\,)+),");
- Matcher matcher = namePattern.matcher(name);
- Map<String, String> components = new LinkedHashMap<>();
- while (matcher.find())
- {
- components.put(matcher.group(1), matcher.group(2).replaceAll("\\\\", ""));
- }
-
- components.put("from", notBefore);
- components.put("to", notAfter);
-
- System.err.println("###Other" + components);
- break;
- }
- }
- }
-
Map<String, IInstallableUnit> artifacts = certificates.get(certificateList);
if (artifacts == null)
{
@@ -3589,96 +3531,7 @@
return null;
}
- SignedContent signedContent2 = verifierFactory.getSignedContent(targetFile);
- if (file.toString().contains("org.eclipse.emf.databinding_1.6.0.v20220516-1117.jar"))
- {
- if (signedContent2 != null && signedContent2.isSigned())
- {
- Certificate c1 = null;
- Certificate c2 = null;
-
- SignedContent signedContent3 = verifierFactory.getSignedContent(new File(
- "D:\\Users\\merks\\oomph-1.25\\git\\org.eclipse.oomph\\plugins\\org.eclipse.oomph.p2.core\\report\\platform\\artifacts\\plugins\\org.eclipse.swt.examples_3.107.300.v20220418-1921.jar"));
-
- {
- SignerInfo[] signerInfos = signedContent2.getSignerInfos();
- for (SignerInfo signerInfo : signerInfos)
- {
- Certificate[] certificateChain = signerInfo.getCertificateChain();
- for (Certificate certificate : certificateChain)
- {
- if (c1 == null)
- {
- c1 = certificate;
- }
-
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'-'MM'-'dd");
- X509Certificate x509Certificate = (X509Certificate)certificate;
- String notBefore = dateFormat.format(x509Certificate.getNotBefore());
- String notAfter = dateFormat.format(x509Certificate.getNotAfter());
- X500Principal subjectX500Principal = x509Certificate.getSubjectX500Principal();
- String name = subjectX500Principal.getName();
- Pattern namePattern = Pattern.compile("([A-Za-z]+)=(([^,\\\\]|\\\\,)+),");
- Matcher matcher = namePattern.matcher(name);
- Map<String, String> components = new LinkedHashMap<>();
- while (matcher.find())
- {
- components.put(matcher.group(1), matcher.group(2).replaceAll("\\\\", ""));
- }
-
- components.put("from", notBefore);
- components.put("to", notAfter);
-
- System.err.println("###1" + components);
- break;
- }
- }
- }
- {
- SignerInfo[] signerInfos = signedContent3.getSignerInfos();
- for (SignerInfo signerInfo : signerInfos)
- {
- Certificate[] certificateChain = signerInfo.getCertificateChain();
- for (Certificate certificate : certificateChain)
- {
- if (c2 == null)
- {
- c2 = certificate;
- }
-
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'-'MM'-'dd");
- X509Certificate x509Certificate = (X509Certificate)certificate;
- String notBefore = dateFormat.format(x509Certificate.getNotBefore());
- String notAfter = dateFormat.format(x509Certificate.getNotAfter());
- X500Principal subjectX500Principal = x509Certificate.getSubjectX500Principal();
- String name = subjectX500Principal.getName();
- Pattern namePattern = Pattern.compile("([A-Za-z]+)=(([^,\\\\]|\\\\,)+),");
- Matcher matcher = namePattern.matcher(name);
- Map<String, String> components = new LinkedHashMap<>();
- while (matcher.find())
- {
- components.put(matcher.group(1), matcher.group(2).replaceAll("\\\\", ""));
- }
-
- components.put("from", notBefore);
- components.put("to", notAfter);
-
- System.err.println("###2" + components);
- break;
- }
- }
- }
-
- System.err.println("###");
- if (c1.equals(c2))
- {
- System.err.println("###!!");
-
- }
- }
- }
-
- return signedContent2;
+ return verifierFactory.getSignedContent(targetFile);
}
});