aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at/gv/egovernment/moa/id/auth
diff options
context:
space:
mode:
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa/id/auth')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java2
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java2
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java11
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java3
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java2
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java2
6 files changed, 10 insertions, 12 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java
index 961a40303..48320c4f5 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java
@@ -45,7 +45,7 @@ public class CreateXMLSignatureRequestBuilder implements Constants {
* Builds the <code>&lt;CreateXMLSignatureRequest&gt;</code>.
*
* @param authBlock String representation of XML authentication block
- * @param keyBoxIdentfier the key box identifier which will be used (e.g. CertifiedKeyPair)
+ * @param keyBoxIdentfier the key box identifier which will be used (e.g. CertifiedKeypair)
* @return String representation of <code>&lt;CreateXMLSignatureRequest&gt;</code>
*/
public String build(String authBlock, String keyBoxIdentifier, String[] dsigTransformInfos) {
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java
index 58332984e..e52a3e73c 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java
@@ -9,11 +9,9 @@ import org.w3c.dom.Text;
import at.gv.egovernment.moa.id.*;
import at.gv.egovernment.moa.id.auth.data.CreateXMLSignatureResponse;
import at.gv.egovernment.moa.id.auth.data.IdentityLink;
-import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants;
import at.gv.egovernment.moa.util.Base64Utils;
import at.gv.egovernment.moa.util.Constants;
import at.gv.egovernment.moa.util.DOMUtils;
-import at.gv.egovernment.moa.util.OutputXML2File;
import at.gv.egovernment.moa.util.XPathUtils;
/**
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java b/id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java
index 8faa69260..a18cf7322 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java
@@ -62,7 +62,6 @@ public class SignatureVerificationInvoker {
String endPoint;
AuthConfigurationProvider authConfigProvider = AuthConfigurationProvider.getInstance();
authConnParam = authConfigProvider.getMoaSpConnectionParameter();
-
//If the ConnectionParameter do NOT exist, we try to get the api to work....
if (authConnParam != null) {
endPoint = authConnParam.getUrl();
@@ -74,18 +73,20 @@ public class SignatureVerificationInvoker {
else {
SignatureVerificationService svs = SignatureVerificationService.getInstance();
VerifyXMLSignatureRequest vsrequest = new VerifyXMLSignatureRequestParser().parse(request);
+
VerifyXMLSignatureResponse vsresponse = svs.verifyXMLSignature(vsrequest);
-
Document result = new VerifyXMLSignatureResponseBuilder().build(vsresponse);
+
Logger.setHierarchy("moa.id.auth");
return result.getDocumentElement();
}
}
catch (Exception ex) {
- if (authConnParam != null)
- throw new ServiceException("service.00", new Object[] { ex.toString()}, ex);
- else
+ if (authConnParam != null) {
+ throw new ServiceException("service.00", new Object[] { ex.toString()}, ex);
+ } else {
throw new ServiceException("service.03", new Object[] { ex.toString()}, ex);
+ }
}
}
} \ No newline at end of file
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java b/id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java
index c1146218e..012a5b559 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java
@@ -2,7 +2,6 @@ package at.gv.egovernment.moa.id.auth.parser;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-
import org.w3c.dom.Element;
import at.gv.egovernment.moa.id.AuthenticationException;
@@ -54,7 +53,7 @@ public class InfoboxReadResponseParser {
infoBoxElem = DOMUtils.parseXmlValidating(s);
}
catch (Throwable t) {
- throw new ParseException("parser.01", new Object[] { t.toString()}, t);
+ throw new ParseException("parser.01", new Object[] { t.toString()}, t);
}
}
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java b/id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java
index 9c74114ad..e628cb997 100644
--- a/id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java
+++ b/id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java
@@ -124,7 +124,6 @@ public class VerifyXMLSignatureResponseParser {
VerifyXMLSignatureResponse respData=new VerifyXMLSignatureResponse();
try {
-
respData.setXmlDsigSubjectName(XPathUtils.getElementValue(verifyXMLSignatureResponse,DSIG_SUBJECT_NAME_XPATH,""));
Element e = (Element)XPathUtils.selectSingleNode(verifyXMLSignatureResponse,QUALIFIED_CERTIFICATE_XPATH);
respData.setQualifiedCertificate(e!=null);
@@ -133,7 +132,6 @@ public class VerifyXMLSignatureResponseParser {
verifyXMLSignatureResponse,DSIG_X509_CERTIFICATE_XPATH,"").getBytes("UTF-8")),true);
respData.setX509certificate(new X509Certificate(in));
-
Element publicAuthority = (Element)XPathUtils.selectSingleNode(verifyXMLSignatureResponse,PUBLIC_AUTHORITY_CODE_XPATH);
respData.setPublicAuthority(publicAuthority != null);
respData.setPublicAuthorityCode(XPathUtils.getElementValue(verifyXMLSignatureResponse,PUBLIC_AUTHORITY_CODE_XPATH,""));
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 103d3cc83..3c15b9ec4 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
@@ -64,9 +64,11 @@ public class CreateXMLSignatureResponseValidator {
// A3.056: more then one /saml:Assertion/saml:AttributeStatement/saml:Subject/saml:NameIdentifier
+
XPathUtils.selectNodeList(createXMLSignatureResponse.getSamlAssertion(),SAML_SUBJECT_NAME_IDENTIFIER_XPATH);
SAMLAttribute[] samlattributes = createXMLSignatureResponse.getSamlAttributes();
+
boolean foundOA = false;
boolean foundGB = false;
for (int i = 0; i < samlattributes.length; i++)