Skip to content

Commit 3c4e824

Browse files
committed
8249783: Simplify DerValue and DerInputStream
Reviewed-by: valeriep
1 parent 9230c2a commit 3c4e824

File tree

8 files changed

+833
-1467
lines changed

8 files changed

+833
-1467
lines changed

src/java.base/share/classes/sun/security/util/DerIndefLenConverter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,19 +372,18 @@ byte[] convertBytes(byte[] indefData) throws IOException {
372372
* This may block.
373373
*
374374
* @param in the input stream with tag and lenByte already read
375-
* @param lenByte the length of the length field to remember
376375
* @param tag the tag to remember
377376
* @return a DER byte array
378377
* @throws IOException if not all indef len BER
379378
* can be resolved or another I/O error happens
380379
*/
381-
public static byte[] convertStream(InputStream in, byte lenByte, byte tag)
380+
public static byte[] convertStream(InputStream in, byte tag)
382381
throws IOException {
383382
int offset = 2; // for tag and length bytes
384383
int readLen = in.available();
385384
byte[] indefData = new byte[readLen + offset];
386385
indefData[0] = tag;
387-
indefData[1] = lenByte;
386+
indefData[1] = (byte)0x80;
388387
while (true) {
389388
int bytesRead = in.readNBytes(indefData, offset, readLen);
390389
if (bytesRead != readLen) {

0 commit comments

Comments
 (0)