From 0422c1070bb5d19f9198e90fe225b39d0c877854 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 13 May 2014 14:00:17 +0200 Subject: add debug messages --- .../moa/id/auth/AuthenticationServer.java | 56 ++++++++++++++-------- .../VerifyXMLSignatureResponseValidator.java | 9 +++- 2 files changed, 45 insertions(+), 20 deletions(-) (limited to 'id/server/idserverlib/src') 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 010aead55..b05c1494a 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 @@ -1167,27 +1167,27 @@ public class AuthenticationServer implements MOAIDAuthConstants { Element domVsresp = null; - try { +// try { // invokes the call domVsresp = new SignatureVerificationInvoker() .verifyXMLSignature(domVsreq); // debug output - } catch ( ServiceException e) { - Logger.error("Signature verification error. ", e); - Logger.error("Signed Data: " + session.getAuthBlock()); - try { - Logger.error("VerifyRequest: " + DOMUtils.serializeNode(domVsreq)); - } catch (TransformerException e1) { - e1.printStackTrace(); - - } catch (IOException e1) { - e1.printStackTrace(); - - } - - throw e; - } +// } catch ( ServiceException e) { +// Logger.error("Signature verification error. ", e); +// Logger.error("Signed Data: " + session.getAuthBlock()); +// try { +// Logger.error("VerifyRequest: " + DOMUtils.serializeNode(domVsreq)); +// } catch (TransformerException e1) { +// e1.printStackTrace(); +// +// } catch (IOException e1) { +// e1.printStackTrace(); +// +// } +// +// throw e; +// } // parses the @@ -1217,9 +1217,27 @@ public class AuthenticationServer implements MOAIDAuthConstants { // date and time CreateXMLSignatureResponseValidator.getInstance().validateSigningDateTime(csresp); - // compares the public keys from the identityLink with the AuthBlock - VerifyXMLSignatureResponseValidator.getInstance().validateCertificate( - vsresp, session.getIdentityLink()); + try { + // compares the public keys from the identityLink with the AuthBlock + VerifyXMLSignatureResponseValidator.getInstance().validateCertificate( + vsresp, session.getIdentityLink()); + + } catch ( ValidateException e) { + Logger.error("Signature verification error. ", e); + Logger.error("Signed Data: " + session.getAuthBlock()); + try { + Logger.error("VerifyRequest: " + DOMUtils.serializeNode(domVsreq)); + Logger.error("VerifyResponse: " + DOMUtils.serializeNode(domVsresp)); + } catch (TransformerException e1) { + e1.printStackTrace(); + + } catch (IOException e1) { + e1.printStackTrace(); + + } + + throw e; + } // post processing of the infoboxes Iterator iter = session.getInfoboxValidatorIterator(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java index b69fdd9ab..4fd7fa965 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java @@ -229,10 +229,17 @@ public class VerifyXMLSignatureResponseValidator { if(ecdsakey.equals(ecdsaPubKeySignature)) found = true; } + +// Logger.debug("IDL-Pubkey=" + idl.getPublicKey()[i].getClass().getName() +// + " Resp-Pubkey=" + pubKeySignature.getClass().getName()); + } - if (!found) + if (!found) { + throw new ValidateException("validator.09", null); + + } } } -- cgit v1.2.3