jdk/src/share/classes/com/sun/net/ssl/SSLSecurity.java
changeset 10596 39b3a979e600
parent 5506 202f599c92aa
equal deleted inserted replaced
10595:c5be3e19fbab 10596:39b3a979e600
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    75     private static Object[] getImpl1(String algName, String engineType,
    75     private static Object[] getImpl1(String algName, String engineType,
    76             Service service) throws NoSuchAlgorithmException
    76             Service service) throws NoSuchAlgorithmException
    77     {
    77     {
    78         Provider provider = service.getProvider();
    78         Provider provider = service.getProvider();
    79         String className = service.getClassName();
    79         String className = service.getClassName();
    80         Class implClass;
    80         Class<?> implClass;
    81         try {
    81         try {
    82             ClassLoader cl = provider.getClass().getClassLoader();
    82             ClassLoader cl = provider.getClass().getClassLoader();
    83             if (cl == null) {
    83             if (cl == null) {
    84                 // system class
    84                 // system class
    85                 implClass = Class.forName(className);
    85                 implClass = Class.forName(className);
   131              * loaded by the same class loader.)  That is, unless they
   131              * loaded by the same class loader.)  That is, unless they
   132              * give us a SPI class that doesn't exist, say SSLFoo,
   132              * give us a SPI class that doesn't exist, say SSLFoo,
   133              * or someone has removed classes from the jsse.jar file.
   133              * or someone has removed classes from the jsse.jar file.
   134              */
   134              */
   135 
   135 
   136             Class typeClassJavax;
   136             Class<?> typeClassJavax;
   137             Class typeClassCom;
   137             Class<?> typeClassCom;
   138             Object obj = null;
   138             Object obj = null;
   139 
   139 
   140             /*
   140             /*
   141              * Odds are more likely that we have a javax variant, try this
   141              * Odds are more likely that we have a javax variant, try this
   142              * first.
   142              * first.
   235     }
   235     }
   236 
   236 
   237     /*
   237     /*
   238      * Checks whether one class is the superclass of another
   238      * Checks whether one class is the superclass of another
   239      */
   239      */
   240     private static boolean checkSuperclass(Class subclass, Class superclass) {
   240     private static boolean checkSuperclass(Class<?> subclass, Class<?> superclass) {
   241         if ((subclass == null) || (superclass == null))
   241         if ((subclass == null) || (superclass == null))
   242                 return false;
   242                 return false;
   243 
   243 
   244         while (!subclass.equals(superclass)) {
   244         while (!subclass.equals(superclass)) {
   245             subclass = subclass.getSuperclass();
   245             subclass = subclass.getSuperclass();
   274  * javax.net.ssl.*Spi, we need to go grab a real instance of the
   274  * javax.net.ssl.*Spi, we need to go grab a real instance of the
   275  * thing that the Spi supports, and wrap into a com.sun.net.ssl.*Spi
   275  * thing that the Spi supports, and wrap into a com.sun.net.ssl.*Spi
   276  * object.  This also mean that anything going down into the SPI
   276  * object.  This also mean that anything going down into the SPI
   277  * needs to be wrapped, as well as anything coming back up.
   277  * needs to be wrapped, as well as anything coming back up.
   278  */
   278  */
   279 
       
   280 final class SSLContextSpiWrapper extends SSLContextSpi {
   279 final class SSLContextSpiWrapper extends SSLContextSpi {
   281 
   280 
   282     private javax.net.ssl.SSLContext theSSLContext;
   281     private javax.net.ssl.SSLContext theSSLContext;
   283 
   282 
   284     SSLContextSpiWrapper(String algName, Provider prov) throws
   283     SSLContextSpiWrapper(String algName, Provider prov) throws