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 2014/02/07 17:51:40 UTC
svn commit: r1565723 - in /webservices/wss4j/trunk:
ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/
ws-security-dom/src/main/java/org/apache/wss4j/dom/action/
ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/ ws-security-...
Author: coheigea
Date: Fri Feb 7 16:51:39 2014
New Revision: 1565723
URL: http://svn.apache.org/r1565723
Log:
Use the 2005/12 namespace by default for DerivedKeys/SecureConversation
Modified:
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/ConversationConstants.java
webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java
webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/RequestData.java
webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java
webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSSecurityProperties.java
webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java
webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java
webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java
Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/ConversationConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/ConversationConstants.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/ConversationConstants.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/ConversationConstants.java Fri Feb 7 16:51:39 2014
@@ -30,7 +30,7 @@ public final class ConversationConstants
public static final int VERSION_05_12 = 2;
- public static final int DEFAULT_VERSION = VERSION_05_02;
+ public static final int DEFAULT_VERSION = VERSION_05_12;
/**
* WS-SecConv Feb 2005 version
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java Fri Feb 7 16:51:39 2014
@@ -28,6 +28,7 @@ import org.apache.wss4j.common.SecurityA
import org.apache.wss4j.common.SignatureActionToken;
import org.apache.wss4j.common.WSEncryptionPart;
import org.apache.wss4j.common.crypto.Crypto;
+import org.apache.wss4j.common.derivedKey.ConversationConstants;
import org.apache.wss4j.common.ext.WSPasswordCallback;
import org.apache.wss4j.common.ext.WSSecurityException;
import org.apache.wss4j.dom.WSConstants;
@@ -76,6 +77,12 @@ public class SignatureDerivedAction impl
WSSecEncryptedKey encrKeyBuilder = null;
String sctId = null;
+ if (reqData.isUse200512Namespace()) {
+ wsSign.setWscVersion(ConversationConstants.VERSION_05_12);
+ } else {
+ wsSign.setWscVersion(ConversationConstants.VERSION_05_02);
+ }
+
String derivedKeyTokenReference = signatureToken.getDerivedKeyTokenReference();
if ("EncryptedKey".equals(derivedKeyTokenReference)) {
encrKeyBuilder = new WSSecEncryptedKey();
@@ -90,7 +97,11 @@ public class SignatureDerivedAction impl
wsSign.setCustomValueType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
} else if ("SecurityContextToken".equals(derivedKeyTokenReference)) {
sctId = IDGenerator.generateID("uuid:");
- wsSign.setCustomValueType(WSConstants.WSC_SCT);
+ if (reqData.isUse200512Namespace()) {
+ wsSign.setCustomValueType(WSConstants.WSC_SCT_05_12);
+ } else {
+ wsSign.setCustomValueType(WSConstants.WSC_SCT);
+ }
wsSign.setExternalKey(passwordCallback.getKey(), sctId);
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/RequestData.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/RequestData.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/RequestData.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/RequestData.java Fri Feb 7 16:51:39 2014
@@ -92,6 +92,7 @@ public class RequestData {
private boolean enableSamlOneTimeUseReplayCache = true;
private PasswordEncryptor passwordEncryptor;
private String derivedKeyTokenReference;
+ private boolean use200512Namespace = true;
public void clear() {
soapConstants = null;
@@ -125,6 +126,7 @@ public class RequestData {
setEnableSamlOneTimeUseReplayCache(true);
passwordEncryptor = null;
derivedKeyTokenReference = null;
+ setUse200512Namespace(true);
}
public boolean isEnableTimestampReplayCache() {
@@ -552,5 +554,13 @@ public class RequestData {
public void setDerivedKeyTokenReference(String derivedKeyTokenReference) {
this.derivedKeyTokenReference = derivedKeyTokenReference;
}
+
+ public boolean isUse200512Namespace() {
+ return use200512Namespace;
+ }
+
+ public void setUse200512Namespace(boolean use200512Namespace) {
+ this.use200512Namespace = use200512Namespace;
+ }
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java Fri Feb 7 16:51:39 2014
@@ -573,6 +573,9 @@ public abstract class WSHandler {
String c14nAlgo = getString(WSHandlerConstants.SIG_C14N_ALGO, mc);
actionToken.setC14nAlgorithm(c14nAlgo);
+
+ boolean use200512Namespace = decodeUse200512Namespace(reqData);
+ reqData.setUse200512Namespace(use200512Namespace);
String parts = getString(WSHandlerConstants.SIGNATURE_PARTS, mc);
if (parts != null) {
@@ -667,6 +670,9 @@ public abstract class WSHandler {
String derivedKeyReference = getString(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, mc);
actionToken.setDerivedKeyTokenReference(derivedKeyReference);
+ boolean use200512Namespace = decodeUse200512Namespace(reqData);
+ reqData.setUse200512Namespace(use200512Namespace);
+
String digestAlgo = getString(WSHandlerConstants.ENC_DIGEST_ALGO, mc);
actionToken.setDigestAlgorithm(digestAlgo);
@@ -845,6 +851,13 @@ public abstract class WSHandler {
);
}
+ protected boolean decodeUse200512Namespace(RequestData reqData)
+ throws WSSecurityException {
+ return decodeBooleanConfigValue(
+ reqData, WSHandlerConstants.USE_2005_12_NAMESPACE, true
+ );
+ }
+
protected boolean decodeUseSingleCertificate(RequestData reqData)
throws WSSecurityException {
return decodeBooleanConfigValue(
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java Fri Feb 7 16:51:39 2014
@@ -27,9 +27,9 @@ import javax.crypto.SecretKey;
import javax.security.auth.callback.CallbackHandler;
import org.w3c.dom.Document;
-
import org.apache.wss4j.common.crypto.Crypto;
import org.apache.wss4j.common.crypto.CryptoFactory;
+import org.apache.wss4j.common.derivedKey.ConversationConstants;
import org.apache.wss4j.common.util.XMLUtils;
import org.apache.wss4j.dom.WSConstants;
import org.apache.wss4j.dom.WSSConfig;
@@ -43,6 +43,7 @@ import org.apache.wss4j.dom.common.Secur
import org.apache.wss4j.dom.handler.HandlerAction;
import org.apache.wss4j.dom.handler.RequestData;
import org.apache.wss4j.dom.handler.WSHandlerConstants;
+import org.junit.Assert;
/**
* A set of tests for using a derived key for encryption/signature using WSHandler actions.
@@ -87,6 +88,40 @@ public class DerivedKeyActionTest extend
);
String outputString =
XMLUtils.PrettyDocumentToString(doc);
+ Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(outputString);
+ }
+
+ verify(doc);
+ }
+
+ @org.junit.Test
+ public void testSignatureThumbprintSHA1OldNamespace() throws Exception {
+ final WSSConfig cfg = WSSConfig.getNewInstance();
+ final RequestData reqData = new RequestData();
+ reqData.setWssConfig(cfg);
+ reqData.setUsername("wss40");
+
+ java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
+ config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
+ config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
+ config.put(WSHandlerConstants.SIG_KEY_ID, "Thumbprint");
+ config.put(WSHandlerConstants.USE_2005_12_NAMESPACE, "false");
+ reqData.setMsgContext(config);
+
+ final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
+ CustomHandler handler = new CustomHandler();
+ HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
+ handler.send(
+ doc,
+ reqData,
+ Collections.singletonList(action),
+ true
+ );
+ String outputString =
+ XMLUtils.PrettyDocumentToString(doc);
+ Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_02));
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java Fri Feb 7 16:51:39 2014
@@ -131,7 +131,7 @@ public class SecurityContextTokenTest ex
SecurityContextToken receivedToken =
(SecurityContextToken) actionResult.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN);
assertTrue(receivedToken != null);
- assertTrue(WSConstants.WSC_SCT.equals(receivedToken.getTokenType()));
+ assertTrue(WSConstants.WSC_SCT_05_12.equals(receivedToken.getTokenType()));
SecurityContextToken clone = new SecurityContextToken(receivedToken.getElement());
assertTrue(clone.equals(receivedToken));
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSSecurityProperties.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSSecurityProperties.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSSecurityProperties.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSSecurityProperties.java Fri Feb 7 16:51:39 2014
@@ -74,7 +74,7 @@ public class WSSSecurityProperties exten
private boolean addUsernameTokenNonce;
private boolean addUsernameTokenCreated;
private boolean encryptSymmetricEncrytionKey = true;
- private boolean use200512Namespace;
+ private boolean use200512Namespace = true;
/**
* This variable controls whether types other than PasswordDigest or PasswordText
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityContextTokenOutputProcessor.java Fri Feb 7 16:51:39 2014
@@ -100,7 +100,8 @@ public class SecurityContextTokenOutputP
};
FinalSecurityContextTokenOutputProcessor finalSecurityContextTokenOutputProcessor =
- new FinalSecurityContextTokenOutputProcessor(securityContextSecurityToken, identifier);
+ new FinalSecurityContextTokenOutputProcessor(securityContextSecurityToken, identifier,
+ ((WSSSecurityProperties)getSecurityProperties()).isUse200512Namespace());
finalSecurityContextTokenOutputProcessor.setXMLSecurityProperties(getSecurityProperties());
finalSecurityContextTokenOutputProcessor.setAction(getAction());
XMLSecurityConstants.Action action = getAction();
@@ -135,11 +136,13 @@ public class SecurityContextTokenOutputP
private final OutboundSecurityToken securityToken;
private final String identifier;
+ private final boolean use200512Namespace;
- FinalSecurityContextTokenOutputProcessor(OutboundSecurityToken securityToken, String identifier) throws XMLSecurityException {
+ FinalSecurityContextTokenOutputProcessor(OutboundSecurityToken securityToken, String identifier, boolean use200512Namespace) throws XMLSecurityException {
super();
this.securityToken = securityToken;
this.identifier = identifier;
+ this.use200512Namespace = use200512Namespace;
}
@Override
@@ -150,21 +153,36 @@ public class SecurityContextTokenOutputP
if (WSSUtils.isSecurityHeaderElement(xmlSecEvent, ((WSSSecurityProperties) getSecurityProperties()).getActor())) {
- final QName headerElementName = WSSConstants.TAG_wsc0502_SecurityContextToken;
+ final QName headerElementName = getHeaderElementName();
WSSUtils.updateSecurityHeaderOrder(outputProcessorChain, headerElementName, getAction(), false);
OutputProcessorChain subOutputProcessorChain = outputProcessorChain.createSubChain(this);
List<XMLSecAttribute> attributes = new ArrayList<XMLSecAttribute>(1);
attributes.add(createAttribute(WSSConstants.ATT_wsu_Id, securityToken.getId()));
+ QName identifierName = getIdentifierName();
createStartElementAndOutputAsEvent(subOutputProcessorChain, headerElementName, true, attributes);
- createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsc0502_Identifier, false, null);
+ createStartElementAndOutputAsEvent(subOutputProcessorChain, identifierName, false, null);
createCharactersAndOutputAsEvent(subOutputProcessorChain, identifier);
- createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsc0502_Identifier);
+ createEndElementAndOutputAsEvent(subOutputProcessorChain, identifierName);
createEndElementAndOutputAsEvent(subOutputProcessorChain, headerElementName);
outputProcessorChain.removeProcessor(this);
}
}
+
+ private QName getHeaderElementName() {
+ if (use200512Namespace) {
+ return WSSConstants.TAG_wsc0512_SecurityContextToken;
+ }
+ return WSSConstants.TAG_wsc0502_SecurityContextToken;
+ }
+
+ private QName getIdentifierName() {
+ if (use200512Namespace) {
+ return WSSConstants.TAG_wsc0512_Identifier;
+ }
+ return WSSConstants.TAG_wsc0502_Identifier;
+ }
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/DerivedKeyTokenTest.java Fri Feb 7 16:51:39 2014
@@ -409,11 +409,11 @@ public class DerivedKeyTokenTest extends
NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_SecurityContextToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_SecurityContextToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 0);
nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 0);
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_DerivedKeyToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_DerivedKeyToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsse_KeyIdentifier.getNamespaceURI(), WSSConstants.TAG_wsse_KeyIdentifier.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
@@ -501,11 +501,11 @@ public class DerivedKeyTokenTest extends
NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_SecurityContextToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_SecurityContextToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 0);
nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 0);
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_DerivedKeyToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_DerivedKeyToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsse_KeyIdentifier.getNamespaceURI(), WSSConstants.TAG_wsse_KeyIdentifier.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
@@ -596,11 +596,11 @@ public class DerivedKeyTokenTest extends
NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_SecurityContextToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_SecurityContextToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 0);
nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_DerivedKeyToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_DerivedKeyToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 2);
nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java?rev=1565723&r1=1565722&r2=1565723&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SecurityContextTokenTest.java Fri Feb 7 16:51:39 2014
@@ -112,9 +112,9 @@ public class SecurityContextTokenTest ex
Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_soap11_Body.getLocalPart());
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_SecurityContextToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_SecurityContextToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_DerivedKeyToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_DerivedKeyToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_ReferenceList.getNamespaceURI(), WSSConstants.TAG_xenc_ReferenceList.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
@@ -241,9 +241,9 @@ public class SecurityContextTokenTest ex
Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_dsig_Signature.getNamespaceURI(), WSSConstants.TAG_dsig_Signature.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_SecurityContextToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_SecurityContextToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_SecurityContextToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
- nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0502_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0502_DerivedKeyToken.getLocalPart());
+ nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_wsc0512_DerivedKeyToken.getNamespaceURI(), WSSConstants.TAG_wsc0512_DerivedKeyToken.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 1);
nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_ReferenceList.getNamespaceURI(), WSSConstants.TAG_xenc_ReferenceList.getLocalPart());
Assert.assertEquals(nodeList.getLength(), 0);