diff options
author | Adam Vartanian <flooey@google.com> | 2019-02-14 14:42:19 +0000 |
---|---|---|
committer | Adam Vartanian <flooey@google.com> | 2019-02-18 10:18:52 +0000 |
commit | 27254450f01adef5f4bb25a648d42eeacc14c438 (patch) | |
tree | 90eb8fa6c24a44780cc4c4be2d50555f955d29f4 /bcprov/src/main/java/org/bouncycastle/asn1/ASN1Sequence.java | |
parent | bdfb209e7c1139588c82722a809c46667775a314 (diff) | |
parent | 1b335c5efbcf241b55345622fe9978047c3fdf9e (diff) | |
download | bouncycastle-27254450f01adef5f4bb25a648d42eeacc14c438.tar.gz |
Update Bouncy Castle to 1.61
Test: cts -m CtsLibcoreTestCases
Test: cts -m CtsLibcoreWycheproofBCTestCases
Change-Id: Ifcd182a8537439b945aedf80741bd51cbce37e49
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/asn1/ASN1Sequence.java')
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/asn1/ASN1Sequence.java | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/ASN1Sequence.java b/bcprov/src/main/java/org/bouncycastle/asn1/ASN1Sequence.java index 0ca4d8f5..ea6f3d87 100644 --- a/bcprov/src/main/java/org/bouncycastle/asn1/ASN1Sequence.java +++ b/bcprov/src/main/java/org/bouncycastle/asn1/ASN1Sequence.java @@ -50,9 +50,11 @@ import org.bouncycastle.util.Arrays; * * <p><b>11: Restrictions on BER employed by both CER and DER</b></p> * <p><b>11.5 Set and sequence components with default value</b></p> + * <p> * The encoding of a set value or sequence value shall not include * an encoding for any component value which is equal to * its default value. + * </p> */ public abstract class ASN1Sequence extends ASN1Primitive @@ -103,7 +105,7 @@ public abstract class ASN1Sequence } /** - * Return an ASN1 sequence from a tagged object. There is a special + * Return an ASN1 SEQUENCE from a tagged object. There is a special * case here, if an object appears to have been explicitly tagged on * reading but we were expecting it to be implicitly tagged in the * normal course of events it indicates that we lost the surrounding @@ -134,6 +136,8 @@ public abstract class ASN1Sequence } else { + ASN1Primitive o = obj.getObject(); + // // constructed object which appears to be explicitly tagged // when it should be implicit means we have to add the @@ -143,18 +147,18 @@ public abstract class ASN1Sequence { if (obj instanceof BERTaggedObject) { - return new BERSequence(obj.getObject()); + return new BERSequence(o); } else { - return new DLSequence(obj.getObject()); + return new DLSequence(o); } } else { - if (obj.getObject() instanceof ASN1Sequence) + if (o instanceof ASN1Sequence) { - return (ASN1Sequence)obj.getObject(); + return (ASN1Sequence)o; } } } @@ -163,14 +167,14 @@ public abstract class ASN1Sequence } /** - * Create an empty sequence + * Create an empty SEQUENCE */ protected ASN1Sequence() { } /** - * Create a sequence containing one object + * Create a SEQUENCE containing one object. * @param obj the object to be put in the SEQUENCE. */ protected ASN1Sequence( @@ -180,8 +184,8 @@ public abstract class ASN1Sequence } /** - * Create a sequence containing a vector of objects. - * @param v the vector of objects to be put in the SEQUENCE + * Create a SEQUENCE containing a vector of objects. + * @param v the vector of objects to be put in the SEQUENCE. */ protected ASN1Sequence( ASN1EncodableVector v) @@ -192,8 +196,9 @@ public abstract class ASN1Sequence } } - /* - * Create a sequence containing a vector of objects. + /** + * Create a SEQUENCE containing an array of objects. + * @param array the array of objects to be put in the SEQUENCE. */ protected ASN1Sequence( ASN1Encodable[] array) |