Author: coheigea Date: Mon Oct 19 13:11:20 2015 New Revision: 1709410 URL: http://svn.apache.org/viewvc?rev=1709410&view=rev Log: Minor changes
Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/SignatureEncryptionActionToken.java webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/XMLUtils.java webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyInputProcessor.java webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/SignatureEncryptionActionToken.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/SignatureEncryptionActionToken.java?rev=1709410&r1=1709409&r2=1709410&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/SignatureEncryptionActionToken.java (original) +++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/SignatureEncryptionActionToken.java Mon Oct 19 13:11:20 2015 @@ -100,7 +100,7 @@ public abstract class SignatureEncryptio return crypto; } - public void setCrypto(Crypto crypto) { + public synchronized void setCrypto(Crypto crypto) { this.crypto = crypto; } public String getKeyIdentifier() { @@ -133,12 +133,15 @@ public abstract class SignatureEncryptio public void setParts(List<WSEncryptionPart> parts) { this.parts = parts; } - public String getCryptoProperties() { - return cryptoProperties; - } - public void setCryptoProperties(String cryptoProperties) { + + public synchronized void setCryptoProperties(String cryptoProperties) { this.cryptoProperties = cryptoProperties; } + + public synchronized String getCryptoProperties() { + return cryptoProperties; + } + public String getTokenType() { return tokenType; } Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/XMLUtils.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/XMLUtils.java?rev=1709410&r1=1709409&r2=1709410&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/XMLUtils.java (original) +++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/XMLUtils.java Mon Oct 19 13:11:20 2015 @@ -263,6 +263,9 @@ public final class XMLUtils { // // Replace the formerly recursive implementation with a depth-first-loop lookup // + if (startNode == null) { + return null; + } Node startParent = startNode.getParentNode(); Node processedNode = null; Element foundElement = null; 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=1709410&r1=1709409&r2=1709410&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 Mon Oct 19 13:11:20 2015 @@ -210,7 +210,7 @@ public abstract class WSHandler { actionsToPerform = new ArrayList<>(actions); Collections.copy(actionsToPerform, actions); - int signatureIndex = actions.indexOf(WSConstants.SIGN); + int signatureIndex = actions.indexOf(signingAction); actionsToPerform.remove(signingAction); actionsToPerform.add(signingAction); reqData.setAppendSignatureAfterTimestamp(true); Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java?rev=1709410&r1=1709409&r2=1709410&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java (original) +++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java Mon Oct 19 13:11:20 2015 @@ -517,7 +517,10 @@ public class EncryptedKeyProcessor imple // EncryptionAlgorithm cannot be null if (symEncAlgo == null) { - data.getBSPEnforcer().handleBSPRule(BSPRule.R5601); + LOG.debug("No encryption algorithm was specified in the request"); + throw new WSSecurityException(WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "badEncAlgo", + new Object[] {null}); + } // EncryptionAlgorithm must be 3DES, or AES128, or AES256 if (!WSConstants.TRIPLE_DES.equals(symEncAlgo) Modified: webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyInputProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyInputProcessor.java?rev=1709410&r1=1709409&r2=1709410&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyInputProcessor.java (original) +++ webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/enforcer/PolicyInputProcessor.java Mon Oct 19 13:11:20 2015 @@ -225,7 +225,7 @@ public class PolicyInputProcessor extend protected String getId(XMLSecEvent xmlSecEvent) { XMLSecStartElement xmlSecStartElement = xmlSecEvent.asStartElement(); - if (xmlSecStartElement.getOnElementDeclaredAttributes().size() >= 0) { + if (!xmlSecStartElement.getOnElementDeclaredAttributes().isEmpty()) { Attribute attribute = xmlSecStartElement.getAttributeByName(WSSConstants.ATT_wsu_Id); if (attribute != null) { return attribute.getValue(); Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java?rev=1709410&r1=1709409&r2=1709410&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java Mon Oct 19 13:11:20 2015 @@ -147,7 +147,7 @@ public class EncryptOutputProcessor exte @Override protected SecurePart securePartMatches(XMLSecStartElement xmlSecStartElement, Map<Object, SecurePart> secureParts) { - if (xmlSecStartElement.getOnElementDeclaredAttributes().size() >= 0) { + if (!xmlSecStartElement.getOnElementDeclaredAttributes().isEmpty()) { Attribute attribute = xmlSecStartElement.getAttributeByName(WSSConstants.ATT_wsu_Id); if (attribute != null) { SecurePart securePart = secureParts.get(attribute.getValue()); Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java?rev=1709410&r1=1709409&r2=1709410&view=diff ============================================================================== --- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java (original) +++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java Mon Oct 19 13:11:20 2015 @@ -252,7 +252,7 @@ public class WSSSignatureOutputProcessor @Override protected SecurePart securePartMatches(XMLSecStartElement xmlSecStartElement, Map<Object, SecurePart> secureParts) { - if (xmlSecStartElement.getOnElementDeclaredAttributes().size() >= 0) { + if (!xmlSecStartElement.getOnElementDeclaredAttributes().isEmpty()) { Attribute attribute = xmlSecStartElement.getAttributeByName(WSSConstants.ATT_wsu_Id); if (attribute != null) { SecurePart securePart = secureParts.get(attribute.getValue());