Skip to content

Commit

Permalink
class cast elimination
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Oct 5, 2019
1 parent 84b475c commit 501875b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,9 @@ private static ASN1Primitive getObject(byte[] ext)
throws IOException
{
ASN1InputStream aIn = new ASN1InputStream(ext);
ASN1OctetString octs = (ASN1OctetString)aIn.readObject();
ASN1OctetString octs = ASN1OctetString.getInstance(aIn.readObject());

aIn = new ASN1InputStream(octs.getOctets());
return aIn.readObject();
return ASN1Primitive.fromByteArray(octs.getOctets());
}

protected void checkSignerCert(X509Certificate cert, List errors,
Expand Down
2 changes: 1 addition & 1 deletion pkix/src/main/java/org/bouncycastle/est/ESTService.java
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public CSRRequestResponse getCSRAttributes()
if (resp.getContentLength() != null && resp.getContentLength() > 0)
{
ASN1InputStream ain = new ASN1InputStream(resp.getInputStream());
ASN1Sequence seq = (ASN1Sequence)ain.readObject();
ASN1Sequence seq = ASN1Sequence.getInstance(ain.readObject());
response = new CSRAttributesResponse(CsrAttrs.getInstance(seq));
}
}
Expand Down

0 comments on commit 501875b

Please sign in to comment.