aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at/gv/egovernment/moa/id
diff options
context:
space:
mode:
authorpeter.danner <peter.danner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-01-15 11:13:22 +0000
committerpeter.danner <peter.danner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-01-15 11:13:22 +0000
commit32e1a7ef05521924a69cc82a46e3fe84ab85da91 (patch)
tree60a014e569e28f60893f03b5104024d9f3b72dd7 /id.server/src/at/gv/egovernment/moa/id
parent1bcb5e06781aa67dc5ff59670501d35b1b89a91e (diff)
downloadmoa-id-spss-32e1a7ef05521924a69cc82a46e3fe84ab85da91.tar.gz
moa-id-spss-32e1a7ef05521924a69cc82a46e3fe84ab85da91.tar.bz2
moa-id-spss-32e1a7ef05521924a69cc82a46e3fe84ab85da91.zip
fixed comparison of possibly base64 encoded SAML-Attributes
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@785 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa/id')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java b/id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java
index e72d0b6c4..78f62de50 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java
@@ -4,7 +4,6 @@ import java.util.Iterator;
import java.util.List;
import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
import at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder;
import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
@@ -14,6 +13,7 @@ import at.gv.egovernment.moa.id.auth.data.IdentityLink;
import at.gv.egovernment.moa.id.auth.data.SAMLAttribute;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Constants;
+import at.gv.egovernment.moa.util.StringUtils;
import at.gv.egovernment.moa.util.XPathUtils;
/**
@@ -213,7 +213,12 @@ public class CreateXMLSignatureResponseValidator {
Object actualValue = samlAttribute.getValue();
try {
if (expectedValue instanceof String) {
- if (!(((String)expectedValue).equals((String)actualValue))) {
+ // replace \r\n because text might be base64-encoded
+ String expValue = StringUtils.replaceAll((String)expectedValue,"\r","");
+ expValue = StringUtils.replaceAll(expValue,"\n","");
+ String actValue = StringUtils.replaceAll((String)actualValue,"\r","");
+ actValue = StringUtils.replaceAll(actValue,"\n","");
+ if (!expValue.equals(actValue)) {
throw new ValidateException(
"validator.38",
new Object[] {"Wert", String.valueOf((i+1)), actualName, actualValue, expectedValue });