[jboss-remoting-commits] JBoss Remoting SVN: r3945 - remoting2/branches/2.x/src/main/org/jboss/remoting/security.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Apr 11 21:07:26 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-11 21:07:26 -0400 (Fri, 11 Apr 2008)
New Revision: 3945

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java
Log:
JBREM-934: (1) Replaced AccessController.doPrivileged() calls with SecurityUtility calls; (2) renamed SystemUtility SecurityUtility.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java	2008-04-12 01:06:55 UTC (rev 3944)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java	2008-04-12 01:07:26 UTC (rev 3945)
@@ -23,7 +23,7 @@
 
 import org.jboss.logging.Logger;
 import org.jboss.remoting.serialization.ClassLoaderUtility;
-import org.jboss.remoting.util.SystemUtility;
+import org.jboss.remoting.util.SecurityUtility;
 import org.jboss.remoting.util.socket.RemotingKeyManager;
 
 import javax.net.ServerSocketFactory;
@@ -396,30 +396,15 @@
 
       if (getUseSSLSocketFactory())
       {
-         String defaultFactoryName = SystemUtility.getSystemProperty(REMOTING_DEFAULT_SOCKET_FACTORY_CLASS);
+         String defaultFactoryName = SecurityUtility.getSystemProperty(REMOTING_DEFAULT_SOCKET_FACTORY_CLASS);
          
          if (defaultFactoryName != null)
          {
             try
             {
                final Class sfClass = ClassLoaderUtility.loadClass(defaultFactoryName, SSLSocketBuilder.class);
-               Method m =null;
+               Method m = SecurityUtility.getMethod(sfClass, "getDefault", null);
                
-               try
-               {
-                  m = (Method)AccessController.doPrivileged( new PrivilegedExceptionAction()
-                  {
-                     public Object run() throws Exception
-                     {
-                        return sfClass.getMethod("getDefault", null);
-                     }
-                  });
-               }
-               catch (PrivilegedActionException e)
-               {
-                   throw (Exception) e.getCause();
-               }
-               
                if (m == null)
                {
                   throw new RuntimeException(
@@ -631,7 +616,7 @@
 
       if(keyStoreFilePath == null)
       {
-         String path = SystemUtility.getSystemProperty(STANDARD_KEY_STORE_FILE_PATH);;
+         String path = SecurityUtility.getSystemProperty(STANDARD_KEY_STORE_FILE_PATH);;
          if(path != null && path.length() > 0)
          {
             setKeyStoreURL( path );
@@ -685,7 +670,7 @@
 
       if(keyStoreType == null)
       {
-         keyStoreType = SystemUtility.getSystemProperty(STANDARD_KEY_STORE_TYPE);
+         keyStoreType = SecurityUtility.getSystemProperty(STANDARD_KEY_STORE_TYPE);
          if(keyStoreType == null)
          {
             keyStoreType = DEFAULT_KEY_STORE_TYPE;
@@ -761,7 +746,7 @@
 
       if(keyStorePassword == null)
       {
-         keyStorePassword = SystemUtility.getSystemProperty(STANDARD_KEY_STORE_PASSWORD);
+         keyStorePassword = SecurityUtility.getSystemProperty(STANDARD_KEY_STORE_PASSWORD);
       }
 
       return keyStorePassword;
@@ -812,7 +797,7 @@
 
       if(trustStoreFilePath == null)
       {
-         String path = SystemUtility.getSystemProperty(STANDARD_TRUST_STORE_FILE_PATH);
+         String path = SecurityUtility.getSystemProperty(STANDARD_TRUST_STORE_FILE_PATH);
          if(path != null && path.length() > 0)
          {
             setTrustStoreURL( path );
@@ -866,7 +851,7 @@
 
       if(trustStoreType == null)
       {
-         trustStoreType = SystemUtility.getSystemProperty(STANDARD_TRUST_STORE_TYPE);
+         trustStoreType = SecurityUtility.getSystemProperty(STANDARD_TRUST_STORE_TYPE);
          if(trustStoreType == null)
          {
             trustStoreType = getKeyStoreType();
@@ -942,7 +927,7 @@
 
       if(trustStorePassword == null)
       {
-         trustStorePassword = SystemUtility.getSystemProperty(STANDARD_TRUST_STORE_PASSWORD);
+         trustStorePassword = SecurityUtility.getSystemProperty(STANDARD_TRUST_STORE_PASSWORD);
          if(trustStorePassword == null)
          {
             trustStorePassword = getKeyStorePassword();




More information about the jboss-remoting-commits mailing list