From 450b4b6e2545bfe2552665cc882dae3a0845ffa5 Mon Sep 17 00:00:00 2001 From: coffeys Date: Tue, 24 Oct 2017 03:44:21 -0700 Subject: [PATCH] 8178458: Better use of certificates in LDAP Reviewed-by: weijun, coffeys Contributed-by: prasadarao.koppula@oracle.com --- .../sun/security/provider/certpath/ldap/LDAPCertStore.java | 6 ++++++ test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java b/src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java index ba3e4d60c..6ca845f8b 100644 --- a/src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java +++ b/src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java @@ -220,6 +220,12 @@ public final class LDAPCertStore extends CertStoreSpi { certStoreCache = Cache.newSoftMemoryCache(185); static synchronized CertStore getInstance(LDAPCertStoreParameters params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { + + SecurityManager security = System.getSecurityManager(); + if (security != null) { + security.checkConnect(params.getServerName(), params.getPort()); + } + CertStore lcs = certStoreCache.get(params); if (lcs == null) { lcs = CertStore.getInstance("LDAP", params); diff --git a/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java b/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java index b760b9bb7..a715d21e2 100644 --- a/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java +++ b/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -369,7 +369,7 @@ public final class OutputAnalyzer { * - standard input produced by the process under test - standard output - * exit code Note: the command line is printed by the ProcessTools */ - private OutputAnalyzer reportDiagnosticSummary() { + public OutputAnalyzer reportDiagnosticSummary() { String msg = " stdout: [" + stdout + "];\n" + " stderr: [" + stderr + "]\n" + " exitValue = " + getExitValue() + "\n"; -- GitLab