diff options
Diffstat (limited to 'Adobe_SigHandler/Adobe.PDF-AS-SigHandler/sources')
-rw-r--r-- | Adobe_SigHandler/Adobe.PDF-AS-SigHandler/sources/PDF-AS.SigHandler.cpp | 24 |
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);
|