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/11 12:07:51 UTC
svn commit: r1724006 [2/2] - in /webservices/wss4j/branches/2_1_x-fixes:
ws-security-dom/src/main/java/org/apache/wss4j/dom/util/
ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/
ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/proce...
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.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/UsernameTokenOutputProcessor.java?rev=1724006&r1=1724005&r2=1724006&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java Mon Jan 11 11:07:51 2016
@@ -54,11 +54,13 @@ public class UsernameTokenOutputProcesso
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ throws XMLStreamException, XMLSecurityException {
try {
CallbackHandler callbackHandler = ((WSSSecurityProperties)getSecurityProperties()).getCallbackHandler();
- WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType = ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType();
+ WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType =
+ ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType();
if (callbackHandler == null
&& WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE != usernameTokenPasswordType) {
@@ -68,7 +70,8 @@ public class UsernameTokenOutputProcesso
String password = null;
if (callbackHandler != null) {
WSPasswordCallback pwCb =
- new WSPasswordCallback(((WSSSecurityProperties) getSecurityProperties()).getTokenUser(), WSPasswordCallback.USERNAME_TOKEN);
+ new WSPasswordCallback(((WSSSecurityProperties) getSecurityProperties()).getTokenUser(),
+ WSPasswordCallback.USERNAME_TOKEN);
WSSUtils.doPasswordCallback(callbackHandler, pwCb);
password = pwCb.getPassword();
}
@@ -187,18 +190,21 @@ public class UsernameTokenOutputProcesso
attributes.add(createAttribute(WSSConstants.ATT_wsu_Id, this.wsuId));
createStartElementAndOutputAsEvent(subOutputProcessorChain, headerElementName, false, attributes);
createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Username, false, null);
- createCharactersAndOutputAsEvent(subOutputProcessorChain, ((WSSSecurityProperties) getSecurityProperties()).getTokenUser());
+ createCharactersAndOutputAsEvent(subOutputProcessorChain,
+ ((WSSSecurityProperties) getSecurityProperties()).getTokenUser());
createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Username);
- if (((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType() != WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE
- && !WSSConstants.USERNAMETOKEN_SIGNED.equals(action)) {
+ if (((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
+ != WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE && !WSSConstants.USERNAMETOKEN_SIGNED.equals(action)) {
attributes = new ArrayList<>(1);
attributes.add(createAttribute(WSSConstants.ATT_NULL_Type,
- ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType() == WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
+ ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
+ == WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
? WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST.getNamespace()
: WSSConstants.UsernameTokenPasswordType.PASSWORD_TEXT.getNamespace()));
createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Password, false, attributes);
createCharactersAndOutputAsEvent(subOutputProcessorChain,
- ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType() == WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
+ ((WSSSecurityProperties) getSecurityProperties()).getUsernameTokenPasswordType()
+ == WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
? WSSUtils.doPasswordDigest(this.nonceValue, this.created.toXMLFormat(), this.password)
: this.password);
createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Password);
@@ -220,7 +226,8 @@ public class UsernameTokenOutputProcesso
attributes = new ArrayList<>(1);
attributes.add(createAttribute(WSSConstants.ATT_NULL_EncodingType, WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Nonce, false, attributes);
- createCharactersAndOutputAsEvent(subOutputProcessorChain, new Base64(76, new byte[]{'\n'}).encodeToString(this.nonceValue));
+ createCharactersAndOutputAsEvent(subOutputProcessorChain,
+ new Base64(76, new byte[]{'\n'}).encodeToString(this.nonceValue));
createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse_Nonce);
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.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/WSSSignatureEndingOutputProcessor.java?rev=1724006&r1=1724005&r2=1724006&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java Mon Jan 11 11:07:51 2016
@@ -116,7 +116,8 @@ public class WSSSignatureEndingOutputPro
|| WSSecurityTokenConstants.KeyIdentifier_EncryptedKeySha1Identifier.equals(keyIdentifier)
|| WSSecurityTokenConstants.KeyIdentifier_EncryptedKey.equals(keyIdentifier)) {
attributes.add(createAttribute(WSSConstants.ATT_wsse11_TokenType, WSSConstants.NS_WSS_ENC_KEY_VALUE_TYPE));
- } else if (WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference.equals(keyIdentifier) && !useSingleCertificate) {
+ } else if (WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference.equals(keyIdentifier)
+ && !useSingleCertificate) {
attributes.add(createAttribute(WSSConstants.ATT_wsse11_TokenType, WSSConstants.NS_X509PKIPathv1));
}
createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_wsse_SecurityTokenReference, false, attributes);
@@ -194,7 +195,8 @@ public class WSSSignatureEndingOutputPro
}
@Override
- protected void createTransformsStructureForSignature(OutputProcessorChain subOutputProcessorChain, SignaturePartDef signaturePartDef) throws XMLStreamException, XMLSecurityException {
+ protected void createTransformsStructureForSignature(OutputProcessorChain subOutputProcessorChain, SignaturePartDef signaturePartDef)
+ throws XMLStreamException, XMLSecurityException {
String[] transforms = signaturePartDef.getTransforms();
if (transforms != null && transforms.length > 0) {
createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_dsig_Transforms, false, null);
@@ -225,8 +227,10 @@ public class WSSSignatureEndingOutputPro
&& !WSSConstants.SWA_ATTACHMENT_COMPLETE_SIG_TRANS.equals(transform))
{
attributes = new ArrayList<>(1);
- attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_PrefixList, signaturePartDef.getInclusiveNamespacesPrefixes()));
- createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces, true, attributes);
+ attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_PrefixList,
+ signaturePartDef.getInclusiveNamespacesPrefixes()));
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces,
+ true, attributes);
createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_c14nExcl_InclusiveNamespaces);
}
Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.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/WSSSignatureOutputProcessor.java?rev=1724006&r1=1724005&r2=1724006&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java Mon Jan 11 11:07:51 2016
@@ -73,7 +73,8 @@ public class WSSSignatureOutputProcessor
}
@Override
- public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
+ public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
+ throws XMLStreamException, XMLSecurityException {
if (xmlSecEvent.getEventType() == XMLStreamConstants.START_ELEMENT) {
XMLSecStartElement xmlSecStartElement = xmlSecEvent.asStartElement();
@@ -288,7 +289,8 @@ public class WSSSignatureOutputProcessor
class InternalWSSSignatureOutputProcessor extends InternalSignatureOutputProcessor {
- public InternalWSSSignatureOutputProcessor(SignaturePartDef signaturePartDef, XMLSecStartElement xmlSecStartElement) throws XMLSecurityException {
+ public InternalWSSSignatureOutputProcessor(SignaturePartDef signaturePartDef, XMLSecStartElement xmlSecStartElement)
+ throws XMLSecurityException {
super(signaturePartDef, xmlSecStartElement);
this.addBeforeProcessor(InternalWSSSignatureOutputProcessor.class.getName());
}