diff options
author | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2009-12-02 18:06:58 +0000 |
---|---|---|
committer | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2009-12-02 18:06:58 +0000 |
commit | 8d5c38a34858f66a30d14a5794c746c6e66278bc (patch) | |
tree | 0dff04efb59495f3559df8138aff07c2bd3adeca /src/main/java/at | |
parent | 6c27b990ffb2dcbba856a35f78a50bec0079aa30 (diff) | |
download | pdf-as-3-8d5c38a34858f66a30d14a5794c746c6e66278bc.tar.gz pdf-as-3-8d5c38a34858f66a30d14a5794c746c6e66278bc.tar.bz2 pdf-as-3-8d5c38a34858f66a30d14a5794c746c6e66278bc.zip |
Rejecting unknown /replaces names upon verification of binary signatures
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@481 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java | 2 | ||||
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java index d903c9b..857fc09 100644 --- a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java +++ b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java @@ -43,6 +43,8 @@ public final class ErrorCode public static final int MODIFIED_AFTER_SIGNATION = 316;
public static final int NON_BINARY_SIGNATURES_PRESENT = 317;
+
+ public static final int UNSUPPORTED_REPLACES_NAME = 318;
public static final int SIGNATURE_VERIFICATION_NOT_SUPPORTED = 371;
public static final int INVALID_SIGNING_TIME = 372;
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java b/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java index 9ca2246..46dbb40 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java @@ -309,6 +309,10 @@ public class BinaryVerificator_1_0_0 implements Verificator ReplaceInfo ri = (ReplaceInfo) rit.next();
String type = SignatureTypes.convertBrevToType(ri.brev);
+
+ if (type == null) {
+ throw new PresentableException(ErrorCode.UNSUPPORTED_REPLACES_NAME, "Unsupported /replaces name.");
+ }
// signature_object.setSigValue(ri.type, ri.value);
if (type.equals(SignatureTypes.SIG_DATE))
|