[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/system/conf/saml-nameid-system.xml idp-saml-im...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Sep 2 17:28:44 EDT 2016
Author: scantor
Date: Fri Sep 2 17:28:43 2016
New Revision: 8368
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8368&view=rev
Log:
IDP-1019 - Problem using persistentId salt with special characters
https://issues.shibboleth.net/jira/browse/IDP-1019
Completes workaround for salt by setting both plain and encoded salt
using separate properties, and skipping empty inputs.
Modified:
trunk/idp-conf/src/main/resources/system/conf/saml-nameid-system.xml
trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/ComputedPersistentIdGenerationStrategy.java
Modified: trunk/idp-conf/src/main/resources/system/conf/saml-nameid-system.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/conf/saml-nameid-system.xml?rev=8368&r1=8367&r2=8368&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/conf/saml-nameid-system.xml (original)
+++ trunk/idp-conf/src/main/resources/system/conf/saml-nameid-system.xml Fri Sep 2 17:28:43 2016
@@ -59,7 +59,9 @@
<bean id="shibboleth.ComputedPersistentIdGenerator" lazy-init="true"
class="net.shibboleth.idp.saml.nameid.impl.ComputedPersistentIdGenerationStrategy"
- p:salt="%{idp.persistentId.salt:}" p:algorithm="%{idp.persistentId.algorithm:SHA}" />
+ p:salt="%{idp.persistentId.salt:}"
+ p:encodedSalt="%{idp.persistentId.encodedSalt:}"
+ p:algorithm="%{idp.persistentId.algorithm:SHA}" />
<bean id="shibboleth.StoredPersistentIdGenerator" lazy-init="true"
class="net.shibboleth.idp.saml.nameid.impl.StoredPersistentIdGenerationStrategy"
Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/ComputedPersistentIdGenerationStrategy.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/ComputedPersistentIdGenerationStrategy.java?rev=8368&r1=8367&r2=8368&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/ComputedPersistentIdGenerationStrategy.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/ComputedPersistentIdGenerationStrategy.java Fri Sep 2 17:28:43 2016
@@ -21,6 +21,7 @@
import java.security.NoSuchAlgorithmException;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
@@ -68,24 +69,33 @@
/**
* Set the salt used when computing the ID.
*
+ * <p>An empty/null input is ignored.</p>
+ *
* @param newValue used when computing the ID
*/
- public void setSalt(@Nonnull @NotEmpty final byte[] newValue) {
+ public void setSalt(@Nullable final byte[] newValue) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
- salt = Constraint.isNotEmpty(newValue, "Salt cannot be null or empty");
+ if (newValue != null && newValue.length > 0) {
+ salt = newValue;
+ }
}
/**
* Set the base64-encoded salt used when computing the ID.
*
+ * <p>An empty/null input is ignored.</p>
+ *
* @param newValue used when computing the ID
+ *
+ * @since 3.3.0
*/
- public void setEncodedSalt(@Nonnull @NotEmpty final String newValue) {
+ public void setEncodedSalt(@Nullable final String newValue) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
- Constraint.isNotEmpty(newValue, "Salt cannot be null or empty");
- salt = Base64Support.decode(newValue);
+ if (newValue != null && !newValue.isEmpty()) {
+ salt = Base64Support.decode(newValue);
+ }
}
/**
More information about the commits
mailing list