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 2015/05/15 16:13:50 UTC
svn commit: r1679570 [3/3] - in /webservices/wss4j/trunk:
ws-security-common/src/main/java/org/apache/wss4j/common/bsp/
ws-security-common/src/main/java/org/apache/wss4j/common/crypto/
ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey...
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java Fri May 15 14:13:49 2015
@@ -41,6 +41,7 @@ import javax.xml.datatype.DatatypeConsta
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamConstants;
+
import java.util.Deque;
import java.util.List;
@@ -57,7 +58,7 @@ public class TimestampInputHandler exten
Boolean alreadyProcessed = wssecurityContextInbound.<Boolean>get(WSSConstants.TIMESTAMP_PROCESSED);
if (Boolean.TRUE.equals(alreadyProcessed)) {
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp",
- "Message contains two or more timestamps");
+ new Object[] {"Message contains two or more timestamps"});
}
wssecurityContextInbound.put(WSSConstants.TIMESTAMP_PROCESSED, Boolean.TRUE);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureReferenceVerifyInputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureReferenceVerifyInputProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureReferenceVerifyInputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureReferenceVerifyInputProcessor.java Fri May 15 14:13:49 2015
@@ -53,6 +53,7 @@ import javax.security.auth.callback.Call
import javax.security.auth.callback.CallbackHandler;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
+
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -84,7 +85,7 @@ public class WSSSignatureReferenceVerify
if (attachmentCallbackHandler == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
- "empty", "no attachment callbackhandler supplied"
+ "empty", new Object[] {"no attachment callbackhandler supplied"}
);
}
@@ -102,7 +103,7 @@ public class WSSSignatureReferenceVerify
if (attachments == null || attachments.isEmpty() || !attachmentId.equals(attachments.get(0).getId())) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
- "empty", "Attachment not found"
+ "empty", new Object[] {"Attachment not found"}
);
}
@@ -127,7 +128,8 @@ public class WSSSignatureReferenceVerify
if (!(transformer instanceof AttachmentContentSignatureTransform)) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
- "empty", "First transform must be Attachment[Content|Complete]SignatureTransform"
+ "empty",
+ new Object[] {"First transform must be Attachment[Content|Complete]SignatureTransform"}
);
}
Map<String, Object> transformerProperties = new HashMap<>(2);
@@ -327,8 +329,7 @@ public class WSSSignatureReferenceVerify
if (transformTypeList.size() > maximumAllowedTransformsPerReference) {
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY,
"secureProcessing.MaximumAllowedTransformsPerReference",
- transformTypeList.size(),
- maximumAllowedTransformsPerReference);
+ new Object[] {transformTypeList.size(), maximumAllowedTransformsPerReference});
}
String algorithm = null;
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java Fri May 15 14:13:49 2015
@@ -96,7 +96,8 @@ public class DerivedKeyTokenOutputProces
String defaultLabel = WSSConstants.WS_SecureConversation_DEFAULT_LABEL + WSSConstants.WS_SecureConversation_DEFAULT_LABEL;
label = defaultLabel.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", e, "UTF-8 encoding is not supported");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "empty",
+ new Object[] {"UTF-8 encoding is not supported"});
}
byte[] nonce = WSSConstants.generateBytes(16);
@@ -113,7 +114,8 @@ public class DerivedKeyTokenOutputProces
WSPasswordCallback passwordCallback = new WSPasswordCallback(wsuIdDKT, WSPasswordCallback.SECRET_KEY);
WSSUtils.doSecretKeyCallback(((WSSSecurityProperties)securityProperties).getCallbackHandler(), passwordCallback, wsuIdDKT);
if (passwordCallback.getKey() == null) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noKey", wsuIdDKT);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noKey",
+ new Object[] {wsuIdDKT});
}
secret = passwordCallback.getKey();
} else {
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=1679570&r1=1679569&r2=1679570&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 Fri May 15 14:13:49 2015
@@ -209,7 +209,7 @@ public class EncryptOutputProcessor exte
if (attachmentCallbackHandler == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
- "empty", "no attachment callbackhandler supplied"
+ "empty", new Object[] {"no attachment callbackhandler supplied"}
);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java Fri May 15 14:13:49 2015
@@ -314,7 +314,7 @@ public class EncryptedKeyOutputProcessor
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"unsupportedKeyTransp",
- "public key algorithm too weak to encrypt symmetric key"
+ new Object[] {"public key algorithm too weak to encrypt symmetric key"}
);
}
byte[] encryptedEphemeralKey = cipher.wrap(secretKey);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java Fri May 15 14:13:49 2015
@@ -141,8 +141,9 @@ public class SAMLTokenOutputProcessor ex
}
if (certificates == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", "No issuer certs were found to sign the SAML Assertion using issuer name: "
- + samlCallback.getIssuerKeyName()
+ "empty",
+ new Object[] {"No issuer certs were found to sign the SAML Assertion using issuer name: "
+ + samlCallback.getIssuerKeyName()}
);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java Fri May 15 14:13:49 2015
@@ -33,6 +33,7 @@ import org.apache.xml.security.stax.impl
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
+
import java.util.*;
/**
@@ -154,9 +155,9 @@ public class SecurityHeaderReorderProces
!xmlSecStartElement.getName().equals(securityHeaderOrder.getSecurityHeaderElementName())) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "empty",
- "Invalid security header order. Expected " +
+ new Object[] {"Invalid security header order. Expected " +
securityHeaderOrder.getSecurityHeaderElementName() +
- " but got " + xmlSecStartElement.getName());
+ " but got " + xmlSecStartElement.getName()});
}
Map<SecurityHeaderOrder, Deque<XMLSecEvent>> map = actionEventMap.get(securityHeaderOrder.getAction());
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java Fri May 15 14:13:49 2015
@@ -186,7 +186,8 @@ public class WSSSignatureEndingOutputPro
} else if (WSSecurityTokenConstants.KeyIdentifier_UsernameTokenReference.equals(keyIdentifier)) {
WSSUtils.createUsernameTokenReferenceStructure(this, outputProcessorChain, tokenId);
} else {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "unsupportedSecurityToken", keyIdentifier);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "unsupportedSecurityToken",
+ new Object[] {keyIdentifier});
}
createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_wsse_SecurityTokenReference);
}
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=1679570&r1=1679569&r2=1679570&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 Fri May 15 14:13:49 2015
@@ -155,7 +155,8 @@ public class WSSSignatureOutputProcessor
if (attachmentCallbackHandler == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILED_SIGNATURE,
- "empty", "no attachment callbackhandler supplied"
+ "empty",
+ new Object[] {"no attachment callbackhandler supplied"}
);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/EncryptedKeySha1SecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/EncryptedKeySha1SecurityTokenImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/EncryptedKeySha1SecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/EncryptedKeySha1SecurityTokenImpl.java Fri May 15 14:13:49 2015
@@ -69,7 +69,8 @@ public class EncryptedKeySha1SecurityTok
WSSConstants.NS_ENCRYPTED_KEY_SHA1, WSPasswordCallback.SECRET_KEY);
WSSUtils.doSecretKeyCallback(callbackHandler, secretKeyCallback, getSha1Identifier());
if (secretKeyCallback.getKey() == null) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noKey", getSha1Identifier());
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noKey",
+ new Object[] {getSha1Identifier()});
}
String keyAlgorithm = JCEMapper.getJCEKeyAlgorithmFromURI(algorithmURI);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java Fri May 15 14:13:49 2015
@@ -54,7 +54,7 @@ public class ExternalSecurityTokenImpl e
try {
securityProperties.getCallbackHandler().handle(new Callback[]{pwcb});
} catch (IOException | UnsupportedCallbackException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noPassword", e);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "noPassword");
}
this.tokenElement = pwcb.getCustomToken();
@@ -63,7 +63,8 @@ public class ExternalSecurityTokenImpl e
if (this.tokenElement == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken", id
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken",
+ new Object[] {id}
);
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java Fri May 15 14:13:49 2015
@@ -80,7 +80,8 @@ public class KerberosClientSecurityToken
if (clientPrincipals.isEmpty()) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
- "kerberosLoginError", "No Client principals found after login"
+ "kerberosLoginError",
+ new Object[] {"No Client principals found after login"}
);
}
// Store the TGT
@@ -113,7 +114,7 @@ public class KerberosClientSecurityToken
throw (WSSecurityException) cause;
} else {
throw new WSSecurityException(
- ErrorCode.FAILURE, "kerberosServiceTicketError", new Object[] {}, cause
+ ErrorCode.FAILURE, new Exception(cause), "kerberosServiceTicketError"
);
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java Fri May 15 14:13:49 2015
@@ -96,7 +96,7 @@ public class KerberosServiceSecurityToke
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"kerberosLoginError",
- "No Client principals found after login"
+ new Object[] {"No Client principals found after login"}
);
}
service = principals.iterator().next().getName();
@@ -116,7 +116,7 @@ public class KerberosServiceSecurityToke
throw (WSSecurityException) cause;
} else {
throw new WSSecurityException(
- ErrorCode.FAILURE, "kerberosTicketValidationError", new Object[] {}, cause
+ ErrorCode.FAILURE, new Exception(cause), "kerberosTicketValidationError"
);
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java Fri May 15 14:13:49 2015
@@ -77,7 +77,7 @@ public class SamlSecurityTokenImpl exten
try {
securityProperties.getCallbackHandler().handle(new Callback[]{pwcb});
} catch (IOException | UnsupportedCallbackException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noPassword", e);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "noPassword");
}
Element assertionElem = pwcb.getCustomToken();
@@ -102,12 +102,14 @@ public class SamlSecurityTokenImpl exten
if (this.samlAssertionWrapper == null && secret == null && key == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken", id
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken",
+ new Object[] {id}
);
}
} else {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken", id
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken",
+ new Object[] {id}
);
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509PKIPathv1SecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509PKIPathv1SecurityTokenImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509PKIPathv1SecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509PKIPathv1SecurityTokenImpl.java Fri May 15 14:13:49 2015
@@ -61,7 +61,7 @@ public class X509PKIPathv1SecurityTokenI
setX509Certificates(certs);
}
} catch (CertificateException | IOException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "parseError", e);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, e, "parseError");
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509V3SecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509V3SecurityTokenImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509V3SecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509V3SecurityTokenImpl.java Fri May 15 14:13:49 2015
@@ -48,7 +48,7 @@ public class X509V3SecurityTokenImpl ext
X509Certificate x509Certificate = getCrypto().loadCertificate(inputStream);
setX509Certificates(new X509Certificate[]{x509Certificate});
} catch (IOException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "parseError", e);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, e, "parseError");
}
// Check to see if the certificates actually correspond to the decryption crypto
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java Fri May 15 14:13:49 2015
@@ -46,7 +46,7 @@ public class BinarySecurityTokenValidato
if (!WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING.equals(binarySecurityTokenType.getEncodingType())) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "badEncoding",
- binarySecurityTokenType.getEncodingType());
+ new Object[] {binarySecurityTokenType.getEncodingType()});
}
byte[] securityTokenData = Base64.decodeBase64(binarySecurityTokenType.getValue());
@@ -91,7 +91,7 @@ public class BinarySecurityTokenValidato
} else {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "invalidValueType",
- binarySecurityTokenType.getValueType());
+ new Object[] {binarySecurityTokenType.getValueType()});
}
} catch (XMLSecurityException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, e);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java Fri May 15 14:13:49 2015
@@ -254,7 +254,7 @@ public class SamlTokenValidatorImpl exte
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
"badSamlToken",
- "A replay attack has been detected");
+ new Object[] {"A replay attack has been detected"});
}
DateTime expires = samlAssertion.getSaml2().getConditions().getNotOnOrAfter();
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java Fri May 15 14:13:49 2015
@@ -64,7 +64,7 @@ public class SecurityContextTokenValidat
tokenContext.getWssSecurityProperties().getCallbackHandler(), passwordCallback, null);
if (passwordCallback.getKey() == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE,
- "noKey", securityContextTokenType.getId());
+ "noKey", new Object[] {securityContextTokenType.getId()});
}
String keyAlgorithm = JCEMapper.getJCEKeyAlgorithmFromURI(algorithmURI);
key = new SecretKeySpec(passwordCallback.getKey(), keyAlgorithm);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java Fri May 15 14:13:49 2015
@@ -66,7 +66,7 @@ public class TimestampValidatorImpl impl
expiresDate = expires.toGregorianCalendar().getTime();
} else if (tokenContext.getWssSecurityProperties().isRequireTimestampExpires()) {
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "invalidTimestamp",
- "The received Timestamp does not contain an expires Element");
+ new Object[] {"The received Timestamp does not contain an expires Element"});
}
Date rightNow = new Date();
@@ -77,13 +77,13 @@ public class TimestampValidatorImpl impl
&& expiresDate.before(rightNow)) {
log.debug("Time now: " + WSSConstants.datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar()).toXMLFormat());
throw new WSSecurityException(WSSecurityException.ErrorCode.MESSAGE_EXPIRED, "invalidTimestamp",
- "The security semantics of the message have expired");
+ new Object[] {"The security semantics of the message have expired"});
}
if (createdDate != null && !DateUtil.verifyCreated(createdDate, ttl, futureTTL)) {
log.debug("Time now: " + WSSConstants.datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar()).toXMLFormat());
throw new WSSecurityException(WSSecurityException.ErrorCode.MESSAGE_EXPIRED, "invalidTimestamp",
- "The security semantics of the message have expired");
+ new Object[] {"The security semantics of the message have expired"});
}
} catch (IllegalArgumentException e) {
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java Fri May 15 14:13:49 2015
@@ -384,7 +384,8 @@ public abstract class AbstractTestBase e
*/
String action = (String) mc.get(WSHandlerConstants.ACTION);
if (action == null) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "WSS4JHandler: No action defined");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
+ new Object[] {"WSS4JHandler: No action defined"});
}
List<HandlerAction> actions = WSSecurityUtil.decodeHandlerAction(action, null);
if (actions.isEmpty()) {
@@ -420,7 +421,7 @@ public abstract class AbstractTestBase e
* there is a specific parameter to get a username.
*/
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "WSS4JHandler: Empty username for specified action"
+ new Object[] {"WSS4JHandler: Empty username for specified action"}
);
}
if (doDebug) {
@@ -435,7 +436,7 @@ public abstract class AbstractTestBase e
Document doc = (Document) mc.get(SECURED_DOCUMENT);
if (doc == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "WSS4JHandler: cannot get SOAP envlope from message"
+ new Object[] {"WSS4JHandler: cannot get SOAP envlope from message"}
);
}
if (doDebug) {
@@ -454,7 +455,8 @@ public abstract class AbstractTestBase e
throws WSSecurityException {
String action = (String) mc.get(WSHandlerConstants.ACTION);
if (action == null) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "WSS4JHandler: No action defined");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
+ new Object[] {"WSS4JHandler: No action defined"});
}
List<Integer> actions = WSSecurityUtil.decodeAction(action);
@@ -500,8 +502,8 @@ public abstract class AbstractTestBase e
if (doDebug) {
log.debug(ex.getMessage(), ex);
}
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "WSS4JHandler: security processing failed", ex
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, "empty",
+ new Object[] {"WSS4JHandler: security processing failed"}
);
}
if (wsResult.getResults() == null || wsResult.getResults().size() == 0) {
@@ -510,7 +512,7 @@ public abstract class AbstractTestBase e
return true;
} else {
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "empty",
- "WSS4JHandler: Request does not contain required Security header"
+ new Object[] {"WSS4JHandler: Request does not contain required Security header"}
);
}
}
@@ -527,7 +529,7 @@ public abstract class AbstractTestBase e
*/
if (!checkReceiverResults(wsResult.getResults(), actions)) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "WSS4JHandler: security processing failed (actions mismatch)"
+ new Object[] {"WSS4JHandler: security processing failed (actions mismatch)"}
);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java Fri May 15 14:13:49 2015
@@ -179,7 +179,8 @@ public class UsernameTokenTest extends A
if (securityEvent instanceof UsernameTokenSecurityEvent) {
UsernameTokenSecurityEvent usernameTokenSecurityEvent = (UsernameTokenSecurityEvent) securityEvent;
if (!"username".equals(usernameTokenSecurityEvent.getSecurityToken().getPrincipal().getName())) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "Wrong username");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
+ new Object[] {"Wrong username"});
}
}
}