Author: markt
Date: Tue Jan 29 13:18:25 2008
New Revision: 616522

URL: http://svn.apache.org/viewvc?rev=616522&view=rev
Log:
Tab police. No function change

Modified:
    
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSImplementation.java
    tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocket.java
    
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocketFactory.java
    tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSupport.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSImplementation.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSImplementation.java?rev=616522&r1=616521&r2=616522&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSImplementation.java 
(original)
+++ 
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSImplementation.java 
Tue Jan 29 13:18:25 2008
@@ -35,8 +35,8 @@
 public class PureTLSImplementation extends SSLImplementation
 {
     public PureTLSImplementation() throws ClassNotFoundException {
-       // Check to see if PureTLS is floating around somewhere
-       Class.forName("COM.claymoresystems.ptls.SSLContext");
+        // Check to see if PureTLS is floating around somewhere
+        Class.forName("COM.claymoresystems.ptls.SSLContext");
     }
 
     public String getImplementationName(){
@@ -45,12 +45,12 @@
       
     public ServerSocketFactory getServerSocketFactory()
     {
-       return new PureTLSSocketFactory();
+        return new PureTLSSocketFactory();
     } 
 
     public SSLSupport getSSLSupport(Socket s)
     {
-       return new PureTLSSupport((SSLSocket)s);
+        return new PureTLSSupport((SSLSocket)s);
     }
 
 

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocket.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocket.java?rev=616522&r1=616521&r2=616522&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocket.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocket.java Tue 
Jan 29 13:18:25 2008
@@ -37,7 +37,7 @@
     // constructor since this class is only used with
     // implAccept
     public PureTLSSocket() throws IOException {
-       super();
+        super();
     }
 }
  

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocketFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocketFactory.java?rev=616522&r1=616521&r2=616522&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocketFactory.java 
(original)
+++ 
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSocketFactory.java 
Tue Jan 29 13:18:25 2008
@@ -44,7 +44,7 @@
     extends org.apache.tomcat.util.net.ServerSocketFactory
 {
     static org.apache.commons.logging.Log logger =
-       
org.apache.commons.logging.LogFactory.getLog(PureTLSSocketFactory.class);
+        
org.apache.commons.logging.LogFactory.getLog(PureTLSSocketFactory.class);
     static String defaultProtocol = "TLS";
     static boolean defaultClientAuth = false;
     static String defaultKeyStoreFile = "server.pem";
@@ -58,71 +58,71 @@
     }
 
     public ServerSocket createSocket(int port)
-       throws IOException
+        throws IOException
     {
-       init();
-       return new SSLServerSocket(context,port);
+        init();
+        return new SSLServerSocket(context,port);
     }
 
     public ServerSocket createSocket(int port, int backlog)
-       throws IOException
+        throws IOException
     {
-       init();
-       ServerSocket tmp;
-       
-       try {
-           tmp=new SSLServerSocket(context,port,backlog);
-       }
-       catch (IOException e){
-           throw e;
-       }
-       return tmp;
+        init();
+        ServerSocket tmp;
+        
+        try {
+            tmp=new SSLServerSocket(context,port,backlog);
+        }
+        catch (IOException e){
+            throw e;
+        }
+        return tmp;
     }
 
     public ServerSocket createSocket(int port, int backlog,
-                                    InetAddress ifAddress)
-       throws IOException
+                                     InetAddress ifAddress)
+        throws IOException
     {
-       init();
-       return new SSLServerSocket(context,port,backlog,ifAddress);
+        init();
+        return new SSLServerSocket(context,port,backlog,ifAddress);
     }
 
     private void init()
-       throws IOException
+        throws IOException
     {
-       if(context!=null)
-           return;
-       
-       boolean clientAuth=defaultClientAuth;
-
-       try {
-           String keyStoreFile=(String)attributes.get("keystore");
-           if(keyStoreFile==null) keyStoreFile=defaultKeyStoreFile;
-           
-           String keyPass=(String)attributes.get("keypass");
-           if(keyPass==null) keyPass=defaultKeyPass;
-           
-           String rootFile=(String)attributes.get("rootfile");
-           if(rootFile==null) rootFile=defaultRootFile;
-
-           String randomFile=(String)attributes.get("randomfile");
-           if(randomFile==null) randomFile=defaultRandomFile;
-           
-           String protocol=(String)attributes.get("protocol");
-           if(protocol==null) protocol=defaultProtocol;
-
-           String clientAuthStr=(String)attributes.get("clientauth");
-           if(clientAuthStr != null){
-               if(clientAuthStr.equals("true")){
-                   clientAuth=true;
-               } else if(clientAuthStr.equals("false")) {
-                   clientAuth=false;
-               } else {
-                   throw new IOException("Invalid value '" +
-                                         clientAuthStr + 
-                                         "' for 'clientauth' parameter:");
-               }
-           }
+        if(context!=null)
+            return;
+        
+        boolean clientAuth=defaultClientAuth;
+
+        try {
+            String keyStoreFile=(String)attributes.get("keystore");
+            if(keyStoreFile==null) keyStoreFile=defaultKeyStoreFile;
+            
+            String keyPass=(String)attributes.get("keypass");
+            if(keyPass==null) keyPass=defaultKeyPass;
+            
+            String rootFile=(String)attributes.get("rootfile");
+            if(rootFile==null) rootFile=defaultRootFile;
+
+            String randomFile=(String)attributes.get("randomfile");
+            if(randomFile==null) randomFile=defaultRandomFile;
+            
+            String protocol=(String)attributes.get("protocol");
+            if(protocol==null) protocol=defaultProtocol;
+
+            String clientAuthStr=(String)attributes.get("clientauth");
+            if(clientAuthStr != null){
+                if(clientAuthStr.equals("true")){
+                    clientAuth=true;
+                } else if(clientAuthStr.equals("false")) {
+                    clientAuth=false;
+                } else {
+                    throw new IOException("Invalid value '" +
+                                          clientAuthStr + 
+                                          "' for 'clientauth' parameter:");
+                }
+            }
 
             SSLContext tmpContext=new SSLContext();
             try {
@@ -133,10 +133,10 @@
                                  rootFile,iex);
             }
             tmpContext.loadEAYKeyFile(keyStoreFile,keyPass);
-           tmpContext.useRandomnessFile(randomFile,keyPass);
-           
-           SSLPolicyInt policy=new SSLPolicyInt();
-           policy.requireClientAuth(clientAuth);
+            tmpContext.useRandomnessFile(randomFile,keyPass);
+            
+            SSLPolicyInt policy=new SSLPolicyInt();
+            policy.requireClientAuth(clientAuth);
             policy.handshakeOnConnect(false);
             policy.waitOnClose(false);
             short [] enabledCiphers = 
getEnabledCiphers(policy.getCipherSuites());
@@ -144,11 +144,11 @@
                 policy.setCipherSuites(enabledCiphers);
             }
             tmpContext.setPolicy(policy);
-           context=tmpContext;
-       } catch (Exception e){
-           logger.info("Error initializing SocketFactory",e);
-           throw new IOException(e.getMessage());
-       }
+            context=tmpContext;
+        } catch (Exception e){
+            logger.info("Error initializing SocketFactory",e);
+            throw new IOException(e.getMessage());
+        }
     }
 
     /*
@@ -206,21 +206,21 @@
     }
 
     public Socket acceptSocket(ServerSocket socket)
-       throws IOException
+        throws IOException
     {
-       try {
-           Socket sock=socket.accept();
-           return sock;
-       } catch (SSLException e){
+        try {
+            Socket sock=socket.accept();
+            return sock;
+        } catch (SSLException e){
             logger.debug("SSL handshake error",e);
             throw new SocketException("SSL handshake error" + e.toString());
-       }
+        }
     }
 
     public void handshake(Socket sock)
-        throws IOException
+         throws IOException
     {
-       ((SSLSocket)sock).handshake();
+        ((SSLSocket)sock).handshake();
     }
 }
 

Modified: 
tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSupport.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSupport.java?rev=616522&r1=616521&r2=616522&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSupport.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/puretls/PureTLSSupport.java 
Tue Jan 29 13:18:25 2008
@@ -44,7 +44,7 @@
 
 class PureTLSSupport implements SSLSupport {
     static org.apache.commons.logging.Log logger =
-       org.apache.commons.logging.LogFactory.getLog(PureTLSSupport.class);
+        org.apache.commons.logging.LogFactory.getLog(PureTLSSupport.class);
 
     private COM.claymoresystems.ptls.SSLSocket ssl;
 
@@ -59,21 +59,21 @@
 
     public Object[] getPeerCertificateChain()
         throws IOException {
-       return getPeerCertificateChain(false);
+        return getPeerCertificateChain(false);
     }
 
     public Object[] getPeerCertificateChain(boolean force)
         throws IOException {
         Vector v=ssl.getCertificateChain();
 
-       if(v == null && force) {
-           SSLPolicyInt policy=new SSLPolicyInt();
-           policy.requireClientAuth(true);
-           policy.handshakeOnConnect(false);
-           policy.waitOnClose(false);
-           ssl.renegotiate(policy);
-           v = ssl.getCertificateChain();
-       }
+        if(v == null && force) {
+            SSLPolicyInt policy=new SSLPolicyInt();
+            policy.requireClientAuth(true);
+            policy.handshakeOnConnect(false);
+            policy.waitOnClose(false);
+            ssl.renegotiate(policy);
+            v = ssl.getCertificateChain();
+        }
 
         if(v==null)
             return null;
@@ -97,11 +97,11 @@
             X509Certificate xCert = 
(X509Certificate)cf.generateCertificate(stream);
             chain[i-1]= xCert;
             if(logger.isTraceEnabled()) {
-               logger.trace("Cert # " + i + " = " + xCert);
-           }
+                logger.trace("Cert # " + i + " = " + xCert);
+            }
           }
         } catch (java.security.cert.CertificateException e) {
-           logger.info("JDK's broken cert handling can't parse this 
certificate (which PureTLS likes)",e);
+            logger.info("JDK's broken cert handling can't parse this 
certificate (which PureTLS likes)",e);
             throw new IOException("JDK's broken cert handling can't parse this 
certificate (which PureTLS likes)");
         }
         return chain;



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to