aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/security
diff options
context:
space:
mode:
authorDeepak Bhole <[email protected]>2012-02-29 13:56:57 -0500
committerDeepak Bhole <[email protected]>2012-02-29 13:56:57 -0500
commit5c36cd9c2204267ae401b2c5d58a81bb3fd6339e (patch)
tree6a763751af19605a6f044d9baabc454524712811 /netx/net/sourceforge/jnlp/security
parentf1cd5727f6e4fec7dea99c8f779e22d1f9a83e17 (diff)
Change CertificateUtils.inKeyStores() to only check for certificate equality
Diffstat (limited to 'netx/net/sourceforge/jnlp/security')
-rw-r--r--netx/net/sourceforge/jnlp/security/CertificateUtils.java27
1 files changed, 6 insertions, 21 deletions
diff --git a/netx/net/sourceforge/jnlp/security/CertificateUtils.java b/netx/net/sourceforge/jnlp/security/CertificateUtils.java
index 0a1c2bd..41ae228 100644
--- a/netx/net/sourceforge/jnlp/security/CertificateUtils.java
+++ b/netx/net/sourceforge/jnlp/security/CertificateUtils.java
@@ -167,34 +167,19 @@ public class CertificateUtils {
// Check against all certs
Enumeration<String> aliases = keyStores[i].aliases();
while (aliases.hasMoreElements()) {
+
+ // Verify against this entry
String alias = aliases.nextElement();
- try {
- // Verify against this entry
- c.verify(keyStores[i].getCertificate(alias).getPublicKey());
+ if (c.equals(keyStores[i].getCertificate(alias))) {
if (JNLPRuntime.isDebug()) {
System.out.println(c.getSubjectX500Principal().getName() + " found in cacerts");
}
-
- // If we got here, it means verification succeeded. Return true.
+
return true;
- } catch (NoSuchAlgorithmException nsae) {
- // Unsupported signature algorithm
- // Consider non-match and keep going
- } catch (InvalidKeyException ike) {
- // Incorrect/corrupt key
- // Consider non-match and keep going
- } catch (NoSuchProviderException nspe) {
- // No default provider
- // Consider non-match and keep going
- } catch (SignatureException se) {
- // Signature error
- // Consider non-match and keep going
- } catch (CertificateException ce) {
- // Encoding error
- // Consider non-match and keep going
- }
+ } // else continue
}
+
} catch (KeyStoreException e) {
e.printStackTrace();
// continue