aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/pki/cert/TbsCertificate.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/model/pki/cert/TbsCertificate.java')
-rw-r--r--src/main/model/pki/cert/TbsCertificate.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/model/pki/cert/TbsCertificate.java b/src/main/model/pki/cert/TbsCertificate.java
index 84cf0ba..26b30f4 100644
--- a/src/main/model/pki/cert/TbsCertificate.java
+++ b/src/main/model/pki/cert/TbsCertificate.java
@@ -171,7 +171,7 @@ public class TbsCertificate extends ASN1Object {
} else {
// Enforce the extensions tag - nothing else should be here.
if (Integer.compareUnsigned(getLength(), (encoded.getIndex() - i)) != 0) {
- new Tag(encoded).enforce(new Tag(TagClass.CONTEXT_SPECIFIC, true, 3));
+ throw new ParseException("Unexpected objects after.");
}
this.extensions = null;
}
@@ -204,9 +204,7 @@ public class TbsCertificate extends ASN1Object {
*/
private void enforceVersion() throws ParseException {
if (version != null
- && (version.getLong() != VERSION_V1
- && version.getLong() != VERSION_V2
- && version.getLong() != VERSION_V3)) {
+ && (version.getLong() < VERSION_V1 || version.getLong() > VERSION_V3)) {
throw new ParseException("Illegal certificate version: " + version.getLong());
}
if (extensions != null && (version == null || version.getLong() != VERSION_V3)) {