Skip to content

Commit e6c926e

Browse files
Valerie Pengslowhog
Valerie Peng
authored andcommittedApr 19, 2022
8277227: Better identification of OIDs
Reviewed-by: ahgross, weijun, rhalade
1 parent e2f8ce9 commit e6c926e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/java.base/share/classes/sun/security/util/ObjectIdentifier.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ private int[] toIntArray() {
365365
if ((encoding[i] & 0x80) == 0) {
366366
// one section [fromPos..i]
367367
if (i - fromPos + 1 > 4) {
368-
BigInteger big = new BigInteger(pack(encoding,
368+
BigInteger big = new BigInteger(1, pack(encoding,
369369
fromPos, i-fromPos+1, 7, 8));
370370
if (fromPos == 0) {
371371
result[which++] = 2;
@@ -434,7 +434,7 @@ public String toString() {
434434
sb.append('.');
435435
}
436436
if (i - fromPos + 1 > 4) { // maybe big integer
437-
BigInteger big = new BigInteger(
437+
BigInteger big = new BigInteger(1,
438438
pack(encoding, fromPos, i-fromPos+1, 7, 8));
439439
if (fromPos == 0) {
440440
// first section encoded with more than 4 bytes,
@@ -688,6 +688,7 @@ private static void checkOidSize(int oidLength) throws IOException {
688688
throw new IOException("ObjectIdentifier encoded length was " +
689689
"negative: " + oidLength);
690690
}
691+
691692
if (oidLength > MAXIMUM_OID_SIZE) {
692693
throw new IOException(
693694
"ObjectIdentifier encoded length exceeds " +

0 commit comments

Comments
 (0)
Please sign in to comment.