From 0f4df46e9b69400accb45947ff275cd7f693ee63 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 4 Jul 2006 10:51:51 +0000 Subject: [PATCH] LWJGLInstaller should check for non-existing master directory. Use exceptions instead of boolean status code in verifyCerts --- .../org/lwjgl/util/applet/LWJGLInstaller.java | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/java/org/lwjgl/util/applet/LWJGLInstaller.java b/src/java/org/lwjgl/util/applet/LWJGLInstaller.java index c1652865..a28f2cdc 100644 --- a/src/java/org/lwjgl/util/applet/LWJGLInstaller.java +++ b/src/java/org/lwjgl/util/applet/LWJGLInstaller.java @@ -189,9 +189,7 @@ public class LWJGLInstaller { files.put(native_entry.getName(), baos.toByteArray()); // now check the chain of an actual file - if(!validateCertificateChain(ownCerts, native_entry.getCertificates())) { - throw new Exception("Failed to validate certificate chain for " + native_entry.getName()); - } + validateCertificateChain(ownCerts, native_entry.getCertificates()); } return files; @@ -206,24 +204,18 @@ public class LWJGLInstaller { * @param native_certs Chain of certificates to check * @return true if the chains match */ - private static boolean validateCertificateChain(Certificate[] ownCerts, Certificate[] native_certs) { - if(native_certs == null) { - LWJGLUtil.log("Unable to validate certificate chain. Native entry did not have a certificate chain at all"); - return false; - } + private static void validateCertificateChain(Certificate[] ownCerts, Certificate[] native_certs) throws Exception { + if(native_certs == null) + throw new Exception("Unable to validate certificate chain. Native entry did not have a certificate chain at all"); - if(ownCerts.length != native_certs.length) { - LWJGLUtil.log("Unable to validate certificate chain. Chain differs in length [" + ownCerts.length + " vs " + native_certs.length + "]"); - return false; - } + if(ownCerts.length != native_certs.length) + throw new Exception("Unable to validate certificate chain. Chain differs in length [" + ownCerts.length + " vs " + native_certs.length + "]"); for(int i=0; i