aboutsummaryrefslogtreecommitdiff
path: root/Adobe_SigHandler/Adobe.PDF-AS-SigHandler
diff options
context:
space:
mode:
authorferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-01-14 09:59:17 +0000
committerferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-01-14 09:59:17 +0000
commitec84f9ec53fc1c8764d3dd1bb587571deff51819 (patch)
tree01f779d85621132b5657a862a2931e03790b52f1 /Adobe_SigHandler/Adobe.PDF-AS-SigHandler
parent7ecb528235dc3e1246ee6d60472df3a1236f69e4 (diff)
downloadpdf-as-3-ec84f9ec53fc1c8764d3dd1bb587571deff51819.tar.gz
pdf-as-3-ec84f9ec53fc1c8764d3dd1bb587571deff51819.tar.bz2
pdf-as-3-ec84f9ec53fc1c8764d3dd1bb587571deff51819.zip
improved mutli signature handling (url-map)
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@548 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'Adobe_SigHandler/Adobe.PDF-AS-SigHandler')
-rw-r--r--Adobe_SigHandler/Adobe.PDF-AS-SigHandler/sources/PDF-AS.SigHandler.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/Adobe_SigHandler/Adobe.PDF-AS-SigHandler/sources/PDF-AS.SigHandler.cpp b/Adobe_SigHandler/Adobe.PDF-AS-SigHandler/sources/PDF-AS.SigHandler.cpp
index b0e7b81..7c4c4ff 100644
--- a/Adobe_SigHandler/Adobe.PDF-AS-SigHandler/sources/PDF-AS.SigHandler.cpp
+++ b/Adobe_SigHandler/Adobe.PDF-AS-SigHandler/sources/PDF-AS.SigHandler.cpp
@@ -8,7 +8,7 @@
#include "FormsHFT.h"
#include <string>
#include <ctime>
-
+#include <map>
using namespace std;
@@ -19,9 +19,10 @@ HFT gPubSecHFT = NULL;
boolean gSigHandlerInitialized = false;
clock_t openStamp = 0;
clock_t validatedStamp = 0;
+map<string, bool> verifyUrls;
#define OPEN_INTERVAL 2000 // ms. no validation after document was opened
-#define VALID_INTERVAL 5000 // ms. no multi signature validation
+#define VALID_INTERVAL 6000 // ms. no multi signature validation
/*-------------------------------------------------------
Custom validation Callbacks
@@ -48,9 +49,9 @@ static ACCBPROTO1 DSValidState ACCBPROTO2 DSValidateSig(PDDoc pdDoc, CosObj sigF
}
long validateDif = clock() - validatedStamp;
- if (validateDif < VALID_INTERVAL) {
- return DSSigValid;
- }
+ //if (validateDif < VALID_INTERVAL) {
+ // return DSSigValid;
+ //}
CosObj sigEntry = CosDictGet(sigAnnot, ASAtomFromString("V"));
CosObj urlObj = CosDictGet(sigEntry, ASAtomFromString("ContactInfo"));
@@ -60,6 +61,19 @@ static ACCBPROTO1 DSValidState ACCBPROTO2 DSValidateSig(PDDoc pdDoc, CosObj sigF
urlStr = CosStringValue(urlObj, &len );
}
+ if (validateDif < VALID_INTERVAL) {
+ // multi sig verify
+ //string ustr (urlStr);
+ if (verifyUrls.find(urlStr) == verifyUrls.end()) {
+ verifyUrls[urlStr] = true;
+ } else {
+ return DSSigValid;
+ }
+ } else {
+ verifyUrls.clear();
+ verifyUrls[urlStr];
+ }
+
char msg[1024];
sprintf(msg, "Dieses Dokument enthält PDF-AS Signaturen. Wollen Sie diese unter %s verifizieren?", urlStr);