From a90e70cf7beb2fe596185309b0e9c305af08c045 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 9 Feb 2017 15:33:11 +0100 Subject: update eIDAS node target validator --- .../id/configuration/validation/oa/OATargetConfigValidation.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java index 9cb3ce700..0062beb96 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OATargetConfigValidation.java @@ -24,6 +24,8 @@ package at.gv.egovernment.moa.id.configuration.validation.oa; import java.util.ArrayList; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; @@ -76,8 +78,9 @@ public class OATargetConfigValidation { } } else if (form.getIdentificationType().equals(Constants.IDENIFICATIONTYPE_EIDAS)) { - String[] test = check.split("\\+"); - if (test.length < 2) { + Pattern pattern = Pattern.compile("[A-Z,a-z]{2}\\+[A-Z,a-z]{2}"); + Matcher matcher = pattern.matcher(check); + if (!matcher.matches()) { log.info("Not valid eIDAS Target"); errors.add(LanguageHelper.getErrorString("validation.general.identificationnumber.eidas.valid", request)); -- cgit v1.2.3