aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-03-10 10:53:25 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-03-10 10:53:25 +0100
commite34d8e8a2292a0ea049ab3b3aa6e649aa215e82b (patch)
treee456e8fba58b493462746a24fb6073e76b0293f9 /id/server/idserverlib/src/main
parent989f5cfa9c9c6f60ce6e161983be8434ca87a698 (diff)
downloadmoa-id-spss-e34d8e8a2292a0ea049ab3b3aa6e649aa215e82b.tar.gz
moa-id-spss-e34d8e8a2292a0ea049ab3b3aa6e649aa215e82b.tar.bz2
moa-id-spss-e34d8e8a2292a0ea049ab3b3aa6e649aa215e82b.zip
fix bug in PVP RedirectBinding decoder
Diffstat (limited to 'id/server/idserverlib/src/main')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java
index 1d13cbd07..7278c9c6c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java
@@ -57,7 +57,7 @@ import at.gv.egovernment.moa.id.protocols.pvp2x.messages.InboundMessage;
import at.gv.egovernment.moa.id.protocols.pvp2x.messages.InboundMessageInterface;
import at.gv.egovernment.moa.id.protocols.pvp2x.messages.MOARequest;
import at.gv.egovernment.moa.id.protocols.pvp2x.messages.MOAResponse;
-import at.gv.egovernment.moa.id.protocols.pvp2x.metadata.MOAMetadataProvider;
+import at.gv.egovernment.moa.id.protocols.pvp2x.metadata.IMOARefreshableMetadataProvider;
import at.gv.egovernment.moa.id.protocols.pvp2x.verification.TrustEngineFactory;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -180,20 +180,27 @@ public class RedirectBinding implements IDecoder, IEncoder {
if (MiscUtil.isEmpty(messageContext.getInboundMessageIssuer())) {
throw e;
- }
- Logger.debug("PVP2X message validation FAILED. Relead metadata for entityID: " + messageContext.getPeerEntityId());
- if (!MOAMetadataProvider.getInstance().refreshMetadataProvider(messageContext.getInboundMessageIssuer()))
- throw e;
+ }
- else {
- Logger.trace("PVP2X metadata reload finished. Check validate message again.");
- decode.decode(messageContext);
+ if (metadataProvider instanceof IMOARefreshableMetadataProvider) {
+ Logger.debug("PVP2X message validation FAILED. Relead metadata for entityID: " + messageContext.getPeerEntityId());
+ if (!((IMOARefreshableMetadataProvider) metadataProvider).refreshMetadataProvider(messageContext.getInboundMessageIssuer()))
+ throw e;
+
+ else {
+ Logger.trace("PVP2X metadata reload finished. Check validate message again.");
+ decode.decode(messageContext);
- //check signature
- signatureRule.evaluate(messageContext);
+ //check signature
+ signatureRule.evaluate(messageContext);
+ }
+ Logger.trace("Second PVP2X message validation finished");
+
+ } else {
+ throw e;
+
}
- Logger.trace("Second PVP2X message validation finished");
}
InboundMessage msg = null;