/hg/release/icedtea-web-1.7: 7 new changesets
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Mon Sep 10 15:43:46 UTC 2018
changeset e3d4b4e9f37c in /hg/release/icedtea-web-1.7
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.7?cmd=changeset;node=e3d4b4e9f37c
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Sep 10 17:34:00 2018 +0200
Made headless detection softer
changeset 96c91c6c1bb3 in /hg/release/icedtea-web-1.7
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.7?cmd=changeset;node=96c91c6c1bb3
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Sep 10 17:35:31 2018 +0200
added deployment property to enforce headfull execution
* netx/net/sourceforge/jnlp/config/Defaults.java: IGNORE_HEADLESS_CHECK set to false
* netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: deployment.headless.ignore
* netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: if deployment.headless.ignore is true, then headless state is not checked and environment is always considered as headfull
changeset cd94fb214752 in /hg/release/icedtea-web-1.7
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.7?cmd=changeset;node=cd94fb214752
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Sep 10 17:36:21 2018 +0200
Added semi support for recognition jdk10 and up
* netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java: replaced hardcoded 9 by cycle from 9 to 99
* netx/net/sourceforge/jnlp/resources/Messages.properties: replaced jdk9 by jdk9 and up.
changeset f136f53d661c in /hg/release/icedtea-web-1.7
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.7?cmd=changeset;node=f136f53d661c
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Sep 10 17:37:30 2018 +0200
netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java: fixed hex output of certificate signature for jdk8
changeset 28e58481df58 in /hg/release/icedtea-web-1.7
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.7?cmd=changeset;node=28e58481df58
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Sep 10 17:38:14 2018 +0200
Enhanced itw-settngs' certificate viewer to show what file is backing showed certificate store.
* netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: adapted to refactoring of KeyStores
* netx/net/sourceforge/jnlp/security/KeyStores.java: getKeyStore now returns wrapper with path alongside with ks itself
* netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: adapted to refactoring of KeyStores
* netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: now shows read-only path to shown ks
changeset 723ab7fdbc59 in /hg/release/icedtea-web-1.7
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.7?cmd=changeset;node=723ab7fdbc59
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Sep 10 17:38:48 2018 +0200
new file of LICENSE, added explicit license with details
changeset caad90b359d8 in /hg/release/icedtea-web-1.7
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.7?cmd=changeset;node=caad90b359d8
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Sep 10 17:42:38 2018 +0200
launcher/launchers.in: inverted logic to detect modular jdk. If it is jdk8, then it is not modular JDK, otherwise it is.
diffstat:
ChangeLog | 42 +++++++
LICENSE | 8 +
launcher/launchers.in | 8 +-
netx/net/sourceforge/jnlp/config/Defaults.java | 5 +
netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java | 2 +
netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java | 9 +-
netx/net/sourceforge/jnlp/resources/Messages.properties | 2 +-
netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 27 +++-
netx/net/sourceforge/jnlp/security/KeyStores.java | 60 ++++++---
netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java | 2 +-
netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java | 27 ++--
netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java | 43 +++++--
12 files changed, 173 insertions(+), 62 deletions(-)
diffs (truncated from 557 to 500 lines):
diff -r bcbef8d7bbd6 -r caad90b359d8 ChangeLog
--- a/ChangeLog Mon May 14 17:15:38 2018 +0200
+++ b/ChangeLog Mon Sep 10 17:42:38 2018 +0200
@@ -1,3 +1,45 @@
+2018-09-05 Jiri Vanek <jvanek at redhat.com>
+
+ * launcher/launchers.in: inverted logic to detect modular jdk.
+ If it is jdk8, then it is not modular JDK, otherwise it is.
+
+2018-08-13 Jiri Vanek <jvanek at redhat.com>
+
+ * LICENSE: new file. Added explicit license with details
+
+2018-06-20 Jiri Vanek <jvanek at redhat.com>
+
+ Enhanced itw-settngs' certificate viewer to show what file is backing showed certificate store.
+ * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: adapted to refactoring of KeyStores
+ * netx/net/sourceforge/jnlp/security/KeyStores.java: getKeyStore now returns wrapper with path alongside with ks itself
+ * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: adapted to refactoring of KeyStores
+ * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: now shows read-only path to shown ks
+
+2018-06-20 Jiri Vanek <jvanek at redhat.com>
+
+ * netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java: fixed hex output of certificate signature
+ for jdk8
+
+2018-06-20 Jiri Vanek <jvanek at redhat.com>
+
+ Added semi support for recognition jdk10 and up
+ * netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java: replaced hardcoded 9 by cycle from 9 to 99
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: replaced jdk9 by jdk9 and up.
+
+2018-05-28 Jiri Vanek <jvanek at redhat.com>
+
+ added deployment property to enforce headfull execution
+ * netx/net/sourceforge/jnlp/config/Defaults.java: IGNORE_HEADLESS_CHECK set to false
+ * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: deployment.headless.ignore
+ * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: if deployment.headless.ignore is true, then headless state is not checked
+ and environment is always considered as headfull
+
+2018-05-24 Jiri Vanek <jvanek at redhat.com>
+
+ Made headless detection softer
+ * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: JWindow().getOwner() repalced by GraphicsEnvironment.isHeadless()
+ JWindow().getOwner() was failing on headfull systems after headless check itself, on NPE.
+
2018-05-14 Jiri Vanek <jvanek at redhat.com>
* netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: getDocumentBase now returns codeBase as fallback when
diff -r bcbef8d7bbd6 -r caad90b359d8 LICENSE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSE Mon Sep 10 17:42:38 2018 +0200
@@ -0,0 +1,8 @@
+***************************************
+** LGPLv2+ and GPLv2 with exceptions **
+***************************************
+
+
+Details:
+All newest files, unless claiming differently and all files inherited from GNU Classpath (mostly base of plugin) are GPL+Exceptions
+NetX code is GPL and LGPL only.
diff -r bcbef8d7bbd6 -r caad90b359d8 launcher/launchers.in
--- a/launcher/launchers.in Mon May 14 17:15:38 2018 +0200
+++ b/launcher/launchers.in Mon Sep 10 17:42:38 2018 +0200
@@ -37,9 +37,9 @@
LAUNCHER_BOOTCLASSPATH="$LAUNCHER_BOOTCLASSPATH:@JRE@/$NASHORN"
fi;
-JDK9="NO"
-if ${JAVA} -version 2>&1 | grep -q "version \"9-" ; then
- JDK9="YES"
+MODULAR_JDK="YES"
+if ${JAVA} -version 2>&1 | grep -q "version \"1.8.0" ; then
+ MODULAR_JDK="NO"
fi
JAVA_ARGS=( )
@@ -82,7 +82,7 @@
COMMAND[k]="${LAUNCHER_FLAGS}"
k=$((k+1))
-if [ "x$JDK9" == "xYES" ] ; then
+if [ "x$MODULAR_JDK" == "xYES" ] ; then
COMMAND[k]="--patch-module"
k=$((k+1))
COMMAND[k]="java.desktop=@PLUGIN_JAR@:@NETX_JAR@"
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/config/Defaults.java
--- a/netx/net/sourceforge/jnlp/config/Defaults.java Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/config/Defaults.java Mon Sep 10 17:42:38 2018 +0200
@@ -412,6 +412,11 @@
BasicValueValidators.getRangedIntegerValidator(0, 10000),
String.valueOf(500)
},
+ {
+ DeploymentConfiguration.IGNORE_HEADLESS_CHECK,
+ BasicValueValidators.getBooleanValidator(),
+ String.valueOf(false)
+ },
//JVM arguments for plugin
{
DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS,
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
--- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java Mon Sep 10 17:42:38 2018 +0200
@@ -222,6 +222,8 @@
public static final String KEY_BROWSER_PATH = "deployment.browser.path";
public static final String KEY_UPDATE_TIMEOUT = "deployment.javaws.update.timeout";
+
+ public static final String IGNORE_HEADLESS_CHECK = "deployment.headless.ignore";
/*
* JVM arguments for plugin
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java
--- a/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java Mon Sep 10 17:42:38 2018 +0200
@@ -281,8 +281,13 @@
}
boolean findRT = false;
-
- if (processErrorStream.contains("\"9") || processStdOutStream.contains("\"9") || processErrorStream.contains("build 9") || processStdOutStream.contains("build 9")) {
+ boolean jdk9up = false;
+ for (int i = 9; i <= 99; i++) {
+ if (processErrorStream.contains("\"" + i) || processStdOutStream.contains("\"" + i)) {
+ jdk9up = true;
+ }
+ }
+ if (jdk9up) {
validationResult += "<span color=\"green\">" + Translator.R("CPJVMjdk9") + "</span><br />";
findRT = false;
} else if (processErrorStream.contains("1.8.0") || processStdOutStream.contains("1.8.0")) {
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/resources/Messages.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Mon Sep 10 17:42:38 2018 +0200
@@ -612,7 +612,7 @@
CPJVMjdk6=JDK6 recognized. JDK7 and older are longer supported.
CPJVMjdk7=JDK7 recognized. JDK7 and older are longer supported.
CPJVMjdk8=JDK8 recognized. Jdk8 and higher are supported
-CPJVMjdk9=JDK9 recognized. Jdk8 and higher are supported
+CPJVMjdk9=JDK9 or higher recognized. Jdk8 and higher are supported. Jdk9 and up can have modularity issues.
CPJVMjdk=Unknown version. Hard to judge support. See tooltip or console/standard output (depends on verbosity)for real version.
CPJVMoracleFound=Great, Oracle java detected
CPJVMibmFound=Good, IBM java detected
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
--- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon Sep 10 17:42:38 2018 +0200
@@ -19,6 +19,9 @@
import static net.sourceforge.jnlp.runtime.Translator.R;
import java.awt.EventQueue;
+import java.awt.GraphicsEnvironment;
+import static java.awt.GraphicsEnvironment.isHeadless;
+import java.awt.HeadlessException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -272,7 +275,7 @@
try {
SSLSocketFactory sslSocketFactory;
SSLContext context = SSLContext.getInstance("SSL");
- KeyStore ks = KeyStores.getKeyStore(KeyStores.Level.USER, KeyStores.Type.CLIENT_CERTS);
+ KeyStore ks = KeyStores.getKeyStore(KeyStores.Level.USER, KeyStores.Type.CLIENT_CERTS).getKs();
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
SecurityUtil.initKeyManagerFactory(kmf, ks);
TrustManager[] trust = new TrustManager[] { getSSLSocketTrustManager() };
@@ -736,16 +739,24 @@
//if (GraphicsEnvironment.isHeadless()) // jdk1.4+ only
// headless = true;
try {
- if ("true".equalsIgnoreCase(System.getProperty("java.awt.headless"))){
+ if ("true".equalsIgnoreCase(System.getProperty("java.awt.headless"))) {
headless = true;
}
if (!headless) {
- try {
- new JWindow().getOwner();
- } catch (Exception ex) {
- headless = true;
- OutputController.getLogger().log(ex);
- OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Translator.R("HEADLESS_MISSCONFIGURED"));
+ boolean noCheck = Boolean.valueOf(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.IGNORE_HEADLESS_CHECK));
+ if (noCheck) {
+ headless = false;
+ OutputController.getLogger().log(DeploymentConfiguration.IGNORE_HEADLESS_CHECK + " set to " + noCheck + ". Avoding headless check.");
+ } else {
+ try {
+ if (GraphicsEnvironment.isHeadless()) {
+ throw new HeadlessException();
+ }
+ } catch (HeadlessException ex) {
+ headless = true;
+ OutputController.getLogger().log(ex);
+ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Translator.R("HEADLESS_MISSCONFIGURED"));
+ }
}
}
} catch (SecurityException ex) {
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/security/KeyStores.java
--- a/netx/net/sourceforge/jnlp/security/KeyStores.java Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/security/KeyStores.java Mon Sep 10 17:42:38 2018 +0200
@@ -33,8 +33,7 @@
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
-*/
-
+ */
package net.sourceforge.jnlp.security;
import java.io.File;
@@ -64,8 +63,26 @@
*/
public final class KeyStores {
+ public static class KeyStoreWithPath {
+
+ private final KeyStore ks;
+ private final String path;
+
+ public KeyStoreWithPath(KeyStore ks, String path) {
+ this.ks = ks;
+ this.path = path;
+ }
+
+ public KeyStore getKs() {
+ return ks;
+ }
+
+ public String getPath() {
+ return path;
+ }
+ }
+
/* this gets turned into user-readable strings, see toUserReadableString */
-
public enum Level {
USER,
SYSTEM,
@@ -79,10 +96,10 @@
CLIENT_CERTS,
}
- public static final Map<Integer,String> keystoresPaths=new HashMap<>();
+ public static final Map<Integer, String> keystoresPaths = new HashMap<>();
private static final String KEYSTORE_TYPE = "JKS";
-
+
/**
* Returns a KeyStore corresponding to the appropriate level level (user or
* system) and type.
@@ -92,7 +109,7 @@
* @param type the type of KeyStore desired
* @return a KeyStore containing certificates from the appropriate
*/
- public static final KeyStore getKeyStore(Level level, Type type) {
+ public static final KeyStoreWithPath getKeyStore(Level level, Type type) {
boolean create;
if (level == Level.USER) {
create = true;
@@ -112,7 +129,7 @@
* @param create true if keystore can be created
* @return a KeyStore containing certificates from the appropriate
*/
- public static final KeyStore getKeyStore(Level level, Type type, boolean create) {
+ private static final KeyStoreWithPath getKeyStore(Level level, Type type, boolean create) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new AllPermission());
@@ -124,11 +141,11 @@
ks = createKeyStoreFromFile(new File(location), create);
//hashcode is used instead of instance so when no references are left
//to keystore, then this will not be blocker for garbage collection
- keystoresPaths.put(ks.hashCode(),location);
+ keystoresPaths.put(ks.hashCode(), location);
} catch (Exception e) {
OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e);
}
- return ks;
+ return new KeyStoreWithPath(ks, location);
}
public static String getPathToKeystore(int k) {
@@ -148,22 +165,22 @@
public static final KeyStore[] getCertKeyStores() {
List<KeyStore> result = new ArrayList<>(10);
/* System-level JSSE certificates */
- KeyStore ks = getKeyStore(Level.SYSTEM, Type.JSSE_CERTS);
+ KeyStore ks = getKeyStore(Level.SYSTEM, Type.JSSE_CERTS).getKs();
if (ks != null) {
result.add(ks);
}
/* System-level certificates */
- ks = getKeyStore(Level.SYSTEM, Type.CERTS);
+ ks = getKeyStore(Level.SYSTEM, Type.CERTS).getKs();
if (ks != null) {
result.add(ks);
}
/* User-level JSSE certificates */
- ks = getKeyStore(Level.USER, Type.JSSE_CERTS);
+ ks = getKeyStore(Level.USER, Type.JSSE_CERTS).getKs();
if (ks != null) {
result.add(ks);
}
/* User-level certificates */
- ks = getKeyStore(Level.USER, Type.CERTS);
+ ks = getKeyStore(Level.USER, Type.CERTS).getKs();
if (ks != null) {
result.add(ks);
}
@@ -179,22 +196,22 @@
public static final KeyStore[] getCAKeyStores() {
List<KeyStore> result = new ArrayList<>(10);
/* System-level JSSE CA certificates */
- KeyStore ks = getKeyStore(Level.SYSTEM, Type.JSSE_CA_CERTS);
+ KeyStore ks = getKeyStore(Level.SYSTEM, Type.JSSE_CA_CERTS).getKs();
if (ks != null) {
result.add(ks);
}
/* System-level CA certificates */
- ks = getKeyStore(Level.SYSTEM, Type.CA_CERTS);
+ ks = getKeyStore(Level.SYSTEM, Type.CA_CERTS).getKs();
if (ks != null) {
result.add(ks);
}
/* User-level JSSE CA certificates */
- ks = getKeyStore(Level.USER, Type.JSSE_CA_CERTS);
+ ks = getKeyStore(Level.USER, Type.JSSE_CA_CERTS).getKs();
if (ks != null) {
result.add(ks);
}
/* User-level CA certificates */
- ks = getKeyStore(Level.USER, Type.CA_CERTS);
+ ks = getKeyStore(Level.USER, Type.CA_CERTS).getKs();
if (ks != null) {
result.add(ks);
}
@@ -211,12 +228,12 @@
public static KeyStore[] getClientKeyStores() {
List<KeyStore> result = new ArrayList<>();
- KeyStore ks = getKeyStore(Level.SYSTEM, Type.CLIENT_CERTS);
+ KeyStore ks = getKeyStore(Level.SYSTEM, Type.CLIENT_CERTS).getKs();
if (ks != null) {
result.add(ks);
}
- ks = getKeyStore(Level.USER, Type.CLIENT_CERTS);
+ ks = getKeyStore(Level.USER, Type.CLIENT_CERTS).getKs();
if (ks != null) {
result.add(ks);
}
@@ -225,7 +242,8 @@
}
/**
- * Returns the location of a KeyStore corresponding to the given level and type.
+ * Returns the location of a KeyStore corresponding to the given level and
+ * type.
*
* @param level the specified level of the key store to be returned.
* @param type the specified type of the key store to be returned.
@@ -242,7 +260,7 @@
case JSSE_CERTS:
return PathsAndFiles.SYS_JSSECERT;
case CERTS:
- return PathsAndFiles.SYS_CERT;
+ return PathsAndFiles.SYS_CERT;
case CLIENT_CERTS:
return PathsAndFiles.SYS_CLIENTCERT;
}
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java
--- a/netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java Mon Sep 10 17:42:38 2018 +0200
@@ -343,7 +343,7 @@
public void saveCert() {
try {
- KeyStore ks = KeyStores.getKeyStore(Level.USER, Type.CERTS);
+ KeyStore ks = KeyStores.getKeyStore(Level.USER, Type.CERTS).getKs();
X509Certificate c = (X509Certificate) parent.getCertVerifier().getPublisher(null);
CertificateUtils.addToKeyStore(c, ks);
File keyStoreFile = KeyStores.getKeyStoreLocation(Level.USER, Type.CERTS).getFile();
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java
--- a/netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java Mon Sep 10 17:42:38 2018 +0200
@@ -185,25 +185,28 @@
return jdkIndependentHexEncoderImpl(signature);
} catch (Exception ex) {
String s = "Failed to encode signature: " + ex.toString();
- OutputController.getLogger().log(s);
+ OutputController.getLogger().log(OutputController.Level.WARNING_ALL, s);
+ OutputController.getLogger().log(ex);
return s;
}
}
private String jdkIndependentHexEncoderImpl(byte[] signature) throws Exception {
- // jdk8 is using sun.misc.HexDumpEncoder,
- // jdk9 is using sun.security.util.HexDumpEncoder
- Class clazz;
try {
- clazz = Class.forName("sun.security.util.HexDumpEncoder");
- } catch (ClassNotFoundException ex) {
- OutputController.getLogger().log("Using jdk8's HexDumpEncoder");
- clazz = Class.forName("sun.misc.HexDumpEncoder");
+ OutputController.getLogger().log("trying jdk9's HexDumpEncoder");
+ Class clazz = Class.forName("sun.security.util.HexDumpEncoder");
+ Object encoder = clazz.newInstance();
+ Method m = clazz.getDeclaredMethod("encodeBuffer", byte[].class);
+ //convert our signature into a nice human-readable form.
+ return (String) m.invoke(encoder, signature);
+ } catch (Exception ex) {
+ OutputController.getLogger().log("trying jdk8's HexDumpEncoder");
+ Class clazz = Class.forName("sun.misc.HexDumpEncoder");
+ Object encoder = clazz.newInstance();
+ Method m = clazz.getMethod("encode", byte[].class);
+ //convert our signature into a nice human-readable form.
+ return (String) m.invoke(encoder, signature);
}
- Object encoder = clazz.newInstance();
- Method m = clazz.getDeclaredMethod("encodeBuffer", byte[].class);
- //convert our signature into a nice human-readable form.
- return (String) m.invoke(encoder, signature);
}
/**
diff -r bcbef8d7bbd6 -r caad90b359d8 netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java
--- a/netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java Mon May 14 17:15:38 2018 +0200
+++ b/netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java Mon Sep 10 17:42:38 2018 +0200
@@ -68,6 +68,7 @@
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
+import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.table.DefaultTableModel;
@@ -104,6 +105,7 @@
};
JTabbedPane tabbedPane;
+ JTextField certPath = new JTextField();
private final JTable userTable;
private final JTable systemTable;
private JComboBox<CertificateType> certificateTypeCombo;
@@ -120,7 +122,7 @@
* The Current KeyStore. Only one table/tab is visible for interaction to
* the user. This KeyStore corresponds to that.
*/
- private KeyStore keyStore = null;
+ private KeyStores.KeyStoreWithPath keyStore = null;
public CertificatePane(JDialog parent) {
super();
@@ -229,8 +231,11 @@
}
tablePanel.add(tabbedPane, BorderLayout.CENTER);
- tablePanel.add(buttonPanel, BorderLayout.SOUTH);
-
+ JPanel buttonPanelWrapper = new JPanel(new BorderLayout());
+ certPath.setEditable(false);
+ buttonPanelWrapper.add(certPath, BorderLayout.CENTER);
+ buttonPanelWrapper.add(buttonPanel, BorderLayout.EAST);
+ tablePanel.add(buttonPanelWrapper, BorderLayout.SOUTH);
main.add(certificateTypePanel, BorderLayout.NORTH);
main.add(tablePanel, BorderLayout.CENTER);
@@ -259,9 +264,9 @@
try {
//Get all of the X509Certificates and put them into an ArrayList
- aliases = keyStore.aliases();
+ aliases = keyStore.getKs().aliases();
while (aliases.hasMoreElements()) {
- Certificate c = keyStore.getCertificate(aliases.nextElement());
+ Certificate c = keyStore.getKs().getCertificate(aliases.nextElement());
if (c instanceof X509Certificate) {
certs.add((X509Certificate) c);
}
@@ -289,8 +294,20 @@
private void repopulateTables() {
initializeKeyStore();
readKeyStore();
+ try {
+ File src = new File(keyStore.getPath());
+ File resolved = src.getCanonicalFile();
+ if (resolved.equals(src)) {
+ certPath.setText(keyStore.getPath());
+ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, keyStore.getPath());
+ } else {
+ certPath.setText(keyStore.getPath() + " -> " + resolved.getCanonicalPath());
+ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, keyStore.getPath() + " -> " + resolved.getCanonicalPath());
+ }
+ } catch (Exception ex) {
+ OutputController.getLogger().log(ex);
+ }
DefaultTableModel tableModel = new DefaultTableModel(issuedToAndBy, columnNames);
More information about the distro-pkg-dev
mailing list