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 [2/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-dom/src/main/java/org/apache/wss4j/dom/action/SignatureAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureAction.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureAction.java Fri May 15 14:13:49 2015
@@ -158,7 +158,8 @@ public class SignatureAction implements
}
reqData.getSignatureValues().add(wsSign.getSignatureValue());
} catch (WSSecurityException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", e, "Error during Signature: ");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "empty",
+ new Object[] {"Error during Signature: "});
}
}
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=1679570&r1=1679569&r2=1679570&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 May 15 14:13:49 2015
@@ -130,7 +130,8 @@ public class SignatureDerivedAction exte
reqData.getSignatureValues().add(wsSign.getSignatureValue());
} catch (WSSecurityException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", e, "Error during Signature: ");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "empty",
+ new Object[] {"Error during Signature: "});
}
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/UsernameTokenSignedAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/UsernameTokenSignedAction.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/UsernameTokenSignedAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/UsernameTokenSignedAction.java Fri May 15 14:13:49 2015
@@ -137,9 +137,8 @@ public class UsernameTokenSignedAction i
sign.computeSignature(referenceList);
reqData.getSignatureValues().add(sign.getSignatureValue());
} catch (WSSecurityException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", e,
- "WSHandler: Error during UsernameTokenSignature"
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+ "empty", new Object[] {"WSHandler: Error during UsernameTokenSignature"}
);
}
builder.prependToHeader(reqData.getSecHeader());
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=1679570&r1=1679569&r2=1679570&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 May 15 14:13:49 2015
@@ -443,8 +443,8 @@ public abstract class WSHandler {
//
if (sigVal.length != 0) {
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "empty",
- "Received a SignatureConfirmation element, but there are no stored"
- + " signature values"
+ new Object[] {"Received a SignatureConfirmation element, but there are no stored"
+ + " signature values"}
);
}
} else {
@@ -453,8 +453,8 @@ public abstract class WSHandler {
savedSignatures.remove(hash);
} else {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "Received a SignatureConfirmation element, but there are no matching"
- + " stored signature values"
+ new Object[] {"Received a SignatureConfirmation element, but there are no matching"
+ + " stored signature values"}
);
}
}
@@ -467,7 +467,8 @@ public abstract class WSHandler {
//
if (savedSignatures != null && !savedSignatures.isEmpty()) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "Check Signature confirmation: the stored signature values list is not empty"
+ new Object[] {"Check Signature confirmation: the stored signature values"
+ + " list is not empty"}
);
}
}
@@ -486,7 +487,7 @@ public abstract class WSHandler {
reqData.setPwType(null);
} else {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", "Unknown password type encoding: " + type);
+ "empty", new Object[] {"Unknown password type encoding: " + type});
}
}
@@ -536,7 +537,7 @@ public abstract class WSHandler {
if (id == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
"empty",
- "WSHandler: Signature: unknown key identification"
+ new Object[] {"WSHandler: Signature: unknown key identification"}
);
}
int tmp = id;
@@ -549,7 +550,7 @@ public abstract class WSHandler {
|| tmp == WSConstants.KEY_VALUE)) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
"empty",
- "WSHandler: Signature: illegal key identification"
+ new Object[] {"WSHandler: Signature: illegal key identification"}
);
}
actionToken.setKeyIdentifierId(tmp);
@@ -656,7 +657,7 @@ public abstract class WSHandler {
if (id == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
"empty",
- "WSHandler: Encryption: unknown key identification"
+ new Object[] {"WSHandler: Encryption: unknown key identification"}
);
}
int tmp = id;
@@ -669,7 +670,7 @@ public abstract class WSHandler {
|| tmp == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER)) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
"empty",
- "WSHandler: Encryption: illegal key identification"
+ new Object[] {"WSHandler: Encryption: illegal key identification"}
);
}
}
@@ -725,7 +726,8 @@ public abstract class WSHandler {
}
if (actionToken.isEncSymmetricEncryptionKey() && actionToken.getUser() == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", "WSHandler: Encryption: no username");
+ "empty",
+ new Object[] {"WSHandler: Encryption: no username"});
}
handleSpecialUser(reqData);
@@ -824,7 +826,7 @@ public abstract class WSHandler {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
"empty",
- "WSHandler: illegal " + configTag + " parameter"
+ new Object[] {"WSHandler: illegal " + configTag + " parameter"}
);
}
@@ -1042,17 +1044,20 @@ public abstract class WSHandler {
callbackHandlerClass,
CallbackHandler.class);
} catch (ClassNotFoundException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", e,
- "WSHandler: cannot load callback handler class: " + callbackHandlerClass
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+ "empty",
+ new Object[] {"WSHandler: cannot load callback handler class: "
+ + callbackHandlerClass}
);
}
try {
cbHandler = cbClass.newInstance();
} catch (Exception e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", e,
- "WSHandler: cannot create instance of callback handler: " + callbackHandlerClass
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+ "empty",
+ new Object[] {"WSHandler: cannot create instance of callback handler: "
+ + callbackHandlerClass
+ }
);
}
return cbHandler;
@@ -1098,7 +1103,8 @@ public abstract class WSHandler {
if (password == null) {
String err = "provided null or empty password";
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", "WSHandler: application " + err);
+ "empty",
+ new Object[] {"WSHandler: application " + err});
}
WSPasswordCallback pwCb = constructPasswordCallback(username, doAction);
pwCb.setPassword(password);
@@ -1129,8 +1135,8 @@ public abstract class WSHandler {
try {
cbHandler.handle(callbacks);
} catch (Exception e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", e, "WSHandler: password callback failed");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+ "empty", new Object[] {"WSHandler: password callback failed"});
}
return pwCb;
}
@@ -1216,7 +1222,8 @@ public abstract class WSHandler {
encPart = new WSEncryptionPart(element, nmSpace, mode);
} else {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", "WSHandler: wrong part definition: " + tmpS);
+ "empty",
+ new Object[] {"WSHandler: wrong part definition: " + tmpS});
}
encPart.setRequired(required);
parts.add(encPart);
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDKSign.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDKSign.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDKSign.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDKSign.java Fri May 15 14:13:49 2015
@@ -135,7 +135,7 @@ public class WSSecDKSign extends WSSecDe
} catch (Exception ex) {
LOG.error("", ex);
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, ex, "noXMLSig"
);
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java Fri May 15 14:13:49 2015
@@ -203,7 +203,8 @@ public abstract class WSSecDerivedKeyBas
String labelText = clientLabel + serviceLabel;
label = labelText.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 = WSSecurityUtil.generateNonce(16);
@@ -367,7 +368,7 @@ public abstract class WSSecDerivedKeyBas
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noUserCertsFound",
- user, "signature");
+ new Object[] {user, "signature"});
}
}
return certs;
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java Fri May 15 14:13:49 2015
@@ -149,7 +149,7 @@ public class WSSecEncrypt extends WSSecE
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noUserCertsFound",
- user, "encryption");
+ new Object[] {user, "encryption"});
}
remoteCert = certs[0];
}
@@ -372,7 +372,7 @@ public class WSSecEncrypt extends WSSecE
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noEncElement",
- "{" + encPart.getNamespace() + "}" + encPart.getName());
+ new Object[] {"{" + encPart.getNamespace() + "}" + encPart.getName()});
}
for (Element elementToEncrypt : elementsToEncrypt) {
@@ -400,7 +400,7 @@ public class WSSecEncrypt extends WSSecE
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-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java Fri May 15 14:13:49 2015
@@ -201,14 +201,14 @@ public class WSSecEncryptedKey extends W
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noUserCertsFound",
- user, "encryption");
+ new Object[] {user, "encryption"});
}
X509Certificate[] certs = crypto.getX509Certificates(cryptoType);
if (certs == null || certs.length <= 0) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noUserCertsFound",
- user, "encryption");
+ new Object[] {user, "encryption"});
}
remoteCert = certs[0];
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java Fri May 15 14:13:49 2015
@@ -166,7 +166,7 @@ public class WSSecSignature extends WSSe
} catch (Exception ex) {
LOG.error("", ex);
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, ex, "noXMLSig"
);
}
@@ -319,7 +319,7 @@ public class WSSecSignature extends WSSe
} catch (java.security.KeyException ex) {
LOG.error("", ex);
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, ex, "noXMLSig"
);
}
break;
@@ -800,7 +800,7 @@ public class WSSecSignature extends WSSe
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noUserCertsFound",
- user, "signature");
+ new Object[] {user, "signature"});
}
certUri = getIdAllocator().createSecureId("X509-", certs[0]);
//
@@ -818,7 +818,7 @@ public class WSSecSignature extends WSSe
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"unknownSignatureAlgorithm",
- pubKeyAlgo);
+ new Object[] {pubKeyAlgo});
}
}
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java Fri May 15 14:13:49 2015
@@ -88,7 +88,7 @@ public class WSSecSignatureBase extends
} catch (Exception ex) {
LOG.error("", ex);
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, ex, "noXMLSig"
);
}
@@ -174,7 +174,7 @@ public class WSSecSignatureBase extends
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noEncElement",
- nmSpace + ", " + elemName);
+ new Object[] {nmSpace + ", " + elemName});
}
for (Element elementToSign : elementsToSign) {
TransformParameterSpec transformSpec = null;
@@ -202,7 +202,7 @@ public class WSSecSignatureBase extends
} catch (Exception ex) {
LOG.error("", ex);
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, ex, "noXMLSig"
);
}
}
@@ -223,7 +223,7 @@ public class WSSecSignatureBase extends
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-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java Fri May 15 14:13:49 2015
@@ -119,7 +119,7 @@ public class WSSecUsernameToken extends
return UsernameTokenUtil.generateDerivedKey(Base64.decode(password), saltValue, iteration);
} catch (Base64DecodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+ WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
);
}
} else {
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java Fri May 15 14:13:49 2015
@@ -196,9 +196,9 @@ public class KerberosSecurity extends Bi
LOG.debug(ex.getMessage(), ex);
}
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE, ex,
"kerberosLoginError",
- ex, ex.getMessage()
+ new Object[] {ex.getMessage()}
);
}
if (LOG.isDebugEnabled()) {
@@ -211,7 +211,7 @@ public class KerberosSecurity extends Bi
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"kerberosLoginError",
- "No Client principals found after login");
+ new Object[] {"No Client principals found after login"});
}
// Store the TGT
KerberosTicket tgt = getKerberosTicket(clientSubject, null);
@@ -252,7 +252,7 @@ public class KerberosSecurity extends Bi
throw (WSSecurityException) cause;
} else {
throw new WSSecurityException(
- ErrorCode.FAILURE, "kerberosServiceTicketError", cause
+ ErrorCode.FAILURE, new Exception(cause), "kerberosServiceTicketError"
);
}
} finally {
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java Fri May 15 14:13:49 2015
@@ -64,7 +64,7 @@ public class SignatureConfirmation {
signatureValue = Base64.decode(sv);
} catch (Base64DecodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+ WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
);
}
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java Fri May 15 14:13:49 2015
@@ -109,8 +109,7 @@ public class UsernameToken {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badElement",
- TOKEN,
- el
+ new Object[] {TOKEN, el}
);
}
elementUsername =
@@ -141,7 +140,7 @@ public class UsernameToken {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken",
- "Username is missing"
+ new Object[] {"Username is missing"}
);
}
@@ -158,7 +157,7 @@ public class UsernameToken {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken",
- "Password is missing"
+ new Object[] {"Password is missing"}
);
}
return;
@@ -173,7 +172,7 @@ public class UsernameToken {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken",
- "Iteration is missing"
+ new Object[] {"Iteration is missing"}
);
}
}
@@ -194,7 +193,7 @@ public class UsernameToken {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken",
- "The Password Type is not allowed to be namespace qualified"
+ new Object[] {"The Password Type is not allowed to be namespace qualified"}
);
}
}
@@ -206,7 +205,7 @@ public class UsernameToken {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"badUsernameToken",
- "Nonce or Created is missing"
+ new Object[] {"Nonce or Created is missing"}
);
}
}
@@ -220,9 +219,9 @@ public class UsernameToken {
WSSConfig.datatypeFactory.newXMLGregorianCalendar(createdString);
} catch (IllegalArgumentException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
- "badUsernameToken", e,
- "Error parsing UsernameToken Created value"
+ WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, e,
+ "badUsernameToken",
+ new Object[] {"Error parsing UsernameToken Created value"}
);
}
createdDate = createdCalendar.toGregorianCalendar().getTime();
@@ -470,7 +469,7 @@ public class UsernameToken {
return Base64.decode(salt);
} catch (Base64DecodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+ WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
);
}
}
@@ -712,7 +711,7 @@ public class UsernameToken {
return UsernameTokenUtil.generateDerivedKey(Base64.decode(rawPassword), salt, iteration);
} catch (Base64DecodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+ WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
);
}
} else {
@@ -747,7 +746,7 @@ public class UsernameToken {
return principal;
} catch (Base64DecodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+ WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
);
}
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java Fri May 15 14:13:49 2015
@@ -76,7 +76,8 @@ public class DerivedKeyTokenProcessor im
String tempNonce = dkt.getNonce();
if (tempNonce == null) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "Missing wsc:Nonce value");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
+ new Object[] {"Missing wsc:Nonce value"});
}
int length = dkt.getLength();
byte[] keyBytes = dkt.deriveKey(length, secret);
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java Fri May 15 14:13:49 2015
@@ -61,8 +61,8 @@ public class EncryptedAssertionProcessor
String typeStr = encryptedDataElement.getAttributeNS(null, "Type");
if (typeStr != null && !(WSConstants.ENC_NS + "Element").equals(typeStr)) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.INVALID_SECURITY, "badElement", "Element",
- typeStr
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "badElement",
+ new Object[] {"Element", typeStr}
);
}
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=1679570&r1=1679569&r2=1679570&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 Fri May 15 14:13:49 2015
@@ -165,7 +165,8 @@ public class EncryptedKeyProcessor imple
if (certs == null || certs.length < 1 || certs[0] == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
- "noCertsFound", "decryption (KeyId)");
+ "noCertsFound",
+ new Object[] {"decryption (KeyId)"});
}
// Check for compliance against the defined AlgorithmSuite
@@ -329,7 +330,7 @@ public class EncryptedKeyProcessor imple
return Base64.decode(text);
} catch (Base64DecodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+ WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
);
}
}
@@ -432,7 +433,7 @@ public class EncryptedKeyProcessor imple
} else if (WSConstants.X509_CERT_LN.equals(x509Child.getLocalName())) {
byte[] token = getDecodedBase64EncodedData(x509Child);
if (token == null) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidCertData", 0);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidCertData", new Object[] {"0"});
}
try (InputStream in = new ByteArrayInputStream(token)) {
X509Certificate cert = data.getDecCrypto().loadCertificate(in);
@@ -441,7 +442,7 @@ public class EncryptedKeyProcessor imple
}
} catch (IOException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError", e
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "parseError"
);
}
}
@@ -540,8 +541,8 @@ public class EncryptedKeyProcessor imple
symmetricKey = KeyUtils.prepareSecretKey(symEncAlgo, decryptedData);
} catch (IllegalArgumentException ex) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "badEncAlgo",
- ex, symEncAlgo);
+ WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, ex, "badEncAlgo",
+ new Object[] {symEncAlgo});
}
// Check for compliance against the defined AlgorithmSuite
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java Fri May 15 14:13:49 2015
@@ -283,7 +283,8 @@ public class ReferenceListProcessor impl
callbackLookup.getElement(dataRefURI, null, true);
if (encryptedDataElement == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.INVALID_SECURITY, "dataRef", dataRefURI);
+ WSSecurityException.ErrorCode.INVALID_SECURITY, "dataRef",
+ new Object[] {dataRefURI});
}
if (encryptedDataElement.getLocalName().equals(WSConstants.ENCRYPTED_HEADER)
&& encryptedDataElement.getNamespaceURI().equals(WSConstants.WSSE11_NS)) {
@@ -433,7 +434,7 @@ public class ReferenceListProcessor impl
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"}
);
}
Attachment attachment = attachments.get(0);
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java Fri May 15 14:13:49 2015
@@ -174,7 +174,7 @@ public class SAMLTokenProcessor implemen
if (keyInfo == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
- "cannot get certificate or key"
+ new Object[] {"cannot get certificate or key"}
);
}
SAMLKeyInfo samlKeyInfo =
@@ -190,7 +190,7 @@ public class SAMLTokenProcessor implemen
} else {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
- "cannot get certificate or key");
+ new Object[] {"cannot get certificate or key"});
}
// Not checking signature here, just marshalling into an XMLSignature
@@ -204,8 +204,8 @@ public class SAMLTokenProcessor implemen
xmlSignature = signatureFactory.unmarshalXMLSignature(context);
} catch (MarshalException ex) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "invalidSAMLsecurity",
- ex, "cannot get certificate or key"
+ WSSecurityException.ErrorCode.FAILED_CHECK, ex, "invalidSAMLsecurity",
+ new Object[] {"cannot get certificate or key"}
);
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java Fri May 15 14:13:49 2015
@@ -111,10 +111,9 @@ public class SecurityContextTokenProcess
cb.handle(callbacks);
} catch (IOException | UnsupportedCallbackException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE, e,
"noKey",
- e,
- identifier);
+ new Object[] {identifier});
}
return callback.getKey();
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java Fri May 15 14:13:49 2015
@@ -675,7 +675,7 @@ public class SignatureProcessor implemen
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
"invalidTimestamp",
- "A replay attack has been detected");
+ new Object[] {"A replay attack has been detected"});
}
// Store the Timestamp/SignatureValue/Key combination in the cache
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java Fri May 15 14:13:49 2015
@@ -26,7 +26,6 @@ import org.apache.commons.codec.binary.B
import org.apache.wss4j.common.principal.SAMLTokenPrincipalImpl;
import org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl;
import org.w3c.dom.Element;
-
import org.apache.wss4j.common.cache.ReplayCache;
import org.apache.wss4j.common.ext.WSSecurityException;
import org.apache.wss4j.dom.WSConstants;
@@ -147,7 +146,7 @@ public class UsernameTokenProcessor impl
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
"badUsernameToken",
- "A replay attack has been detected"
+ new Object[] {"A replay attack has been detected"}
);
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java Fri May 15 14:13:49 2015
@@ -94,17 +94,16 @@ public final class X509Util {
cb.handle(new Callback[]{pwCb});
} catch (IOException | UnsupportedCallbackException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE, e,
"noPassword",
- e,
- keyName);
+ new Object[] {keyName});
}
byte[] decryptedData = pwCb.getKey();
if (decryptedData == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noPassword",
- keyName);
+ new Object[] {keyName});
}
return KeyUtils.prepareSecretKey(algorithm, decryptedData);
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java Fri May 15 14:13:49 2015
@@ -93,8 +93,8 @@ public class WSSSAMLKeyInfoProcessor imp
try {
return new SAMLKeyInfo(Base64.decode(txt.getData()));
} catch (Exception e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "decoding.general", e);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+ "decoding.general");
}
} else if (SecurityTokenReference.STR_QNAME.equals(el)) {
STRParserParameters parameters = new STRParserParameters();
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java Fri May 15 14:13:49 2015
@@ -242,7 +242,7 @@ public class WSSecSignatureSAML extends
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"invalidSAMLsecurity",
- "for SAML Signature (Key Holder)");
+ new Object[] {"for SAML Signature (Key Holder)"});
}
if (secretKey == null) {
RequestData data = new RequestData();
@@ -266,7 +266,7 @@ public class WSSecSignatureSAML extends
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"noCertsFound",
- "SAML signature");
+ new Object[] {"SAML signature"});
}
if (getSignatureAlgorithm() == null) {
@@ -291,7 +291,7 @@ public class WSSecSignatureSAML extends
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
"unknownSignatureAlgorithm",
- pubKeyAlgo);
+ new Object[] {pubKeyAlgo});
}
}
sig = null;
@@ -309,7 +309,7 @@ public class WSSecSignatureSAML extends
} catch (Exception ex) {
LOG.error("", ex);
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, ex, "noXMLSig"
);
}
@@ -368,7 +368,7 @@ public class WSSecSignatureSAML extends
}
} catch (Exception ex) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noXMLSig", ex
+ WSSecurityException.ErrorCode.FAILED_SIGNATURE, ex, "noXMLSig"
);
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java Fri May 15 14:13:49 2015
@@ -138,7 +138,8 @@ public class DerivedKeyTokenSTRParser im
STRParserUtil.getSecretKeyFromToken(uri, null, WSPasswordCallback.SECURITY_CONTEXT_TOKEN, data);
if (secretKey == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
+ WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId",
+ new Object[] {uri});
}
parserResult.setSecretKey(secretKey);
} else if (secRef.containsKeyIdentifier()) {
@@ -165,7 +166,8 @@ public class DerivedKeyTokenSTRParser im
}
if (secretKey == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
+ WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId",
+ new Object[] {uri});
}
parserResult.setSecretKey(secretKey);
} else {
@@ -182,7 +184,8 @@ public class DerivedKeyTokenSTRParser im
);
if (secretKey == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
+ WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId",
+ new Object[] {uri});
}
parserResult.setSecretKey(secretKey);
} else {
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/STRParserUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/STRParserUtil.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/STRParserUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/STRParserUtil.java Fri May 15 14:13:49 2015
@@ -283,8 +283,8 @@ public final class STRParserUtil {
}
} catch (Exception e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE,
- "noPassword", e, uri);
+ WSSecurityException.ErrorCode.FAILURE, e,
+ "noPassword", new Object[] {uri});
}
return null;
@@ -314,7 +314,7 @@ public final class STRParserUtil {
if (tokElement == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE,
- "noToken", uri);
+ "noToken", new Object[] {uri});
}
return tokElement;
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java Fri May 15 14:13:49 2015
@@ -102,7 +102,8 @@ public class SecurityTokenRefSTRParser i
data.getSigVerCrypto(), data.getCallbackHandler());
if (samlKi == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "invalidSAMLToken", "No Secret Key");
+ WSSecurityException.ErrorCode.FAILED_CHECK, "invalidSAMLToken",
+ new Object[] {"No Secret Key"});
}
return samlKi.getSecret();
}
@@ -153,7 +154,8 @@ public class SecurityTokenRefSTRParser i
if (parserResult.getSecretKey() == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
+ WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId",
+ new Object[] {uri});
}
return parserResult;
@@ -192,7 +194,8 @@ public class SecurityTokenRefSTRParser i
}
if (secretKey == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
+ WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId",
+ new Object[] {uri});
}
parserResult.setSecretKey(secretKey);
} else if (secRef.containsKeyIdentifier()) {
@@ -231,7 +234,8 @@ public class SecurityTokenRefSTRParser i
}
if (secretKey == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
+ WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId",
+ new Object[] {uri});
}
parserResult.setSecretKey(secretKey);
} else {
@@ -245,7 +249,8 @@ public class SecurityTokenRefSTRParser i
);
if (secretKey == null) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
+ WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId",
+ new Object[] {uri});
}
parserResult.setSecretKey(secretKey);
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java Fri May 15 14:13:49 2015
@@ -227,12 +227,12 @@ public class SignatureSTRParser implemen
}
} catch (Base64DecodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+ WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
);
}
} catch (CertificateEncodingException ex) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", ex
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, ex, "encodeError"
);
}
}
@@ -447,7 +447,7 @@ public class SignatureSTRParser implemen
} else {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
- "unsupportedKeyInfo", strElement.toString());
+ "unsupportedKeyInfo", new Object[] {strElement.toString()});
}
REFERENCE_TYPE referenceType = getReferenceType(secRef);
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java Fri May 15 14:13:49 2015
@@ -124,7 +124,7 @@ public final class STRTransformUtil {
data = cert.getEncoded();
} catch (CertificateEncodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", e
+ WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "encodeError"
);
}
String prefix = XMLUtils.getPrefixNS(WSConstants.WSSE_NS, secRefE);
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java Fri May 15 14:13:49 2015
@@ -386,7 +386,7 @@ public final class WSSecurityUtil {
public static String getSOAPNamespace(Element startElement) {
return getSOAPConstants(startElement).getEnvelopeURI();
}
-
+
public static List<Integer> decodeAction(String action) throws WSSecurityException {
String actionToParse = action;
if (actionToParse == null) {
@@ -428,7 +428,7 @@ public final class WSSecurityUtil {
actions.add(WSConstants.CUSTOM_TOKEN);
} else {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "Unknown action defined: " + single[i]
+ new Object[] {"Unknown action defined: " + single[i]}
);
}
}
@@ -481,13 +481,13 @@ public final class WSSecurityUtil {
int parsedAction = Integer.parseInt(single[i]);
if (wssConfig.getAction(parsedAction) == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "Unknown action defined: " + single[i]
+ new Object[] {"Unknown action defined: " + single[i]}
);
}
actions.add(new HandlerAction(parsedAction));
} catch (NumberFormatException ex) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
- "Unknown action defined: " + single[i]
+ new Object[] {"Unknown action defined: " + single[i]}
);
}
}
@@ -506,9 +506,8 @@ public final class WSSecurityUtil {
try {
return XMLSecurityConstants.generateBytes(length);
} catch (Exception ex) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", ex,
- "Error in generating nonce of length " + length
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex,
+ "empty", new Object[] {"Error in generating nonce of length " + length}
);
}
}
@@ -536,7 +535,8 @@ public final class WSSecurityUtil {
}
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILED_CHECK, "requiredElementNotSigned", elem);
+ WSSecurityException.ErrorCode.FAILED_CHECK, "requiredElementNotSigned",
+ new Object[] {elem});
}
/**
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/KerberosTokenValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/KerberosTokenValidator.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/KerberosTokenValidator.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/KerberosTokenValidator.java Fri May 15 14:13:49 2015
@@ -166,10 +166,9 @@ public class KerberosTokenValidator impl
LOG.debug(ex.getMessage(), ex);
}
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE,
+ WSSecurityException.ErrorCode.FAILURE, ex,
"kerberosLoginError",
- ex,
- ex.getMessage()
+ new Object[] {ex.getMessage()}
);
}
if (LOG.isDebugEnabled()) {
@@ -187,7 +186,7 @@ public class KerberosTokenValidator impl
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();
}
@@ -205,7 +204,7 @@ public class KerberosTokenValidator impl
throw (WSSecurityException) cause;
} else {
throw new WSSecurityException(
- ErrorCode.FAILURE, "kerberosTicketValidationError", cause
+ ErrorCode.FAILURE, new Exception(cause), "kerberosTicketValidationError"
);
}
}
@@ -245,7 +244,7 @@ public class KerberosTokenValidator impl
}
} catch (KerberosTokenDecoderException e) {
// TODO
- throw new WSSecurityException(ErrorCode.FAILURE, "Error retrieving session key.", e);
+ throw new WSSecurityException(ErrorCode.FAILURE, e, "Error retrieving session key.");
}
} else {
LOG.debug("KerberosTokenDecoder is not set.");
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/SamlAssertionValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/SamlAssertionValidator.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/SamlAssertionValidator.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/SamlAssertionValidator.java Fri May 15 14:13:49 2015
@@ -256,7 +256,7 @@ public class SamlAssertionValidator 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-dom/src/main/java/org/apache/wss4j/dom/validate/TimestampValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/TimestampValidator.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/TimestampValidator.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/TimestampValidator.java Fri May 15 14:13:49 2015
@@ -42,7 +42,8 @@ public class TimestampValidator implemen
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noCredential");
}
if (data.getWssConfig() == null) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "WSSConfig cannot be null");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
+ new Object[] {"WSSConfig cannot be null"});
}
boolean timeStampStrict = data.isTimeStampStrict();
int timeStampTTL = data.getTimeStampTTL();
@@ -55,14 +56,14 @@ public class TimestampValidator implemen
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 (data.isRequireTimestampExpires() && timeStamp.getExpires() == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.SECURITY_ERROR,
"invalidTimestamp",
- "The received Timestamp does not contain an expires Element");
+ new Object[] {"The received Timestamp does not contain an expires Element"});
}
return credential;
}
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java Fri May 15 14:13:49 2015
@@ -182,7 +182,7 @@ public class UsernameTokenValidator impl
passDigest = UsernameToken.doPasswordDigest(nonce, createdTime, Base64.decode(origPassword));
} catch (Base64DecodingException e) {
throw new WSSecurityException(
- WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+ WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
);
}
} else {
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomSamlAssertionValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomSamlAssertionValidator.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomSamlAssertionValidator.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomSamlAssertionValidator.java Fri May 15 14:13:49 2015
@@ -63,7 +63,7 @@ public class CustomSamlAssertionValidato
if (samlSubject == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "invalidSAMLToken",
- "for Signature (no Subject)"
+ new Object[] {"for Signature (no Subject)"}
);
}
String nameIdentifier = samlSubject.getNameIdentifier().getValue();
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ConfigurationConverter.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ConfigurationConverter.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ConfigurationConverter.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ConfigurationConverter.java Fri May 15 14:13:49 2015
@@ -355,17 +355,19 @@ public final class ConfigurationConverte
callbackHandlerClass,
CallbackHandler.class);
} catch (ClassNotFoundException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", e,
- "WSHandler: cannot load callback handler class: " + callbackHandlerClass
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+ "empty",
+ new Object[] {"WSHandler: cannot load callback handler class: "
+ + callbackHandlerClass}
);
}
try {
cbHandler = cbClass.newInstance();
} catch (Exception e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", e,
- "WSHandler: cannot create instance of callback handler: " + callbackHandlerClass
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+ "empty",
+ new Object[] {"WSHandler: cannot create instance of callback handler: "
+ + callbackHandlerClass}
);
}
return cbHandler;
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/OutboundWSSec.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/OutboundWSSec.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/OutboundWSSec.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/OutboundWSSec.java Fri May 15 14:13:49 2015
@@ -428,14 +428,16 @@ public class OutboundWSSec {
cryptoType.setAlias(alias);
x509Certificates = securityProperties.getSignatureCrypto().getX509Certificates(cryptoType);
if (x509Certificates == null || x509Certificates.length == 0) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noUserCertsFound", alias);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noUserCertsFound",
+ new Object[] {alias});
}
} else if (secretKey != null) {
x509Certificates = null;
String algoFamily = JCEAlgorithmMapper.getJCEKeyAlgorithmFromURI(signatureAlgorithm);
key = new SecretKeySpec(secretKey, algoFamily);
} else {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noPassword", alias);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noPassword",
+ new Object[] {alias});
}
} catch (WSSecurityException ex) {
if (signedSAML && securityProperties.getSamlCallbackHandler() != null) {
@@ -543,7 +545,7 @@ public class OutboundWSSec {
x509Certificates = crypto.getX509Certificates(cryptoType);
if (x509Certificates == null || x509Certificates.length == 0) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_ENCRYPTION, "noUserCertsFound",
- securityProperties.getEncryptionUser(), "encryption");
+ new Object[] {securityProperties.getEncryptionUser(), "encryption"});
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConfigurationException.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConfigurationException.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConfigurationException.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConfigurationException.java Fri May 15 14:13:49 2015
@@ -27,15 +27,15 @@ public class WSSConfigurationException e
private static final long serialVersionUID = 689628294822027113L;
- public WSSConfigurationException(ErrorCode errorCode, String msgId, Throwable exception, Object ... args) {
- super(errorCode, msgId, exception, args);
+ public WSSConfigurationException(ErrorCode errorCode, Exception exception, String msgId, Object[] args) {
+ super(errorCode, exception, msgId, args);
}
- public WSSConfigurationException(ErrorCode errorCode, String msgId, Throwable exception) {
- super(errorCode, msgId, exception);
+ public WSSConfigurationException(ErrorCode errorCode, Exception exception, String msgId) {
+ super(errorCode, exception, msgId);
}
- public WSSConfigurationException(ErrorCode errorCode, String msgId, Object ... args) {
+ public WSSConfigurationException(ErrorCode errorCode, String msgId, Object[] args) {
super(errorCode, msgId, args);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java Fri May 15 14:13:49 2015
@@ -62,7 +62,7 @@ class WSSCrypto {
passwordEncryptor);
keyStore = crypto.getKeyStore();
} catch (Exception e) {
- throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, "signatureCryptoFailure", e);
+ throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, e, "signatureCryptoFailure");
}
} else {
try {
@@ -73,7 +73,7 @@ class WSSCrypto {
crypto.setCRLCertStore(this.getCrlCertStore());
crypto.setPasswordEncryptor(passwordEncryptor);
} catch (Exception e) {
- throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, "signatureCryptoFailure", e);
+ throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, e, "signatureCryptoFailure");
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java Fri May 15 14:13:49 2015
@@ -103,7 +103,7 @@ public class WSSUtils extends XMLSecurit
try {
callbackHandler.handle(new Callback[]{callback});
} catch (IOException | UnsupportedCallbackException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noPassword", e);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "noPassword");
}
}
}
@@ -128,7 +128,7 @@ public class WSSUtils extends XMLSecurit
sha.update(b4);
return new String(Base64.encodeBase64(sha.digest()));
} catch (NoSuchAlgorithmException e) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "decoding.general", e);
+ throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "decoding.general");
} catch (UnsupportedEncodingException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java Fri May 15 14:13:49 2015
@@ -580,7 +580,7 @@ public class InboundWSSecurityContextImp
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
"empty",
- "BSP:" + bspRule.name() + ": " + bspRule.getMsg());
+ new Object[] {"BSP:" + bspRule.name() + ": " + bspRule.getMsg()});
} else {
LOG.warn("BSP:" + bspRule.name() + ": " + bspRule.getMsg());
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/BinarySecurityTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/BinarySecurityTokenInputHandler.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/BinarySecurityTokenInputHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/BinarySecurityTokenInputHandler.java Fri May 15 14:13:49 2015
@@ -42,6 +42,7 @@ import org.apache.xml.security.stax.secu
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
+
import java.util.Deque;
import java.util.List;
@@ -105,7 +106,7 @@ public class BinarySecurityTokenInputHan
} else {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "invalidValueType",
- binarySecurityTokenType.getValueType());
+ new Object[] {binarySecurityTokenType.getValueType()});
}
tokenSecurityEvent.setCorrelationID(binarySecurityTokenType.getId());
wsInboundSecurityContext.registerSecurityEvent(tokenSecurityEvent);
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/DecryptInputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/DecryptInputProcessor.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/DecryptInputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/DecryptInputProcessor.java Fri May 15 14:13:49 2015
@@ -283,7 +283,7 @@ public class DecryptInputProcessor exten
if (attachmentCallbackHandler == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY,
- "empty", "no attachment callbackhandler supplied"
+ "empty", new Object[] {"no attachment callbackhandler supplied"}
);
}
@@ -298,7 +298,7 @@ public class DecryptInputProcessor exten
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"}
);
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/DerivedKeyTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/DerivedKeyTokenInputHandler.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/DerivedKeyTokenInputHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/DerivedKeyTokenInputHandler.java Fri May 15 14:13:49 2015
@@ -44,6 +44,7 @@ import org.apache.xml.security.stax.secu
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
+
import java.security.Key;
import java.util.Deque;
import java.util.List;
@@ -122,7 +123,8 @@ public class DerivedKeyTokenInputHandler
}
byte[] nonce = derivedKeyTokenType.getNonce();
if (nonce == null || nonce.length == 0) {
- throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "empty", "Missing wsc:Nonce value");
+ throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, "empty",
+ new Object[] {"Missing wsc:Nonce value"});
}
String derivedKeyAlgorithm = derivedKeyTokenType.getAlgorithm();
if (derivedKeyAlgorithm == null) {
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.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/SAMLTokenInputHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java Fri May 15 14:13:49 2015
@@ -124,7 +124,7 @@ public class SAMLTokenInputHandler exten
Signature signature = samlAssertionWrapper.getSignature();
if (signature == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
- "empty", "no signature to validate");
+ "empty", new Object[] {"no signature to validate"});
}
int sigKeyInfoIdx = getSignatureKeyInfoIndex(eventQueue);
@@ -147,14 +147,14 @@ public class SAMLTokenInputHandler exten
} else {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
- "cannot get certificate or key"
+ new Object[] {"cannot get certificate or key"}
);
}
try {
SignatureValidator.validate(signature, credential);
} catch (SignatureException ex) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
- "empty", ex, "SAML signature validation failed");
+ ex, "empty", new Object[] {"SAML signature validation failed"});
}
}
@@ -558,7 +558,7 @@ public class SAMLTokenInputHandler exten
throw new WSSecurityException(
WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
"empty",
- "Illegal XMLEvent received: " + xmlSecEvent.getEventType());
+ new Object[] {"Illegal XMLEvent received: " + xmlSecEvent.getEventType()});
}
return currentNode;
}
@@ -749,7 +749,8 @@ public class SAMLTokenInputHandler exten
}
if (methodNotSatisfied) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION,
- "empty", "SAML proof-of-possession of the private/secret key failed");
+ "empty",
+ new Object[] {"SAML proof-of-possession of the private/secret key failed"});
}
}