Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero-length OCTET STRING DerValue cannot be converted to byte[] #3196

Open
pki-bot opened this issue Oct 3, 2020 · 2 comments
Open

zero-length OCTET STRING DerValue cannot be converted to byte[] #3196

pki-bot opened this issue Oct 3, 2020 · 2 comments

Comments

@pki-bot
Copy link

pki-bot commented Oct 3, 2020

This issue was migrated from Pagure Issue #3079. Originally filed by ftweedal (@frasertweedale) on 2018-11-11 21:03:50:


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();
        }
    }
}
@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from ftweedal (@frasertweedale) at 2018-11-11 22:10:36

PR: #103

@pki-bot
Copy link
Author

pki-bot commented Oct 3, 2020

Comment from ftweedal (@frasertweedale) at 2018-11-11 22:10:38

Metadata Update from @frasertweedale:

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant