cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/6] cxf git commit: Some updates from WSS4J
Date Mon, 14 Mar 2016 16:48:39 GMT
Some updates from WSS4J


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d96083c2
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d96083c2
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d96083c2

Branch: refs/heads/3.0.x-fixes
Commit: d96083c2342a6193e01eea4880e21b912047b760
Parents: f4da241
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Jan 14 11:57:59 2016 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Mar 14 16:47:47 2016 +0000

----------------------------------------------------------------------
 .../security/trust/STSStaxTokenValidator.java   | 14 +++++++-------
 .../security/wss4j/WSS4JStaxInInterceptor.java  | 14 +++++++-------
 .../cxf/ws/security/wss4j/WSS4JUtils.java       |  2 +-
 .../AbstractStaxBindingHandler.java             | 20 ++++++++++----------
 .../StaxAsymmetricBindingHandler.java           |  4 ++--
 .../StaxSymmetricBindingHandler.java            |  4 ++--
 6 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d96083c2/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSStaxTokenValidator.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSStaxTokenValidator.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSStaxTokenValidator.java
index f454ffb..8cf0778 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSStaxTokenValidator.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSStaxTokenValidator.java
@@ -160,11 +160,11 @@ public class STSStaxTokenValidator
         // If the UsernameToken is to be used for key derivation, the (1.1)
         // spec says that it cannot contain a password, and it must contain
         // an Iteration element
-        final byte[] salt = XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), WSSConstants.TAG_wsse11_Salt);
+        final byte[] salt = XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), WSSConstants.TAG_WSSE11_SALT);
         PasswordString passwordType = 
-            XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), WSSConstants.TAG_wsse_Password);
+            XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), WSSConstants.TAG_WSSE_PASSWORD);
         final Long iteration = 
-            XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), WSSConstants.TAG_wsse11_Iteration);
+            XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), WSSConstants.TAG_WSSE11_ITERATION);
         if (salt != null && (passwordType != null || iteration == null)) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badTokenType01");
         }
