changeset 1742:67fd7b8b46d4

8178458: Better use of certificates in LDAP Reviewed-by: weijun, coffeys Contributed-by: prasadarao.koppula@oracle.com
author coffeys
date Tue, 24 Oct 2017 03:44:21 -0700
parents 324a69af78f0
children c4c55e626604
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 Oct 24 03:44:21 2017 -0700
@@ -210,6 +210,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 Oct 24 03:44:21 2017 -0700
@@ -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";