diff options
author | Jiri Vanek <[email protected]> | 2013-09-25 18:50:18 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-09-25 18:50:18 +0200 |
commit | 19e74fe5dacd03e0cb5582f840e15262e39fe24f (patch) | |
tree | 38ffc4f47f7641f8d20ba0e0e8a97a97ffb1db64 /netx/net/sourceforge/jnlp/tools | |
parent | fcd5c4c69fc5ea84b04f309eb40e295eab921fd8 (diff) |
Introduced logging bottleneck
Diffstat (limited to 'netx/net/sourceforge/jnlp/tools')
-rw-r--r-- | netx/net/sourceforge/jnlp/tools/CertInformation.java | 4 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/tools/JarCertVerifier.java | 23 |
2 files changed, 9 insertions, 18 deletions
diff --git a/netx/net/sourceforge/jnlp/tools/CertInformation.java b/netx/net/sourceforge/jnlp/tools/CertInformation.java index 6d6d27e..18a7b64 100644 --- a/netx/net/sourceforge/jnlp/tools/CertInformation.java +++ b/netx/net/sourceforge/jnlp/tools/CertInformation.java @@ -46,6 +46,7 @@ import java.util.List; import java.util.Map; import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.util.logging.OutputController; /** * Maintains information about a CertPath that has signed at least one of the @@ -163,8 +164,7 @@ public class CertInformation { */ public void setNumJarEntriesSigned(String jarName, int signedEntriesCount) { if (signedJars.containsKey(jarName)) { - if (JNLPRuntime.isDebug()) - System.err.println("WARNING: A jar that has already been " + OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "WARNING: A jar that has already been " + "verified is being yet again verified: " + jarName); } else { signedJars.put(jarName, signedEntriesCount); diff --git a/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java b/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java index db9699d..31270e8 100644 --- a/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java +++ b/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java @@ -52,6 +52,7 @@ import net.sourceforge.jnlp.security.AppVerifier; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.CertificateUtils; import net.sourceforge.jnlp.security.KeyStores; +import net.sourceforge.jnlp.util.logging.OutputController; import sun.security.util.DerInputStream; import sun.security.util.DerValue; import sun.security.x509.NetscapeCertTypeExtension; @@ -117,19 +118,15 @@ public class JarCertVerifier implements CertVerifier { public boolean getAlreadyTrustPublisher() { boolean allPublishersTrusted = appVerifier.hasAlreadyTrustedPublisher( certs, jarSignableEntries); - if (JNLPRuntime.isDebug()) { - System.out.println("App already has trusted publisher: " + OutputController.getLogger().log("App already has trusted publisher: " + allPublishersTrusted); - } return allPublishersTrusted; } public boolean getRootInCacerts() { boolean allRootCAsTrusted = appVerifier.hasRootInCacerts(certs, jarSignableEntries); - if (JNLPRuntime.isDebug()) { - System.out.println("App has trusted root CA: " + allRootCAsTrusted); - } + OutputController.getLogger().log("App has trusted root CA: " + allRootCAsTrusted); return allRootCAsTrusted; } @@ -181,10 +178,8 @@ public class JarCertVerifier implements CertVerifier { return true; boolean fullySigned = appVerifier.isFullySigned(certs, jarSignableEntries); - if (JNLPRuntime.isDebug()) { - System.out.println("App already has trusted publisher: " + OutputController.getLogger().log("App already has trusted publisher: " + fullySigned); - } return fullySigned; } @@ -292,7 +287,7 @@ public class JarCertVerifier implements CertVerifier { entriesVec); } catch (Exception e) { - e.printStackTrace(); + OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); throw e; } finally { // close the resource if (jarFile != null) { @@ -418,10 +413,8 @@ public class JarCertVerifier implements CertVerifier { result = VerifyResult.UNSIGNED; } - if (JNLPRuntime.isDebug()) { - System.out.println("Jar found at " + jarName + OutputController.getLogger().log("Jar found at " + jarName + "has been verified as " + result); - } return result; } @@ -452,9 +445,7 @@ public class JarCertVerifier implements CertVerifier { // TODO: Warn user about not being able to // look through their cacerts/trusted.certs // file depending on exception. - if (JNLPRuntime.isDebug()) { - System.out.println("WARNING: Unable to read through cert store files."); - } + OutputController.getLogger().log("WARNING: Unable to read through cert store files."); throw e; } |