changeset 8575:04cb59070203

8178458: Better use of certificates in LDAP Reviewed-by: weijun, coffeys Contributed-by: prasadarao.koppula@oracle.com
author coffeys
date Tue, 16 Jan 2018 19:49:28 +0000
parents 792d98acbb6b
children 19beac6fd156
files src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java	Mon Sep 04 19:33:44 2017 +0100
+++ b/src/share/classes/sun/security/provider/certpath/ldap/LDAPCertStore.java	Tue Jan 16 19:49:28 2018 +0000
@@ -219,6 +219,12 @@
     private static final Cache 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 = (CertStore) certStoreCache.get(params);
         if (lcs == null) {
             lcs = CertStore.getInstance("LDAP", params);
--- a/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java	Mon Sep 04 19:33:44 2017 +0100
+++ b/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java	Tue Jan 16 19:49:28 2018 +0000
@@ -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
@@ -366,7 +366,7 @@
      * - 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";