提交 f423174d 编写于 作者: S Stephen Connolly

Additional safety as an addendum to 34b4bf52

上级 34b4bf52
......@@ -77,8 +77,11 @@ public class JSONSignatureValidator {
Set<TrustAnchor> anchors = new HashSet<TrustAnchor>(); // CertificateUtil.getDefaultRootCAs();
Jenkins j = Jenkins.getInstance();
for (String cert : (Set<String>) j.servletContext.getResourcePaths("/WEB-INF/update-center-rootCAs")) {
if (cert.endsWith(".txt")) continue; // skip text files that are meant to be documentation
if (cert.endsWith("/") || cert.endsWith(".txt")) {
continue; // skip directories also any text files that are meant to be documentation
}
InputStream in = j.servletContext.getResourceAsStream(cert);
if (in == null) continue; // our test for paths ending in / should prevent this from happening
Certificate certificate;
try {
certificate = cf.generateCertificate(in);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册