aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog20
-rw-r--r--netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java52
-rw-r--r--netx/net/sourceforge/jnlp/security/CertWarningPane.java8
-rw-r--r--netx/net/sourceforge/jnlp/security/CertsInfoPane.java2
-rw-r--r--netx/net/sourceforge/jnlp/security/MoreInfoPane.java2
-rw-r--r--netx/net/sourceforge/jnlp/security/SecurityDialog.java22
-rw-r--r--netx/net/sourceforge/jnlp/security/SecurityDialogs.java6
-rw-r--r--netx/net/sourceforge/jnlp/tools/JarCertVerifier.java (renamed from netx/net/sourceforge/jnlp/tools/JarSigner.java)4
-rw-r--r--netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java2
9 files changed, 69 insertions, 49 deletions
diff --git a/ChangeLog b/ChangeLog
index 93d4557..58c4189 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2012-04-04 Danesh Dadachanji <[email protected]>
+ Change the name of JarSigner to JarCertVerifier to make it more
+ relevant to the purpose of the file.
+ * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+ * netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java:
+ Replace all instances, paramaters and references of JarSigner
+ by JarCertVerifier.
+ * netx/net/sourceforge/jnlp/security/CertWarningPane.java
+ * netx/net/sourceforge/jnlp/security/CertsInfoPane.java
+ * netx/net/sourceforge/jnlp/security/MoreInfoPane.java
+ * netx/net/sourceforge/jnlp/security/SecurityDialogs.java:
+ Replaced all paramaters, references and variable names of JarSigner
+ to CertVerifier to match the variable object type.
+ * netx/net/sourceforge/jnlp/security/SecurityDialog.java (getJarSigner):
+ Renamed to getCertVerifier as it returns the certVerfier instance.
+ * netx/net/sourceforge/jnlp/tools/JarSigner.java:
+ Renamed to JarCertVerifier.
+ * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java:
+ The rename of JarSigner.
+
2012-04-05 Jiri Vanek <[email protected]>
Fixing issue when process was not launched at all and when was killed but
diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
index cfca05d..6fbc531 100644
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
@@ -72,7 +72,7 @@ import net.sourceforge.jnlp.cache.ResourceTracker;
import net.sourceforge.jnlp.cache.UpdatePolicy;
import net.sourceforge.jnlp.security.SecurityDialogs;
import net.sourceforge.jnlp.security.SecurityDialogs.AccessType;
-import net.sourceforge.jnlp.tools.JarSigner;
+import net.sourceforge.jnlp.tools.JarCertVerifier;
import net.sourceforge.jnlp.util.FileUtils;
import sun.misc.JarIndex;
@@ -150,8 +150,8 @@ public class JNLPClassLoader extends URLClassLoader {
/** all of the jar files that were not verified */
private ArrayList<String> unverifiedJars = null;
- /** the jarsigner tool to verify our jars */
- private JarSigner js = null;
+ /** the jar cert verifier tool to verify our jars */
+ private JarCertVerifier jcv = null;
private boolean signing = false;
@@ -469,13 +469,13 @@ public class JNLPClassLoader extends URLClassLoader {
if (JNLPRuntime.isVerifying()) {
- JarSigner js;
+ JarCertVerifier jcv;
waitForJars(initialJars); //download the jars first.
try {
- js = verifyJars(initialJars);
+ jcv = verifyJars(initialJars);
} catch (Exception e) {
- //we caught an Exception from the JarSigner class.
+ //we caught an Exception from the JarCertVerifier class.
//Note: one of these exceptions could be from not being able
//to read the cacerts or trusted.certs files.
e.printStackTrace();
@@ -484,10 +484,10 @@ public class JNLPClassLoader extends URLClassLoader {
}
//Case when at least one jar has some signing
- if (js.anyJarsSigned() && js.isFullySignedByASingleCert()) {
+ if (jcv.anyJarsSigned() && jcv.isFullySignedByASingleCert()) {
signing = true;
- if (!js.allJarsSigned() &&
+ if (!jcv.allJarsSigned() &&
!SecurityDialogs.showNotAllSignedWarningDialog(file))
throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo"));
@@ -515,8 +515,8 @@ public class JNLPClassLoader extends URLClassLoader {
file.setSignedJNLPAsMissing();
//user does not trust this publisher
- if (!js.getAlreadyTrustPublisher()) {
- checkTrustWithUser(js);
+ if (!jcv.getAlreadyTrustPublisher()) {
+ checkTrustWithUser(jcv);
} else {
/**
* If the user trusts this publisher (i.e. the publisher's certificate
@@ -700,7 +700,7 @@ public class JNLPClassLoader extends URLClassLoader {
private void verifySignedJNLP(JARDesc jarDesc, JarFile jarFile)
throws LaunchException {
- JarSigner signer = new JarSigner();
+ JarCertVerifier signer = new JarCertVerifier();
List<JARDesc> desc = new ArrayList<JARDesc>();
desc.add(jarDesc);
@@ -797,7 +797,7 @@ public class JNLPClassLoader extends URLClassLoader {
/*
* After this exception is caught, it is escaped. If an exception is
* thrown while handling the jar file, (mainly for
- * JarSigner.verifyJars) it assumes the jar file is unsigned and
+ * JarCertVerifier.verifyJars) it assumes the jar file is unsigned and
* skip the check for a signed JNLP file
*/
@@ -828,24 +828,24 @@ public class JNLPClassLoader extends URLClassLoader {
}
}
- private void checkTrustWithUser(JarSigner js) throws LaunchException {
+ private void checkTrustWithUser(JarCertVerifier jcv) throws LaunchException {
if (JNLPRuntime.isTrustAll()){
return;
}
- if (!js.getRootInCacerts()) { //root cert is not in cacerts
+ if (!jcv.getRootInCacerts()) { //root cert is not in cacerts
boolean b = SecurityDialogs.showCertWarningDialog(
- AccessType.UNVERIFIED, file, js);
+ AccessType.UNVERIFIED, file, jcv);
if (!b)
throw new LaunchException(null, null, R("LSFatal"),
R("LCLaunching"), R("LNotVerified"), "");
- } else if (js.getRootInCacerts()) { //root cert is in cacerts
+ } else if (jcv.getRootInCacerts()) { //root cert is in cacerts
boolean b = false;
- if (js.noSigningIssues())
+ if (jcv.noSigningIssues())
b = SecurityDialogs.showCertWarningDialog(
- AccessType.VERIFIED, file, js);
- else if (!js.noSigningIssues())
+ AccessType.VERIFIED, file, jcv);
+ else if (!jcv.noSigningIssues())
b = SecurityDialogs.showCertWarningDialog(
- AccessType.SIGNING_ERROR, file, js);
+ AccessType.SIGNING_ERROR, file, jcv);
if (!b)
throw new LaunchException(null, null, R("LSFatal"),
R("LCLaunching"), R("LCancelOnUserRequest"), "");
@@ -1031,7 +1031,7 @@ public class JNLPClassLoader extends URLClassLoader {
continue;
}
- JarSigner signer = new JarSigner();
+ JarCertVerifier signer = new JarCertVerifier();
List<JARDesc> jars = new ArrayList<JARDesc>();
JARDesc jarDesc = new JARDesc(new File(extractedJarLocation).toURL(), null, null, false, false, false, false);
jars.add(jarDesc);
@@ -1280,11 +1280,11 @@ public class JNLPClassLoader extends URLClassLoader {
*
* @param jars the jars to be verified.
*/
- private JarSigner verifyJars(List<JARDesc> jars) throws Exception {
+ private JarCertVerifier verifyJars(List<JARDesc> jars) throws Exception {
- js = new JarSigner();
- js.verifyJars(jars, tracker);
- return js;
+ jcv = new JarCertVerifier();
+ jcv.verifyJars(jars, tracker);
+ return jcv;
}
/**
@@ -1442,7 +1442,7 @@ public class JNLPClassLoader extends URLClassLoader {
// Verify if needed
- final JarSigner signer = new JarSigner();
+ final JarCertVerifier signer = new JarCertVerifier();
final List<JARDesc> jars = new ArrayList<JARDesc>();
jars.add(desc);
diff --git a/netx/net/sourceforge/jnlp/security/CertWarningPane.java b/netx/net/sourceforge/jnlp/security/CertWarningPane.java
index 79ad0ce..c095212 100644
--- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java
+++ b/netx/net/sourceforge/jnlp/security/CertWarningPane.java
@@ -96,7 +96,7 @@ public class CertWarningPane extends SecurityDialogPanel {
private void addComponents() {
AccessType type = parent.getAccessType();
JNLPFile file = parent.getFile();
- Certificate c = parent.getJarSigner().getPublisher();
+ Certificate c = parent.getCertVerifier().getPublisher();
String name = "";
String publisher = "";
@@ -222,7 +222,7 @@ public class CertWarningPane extends SecurityDialogPanel {
JButton moreInfo = new JButton(R("ButMoreInformation"));
moreInfo.addActionListener(new MoreInfoButtonListener());
- if (parent.getJarSigner().getRootInCacerts())
+ if (parent.getCertVerifier().getRootInCacerts())
bottomLabel = new JLabel(htmlWrap(R("STrustedSource")));
else
bottomLabel = new JLabel(htmlWrap(R("SUntrustedSource")));
@@ -239,7 +239,7 @@ public class CertWarningPane extends SecurityDialogPanel {
private class MoreInfoButtonListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
- SecurityDialog.showMoreInfoDialog(parent.getJarSigner(),
+ SecurityDialog.showMoreInfoDialog(parent.getCertVerifier(),
parent);
}
}
@@ -252,7 +252,7 @@ public class CertWarningPane extends SecurityDialogPanel {
if (alwaysTrust != null && alwaysTrust.isSelected()) {
try {
KeyStore ks = KeyStores.getKeyStore(Level.USER, Type.CERTS);
- X509Certificate c = (X509Certificate) parent.getJarSigner().getPublisher();
+ X509Certificate c = (X509Certificate) parent.getCertVerifier().getPublisher();
CertificateUtils.addToKeyStore(c, ks);
File keyStoreFile = new File(KeyStores.getKeyStoreLocation(Level.USER, Type.CERTS));
if (!keyStoreFile.isFile()) {
diff --git a/netx/net/sourceforge/jnlp/security/CertsInfoPane.java b/netx/net/sourceforge/jnlp/security/CertsInfoPane.java
index c6ea187..c4f7c67 100644
--- a/netx/net/sourceforge/jnlp/security/CertsInfoPane.java
+++ b/netx/net/sourceforge/jnlp/security/CertsInfoPane.java
@@ -84,7 +84,7 @@ public class CertsInfoPane extends SecurityDialogPanel {
* Builds the JTree out of CertPaths.
*/
void buildTree() {
- certPath = parent.getJarSigner().getCertPath();
+ certPath = parent.getCertVerifier().getCertPath();
X509Certificate firstCert =
((X509Certificate) certPath.getCertificates().get(0));
String subjectString =
diff --git a/netx/net/sourceforge/jnlp/security/MoreInfoPane.java b/netx/net/sourceforge/jnlp/security/MoreInfoPane.java
index a46f3ff..3276ea2 100644
--- a/netx/net/sourceforge/jnlp/security/MoreInfoPane.java
+++ b/netx/net/sourceforge/jnlp/security/MoreInfoPane.java
@@ -118,7 +118,7 @@ public class MoreInfoPane extends SecurityDialogPanel {
private class CertInfoButtonListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
- SecurityDialog.showCertInfoDialog(parent.getJarSigner(),
+ SecurityDialog.showCertInfoDialog(parent.getCertVerifier(),
parent);
}
}
diff --git a/netx/net/sourceforge/jnlp/security/SecurityDialog.java b/netx/net/sourceforge/jnlp/security/SecurityDialog.java
index 8ffbdd4..7c1c607 100644
--- a/netx/net/sourceforge/jnlp/security/SecurityDialog.java
+++ b/netx/net/sourceforge/jnlp/security/SecurityDialog.java
@@ -96,12 +96,12 @@ public class SecurityDialog extends JDialog {
private boolean requiresSignedJNLPWarning;
SecurityDialog(DialogType dialogType, AccessType accessType,
- JNLPFile file, CertVerifier jarSigner, X509Certificate cert, Object[] extras) {
+ JNLPFile file, CertVerifier JarCertVerifier, X509Certificate cert, Object[] extras) {
super();
this.dialogType = dialogType;
this.accessType = accessType;
this.file = file;
- this.certVerifier = jarSigner;
+ this.certVerifier = JarCertVerifier;
this.cert = cert;
this.extras = extras;
initialized = true;
@@ -124,8 +124,8 @@ public class SecurityDialog extends JDialog {
* Create a SecurityDialog to display a certificate-related warning
*/
SecurityDialog(DialogType dialogType, AccessType accessType,
- JNLPFile file, CertVerifier jarSigner) {
- this(dialogType, accessType, file, jarSigner, null, null);
+ JNLPFile file, CertVerifier certVerifier) {
+ this(dialogType, accessType, file, certVerifier, null, null);
}
/**
@@ -164,16 +164,16 @@ public class SecurityDialog extends JDialog {
/**
* Shows more information regarding jar code signing
*
- * @param jarSigner the JarSigner used to verify this application
+ * @param certVerifier the JarCertVerifier used to verify this application
* @param parent the parent option pane
*/
public static void showMoreInfoDialog(
- CertVerifier jarSigner, SecurityDialog parent) {
+ CertVerifier certVerifier, SecurityDialog parent) {
JNLPFile file= parent.getFile();
SecurityDialog dialog =
new SecurityDialog(DialogType.MORE_INFO, null, file,
- jarSigner);
+ certVerifier);
dialog.setModalityType(ModalityType.APPLICATION_MODAL);
dialog.setVisible(true);
dialog.dispose();
@@ -182,13 +182,13 @@ public class SecurityDialog extends JDialog {
/**
* Displays CertPath information in a readable table format.
*
- * @param jarSigner the JarSigner used to verify this application
+ * @param certVerifier the JarCertVerifier used to verify this application
* @param parent the parent option pane
*/
- public static void showCertInfoDialog(CertVerifier jarSigner,
+ public static void showCertInfoDialog(CertVerifier certVerifier,
SecurityDialog parent) {
SecurityDialog dialog = new SecurityDialog(DialogType.CERT_INFO,
- null, null, jarSigner);
+ null, null, certVerifier);
dialog.setLocationRelativeTo(parent);
dialog.setModalityType(ModalityType.APPLICATION_MODAL);
dialog.setVisible(true);
@@ -276,7 +276,7 @@ public class SecurityDialog extends JDialog {
return file;
}
- public CertVerifier getJarSigner() {
+ public CertVerifier getCertVerifier() {
return certVerifier;
}
diff --git a/netx/net/sourceforge/jnlp/security/SecurityDialogs.java b/netx/net/sourceforge/jnlp/security/SecurityDialogs.java
index d13aef9..c5bf824 100644
--- a/netx/net/sourceforge/jnlp/security/SecurityDialogs.java
+++ b/netx/net/sourceforge/jnlp/security/SecurityDialogs.java
@@ -180,12 +180,12 @@ public class SecurityDialogs {
*
* @param accessType the type of warning dialog to show
* @param file the JNLPFile associated with this warning
- * @param jarSigner the JarSigner used to verify this application
+ * @param certVerifier the JarCertVerifier used to verify this application
*
* @return true if the user accepted the certificate
*/
public static boolean showCertWarningDialog(AccessType accessType,
- JNLPFile file, CertVerifier jarSigner) {
+ JNLPFile file, CertVerifier certVerifier) {
if (!shouldPromptUser()) {
return false;
@@ -195,7 +195,7 @@ public class SecurityDialogs {
message.dialogType = DialogType.CERT_WARNING;
message.accessType = accessType;
message.file = file;
- message.certVerifier = jarSigner;
+ message.certVerifier = certVerifier;
Object selectedValue = getUserResponse(message);
diff --git a/netx/net/sourceforge/jnlp/tools/JarSigner.java b/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java
index fbae6e2..fa22675 100644
--- a/netx/net/sourceforge/jnlp/tools/JarSigner.java
+++ b/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java
@@ -42,13 +42,13 @@ import net.sourceforge.jnlp.cache.*;
import net.sourceforge.jnlp.security.*;
/**
- * <p>The jarsigner utility.
+ * <p>The jar certificate verifier utility.
*
* @author Roland Schemers
* @author Jan Luehe
*/
-public class JarSigner implements CertVerifier {
+public class JarCertVerifier implements CertVerifier {
private static final String META_INF = "META-INF/";
diff --git a/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java b/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java
index 017bbea..f69964d 100644
--- a/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java
+++ b/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java
@@ -33,7 +33,7 @@ package net.sourceforge.jnlp.tools;
public class KeyStoreUtil {
// Class and methods marked as public so that they can be
- // accessed by JarSigner, which although lies in a package
+ // accessed by JarCertVerifier, which although lies in a package
// with the same name, but bundled in tools.jar and loaded
// by another class loader, hence in a different *runtime*
// package.