@@ -206,7 +206,7 @@ public class STSStaxTokenValidator
 
         final EncodedString encodedNonce =
                 XMLSecurityUtils.getQNameType(usernameTokenType.getAny(), 
-                                              WSSConstants.TAG_wsse_Nonce);
+                                              WSSConstants.TAG_WSSE_NONCE);
         byte[] nonceVal = null;
         if (encodedNonce != null && encodedNonce.getValue() != null) {
             nonceVal = Base64.decodeBase64(encodedNonce.getValue());
@@ -214,7 +214,7 @@ public class STSStaxTokenValidator
 
         final AttributedDateTime attributedDateTimeCreated =
                 XMLSecurityUtils.getQNameType(usernameTokenType.getAny(),
-                                              WSSConstants.TAG_wsu_Created);
+                                              WSSConstants.TAG_WSU_CREATED);
 
         String created = null;
         if (attributedDateTimeCreated != null) {
@@ -492,7 +492,7 @@ public class STSStaxTokenValidator
                     x509PKIPathv1SecurityToken.setElementPath(tokenContext.getElementPath());
                     x509PKIPathv1SecurityToken.setXMLSecEvent(tokenContext.getFirstXMLSecEvent());
                     return x509PKIPathv1SecurityToken;
-                } else if (WSSConstants.NS_GSS_Kerberos5_AP_REQ.equals(binarySecurityTokenType.getValueType()))
{
+                } else if (WSSConstants.NS_GSS_KERBEROS5_AP_REQ.equals(binarySecurityTokenType.getValueType()))
{
                     KerberosServiceSecurityTokenImpl kerberosServiceSecurityToken = 
                         new KerberosServiceSecurityTokenImpl(
                             tokenContext.getWsSecurityContext(),
@@ -540,7 +540,7 @@ public class STSStaxTokenValidator
                 binarySecurity = new X509Security(doc);
             } else if (WSSConstants.NS_X509PKIPathv1.equals(binarySecurityTokenType.getValueType()))
{
                 binarySecurity = new PKIPathSecurity(doc);
-            } else if (WSSConstants.NS_GSS_Kerberos5_AP_REQ.equals(binarySecurityTokenType.getValueType()))
{
+            } else if (WSSConstants.NS_GSS_KERBEROS5_AP_REQ.equals(binarySecurityTokenType.getValueType()))
{
                 binarySecurity = new KerberosSecurity(doc);
             } else {
                 throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN);

http://git-wip-us.apache.org/repos/asf/cxf/blob/d96083c2/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
index f42b794..8a1dcc8 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
@@ -371,15 +371,15 @@ public class WSS4JStaxInInterceptor extends AbstractWSS4JStaxInterceptor
{
     ) throws WSSecurityException {
         Validator validator = loadValidator(SecurityConstants.SAML1_TOKEN_VALIDATOR, message);
         if (validator != null) {
-            properties.addValidator(WSSConstants.TAG_saml_Assertion, validator);
+            properties.addValidator(WSSConstants.TAG_SAML_ASSERTION, validator);
         }
         validator = loadValidator(SecurityConstants.SAML2_TOKEN_VALIDATOR, message);
         if (validator != null) {
-            properties.addValidator(WSSConstants.TAG_saml2_Assertion, validator);
+            properties.addValidator(WSSConstants.TAG_SAML2_ASSERTION, validator);
         }
         validator = loadValidator(SecurityConstants.USERNAME_TOKEN_VALIDATOR, message);
         if (validator != null) {
-            properties.addValidator(WSSConstants.TAG_wsse_UsernameToken, validator);
+            properties.addValidator(WSSConstants.TAG_WSSE_USERNAME_TOKEN, validator);
         }
         validator = loadValidator(SecurityConstants.SIGNATURE_TOKEN_VALIDATOR, message);
         if (validator != null) {
@@ -387,16 +387,16 @@ public class WSS4JStaxInInterceptor extends AbstractWSS4JStaxInterceptor
{
         }
         validator = loadValidator(SecurityConstants.TIMESTAMP_TOKEN_VALIDATOR, message);
         if (validator != null) {
-            properties.addValidator(WSSConstants.TAG_wsu_Timestamp, validator);
+            properties.addValidator(WSSConstants.TAG_WSU_TIMESTAMP, validator);
         }
         validator = loadValidator(SecurityConstants.BST_TOKEN_VALIDATOR, message);
         if (validator != null) {
-            properties.addValidator(WSSConstants.TAG_wsse_BinarySecurityToken, validator);
+            properties.addValidator(WSSConstants.TAG_WSSE_BINARY_SECURITY_TOKEN, validator);
         }
         validator = loadValidator(SecurityConstants.SCT_TOKEN_VALIDATOR, message);
         if (validator != null) {
-            properties.addValidator(WSSConstants.TAG_wsc0502_SecurityContextToken, validator);
-            properties.addValidator(WSSConstants.TAG_wsc0512_SecurityContextToken, validator);
+            properties.addValidator(WSSConstants.TAG_WSC0502_SCT, validator);
+            properties.addValidator(WSSConstants.TAG_WSC0512_SCT, validator);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/d96083c2/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
index d5ac7bd..abc263c 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
@@ -214,7 +214,7 @@ public final class WSS4JUtils {
                 if (securityToken.getTokenType() == WSSecurityTokenConstants.EncryptedKeyToken)
{
                     cachedTok.setTokenType(WSSConstants.NS_WSS_ENC_KEY_VALUE_TYPE);
                 } else if (securityToken.getTokenType() == WSSecurityTokenConstants.KerberosToken)
{
-                    cachedTok.setTokenType(WSSConstants.NS_GSS_Kerberos5_AP_REQ);
+                    cachedTok.setTokenType(WSSConstants.NS_GSS_KERBEROS5_AP_REQ);
                 } else if (securityToken.getTokenType() == WSSecurityTokenConstants.Saml11Token)
{
                     cachedTok.setTokenType(WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE);
                 } else if (securityToken.getTokenType() == WSSecurityTokenConstants.Saml20Token)
{

http://git-wip-us.apache.org/repos/asf/cxf/blob/d96083c2/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
index b1f59c3cb..22dfa6a 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
@@ -169,7 +169,7 @@ public abstract class AbstractStaxBindingHandler extends AbstractCommonBindingHa
             }
         }
         
-        return new SecurePart(WSSConstants.TAG_wsse_UsernameToken, Modifier.Element);
+        return new SecurePart(WSSConstants.TAG_WSSE_USERNAME_TOKEN, Modifier.Element);
     }
     
     private static class UTCallbackHandler implements CallbackHandler {
@@ -263,7 +263,7 @@ public abstract class AbstractStaxBindingHandler extends AbstractCommonBindingHa
         }
         */
         
-        SecurePart securePart = new SecurePart(WSSConstants.TAG_wsse_BinarySecurityToken,
Modifier.Element);
+        SecurePart securePart = new SecurePart(WSSConstants.TAG_WSSE_BINARY_SECURITY_TOKEN,
Modifier.Element);
         securePart.setIdToSign(wss4jToken.getId());
         
         return securePart;
@@ -309,10 +309,10 @@ public abstract class AbstractStaxBindingHandler extends AbstractCommonBindingHa
         }
         properties.addAction(actionToPerform);
         
-        QName qname = WSSConstants.TAG_saml2_Assertion;
+        QName qname = WSSConstants.TAG_SAML2_ASSERTION;
         SamlTokenType tokenType = token.getSamlTokenType();
         if (tokenType == SamlTokenType.WssSamlV11Token10 || tokenType == SamlTokenType.WssSamlV11Token11)
{
-            qname = WSSConstants.TAG_saml_Assertion;
+            qname = WSSConstants.TAG_SAML_ASSERTION;
         }
         
         return new SecurePart(qname, Modifier.Element);
@@ -367,9 +367,9 @@ public abstract class AbstractStaxBindingHandler extends AbstractCommonBindingHa
                 };
                 properties.setSamlCallbackHandler(callbackHandler);
                 
-                QName qname = WSSConstants.TAG_saml2_Assertion;
+                QName qname = WSSConstants.TAG_SAML2_ASSERTION;
                 if (WSConstants.SAML_NS.equals(el.getNamespaceURI())) {
-                    qname = WSSConstants.TAG_saml_Assertion;
+                    qname = WSSConstants.TAG_SAML_ASSERTION;
                 }
                 
                 return new SecurePart(qname, Modifier.Element);
@@ -681,7 +681,7 @@ public abstract class AbstractStaxBindingHandler extends AbstractCommonBindingHa
                 configureSignature(token, false);
                 if (suppTokens.isEncryptedToken()) {
                     SecurePart part = 
-                        new SecurePart(WSSConstants.TAG_wsse_BinarySecurityToken, Modifier.Element);
+                        new SecurePart(WSSConstants.TAG_WSSE_BINARY_SECURITY_TOKEN, Modifier.Element);
                     encryptedTokensList.add(part);
                 }
                 ret.put(token, new SecurePart(WSSConstants.TAG_dsig_Signature, Modifier.Element));
@@ -787,8 +787,8 @@ public abstract class AbstractStaxBindingHandler extends AbstractCommonBindingHa
                 List<WSSConstants.Action> actionList = properties.getActions();
     
                 // Don't add a signed SAML Token as a part, as it will be automatically signed
by WSS4J
-                if (!((WSSConstants.TAG_saml_Assertion.equals(name) 
-                    || WSSConstants.TAG_saml2_Assertion.equals(name))
+                if (!((WSSConstants.TAG_SAML_ASSERTION.equals(name) 
+                    || WSSConstants.TAG_SAML2_ASSERTION.equals(name))
                     && actionList != null && actionList.contains(WSSConstants.SAML_TOKEN_SIGNED)))
{
                     properties.addSignaturePart(part);
                 }
@@ -815,7 +815,7 @@ public abstract class AbstractStaxBindingHandler extends AbstractCommonBindingHa
         
         if (sigParts != null) {
             SecurePart securePart = 
-                new SecurePart(WSSConstants.TAG_wsse11_SignatureConfirmation, Modifier.Element);
+                new SecurePart(WSSConstants.TAG_WSSE11_SIG_CONF, Modifier.Element);
             sigParts.add(securePart);
         }
         signatureConfirmationAdded = true;

http://git-wip-us.apache.org/repos/asf/cxf/blob/d96083c2/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxAsymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxAsymmetricBindingHandler.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxAsymmetricBindingHandler.java
index 10278d1..bc93956 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxAsymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxAsymmetricBindingHandler.java
@@ -189,7 +189,7 @@ public class StaxAsymmetricBindingHandler extends AbstractStaxBindingHandler
{
                 enc.add(part);
                 if (signatureConfirmationAdded) {
                     SecurePart securePart = 
-                        new SecurePart(WSSConstants.TAG_wsse11_SignatureConfirmation, Modifier.Element);
+                        new SecurePart(WSSConstants.TAG_WSSE11_SIG_CONF, Modifier.Element);
                     enc.add(securePart);
                 }
                 assertPolicy(
@@ -301,7 +301,7 @@ public class StaxAsymmetricBindingHandler extends AbstractStaxBindingHandler
{
                     encrParts.add(part);
                     if (signatureConfirmationAdded) {
                         SecurePart securePart = 
-                            new SecurePart(WSSConstants.TAG_wsse11_SignatureConfirmation,
Modifier.Element);
+                            new SecurePart(WSSConstants.TAG_WSSE11_SIG_CONF, Modifier.Element);
                         encrParts.add(securePart);
                     }
                     assertPolicy(

http://git-wip-us.apache.org/repos/asf/cxf/blob/d96083c2/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
index a6a77fe..d60ef6c 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
@@ -239,7 +239,7 @@ public class StaxSymmetricBindingHandler extends AbstractStaxBindingHandler
{
                         new SecurePart(new QName(WSSConstants.NS_DSIG, "Signature"), Modifier.Element);
                     encrParts.add(part);
                     if (signatureConfirmationAdded) {
-                        part = new SecurePart(WSSConstants.TAG_wsse11_SignatureConfirmation,
Modifier.Element);
+                        part = new SecurePart(WSSConstants.TAG_WSSE11_SIG_CONF, Modifier.Element);
                         encrParts.add(part);
                     }
                     assertPolicy(
@@ -375,7 +375,7 @@ public class StaxSymmetricBindingHandler extends AbstractStaxBindingHandler
{
                     new SecurePart(new QName(WSSConstants.NS_DSIG, "Signature"), Modifier.Element);
                 enc.add(part);
                 if (signatureConfirmationAdded) {
-                    part = new SecurePart(WSSConstants.TAG_wsse11_SignatureConfirmation,
Modifier.Element);
+                    part = new SecurePart(WSSConstants.TAG_WSSE11_SIG_CONF, Modifier.Element);
                     enc.add(part);
                 }
                 assertPolicy(


Mime
View raw message