You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2016/01/13 12:14:35 UTC
svn commit: r1724400 [1/3] - in /webservices/wss4j/branches/2_1_x-fixes:
ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/
ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/
ws-security-policy...
Author: coheigea
Date: Wed Jan 13 11:14:34 2016
New Revision: 1724400
URL: http://svn.apache.org/viewvc?rev=1724400&view=rev
Log:
More checkstyle work
Modified:
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedElementsAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedPartsAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/HttpsTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IncludeTimeStampAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IssuedTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/OnlySignEntireHeadersAndBodyAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RelTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredElementsAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredPartsAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SamlTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecurityContextTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureConfirmationAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureProtectionAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedElementsAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedPartsAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SpnegoContextTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyEnforcer.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/WSP13SpecTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/DerivedKeyTokenSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/EncryptedPartSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/HttpsTokenSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/KerberosTokenSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/NoSecuritySecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/OperationSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/RelTokenSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/RequiredElementSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/RequiredPartSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/SamlTokenSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/SecurityContextTokenSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/SignatureConfirmationSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/SignedPartSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/TimestampSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/UsernameTokenSecurityEvent.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/WSSecurityEventConstants.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/InboundWSSec.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/OutboundWSSec.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/WSSec.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java
webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SamlTokenDerivedTest.java
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedElementsAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedElementsAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedElementsAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedElementsAssertionState.java Wed Jan 13 11:14:34 2016
@@ -73,7 +73,7 @@ public class EncryptedElementsAssertionS
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
WSSecurityEventConstants.EncryptedElement,
- WSSecurityEventConstants.EncryptedPart
+ WSSecurityEventConstants.ENCRYPTED_PART
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedPartsAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedPartsAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedPartsAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/EncryptedPartsAssertionState.java Wed Jan 13 11:14:34 2016
@@ -68,7 +68,7 @@ public class EncryptedPartsAssertionStat
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.EncryptedPart
+ WSSecurityEventConstants.ENCRYPTED_PART
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/HttpsTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/HttpsTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/HttpsTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/HttpsTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -54,7 +54,7 @@ public class HttpsTokenAssertionState ex
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.HttpsToken
+ WSSecurityEventConstants.HTTPS_TOKEN
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IncludeTimeStampAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IncludeTimeStampAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IncludeTimeStampAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IncludeTimeStampAssertionState.java Wed Jan 13 11:14:34 2016
@@ -56,7 +56,7 @@ public class IncludeTimeStampAssertionSt
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.Timestamp
+ WSSecurityEventConstants.TIMESTAMP
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IssuedTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IssuedTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IssuedTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/IssuedTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -62,10 +62,10 @@ public class IssuedTokenAssertionState e
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.KerberosToken,
- WSSecurityEventConstants.RelToken,
- WSSecurityEventConstants.SamlToken,
- WSSecurityEventConstants.SecurityContextToken,
+ WSSecurityEventConstants.KERBEROS_TOKEN,
+ WSSecurityEventConstants.REL_TOKEN,
+ WSSecurityEventConstants.SAML_TOKEN,
+ WSSecurityEventConstants.SECURITY_CONTEXT_TOKEN,
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -59,7 +59,7 @@ public class KerberosTokenAssertionState
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.KerberosToken
+ WSSecurityEventConstants.KERBEROS_TOKEN
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java Wed Jan 13 11:14:34 2016
@@ -41,16 +41,16 @@ public class LayoutAssertionState extend
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.UsernameToken,
- WSSecurityEventConstants.IssuedToken,
+ WSSecurityEventConstants.USERNAME_TOKEN,
+ WSSecurityEventConstants.ISSUED_TOKEN,
SecurityEventConstants.X509Token,
- WSSecurityEventConstants.KerberosToken,
- WSSecurityEventConstants.SecurityContextToken,
- WSSecurityEventConstants.SamlToken,
- WSSecurityEventConstants.RelToken,
- WSSecurityEventConstants.HttpsToken,
+ WSSecurityEventConstants.KERBEROS_TOKEN,
+ WSSecurityEventConstants.SECURITY_CONTEXT_TOKEN,
+ WSSecurityEventConstants.SAML_TOKEN,
+ WSSecurityEventConstants.REL_TOKEN,
+ WSSecurityEventConstants.HTTPS_TOKEN,
SecurityEventConstants.KeyValueToken,
- WSSecurityEventConstants.Timestamp,
+ WSSecurityEventConstants.TIMESTAMP,
};
}
@@ -66,14 +66,14 @@ public class LayoutAssertionState extend
break;
case LaxTsFirst:
if (occuredEvents.isEmpty()
- && !WSSecurityEventConstants.Timestamp.equals(securityEvent.getSecurityEventType())) {
+ && !WSSecurityEventConstants.TIMESTAMP.equals(securityEvent.getSecurityEventType())) {
setAsserted(false);
setErrorMessage("Policy enforces " + layout.getLayoutType() + " but "
+ securityEvent.getSecurityEventType() + " occured first");
}
break;
case LaxTsLast:
- if (occuredEvents.contains(WSSecurityEventConstants.Timestamp)) {
+ if (occuredEvents.contains(WSSecurityEventConstants.TIMESTAMP)) {
setAsserted(false);
setErrorMessage("Policy enforces " + layout.getLayoutType() + " but "
+ securityEvent.getSecurityEventType() + " occured last");
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/OnlySignEntireHeadersAndBodyAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/OnlySignEntireHeadersAndBodyAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/OnlySignEntireHeadersAndBodyAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/OnlySignEntireHeadersAndBodyAssertionState.java Wed Jan 13 11:14:34 2016
@@ -64,7 +64,7 @@ public class OnlySignEntireHeadersAndBod
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.SignedPart,
+ WSSecurityEventConstants.SIGNED_PART,
WSSecurityEventConstants.SignedElement
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java Wed Jan 13 11:14:34 2016
@@ -75,9 +75,9 @@ public class ProtectionOrderAssertionSta
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
SecurityEventConstants.SignedElement,
- WSSecurityEventConstants.SignedPart,
+ WSSecurityEventConstants.SIGNED_PART,
WSSecurityEventConstants.EncryptedElement,
- WSSecurityEventConstants.EncryptedPart,
+ WSSecurityEventConstants.ENCRYPTED_PART,
WSSecurityEventConstants.ContentEncrypted,
};
}
@@ -94,7 +94,7 @@ public class ProtectionOrderAssertionSta
}
List<XMLSecurityConstants.ContentType> contentTypes = signedElementSecurityEvent.getProtectionOrder();
testProtectionOrder(protectionOrder, contentTypes, signedElementSecurityEvent.getElementPath());
- } else if (WSSecurityEventConstants.SignedPart.equals(event)) {
+ } else if (WSSecurityEventConstants.SIGNED_PART.equals(event)) {
SignedPartSecurityEvent signedPartSecurityEvent = (SignedPartSecurityEvent) securityEvent;
if (!signedPartSecurityEvent.isSigned()) {
return true;
@@ -108,7 +108,7 @@ public class ProtectionOrderAssertionSta
}
List<XMLSecurityConstants.ContentType> contentTypes = encryptedElementSecurityEvent.getProtectionOrder();
testProtectionOrder(protectionOrder, contentTypes, encryptedElementSecurityEvent.getElementPath());
- } else if (WSSecurityEventConstants.EncryptedPart.equals(event)) {
+ } else if (WSSecurityEventConstants.ENCRYPTED_PART.equals(event)) {
EncryptedPartSecurityEvent encryptedPartSecurityEvent = (EncryptedPartSecurityEvent) securityEvent;
if (!encryptedPartSecurityEvent.isEncrypted()) {
return true;
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RelTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RelTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RelTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RelTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -43,7 +43,7 @@ public class RelTokenAssertionState exte
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.RelToken
+ WSSecurityEventConstants.REL_TOKEN
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredElementsAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredElementsAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredElementsAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredElementsAssertionState.java Wed Jan 13 11:14:34 2016
@@ -79,7 +79,7 @@ public class RequiredElementsAssertionSt
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.RequiredElement
+ WSSecurityEventConstants.REQUIRED_ELEMENT
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredPartsAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredPartsAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredPartsAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/RequiredPartsAssertionState.java Wed Jan 13 11:14:34 2016
@@ -69,7 +69,7 @@ public class RequiredPartsAssertionState
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.RequiredPart
+ WSSecurityEventConstants.REQUIRED_PART
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SamlTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SamlTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SamlTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SamlTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -62,7 +62,7 @@ public class SamlTokenAssertionState ext
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.SamlToken
+ WSSecurityEventConstants.SAML_TOKEN
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -40,7 +40,7 @@ public class SecureConversationTokenAsse
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.SecurityContextToken
+ WSSecurityEventConstants.SECURITY_CONTEXT_TOKEN
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecurityContextTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecurityContextTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecurityContextTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecurityContextTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -60,7 +60,7 @@ public class SecurityContextTokenAsserti
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.SecurityContextToken
+ WSSecurityEventConstants.SECURITY_CONTEXT_TOKEN
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureConfirmationAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureConfirmationAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureConfirmationAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureConfirmationAssertionState.java Wed Jan 13 11:14:34 2016
@@ -55,7 +55,7 @@ public class SignatureConfirmationAssert
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.SignatureConfirmation
+ WSSecurityEventConstants.SIGNATURE_CONFIRMATION
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureProtectionAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureProtectionAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureProtectionAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignatureProtectionAssertionState.java Wed Jan 13 11:14:34 2016
@@ -86,15 +86,15 @@ public class SignatureProtectionAssertio
return new SecurityEventConstants.Event[]{
WSSecurityEventConstants.EncryptedElement,
WSSecurityEventConstants.EncryptedKeyToken,
- WSSecurityEventConstants.IssuedToken,
- WSSecurityEventConstants.KerberosToken,
+ WSSecurityEventConstants.ISSUED_TOKEN,
+ WSSecurityEventConstants.KERBEROS_TOKEN,
SecurityEventConstants.KeyValueToken,
- WSSecurityEventConstants.RelToken,
- WSSecurityEventConstants.SamlToken,
- WSSecurityEventConstants.SecurityContextToken,
- WSSecurityEventConstants.UsernameToken,
+ WSSecurityEventConstants.REL_TOKEN,
+ WSSecurityEventConstants.SAML_TOKEN,
+ WSSecurityEventConstants.SECURITY_CONTEXT_TOKEN,
+ WSSecurityEventConstants.USERNAME_TOKEN,
SecurityEventConstants.X509Token,
- WSSecurityEventConstants.Operation,
+ WSSecurityEventConstants.OPERATION,
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedElementsAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedElementsAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedElementsAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedElementsAssertionState.java Wed Jan 13 11:14:34 2016
@@ -75,7 +75,7 @@ public class SignedElementsAssertionStat
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
SecurityEventConstants.SignedElement,
- WSSecurityEventConstants.SignedPart
+ WSSecurityEventConstants.SIGNED_PART
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedPartsAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedPartsAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedPartsAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SignedPartsAssertionState.java Wed Jan 13 11:14:34 2016
@@ -68,7 +68,7 @@ public class SignedPartsAssertionState e
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.SignedPart
+ WSSecurityEventConstants.SIGNED_PART
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SpnegoContextTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SpnegoContextTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SpnegoContextTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SpnegoContextTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -47,7 +47,7 @@ public class SpnegoContextTokenAssertion
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.SecurityContextToken
+ WSSecurityEventConstants.SECURITY_CONTEXT_TOKEN
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java Wed Jan 13 11:14:34 2016
@@ -74,15 +74,15 @@ public class TokenProtectionAssertionSta
return new SecurityEventConstants.Event[]{
SecurityEventConstants.SignedElement,
WSSecurityEventConstants.EncryptedKeyToken,
- WSSecurityEventConstants.IssuedToken,
- WSSecurityEventConstants.KerberosToken,
+ WSSecurityEventConstants.ISSUED_TOKEN,
+ WSSecurityEventConstants.KERBEROS_TOKEN,
SecurityEventConstants.KeyValueToken,
- WSSecurityEventConstants.RelToken,
- WSSecurityEventConstants.SamlToken,
- WSSecurityEventConstants.SecurityContextToken,
- WSSecurityEventConstants.UsernameToken,
+ WSSecurityEventConstants.REL_TOKEN,
+ WSSecurityEventConstants.SAML_TOKEN,
+ WSSecurityEventConstants.SECURITY_CONTEXT_TOKEN,
+ WSSecurityEventConstants.USERNAME_TOKEN,
SecurityEventConstants.X509Token,
- WSSecurityEventConstants.Operation,
+ WSSecurityEventConstants.OPERATION,
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java Wed Jan 13 11:14:34 2016
@@ -69,7 +69,7 @@ public class UsernameTokenAssertionState
@Override
public SecurityEventConstants.Event[] getSecurityEventType() {
return new SecurityEventConstants.Event[]{
- WSSecurityEventConstants.UsernameToken
+ WSSecurityEventConstants.USERNAME_TOKEN
};
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyEnforcer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyEnforcer.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyEnforcer.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyEnforcer.java Wed Jan 13 11:14:34 2016
@@ -736,7 +736,7 @@ public class PolicyEnforcer implements S
}
}
- if (WSSecurityEventConstants.Operation.equals(securityEvent.getSecurityEventType())) {
+ if (WSSecurityEventConstants.OPERATION.equals(securityEvent.getSecurityEventType())) {
operationSecurityEventOccured = true;
final OperationSecurityEvent operationSecurityEvent = (OperationSecurityEvent) securityEvent;
if (!faultOccurred && (SOAP11_FAULT.equals(operationSecurityEvent.getOperation())
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/WSP13SpecTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/WSP13SpecTest.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/WSP13SpecTest.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/WSP13SpecTest.java Wed Jan 13 11:14:34 2016
@@ -51,7 +51,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateTransportBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.HttpsToken, 2, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}HttpsToken not satisfied", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.HTTPS_TOKEN, 2, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}HttpsToken not satisfied", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/transportBindingPolicyC11.xml", StandardCharsets.UTF_8);
@@ -59,7 +59,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateTransportBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.RequiredElement, 4, "Element /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.REQUIRED_ELEMENT, 4, "Element /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/transportBindingPolicyC11.xml", StandardCharsets.UTF_8);
@@ -67,7 +67,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateTransportBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.UsernameToken, 0, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.USERNAME_TOKEN, 0, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/transportBindingPolicyC11.xml", StandardCharsets.UTF_8);
@@ -95,7 +95,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateAsymmetricBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.RequiredElement, 8, "Element /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.REQUIRED_ELEMENT, 8, "Element /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/asymmetricBindingPolicyC31.xml", StandardCharsets.UTF_8);
@@ -111,7 +111,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateAsymmetricBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.UsernameToken, 1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.USERNAME_TOKEN, 1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied", policyEnforcer, securityEventList);
}
}
@@ -131,7 +131,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateSymmetricBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.RequiredElement, 4, "Element /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.REQUIRED_ELEMENT, 4, "Element /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/symmetricBindingPolicyC21a.xml", StandardCharsets.UTF_8);
@@ -139,7 +139,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateSymmetricBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.SamlToken, -1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}IssuedToken not satisfied", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.SAML_TOKEN, -1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}IssuedToken not satisfied", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/symmetricBindingPolicyC21a.xml", StandardCharsets.UTF_8);
@@ -147,7 +147,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateSymmetricBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.UsernameToken, 0, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.USERNAME_TOKEN, 0, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/symmetricBindingPolicyC21a.xml", StandardCharsets.UTF_8);
@@ -175,7 +175,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateSymmetricBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.RequiredElement, 4, "Element /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.REQUIRED_ELEMENT, 4, "Element /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/symmetricBindingPolicyC21b.xml", StandardCharsets.UTF_8);
@@ -183,7 +183,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateSymmetricBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.SamlToken, -1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}IssuedToken not satisfied", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.SAML_TOKEN, -1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}IssuedToken not satisfied", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/symmetricBindingPolicyC21b.xml", StandardCharsets.UTF_8);
@@ -191,7 +191,7 @@ public class WSP13SpecTest extends Abstr
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
List<SecurityEvent> securityEventList = inboundWSSecurityContextImplTest.generateSymmetricBindingSecurityEvents();
- applyPolicy(WSSecurityEventConstants.UsernameToken, 0, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied", policyEnforcer, securityEventList);
+ applyPolicy(WSSecurityEventConstants.USERNAME_TOKEN, 0, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied", policyEnforcer, securityEventList);
}
{
String policyString = loadResourceAsString("testdata/policy/symmetricBindingPolicyC21b.xml", StandardCharsets.UTF_8);
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java Wed Jan 13 11:14:34 2016
@@ -35,7 +35,7 @@ import org.apache.xml.security.stax.conf
*/
class WSSCrypto {
- protected static final transient org.slf4j.Logger log =
+ protected static final transient org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(WSSCrypto.class);
private Class<? extends Merlin> cryptoClass = Merlin.class;
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java Wed Jan 13 11:14:34 2016
@@ -96,7 +96,7 @@ public class InboundWSSecurityContextImp
return;
}
- if (WSSecurityEventConstants.Operation.equals(securityEvent.getSecurityEventType())) {
+ if (WSSecurityEventConstants.OPERATION.equals(securityEvent.getSecurityEventType())) {
operationSecurityEventOccured = true;
identifySecurityTokenDepenedenciesAndUsage(securityEventQueue);
@@ -122,8 +122,10 @@ public class InboundWSSecurityContextImp
if (!allowRSA15KeyTransportAlgorithm && SecurityEventConstants.AlgorithmSuite.equals(securityEvent.getSecurityEventType())) {
AlgorithmSuiteSecurityEvent algorithmSuiteSecurityEvent = (AlgorithmSuiteSecurityEvent)securityEvent;
Boolean allowRSA15 = get(WSSConstants.PROP_ALLOW_RSA15_KEYTRANSPORT_ALGORITHM);
- if ((allowRSA15 == null || !allowRSA15) && WSSConstants.NS_XENC_RSA15.equals(algorithmSuiteSecurityEvent.getAlgorithmURI())) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, WSSConstants.PROP_ALLOW_RSA15_KEYTRANSPORT_ALGORITHM);
+ if ((allowRSA15 == null || !allowRSA15)
+ && WSSConstants.NS_XENC_RSA15.equals(algorithmSuiteSecurityEvent.getAlgorithmURI())) {
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK,
+ WSSConstants.PROP_ALLOW_RSA15_KEYTRANSPORT_ALGORITHM);
}
}
@@ -161,7 +163,7 @@ public class InboundWSSecurityContextImp
TokenSecurityEvent<? extends InboundSecurityToken> tokenSecurityEvent =
(TokenSecurityEvent<? extends InboundSecurityToken>)securityEvent;
- if (WSSecurityEventConstants.HttpsToken.equals(securityEvent.getSecurityEventType())) {
+ if (WSSecurityEventConstants.HTTPS_TOKEN.equals(securityEvent.getSecurityEventType())) {
HttpsTokenSecurityEvent actHttpsTokenSecurityEvent = (HttpsTokenSecurityEvent) tokenSecurityEvent;
actHttpsTokenSecurityEvent.getSecurityToken().getTokenUsages().clear();
actHttpsTokenSecurityEvent.getSecurityToken().addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainSignature);
@@ -197,7 +199,8 @@ public class InboundWSSecurityContextImp
Iterator<TokenSecurityEvent<? extends InboundSecurityToken>> supportingTokensIterator = supportingTokens.iterator();
while (supportingTokensIterator.hasNext()) {
TokenSecurityEvent<? extends InboundSecurityToken> tokenSecurityEvent = supportingTokensIterator.next();
- List<InboundSecurityToken> signingSecurityTokens = isSignedToken(tokenSecurityEvent, securityEventDeque, httpsTokenSecurityEvent);
+ List<InboundSecurityToken> signingSecurityTokens =
+ isSignedToken(tokenSecurityEvent, securityEventDeque, httpsTokenSecurityEvent);
List<QName> signatureElementPath = new ArrayList<>(4);
signatureElementPath.addAll(WSSConstants.WSSE_SECURITY_HEADER_PATH);
@@ -208,8 +211,10 @@ public class InboundWSSecurityContextImp
List<QName> signatureConfirmationElementPath = new ArrayList<>(4);
signatureConfirmationElementPath.addAll(WSSConstants.WSSE_SECURITY_HEADER_PATH);
signatureConfirmationElementPath.add(WSSConstants.TAG_wsse11_SignatureConfirmation);
- boolean signsSignatureConfirmation = signsElement(tokenSecurityEvent, signatureConfirmationElementPath, securityEventDeque);
- boolean encryptsSignatureConfirmation = encryptsElement(tokenSecurityEvent, signatureConfirmationElementPath, securityEventDeque);
+ boolean signsSignatureConfirmation =
+ signsElement(tokenSecurityEvent, signatureConfirmationElementPath, securityEventDeque);
+ boolean encryptsSignatureConfirmation =
+ encryptsElement(tokenSecurityEvent, signatureConfirmationElementPath, securityEventDeque);
List<QName> timestampElementPath = new ArrayList<>(4);
timestampElementPath.addAll(WSSConstants.WSSE_SECURITY_HEADER_PATH);
@@ -223,10 +228,13 @@ public class InboundWSSecurityContextImp
boolean transportSecurityActive = Boolean.TRUE == get(WSSConstants.TRANSPORT_SECURITY_ACTIVE);
- List<InboundSecurityToken> encryptingSecurityTokens = isEncryptedToken(tokenSecurityEvent, securityEventDeque, httpsTokenSecurityEvent);
+ List<InboundSecurityToken> encryptingSecurityTokens =
+ isEncryptedToken(tokenSecurityEvent, securityEventDeque, httpsTokenSecurityEvent);
- boolean signatureUsage = tokenSecurityEvent.getSecurityToken().getTokenUsages().contains(WSSecurityTokenConstants.TokenUsage_Signature);
- boolean encryptionUsage = tokenSecurityEvent.getSecurityToken().getTokenUsages().contains(WSSecurityTokenConstants.TokenUsage_Encryption);
+ boolean signatureUsage =
+ tokenSecurityEvent.getSecurityToken().getTokenUsages().contains(WSSecurityTokenConstants.TokenUsage_Signature);
+ boolean encryptionUsage =
+ tokenSecurityEvent.getSecurityToken().getTokenUsages().contains(WSSecurityTokenConstants.TokenUsage_Encryption);
if (!transportSecurityActive && signsSignatureConfirmation && signsTimestamp && !signsSignature) {
supportingTokensIterator.remove();
@@ -246,16 +254,19 @@ public class InboundWSSecurityContextImp
if (encryptionUsage) {
messageEncryptionTokens = addTokenSecurityEvent(tokenSecurityEvent, messageEncryptionTokens);
}
- } else if (!transportSecurityActive &&
- (encryptsSignature || encryptsSignatureConfirmation || encryptsUsernameToken)) {
+ } else if (!transportSecurityActive
+ && (encryptsSignature || encryptsSignatureConfirmation || encryptsUsernameToken)) {
supportingTokensIterator.remove();
messageEncryptionTokens = addTokenSecurityEvent(tokenSecurityEvent, messageEncryptionTokens);
} else if (signsSignature && signingSecurityTokens.size() > 0 && encryptingSecurityTokens.size() > 0) {
supportingTokensIterator.remove();
- signedEndorsingEncryptedSupportingTokens = addTokenSecurityEvent(tokenSecurityEvent, signedEndorsingEncryptedSupportingTokens);
- } else if (transportSecurityActive && signsTimestamp && signingSecurityTokens.size() > 0 && encryptingSecurityTokens.size() > 0) {
+ signedEndorsingEncryptedSupportingTokens =
+ addTokenSecurityEvent(tokenSecurityEvent, signedEndorsingEncryptedSupportingTokens);
+ } else if (transportSecurityActive && signsTimestamp && signingSecurityTokens.size() > 0
+ && encryptingSecurityTokens.size() > 0) {
supportingTokensIterator.remove();
- signedEndorsingEncryptedSupportingTokens = addTokenSecurityEvent(tokenSecurityEvent, signedEndorsingEncryptedSupportingTokens);
+ signedEndorsingEncryptedSupportingTokens =
+ addTokenSecurityEvent(tokenSecurityEvent, signedEndorsingEncryptedSupportingTokens);
} else if (signsSignature && signingSecurityTokens.size() == 0 && encryptingSecurityTokens.size() > 0) {
supportingTokensIterator.remove();
endorsingEncryptedSupportingTokens = addTokenSecurityEvent(tokenSecurityEvent, endorsingEncryptedSupportingTokens);
@@ -304,7 +315,8 @@ public class InboundWSSecurityContextImp
}
if (messageSignatureTokens.isEmpty()) {
- for (Iterator<TokenSecurityEvent<? extends InboundSecurityToken>> iterator = supportingTokens.iterator(); iterator.hasNext(); ) {
+ for (Iterator<TokenSecurityEvent<? extends InboundSecurityToken>> iterator =
+ supportingTokens.iterator(); iterator.hasNext();) {
TokenSecurityEvent<? extends InboundSecurityToken> supportingToken = iterator.next();
if (supportingToken.getSecurityToken().getTokenUsages().contains(WSSecurityTokenConstants.TokenUsage_Signature)) {
iterator.remove();
@@ -315,7 +327,8 @@ public class InboundWSSecurityContextImp
}
if (messageEncryptionTokens.isEmpty()) {
- for (Iterator<TokenSecurityEvent<? extends InboundSecurityToken>> iterator = supportingTokens.iterator(); iterator.hasNext(); ) {
+ for (Iterator<TokenSecurityEvent<? extends InboundSecurityToken>> iterator =
+ supportingTokens.iterator(); iterator.hasNext();) {
TokenSecurityEvent<? extends InboundSecurityToken> supportingToken = iterator.next();
if (supportingToken.getSecurityToken().getTokenUsages().contains(WSSecurityTokenConstants.TokenUsage_Encryption)) {
iterator.remove();
@@ -338,7 +351,8 @@ public class InboundWSSecurityContextImp
setTokenUsage(signedEncryptedSupportingTokens, WSSecurityTokenConstants.TokenUsage_SignedEncryptedSupportingTokens);
setTokenUsage(encryptedSupportingTokens, WSSecurityTokenConstants.TokenUsage_EncryptedSupportingTokens);
setTokenUsage(endorsingEncryptedSupportingTokens, WSSecurityTokenConstants.TokenUsage_EndorsingEncryptedSupportingTokens);
- setTokenUsage(signedEndorsingEncryptedSupportingTokens, WSSecurityTokenConstants.TokenUsage_SignedEndorsingEncryptedSupportingTokens);
+ setTokenUsage(signedEndorsingEncryptedSupportingTokens,
+ WSSecurityTokenConstants.TokenUsage_SignedEndorsingEncryptedSupportingTokens);
}
private void removeTokenSecurityEvent(TokenSecurityEvent<? extends InboundSecurityToken> tokenSecurityEvent,
@@ -362,7 +376,8 @@ public class InboundWSSecurityContextImp
return tokenSecurityEventList;
}
- private boolean containsSecurityToken(List<TokenSecurityEvent<? extends InboundSecurityToken>> supportingTokens, SecurityToken securityToken) {
+ private boolean containsSecurityToken(List<TokenSecurityEvent<? extends InboundSecurityToken>> supportingTokens,
+ SecurityToken securityToken) {
if (securityToken != null) {
for (int i = 0; i < supportingTokens.size(); i++) {
TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent = supportingTokens.get(i);
@@ -428,10 +443,11 @@ public class InboundWSSecurityContextImp
return null;
}
- private List<InboundSecurityToken> getSigningToken(TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent, Deque<SecurityEvent> securityEventDeque) throws XMLSecurityException {
+ private List<InboundSecurityToken> getSigningToken(TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent,
+ Deque<SecurityEvent> securityEventDeque) throws XMLSecurityException {
List<InboundSecurityToken> signingSecurityTokens = new ArrayList<>();
- for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext(); ) {
+ for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext();) {
SecurityEvent securityEvent = iterator.next();
if (WSSecurityEventConstants.SignedElement.equals(securityEvent.getSecurityEventType())) {
SignedElementSecurityEvent signedElementSecurityEvent = (SignedElementSecurityEvent) securityEvent;
@@ -447,14 +463,16 @@ public class InboundWSSecurityContextImp
return signingSecurityTokens;
}
- private void setTokenUsage(List<TokenSecurityEvent<? extends InboundSecurityToken>> tokenSecurityEvents, WSSecurityTokenConstants.TokenUsage tokenUsage) throws XMLSecurityException {
+ private void setTokenUsage(List<TokenSecurityEvent<? extends InboundSecurityToken>> tokenSecurityEvents,
+ WSSecurityTokenConstants.TokenUsage tokenUsage) throws XMLSecurityException {
for (int i = 0; i < tokenSecurityEvents.size(); i++) {
TokenSecurityEvent<? extends InboundSecurityToken> tokenSecurityEvent = tokenSecurityEvents.get(i);
setTokenUsage(tokenSecurityEvent, tokenUsage);
}
}
- private void setTokenUsage(TokenSecurityEvent<? extends InboundSecurityToken> tokenSecurityEvent, WSSecurityTokenConstants.TokenUsage tokenUsage) throws XMLSecurityException {
+ private void setTokenUsage(TokenSecurityEvent<? extends InboundSecurityToken> tokenSecurityEvent,
+ WSSecurityTokenConstants.TokenUsage tokenUsage) throws XMLSecurityException {
tokenSecurityEvent.getSecurityToken().getTokenUsages().remove(WSSecurityTokenConstants.TokenUsage_SupportingTokens);
tokenSecurityEvent.getSecurityToken().getTokenUsages().remove(WSSecurityTokenConstants.TokenUsage_Signature);
tokenSecurityEvent.getSecurityToken().getTokenUsages().remove(WSSecurityTokenConstants.TokenUsage_Encryption);
@@ -469,15 +487,15 @@ public class InboundWSSecurityContextImp
securityTokenList.add(httpsTokenSecurityEvent.getSecurityToken());
return securityTokenList;
}
- for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext(); ) {
+ for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext();) {
SecurityEvent securityEvent = iterator.next();
if (WSSecurityEventConstants.SignedElement.equals(securityEvent.getSecurityEventType())) {
SignedElementSecurityEvent signedElementSecurityEvent = (SignedElementSecurityEvent) securityEvent;
if (signedElementSecurityEvent.isSigned()
&& tokenSecurityEvent.getSecurityToken() != null
&& signedElementSecurityEvent.getXmlSecEvent() != null
- && signedElementSecurityEvent.getXmlSecEvent() ==
- ((InboundSecurityToken)tokenSecurityEvent.getSecurityToken()).getXMLSecEvent()
+ && signedElementSecurityEvent.getXmlSecEvent()
+ == ((InboundSecurityToken)tokenSecurityEvent.getSecurityToken()).getXMLSecEvent()
&& !securityTokenList.contains((InboundSecurityToken)signedElementSecurityEvent.getSecurityToken())) {
securityTokenList.add((InboundSecurityToken)signedElementSecurityEvent.getSecurityToken());
}
@@ -495,15 +513,15 @@ public class InboundWSSecurityContextImp
securityTokenList.add(httpsTokenSecurityEvent.getSecurityToken());
return securityTokenList;
}
- for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext(); ) {
+ for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext();) {
SecurityEvent securityEvent = iterator.next();
if (WSSecurityEventConstants.EncryptedElement.equals(securityEvent.getSecurityEventType())) {
EncryptedElementSecurityEvent encryptedElementSecurityEvent = (EncryptedElementSecurityEvent) securityEvent;
if (encryptedElementSecurityEvent.isEncrypted()
&& tokenSecurityEvent.getSecurityToken() != null
&& encryptedElementSecurityEvent.getXmlSecEvent() != null
- && encryptedElementSecurityEvent.getXmlSecEvent() ==
- ((InboundSecurityToken)tokenSecurityEvent.getSecurityToken()).getXMLSecEvent()
+ && encryptedElementSecurityEvent.getXmlSecEvent()
+ == ((InboundSecurityToken)tokenSecurityEvent.getSecurityToken()).getXMLSecEvent()
&& !securityTokenList.contains((InboundSecurityToken)encryptedElementSecurityEvent.getSecurityToken())) {
securityTokenList.add((InboundSecurityToken)encryptedElementSecurityEvent.getSecurityToken());
}
@@ -514,7 +532,7 @@ public class InboundWSSecurityContextImp
private boolean signsElement(TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent, List<QName> elementPath,
Deque<SecurityEvent> securityEventDeque) throws XMLSecurityException {
- for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext(); ) {
+ for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext();) {
SecurityEvent securityEvent = iterator.next();
if (WSSecurityEventConstants.SignedElement.equals(securityEvent.getSecurityEventType())) {
SignedElementSecurityEvent signedElementSecurityEvent = (SignedElementSecurityEvent) securityEvent;
@@ -548,7 +566,7 @@ public class InboundWSSecurityContextImp
private boolean encryptsElement(TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent, List<QName> elementPath,
Deque<SecurityEvent> securityEventDeque) throws XMLSecurityException {
- for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext(); ) {
+ for (Iterator<SecurityEvent> iterator = securityEventDeque.iterator(); iterator.hasNext();) {
SecurityEvent securityEvent = iterator.next();
if (WSSecurityEventConstants.EncryptedElement.equals(securityEvent.getSecurityEventType())) {
EncryptedElementSecurityEvent encryptedElementSecurityEvent = (EncryptedElementSecurityEvent) securityEvent;
@@ -558,11 +576,13 @@ public class InboundWSSecurityContextImp
return true;
}
} else if (WSSecurityEventConstants.ContentEncrypted.equals(securityEvent.getSecurityEventType())) {
- ContentEncryptedElementSecurityEvent contentEncryptedElementSecurityEvent = (ContentEncryptedElementSecurityEvent) securityEvent;
+ ContentEncryptedElementSecurityEvent contentEncryptedElementSecurityEvent =
+ (ContentEncryptedElementSecurityEvent) securityEvent;
+ String tokenId = tokenSecurityEvent.getSecurityToken().getId();
if (contentEncryptedElementSecurityEvent.isEncrypted()
- && contentEncryptedElementSecurityEvent.getSecurityToken().getId().equals(tokenSecurityEvent.getSecurityToken().getId())
- && contentEncryptedElementSecurityEvent.getXmlSecEvent() ==
- ((InboundSecurityToken)tokenSecurityEvent.getSecurityToken()).getXMLSecEvent()
+ && contentEncryptedElementSecurityEvent.getSecurityToken().getId().equals(tokenId)
+ && contentEncryptedElementSecurityEvent.getXmlSecEvent()
+ == ((InboundSecurityToken)tokenSecurityEvent.getSecurityToken()).getXMLSecEvent()
&& WSSUtils.pathMatches(elementPath, contentEncryptedElementSecurityEvent.getElementPath(), true, false)) {
return true;
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java Wed Jan 13 11:14:34 2016
@@ -599,7 +599,7 @@ public class SAMLTokenInputHandler exten
@Override
public void registerSecurityEvent(SecurityEvent securityEvent) throws XMLSecurityException {
- if (WSSecurityEventConstants.SignedPart.equals(securityEvent.getSecurityEventType())) {
+ if (WSSecurityEventConstants.SIGNED_PART.equals(securityEvent.getSecurityEventType())) {
SignedPartSecurityEvent signedPartSecurityEvent = (SignedPartSecurityEvent) securityEvent;
List<QName> elementPath = signedPartSecurityEvent.getElementPath();
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java Wed Jan 13 11:14:34 2016
@@ -296,7 +296,7 @@ public class SAMLTokenOutputProcessor ex
//fire a tokenSecurityEvent
TokenSecurityEvent<OutboundSecurityToken> tokenSecurityEvent =
- new TokenSecurityEvent<OutboundSecurityToken>(WSSecurityEventConstants.SamlToken) {
+ new TokenSecurityEvent<OutboundSecurityToken>(WSSecurityEventConstants.SAML_TOKEN) {
public OutboundSecurityToken getSecurityToken() {
try {
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java Wed Jan 13 11:14:34 2016
@@ -70,7 +70,8 @@ public class ExternalSecurityTokenImpl e
}
@Override
- protected Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) throws XMLSecurityException {
+ protected Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
+ throws XMLSecurityException {
String keyAlgorithm = JCEMapper.getJCEKeyAlgorithmFromURI(algorithmURI);
return new SecretKeySpec(key, keyAlgorithm);
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java Wed Jan 13 11:14:34 2016
@@ -107,8 +107,7 @@ public class KerberosClientSecurityToken
}
ticket = krbCtx.getKerberosToken();
- }
- catch (PrivilegedActionException e) {
+ } catch (PrivilegedActionException e) {
Throwable cause = e.getCause();
if (cause instanceof WSSecurityException) {
throw (WSSecurityException) cause;
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java Wed Jan 13 11:14:34 2016
@@ -134,7 +134,8 @@ public class SamlSecurityTokenImpl exten
}
@Override
- protected Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) throws XMLSecurityException {
+ protected Key getKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
+ throws XMLSecurityException {
Key key = null;
if (this.key != null) {
key = this.key;
@@ -155,7 +156,8 @@ public class SamlSecurityTokenImpl exten
}
@Override
- protected PublicKey getPubKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) throws XMLSecurityException {
+ protected PublicKey getPubKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID)
+ throws XMLSecurityException {
if (this.subjectSecurityToken != null) {
return subjectSecurityToken.getPublicKey(algorithmURI, algorithmUsage, correlationID);
} else if (subjectKeyInfo != null && subjectKeyInfo.getPublicKey() != null) {
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java?rev=1724400&r1=1724399&r2=1724400&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java Wed Jan 13 11:14:34 2016
@@ -24,6 +24,7 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+import java.security.Principal;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
@@ -91,28 +92,34 @@ public class SecurityTokenFactoryImpl ex
final SecurityTokenReferenceType securityTokenReferenceType
= XMLSecurityUtils.getQNameType(keyInfoType.getContent(), WSSConstants.TAG_wsse_SecurityTokenReference);
if (securityTokenReferenceType != null) {
- return getSecurityToken(securityTokenReferenceType, crypto, ((WSSSecurityProperties)securityProperties).getCallbackHandler(), inboundSecurityContext,
+ return getSecurityToken(securityTokenReferenceType, crypto,
+ ((WSSSecurityProperties)securityProperties).getCallbackHandler(), inboundSecurityContext,
((WSSSecurityProperties)securityProperties));
}
final KeyValueType keyValueType
= XMLSecurityUtils.getQNameType(keyInfoType.getContent(), WSSConstants.TAG_dsig_KeyValue);
if (keyValueType != null) {
- return getSecurityToken(keyValueType, crypto, ((WSSSecurityProperties)securityProperties).getCallbackHandler(), inboundSecurityContext,
+ return getSecurityToken(keyValueType, crypto, ((WSSSecurityProperties)securityProperties).getCallbackHandler(),
+ inboundSecurityContext,
((WSSSecurityProperties)securityProperties));
}
} else if (crypto != null && crypto.getDefaultX509Identifier() != null) {
return new X509DefaultSecurityTokenImpl(
- (WSInboundSecurityContext) inboundSecurityContext, crypto, ((WSSSecurityProperties)securityProperties).getCallbackHandler(), crypto.getDefaultX509Identifier(),
- crypto.getDefaultX509Identifier(), WSSecurityTokenConstants.KeyIdentifier_NoKeyInfo, ((WSSSecurityProperties)securityProperties)
+ (WSInboundSecurityContext) inboundSecurityContext, crypto,
+ ((WSSSecurityProperties)securityProperties).getCallbackHandler(), crypto.getDefaultX509Identifier(),
+ crypto.getDefaultX509Identifier(), WSSecurityTokenConstants.KeyIdentifier_NoKeyInfo,
+ ((WSSSecurityProperties)securityProperties)
);
}
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noKeyinfo");
}
- public static InboundSecurityToken getSecurityToken(SecurityTokenReferenceType securityTokenReferenceType, Crypto crypto,
- final CallbackHandler callbackHandler, InboundSecurityContext inboundSecurityContext,
- WSSSecurityProperties securityProperties)
+ public static InboundSecurityToken getSecurityToken(SecurityTokenReferenceType securityTokenReferenceType,
+ Crypto crypto,
+ final CallbackHandler callbackHandler,
+ InboundSecurityContext inboundSecurityContext,
+ WSSSecurityProperties securityProperties)
throws XMLSecurityException {
//BSP.R5205 is a joke. In real life we have a lot of cases which prevents a one pass processing.
@@ -150,8 +157,9 @@ public class SecurityTokenFactoryImpl ex
X509SecurityToken x509SecurityToken = (X509SecurityToken) inboundSecurityToken;
final X509Certificate x509Certificate = x509SecurityToken.getX509Certificates()[0];
- if (x509Certificate.getSerialNumber().compareTo(x509IssuerSerialType.getX509SerialNumber()) == 0 &&
- x509Certificate.getIssuerX500Principal().equals(new X500Principal(x509IssuerSerialType.getX509IssuerName()))) {
+ Principal principal = new X500Principal(x509IssuerSerialType.getX509IssuerName());
+ if (x509Certificate.getSerialNumber().compareTo(x509IssuerSerialType.getX509SerialNumber()) == 0
+ && x509Certificate.getIssuerX500Principal().equals(principal)) {
return createSecurityTokenProxy(inboundSecurityToken,
WSSecurityTokenConstants.KeyIdentifier_IssuerSerial);
}
@@ -257,7 +265,8 @@ public class SecurityTokenFactoryImpl ex
} else if (WSSConstants.NS_SAML10_TYPE.equals(valueType) || WSSConstants.NS_SAML20_TYPE.equals(valueType)) {
if (WSSConstants.NS_SAML20_TYPE.equals(valueType) && !WSSConstants.NS_SAML20_TOKEN_PROFILE_TYPE.equals(tokenType)) {
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R6617);
- } else if (WSSConstants.NS_SAML10_TYPE.equals(valueType) && !WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE.equals(tokenType)) {
+ } else if (WSSConstants.NS_SAML10_TYPE.equals(valueType)
+ && !WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE.equals(tokenType)) {
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R6611);
}
SecurityTokenProvider<? extends InboundSecurityToken> securityTokenProvider =
@@ -289,7 +298,8 @@ public class SecurityTokenFactoryImpl ex
SecurityTokenProvider<? extends InboundSecurityToken> tokenProvider = securityTokenProviders.get(i);
InboundSecurityToken inboundSecurityToken = tokenProvider.getSecurityToken();
if (inboundSecurityToken instanceof KerberosServiceSecurityToken) {
- KerberosServiceSecurityToken kerberosSecurityToken = (KerberosServiceSecurityToken)inboundSecurityToken;
+ KerberosServiceSecurityToken kerberosSecurityToken =
+ (KerberosServiceSecurityToken)inboundSecurityToken;
byte[] tokenDigest = messageDigest.digest(kerberosSecurityToken.getBinaryContent());
if (Arrays.equals(tokenDigest, binaryContent)) {
return createSecurityTokenProxy(inboundSecurityToken,
@@ -391,8 +401,8 @@ public class SecurityTokenFactoryImpl ex
if (!WSSConstants.NS_SAML20_TOKEN_PROFILE_TYPE.equals(tokenType)) {
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R6617);
}
- } else if (WSSecurityTokenConstants.Saml10Token.equals(samlTokenType) &&
- !WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE.equals(tokenType)) {
+ } else if (WSSecurityTokenConstants.Saml10Token.equals(samlTokenType)
+ && !WSSConstants.NS_SAML11_TOKEN_PROFILE_TYPE.equals(tokenType)) {
((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R6611);
}
}