From 8c8ddf0a97c65b1b39dad580c45e19cfa7e20a7e Mon Sep 17 00:00:00 2001 From: kstranacher Date: Fri, 17 Feb 2012 18:41:30 +0000 Subject: Update libs (iaik_moa-1.32.jar und iaik_ixsil-1.2.2.5.jar) git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@1251 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../moa/id/auth/AuthenticationServer.java | 2 ++ .../moa/id/auth/builder/SAMLArtifactBuilder.java | 22 ++++++++++++---------- .../moa/id/util/ParamValidatorUtils.java | 4 ++-- 3 files changed, 16 insertions(+), 12 deletions(-) (limited to 'id/server/idserverlib/src/main/java') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 093d22732..bf35b31f2 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1679,6 +1679,8 @@ public class AuthenticationServer implements MOAIDAuthConstants { if (isPrPerson.equalsIgnoreCase("pr:PhysicalPerson")) { Node prIdentification = mandatePerson.getFirstChild(); prIdentification.getFirstChild().setTextContent(""); +// Element.appendChild(Document.createTextNode(String)); +// prIdentification.getFirstChild(). } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java index 145664a2b..6a78df9b2 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java @@ -74,13 +74,21 @@ public class SAMLArtifactBuilder { // alternative sourceId String alternativeSourceID = AuthConfigurationProvider.getInstance().getGenericConfigurationParameter(GENERIC_CONFIG_PARAM_SOURCEID); - //System.out.println("alternativeSourceID: " + alternativeSourceID); - //System.out.println("authURL: " + authURL); - // if sourceID is given in GET/POST param - use this as source id if (!ParepUtils.isEmpty(sourceIdParam)) { // if GET/POST parameter sourceID is set, use that sourceID instead of authURL; - sourceID = md.digest(sourceIdParam.getBytes()); + //sourceID = md.digest(sourceIdParam.getBytes()); + + // if sourceIdParam is too short (must have 20 characters) - add " " + int length = sourceIdParam.length(); + if (length < 20) { + int l = 20 - length; + for (int i = 0; i < l; i++) { + sourceIdParam += " "; + } + } + + sourceID = sourceIdParam.getBytes(); Logger.info("Building SAMArtifact from sourceID \"" + sourceIdParam + "\" instead of authURL \"" + authURL + "\"."); byte[] assertionHandle = md.digest(sessionID.getBytes()); @@ -90,9 +98,7 @@ public class SAMLArtifactBuilder { out.write(sourceID, 0, 20); out.write(assertionHandle, 0, 20); byte[] samlArtifact = out.toByteArray(); - //System.out.println("samlArtifact: " + new String(samlArtifact)); String samlArtifactBase64 = Base64Utils.encode(samlArtifact); - //System.out.println("samlArtifact Base64: " + samlArtifactBase64); return samlArtifactBase64; } @@ -108,9 +114,7 @@ public class SAMLArtifactBuilder { out.write(sourceID, 0, 20); out.write(assertionHandle, 0, 20); byte[] samlArtifact = out.toByteArray(); - System.out.println("samlArtifact: " + new String(samlArtifact)); String samlArtifactBase64 = Base64Utils.encode(samlArtifact); - System.out.println("samlArtifact Base64: " + samlArtifactBase64); return samlArtifactBase64; } @@ -123,9 +127,7 @@ public class SAMLArtifactBuilder { out.write(sourceID, 0, 20); out.write(assertionHandle, 0, 20); byte[] samlArtifact = out.toByteArray(); - //System.out.println("samlArtifact: " + new String(samlArtifact)); String samlArtifactBase64 = Base64Utils.encode(samlArtifact); - //System.out.println("samlArtifact Base64: " + samlArtifactBase64); return samlArtifactBase64; //System.out.println("sourceID: " + new String(sourceID)); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java index 644e59f72..9df55724e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java @@ -94,7 +94,7 @@ public class ParamValidatorUtils { } - Pattern pattern = Pattern.compile("[\\w-_]{1,50}"); + Pattern pattern = Pattern.compile("[\\w-_]{1,20}"); Matcher matcher = pattern.matcher(sourceID); boolean b = matcher.matches(); if (b) { @@ -102,7 +102,7 @@ public class ParamValidatorUtils { return true; } else { - Logger.error("Fehler Überprüfung Parameter sourceID. SourceID entspricht nicht den Kriterien (nur Zeichen a-z, A-Z, - und _, sowie 1-50 Zeichen lang)"); + Logger.error("Fehler Überprüfung Parameter sourceID. SourceID entspricht nicht den Kriterien (nur Zeichen a-z, A-Z, - und _, sowie 1-20 Zeichen lang)"); return false; } -- cgit v1.2.3