#3079 zero-length OCTET STRING DerValue cannot be converted to byte[]
Closed: migrated 3 years ago by dmoluguw. Opened 5 years ago by ftweedal.

When reading a DerValue as an OCTET STRING via getOctetString(),
if the length of the OCTET STRING is zero an exception is thrown:

java.io.IOException: short read on DerValue buffer

The following program reproduces the issue:

import java.io.IOException;
import netscape.security.util.DerValue;

class DerTest {
    public static void main(String[] args) {
        byte[] bytes = { 0x04, 0x00 };
        try {
            DerValue derVal = new DerValue(bytes);
            System.out.println(derVal.getOctetString());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Metadata Update from @ftweedal:
- Custom field component adjusted to None
- Custom field feature adjusted to None
- Custom field origin adjusted to None
- Custom field proposedmilestone adjusted to None
- Custom field proposedpriority adjusted to None
- Custom field reviewer adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None

5 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/3196

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata Update from @dmoluguw:
- Issue close_status updated to: migrated
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata