From 67b1ab17d8ab539ef158ccce7d63d222251aed3e Mon Sep 17 00:00:00 2001 From: Klaus Stranacher Date: Thu, 6 Mar 2014 20:07:07 +0100 Subject: Bugfix fileupload for CMSVerifyRequest --- .../moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java | 2 +- .../moa/spss/server/invoke/CMSSignatureVerificationInvoker.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'spss/server/serverlib/src') diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java index 6209d8ef9..6b3f4301f 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java @@ -175,7 +175,7 @@ public class VerifyCMSSignatureRequestParser { excludeByteRangeFrom = new BigDecimal(excludeByteRangeFromStr); if (excludeByteRangeToStr != null) excludeByteRangeTo = new BigDecimal(excludeByteRangeToStr); - + return factory.createCMSDataObject(metaInfo, content, excludeByteRangeFrom, excludeByteRangeTo); diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java index 0e5faf790..aca6f5895 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java @@ -311,6 +311,12 @@ public class CMSSignatureVerificationInvoker { ByteArrayOutputStream contentOs = new ByteArrayOutputStream(); + CMSDataObject dataobject = request.getDataObject(); + BigDecimal from = dataobject.getExcludeByteRangeFrom(); + BigDecimal to = dataobject.getExcludeByteRangeTo(); + + if ( (from == null) || (to == null)) + return contentIs; BigDecimal counter = new BigDecimal("0"); BigDecimal one = new BigDecimal("1"); @@ -318,7 +324,7 @@ public class CMSSignatureVerificationInvoker { try { while ((byteRead=contentIs.read()) >= 0) { - if (inRange(counter, request.getDataObject())) { + if (inRange(counter, dataobject)) { // if byte is in byte range, set byte to 0x00 contentOs.write(0); } -- cgit v1.2.3