You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2014/01/08 14:53:04 UTC
svn commit: r1556531 [2/2] - in /webservices/wss4j/trunk:
ws-security-common/src/main/java/org/apache/wss4j/common/
ws-security-common/src/main/java/org/apache/wss4j/common/crypto/
ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/ ws-s...
Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/JAASUsernameTokenValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/JAASUsernameTokenValidator.java?rev=1556531&r1=1556530&r2=1556531&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/JAASUsernameTokenValidator.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/JAASUsernameTokenValidator.java Wed Jan 8 13:53:03 2014
@@ -38,7 +38,7 @@ import org.apache.wss4j.dom.message.toke
*/
public class JAASUsernameTokenValidator implements Validator {
- private static org.slf4j.Logger log =
+ private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(JAASUsernameTokenValidator.class);
private String contextName;
@@ -77,25 +77,25 @@ public class JAASUsernameTokenValidator
user = usernameToken.getName();
String pwType = usernameToken.getPasswordType();
- if (log.isDebugEnabled()) {
- log.debug("UsernameToken user " + usernameToken.getName());
- log.debug("UsernameToken password type " + pwType);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("UsernameToken user " + usernameToken.getName());
+ LOG.debug("UsernameToken password type " + pwType);
}
if (usernameToken.isHashed()) {
- log.warn("Authentication failed as hashed username token not supported");
+ LOG.warn("Authentication failed as hashed username token not supported");
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
}
password = usernameToken.getPassword();
if (!WSConstants.PASSWORD_TEXT.equals(pwType)) {
- log.warn("Password type " + pwType + " not supported");
+ LOG.warn("Password type " + pwType + " not supported");
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
}
if (!(user != null && user.length() > 0 && password != null && password.length() > 0)) {
- log.warn("User or password empty");
+ LOG.warn("User or password empty");
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
}
@@ -107,7 +107,7 @@ public class JAASUsernameTokenValidator
credential.setSubject(subject);
} catch (LoginException ex) {
- log.info("Authentication failed", ex);
+ LOG.info("Authentication failed", ex);
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILED_AUTHENTICATION, ex
);
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=1556531&r1=1556530&r2=1556531&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 Wed Jan 8 13:53:03 2014
@@ -40,7 +40,7 @@ import org.apache.wss4j.common.kerberos.
*/
public class KerberosTokenValidator implements Validator {
- private static org.slf4j.Logger log =
+ private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(KerberosTokenValidator.class);
private String serviceName;
@@ -133,14 +133,14 @@ public class KerberosTokenValidator impl
return credential;
}
- if (log.isDebugEnabled()) {
+ if (LOG.isDebugEnabled()) {
try {
String jaasAuth = System.getProperty("java.security.auth.login.config");
String krbConf = System.getProperty("java.security.krb5.conf");
- log.debug("KerberosTokenValidator - Using JAAS auth login file: " + jaasAuth);
- log.debug("KerberosTokenValidator - Using KRB conf file: " + krbConf);
+ LOG.debug("KerberosTokenValidator - Using JAAS auth login file: " + jaasAuth);
+ LOG.debug("KerberosTokenValidator - Using KRB conf file: " + krbConf);
} catch (SecurityException ex) {
- log.debug(ex.getMessage(), ex);
+ LOG.debug(ex.getMessage(), ex);
}
}
@@ -156,8 +156,8 @@ public class KerberosTokenValidator impl
}
loginContext.login();
} catch (LoginException ex) {
- if (log.isDebugEnabled()) {
- log.debug(ex.getMessage(), ex);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(ex.getMessage(), ex);
}
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE,
@@ -165,8 +165,8 @@ public class KerberosTokenValidator impl
ex,
ex.getMessage());
}
- if (log.isDebugEnabled()) {
- log.debug("Successfully authenticated to the TGT");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Successfully authenticated to the TGT");
}
byte[] token = binarySecurity.getToken();
@@ -211,8 +211,8 @@ public class KerberosTokenValidator impl
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
}
- if (log.isDebugEnabled()) {
- log.debug("Successfully validated a ticket");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Successfully validated a ticket");
}
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=1556531&r1=1556530&r2=1556531&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 Wed Jan 8 13:53:03 2014
@@ -39,7 +39,7 @@ import org.apache.xml.security.utils.Bas
*/
public class UsernameTokenValidator implements Validator {
- private static org.slf4j.Logger log =
+ private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(UsernameTokenValidator.class);
/**
@@ -75,14 +75,14 @@ public class UsernameTokenValidator impl
usernameToken.setPasswordsAreEncoded(passwordsAreEncoded);
String pwType = usernameToken.getPasswordType();
- if (log.isDebugEnabled()) {
- log.debug("UsernameToken user " + usernameToken.getName());
- log.debug("UsernameToken password type " + pwType);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("UsernameToken user " + usernameToken.getName());
+ LOG.debug("UsernameToken password type " + pwType);
}
if (requiredPasswordType != null && !requiredPasswordType.equals(pwType)) {
- if (log.isDebugEnabled()) {
- log.debug("Authentication failed as the received password type does not "
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Authentication failed as the received password type does not "
+ "match the required password type of: " + requiredPasswordType);
}
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
@@ -101,8 +101,8 @@ public class UsernameTokenValidator impl
verifyPlaintextPassword(usernameToken, data);
} else if (password != null) {
if (!handleCustomPasswordTypes) {
- if (log.isDebugEnabled()) {
- log.debug("Authentication failed as handleCustomUsernameTokenTypes is false");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Authentication failed as handleCustomUsernameTokenTypes is false");
}
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
}
@@ -117,7 +117,7 @@ public class UsernameTokenValidator impl
* Verify a UsernameToken containing a password of some unknown (but specified) password
* type. It does this by querying a CallbackHandler instance to obtain a password for the
* given username, and then comparing it against the received password.
- * This method currently uses the same logic as the verifyPlaintextPassword case, but it in
+ * This method currently uses the same LOG.c as the verifyPlaintextPassword case, but it in
* a separate protected method to allow users to override the validation of the custom
* password type specific case.
* @param usernameToken The UsernameToken instance to verify
@@ -132,7 +132,7 @@ public class UsernameTokenValidator impl
* Verify a UsernameToken containing a plaintext password. It does this by querying a
* CallbackHandler instance to obtain a password for the given username, and then comparing
* it against the received password.
- * This method currently uses the same logic as the verifyDigestPassword case, but it in
+ * This method currently uses the same LOG.c as the verifyDigestPassword case, but it in
* a separate protected method to allow users to override the validation of the plaintext
* password specific case.
* @param usernameToken The UsernameToken instance to verify
@@ -168,15 +168,15 @@ public class UsernameTokenValidator impl
try {
data.getCallbackHandler().handle(new Callback[]{pwCb});
} catch (IOException e) {
- if (log.isDebugEnabled()) {
- log.debug(e.getMessage(), e);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(e.getMessage(), e);
}
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILED_AUTHENTICATION, e
);
} catch (UnsupportedCallbackException e) {
- if (log.isDebugEnabled()) {
- log.debug(e.getMessage(), e);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(e.getMessage(), e);
}
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILED_AUTHENTICATION, e
@@ -184,8 +184,8 @@ public class UsernameTokenValidator impl
}
String origPassword = pwCb.getPassword();
if (origPassword == null) {
- if (log.isDebugEnabled()) {
- log.debug("Callback supplied no password for: " + user);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Callback supplied no password for: " + user);
}
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
}
@@ -228,8 +228,8 @@ public class UsernameTokenValidator impl
}
if (!allowUsernameTokenDerivedKeys) {
- if (log.isDebugEnabled()) {
- log.debug("Authentication failed as the received UsernameToken does not "
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Authentication failed as the received UsernameToken does not "
+ "contain any password element");
}
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
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=1556531&r1=1556530&r2=1556531&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 Wed Jan 8 13:53:03 2014
@@ -52,7 +52,7 @@ import org.apache.xml.security.stax.ext.
*/
public final class ConfigurationConverter {
- private static org.slf4j.Logger log =
+ private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(ConfigurationConverter.class);
private ConfigurationConverter() {
@@ -199,7 +199,7 @@ public final class ConfigurationConverte
properties.setSignatureUser(getDefaultX509Identifier(properties, true));
}
} catch (WSSecurityException e) {
- log.error(e.getMessage(), e);
+ LOG.error(e.getMessage(), e);
}
}
}
@@ -225,7 +225,7 @@ public final class ConfigurationConverte
CryptoFactory.getProperties(sigPropFile, getClassLoader());
properties.setSignatureVerificationCryptoProperties(sigProperties, passwordEncryptor);
} catch (WSSecurityException e) {
- log.error(e.getMessage(), e);
+ LOG.error(e.getMessage(), e);
}
}
}
@@ -251,7 +251,7 @@ public final class ConfigurationConverte
CryptoFactory.getProperties(encPropFile, getClassLoader());
properties.setEncryptionCryptoProperties(encProperties, passwordEncryptor);
} catch (WSSecurityException e) {
- log.error(e.getMessage(), e);
+ LOG.error(e.getMessage(), e);
}
}
}
@@ -277,7 +277,7 @@ public final class ConfigurationConverte
CryptoFactory.getProperties(encPropFile, getClassLoader());
properties.setDecryptionCryptoProperties(encProperties, passwordEncryptor);
} catch (WSSecurityException e) {
- log.error(e.getMessage(), e);
+ LOG.error(e.getMessage(), e);
}
}
}
@@ -295,9 +295,9 @@ public final class ConfigurationConverte
}
return crypto.getDefaultX509Identifier();
} catch (WSSConfigurationException e) {
- log.debug(e.getMessage(), e);
+ LOG.debug(e.getMessage(), e);
} catch (WSSecurityException e) {
- log.debug(e.getMessage(), e);
+ LOG.debug(e.getMessage(), e);
}
return null;
}
@@ -316,7 +316,7 @@ public final class ConfigurationConverte
CallbackHandler pwCallbackHandler = loadCallbackHandler(pwCallback);
properties.setCallbackHandler(pwCallbackHandler);
} catch (WSSecurityException e) {
- log.error(e.getMessage(), e);
+ LOG.error(e.getMessage(), e);
}
}
}
@@ -331,7 +331,7 @@ public final class ConfigurationConverte
CallbackHandler samlCallbackHandler = loadCallbackHandler(samlCallback);
properties.setSamlCallbackHandler(samlCallbackHandler);
} catch (WSSecurityException e) {
- log.error(e.getMessage(), e);
+ LOG.error(e.getMessage(), e);
}
}
}
@@ -615,7 +615,7 @@ public final class ConfigurationConverte
try {
subjectCertConstraints.add(Pattern.compile(certConstraint.trim()));
} catch (PatternSyntaxException ex) {
- log.error(ex.getMessage(), ex);
+ LOG.error(ex.getMessage(), ex);
}
}
properties.setSubjectCertConstraints(subjectCertConstraints);
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=1556531&r1=1556530&r2=1556531&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 Wed Jan 8 13:53:03 2014
@@ -52,7 +52,7 @@ import org.apache.xml.security.stax.secu
*/
public class InboundWSSecurityContextImpl extends InboundSecurityContextImpl implements WSInboundSecurityContext {
- private static final transient org.slf4j.Logger logger =
+ private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(InboundWSSecurityContextImpl.class);
private final Deque<SecurityEvent> securityEventQueue = new ArrayDeque<SecurityEvent>();
@@ -564,7 +564,7 @@ public class InboundWSSecurityContextImp
"empty",
"BSP:" + bspRule.name() + ": " + bspRule.getMsg());
} else {
- logger.warn("BSP:" + bspRule.name() + ": " + bspRule.getMsg());
+ LOG.warn("BSP:" + bspRule.name() + ": " + bspRule.getMsg());
}
}
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SecurityHeaderInputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SecurityHeaderInputProcessor.java?rev=1556531&r1=1556530&r2=1556531&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SecurityHeaderInputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SecurityHeaderInputProcessor.java Wed Jan 8 13:53:03 2014
@@ -50,7 +50,7 @@ import org.apache.xml.security.stax.impl
*/
public class SecurityHeaderInputProcessor extends AbstractInputProcessor {
- protected static final transient org.slf4j.Logger logger =
+ protected static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SecurityHeaderInputProcessor.class);
private final ArrayDeque<XMLSecEvent> xmlSecEventList = new ArrayDeque<XMLSecEvent>();
@@ -200,7 +200,7 @@ public class SecurityHeaderInputProcesso
Class<XMLSecurityHeaderHandler> clazz =
(Class<XMLSecurityHeaderHandler>)SecurityHeaderHandlerMapper.getSecurityHeaderHandler(elementName);
if (clazz == null) {
- logger.warn("No matching handler found for " + elementName);
+ LOG.warn("No matching handler found for " + elementName);
return;
}
try {
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=1556531&r1=1556530&r2=1556531&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 Wed Jan 8 13:53:03 2014
@@ -64,7 +64,7 @@ import org.apache.xml.security.stax.secu
*/
public class EncryptOutputProcessor extends AbstractEncryptOutputProcessor {
- private static final transient org.slf4j.Logger logger =
+ private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(EncryptOutputProcessor.class);
public EncryptOutputProcessor() throws XMLSecurityException {
@@ -89,7 +89,7 @@ public class EncryptOutputProcessor exte
if (getActiveInternalEncryptionOutputProcessor() == null) {
SecurePart securePart = securePartMatches(xmlSecStartElement, outputProcessorChain, WSSConstants.ENCRYPTION_PARTS);
if (securePart != null) {
- logger.debug("Matched encryptionPart for encryption");
+ LOG.debug("Matched encryptionPart for encryption");
InternalEncryptionOutputProcessor internalEncryptionOutputProcessor;
String tokenId = outputProcessorChain.getSecurityContext().get(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION);
SecurityTokenProvider<OutboundSecurityToken> securityTokenProvider = outputProcessorChain.getSecurityContext().getSecurityTokenProvider(tokenId);
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=1556531&r1=1556530&r2=1556531&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 Wed Jan 8 13:53:03 2014
@@ -69,7 +69,7 @@ import org.w3c.dom.Text;
public class SAMLTokenOutputProcessor extends AbstractOutputProcessor {
- private static final transient org.slf4j.Logger logger =
+ private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(SAMLTokenOutputProcessor.class);
public SAMLTokenOutputProcessor() throws XMLSecurityException {
@@ -293,7 +293,7 @@ public class SAMLTokenOutputProcessor ex
try {
return securityTokenProvider.getSecurityToken();
} catch (XMLSecurityException e) {
- logger.debug(e.getMessage(), e);
+ LOG.debug(e.getMessage(), e);
}
return null;
}
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=1556531&r1=1556530&r2=1556531&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 Wed Jan 8 13:53:03 2014
@@ -56,7 +56,7 @@ import org.apache.xml.security.utils.Bas
public class WSSSignatureOutputProcessor extends AbstractSignatureOutputProcessor {
- private static final transient org.slf4j.Logger logger =
+ private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(WSSSignatureOutputProcessor.class);
public WSSSignatureOutputProcessor() throws XMLSecurityException {
@@ -81,7 +81,7 @@ public class WSSSignatureOutputProcessor
if (getActiveInternalSignatureOutputProcessor() == null) {
SecurePart securePart = securePartMatches(xmlSecStartElement, outputProcessorChain, WSSConstants.SIGNATURE_PARTS);
if (securePart != null) {
- logger.debug("Matched securePart for signature");
+ LOG.debug("Matched securePart for signature");
SignaturePartDef signaturePartDef = new SignaturePartDef();
signaturePartDef.setSecurePart(securePart);
@@ -219,8 +219,8 @@ public class WSSSignatureOutputProcessor
}
String calculatedDigest = new String(Base64.encode(digestOutputStream.getDigestValue()));
- if (logger.isDebugEnabled()) {
- logger.debug("Calculated Digest: " + calculatedDigest);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Calculated Digest: " + calculatedDigest);
}
signaturePartDef.setDigestValue(calculatedDigest);