Skip to content

Commit e50a7cc

Browse files
committed
extended wrong encoding override to deal with github #1639
1 parent 432d431 commit e50a7cc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

core/src/main/java/org/bouncycastle/asn1/ASN1RelativeOID.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ static ASN1RelativeOID createPrimitive(byte[] contents, boolean clone)
246246

247247
static boolean isValidContents(byte[] contents)
248248
{
249+
if (Properties.isOverrideSet("org.bouncycastle.asn1.allow_wrong_oid_enc"))
250+
{
251+
return true;
252+
}
253+
249254
if (contents.length < 1)
250255
{
251256
return false;
@@ -256,10 +261,7 @@ static boolean isValidContents(byte[] contents)
256261
{
257262
if (subIDStart && (contents[i] & 0xff) == 0x80)
258263
{
259-
if (!Properties.isOverrideSet("org.bouncycastle.asn1.allow_wrong_oid_enc"))
260-
{
261-
return false;
262-
}
264+
return false;
263265
}
264266

265267
subIDStart = (contents[i] & 0x80) == 0;

0 commit comments

Comments
 (0)