Skip to content

Commit

Permalink
github bcgit#959 corrected order of check for PRIVATE tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed May 22, 2021
1 parent 286074a commit 5c3b337
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/org/bouncycastle/asn1/ASN1InputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ public ASN1Primitive readObject()
IndefiniteLengthInputStream indIn = new IndefiniteLengthInputStream(this, limit);
ASN1StreamParser sp = new ASN1StreamParser(indIn, limit);

if ((tag & PRIVATE) == PRIVATE)
{
return new BERPrivateParser(tagNo, sp).getLoadedObject();
}

if ((tag & APPLICATION) != 0)
{
return new BERApplicationSpecificParser(tagNo, sp).getLoadedObject();
Expand All @@ -266,11 +271,6 @@ public ASN1Primitive readObject()
return new BERTaggedObjectParser(true, tagNo, sp).getLoadedObject();
}

if ((tag & PRIVATE) != 0)
{
return new BERPrivateParser(tagNo, sp).getLoadedObject();
}

// TODO There are other tags that may be constructed (e.g. BIT_STRING)
switch (tagNo)
{
Expand Down

0 comments on commit 5c3b337

Please sign in to comment.