You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by di...@apache.org on 2005/08/18 16:35:00 UTC

cvs commit: ws-wss4j/src/org/apache/ws/security WSSConfig.java WSSecurityEngine.java

dims        2005/08/18 07:35:00

  Modified:    src/org/apache/ws/sandbox/axis/security/conversation
                        ConversationClientHandler.java
                        ConversationServerHandler.java
                        ConvHandlerConstants.java
               src/org/apache/ws/sandbox/security/conversation
                        ConversationEngine.java
               src/org/apache/ws/security WSSConfig.java
                        WSSecurityEngine.java
  Log:
  Fix for WSS-6 - Removed hard-coded BouncyCastle provider from wss4j
  
  Revision  Changes    Path
  1.17      +0 -15     ws-wss4j/src/org/apache/ws/sandbox/axis/security/conversation/ConversationClientHandler.java
  
  Index: ConversationClientHandler.java
  ===================================================================
  RCS file: /home/cvs/ws-wss4j/src/org/apache/ws/sandbox/axis/security/conversation/ConversationClientHandler.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ConversationClientHandler.java	17 Aug 2005 16:48:51 -0000	1.16
  +++ ConversationClientHandler.java	18 Aug 2005 14:35:00 -0000	1.17
  @@ -115,21 +115,6 @@
       private HashMap configurator;
   
       int[] actionsInt;
  -    static {
  -        org.apache.xml.security.Init.init();
  -        String Id = "BC";
  -        if (java.security.Security.getProvider(Id) == null) {
  -            log.debug("The provider " + Id
  -                    + " had to be added to the java.security.Security");
  -            java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
  -        }
  -        Transform.init();
  -        try {
  -            Transform.register(STRTransform.implementedTransformURI,
  -                    "org.apache.ws.security.transform.STRTransform");
  -        } catch (Exception ex) {
  -        }
  -    }
   
       public ConversationClientHandler() throws AxisFault {
           log.debug("ConversationClientHandler :: created");
  
  
  
  1.14      +0 -17     ws-wss4j/src/org/apache/ws/sandbox/axis/security/conversation/ConversationServerHandler.java
  
  Index: ConversationServerHandler.java
  ===================================================================
  RCS file: /home/cvs/ws-wss4j/src/org/apache/ws/sandbox/axis/security/conversation/ConversationServerHandler.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ConversationServerHandler.java	17 Aug 2005 16:48:51 -0000	1.13
  +++ ConversationServerHandler.java	18 Aug 2005 14:35:00 -0000	1.14
  @@ -85,23 +85,6 @@
           log.debug("ConversationServerHandler :: created");
       }
   
  -    static{
  -        org.apache.xml.security.Init.init();
  -        String Id = "BC";
  -        if (java.security.Security.getProvider(Id) == null) {
  -            log.debug("The provider " + Id
  -                    + " had to be added to the java.security.Security");
  -            java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
  -        }
  -        Transform.init();
  -        try {
  -            Transform.register(STRTransform.implementedTransformURI,
  -                    "org.apache.ws.security.transform.STRTransform");
  -        } catch (Exception ex) {
  -        }
  -
  -    }
  -
       /**
        * Method inherited from the BasicHandler.
        * If in the request flow calls the doRequestMetod()
  
  
  
  1.8       +0 -19     ws-wss4j/src/org/apache/ws/sandbox/axis/security/conversation/ConvHandlerConstants.java
  
  Index: ConvHandlerConstants.java
  ===================================================================
  RCS file: /home/cvs/ws-wss4j/src/org/apache/ws/sandbox/axis/security/conversation/ConvHandlerConstants.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ConvHandlerConstants.java	17 Aug 2005 16:48:51 -0000	1.7
  +++ ConvHandlerConstants.java	18 Aug 2005 14:35:00 -0000	1.8
  @@ -113,24 +113,5 @@
   						new Integer(ConversationConstants.STSREQUEST_TOKEN));
   		sctEstablishmentMapper.put("InteropHandshake",
   								new Integer(ConversationConstants.INTEROP_SCENE1));
  -		
  -   
  -        org.apache.xml.security.Init.init();
  -        String Id = "BC";
  -        if (java.security.Security.getProvider(Id) == null) {
  -            log.debug("The provider " + Id
  -                    + " had to be added to the java.security.Security");
  -            java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
  -        }
  -        Transform.init();
  -        try {
  -            Transform.register(STRTransform.implementedTransformURI,
  -                    "org.apache.ws.security.transform.STRTransform");
  -        } catch (Exception ex) {
  -        	//TODO Log the exception
  -        }
  -		
       }
  -    
  -
   }
  \ No newline at end of file
  
  
  
  1.14      +0 -10     ws-wss4j/src/org/apache/ws/sandbox/security/conversation/ConversationEngine.java
  
  Index: ConversationEngine.java
  ===================================================================
  RCS file: /home/cvs/ws-wss4j/src/org/apache/ws/sandbox/security/conversation/ConversationEngine.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ConversationEngine.java	18 Aug 2005 13:54:38 -0000	1.13
  +++ ConversationEngine.java	18 Aug 2005 14:35:00 -0000	1.14
  @@ -80,16 +80,6 @@
   
       private boolean doDebug = false;
   
  -    static {
  -        org.apache.xml.security.Init.init();
  -        String Id = "BC";
  -        if (java.security.Security.getProvider(Id) == null) {
  -            log.debug("The provider " + Id
  -                    + " had to be added to the java.security.Security");
  -            java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
  -        }
  -    }
  -    
       /**
        * <code>wsc:DerivedKeyToken</code> as defined in WS Secure Conversation specification.
        */
  
  
  
  1.6       +24 -0     ws-wss4j/src/org/apache/ws/security/WSSConfig.java
  
  Index: WSSConfig.java
  ===================================================================
  RCS file: /home/cvs/ws-wss4j/src/org/apache/ws/security/WSSConfig.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WSSConfig.java	12 Jul 2005 19:56:21 -0000	1.5
  +++ WSSConfig.java	18 Aug 2005 14:35:00 -0000	1.6
  @@ -17,6 +17,12 @@
   
   package org.apache.ws.security;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +import org.apache.ws.security.transform.STRTransform;
  +import org.apache.ws.security.util.Loader;
  +import org.apache.xml.security.transforms.Transform;
  +
   /**
    * WSSConfig
    * <p/>
  @@ -35,6 +41,7 @@
    * @author Rami Jaamour (rjaamour@parasoft.com)
    */
   public class WSSConfig {
  +    private static Log log = LogFactory.getLog(WSSConfig.class.getName());
       protected static WSSConfig defaultConfig = getNewInstance();
       protected String wsse_ns = WSConstants.WSSE_NS_OASIS_1_0;
       protected String wsu_ns = WSConstants.WSU_NS_OASIS_1_0;
  @@ -56,6 +63,23 @@
       protected boolean precisionInMilliSeconds = true;
   
       protected WSSConfig() {
  +        org.apache.xml.security.Init.init();
  +        try {
  +            Class c = Loader.loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider");
  +            String Id = "BC";
  +            if (java.security.Security.getProvider(Id) == null) {
  +                log.debug("The provider " + Id
  +                        + " had to be added to the java.security.Security");
  +                java.security.Security.addProvider((java.security.Provider)c.newInstance());
  +            }
  +        } catch (Throwable t) {
  +        }
  +        Transform.init();
  +        try {
  +            Transform.register(STRTransform.implementedTransformURI,
  +                    "org.apache.ws.security.transform.STRTransform");
  +        } catch (Exception ex) {
  +        }
       }
   
       /**
  
  
  
  1.48      +0 -14     ws-wss4j/src/org/apache/ws/security/WSSecurityEngine.java
  
  Index: WSSecurityEngine.java
  ===================================================================
  RCS file: /home/cvs/ws-wss4j/src/org/apache/ws/security/WSSecurityEngine.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- WSSecurityEngine.java	15 Aug 2005 13:37:02 -0000	1.47
  +++ WSSecurityEngine.java	18 Aug 2005 14:35:00 -0000	1.48
  @@ -129,20 +129,6 @@
       protected static final QName SAML_TOKEN = new QName(WSConstants.SAML_NS, WSConstants.ASSERTION_LN);
   
       static {
  -        org.apache.xml.security.Init.init();
  -        String Id = "BC";
  -        if (java.security.Security.getProvider(Id) == null) {
  -            log.debug("The provider " + Id
  -                    + " had to be added to the java.security.Security");
  -            java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
  -        }
  -        Transform.init();
  -        try {
  -            Transform.register(STRTransform.implementedTransformURI,
  -                    "org.apache.ws.security.transform.STRTransform");
  -        } catch (Exception ex) {
  -        }
  -        ;
       }
   
       public WSSecurityEngine() {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org