You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Martin Goldhahn (JIRA)" <ji...@apache.org> on 2019/08/07 20:40:00 UTC

[jira] [Updated] (DIRKRB-735) Cannot decode Asn1 enumerated type

     [ https://issues.apache.org/jira/browse/DIRKRB-735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Goldhahn updated DIRKRB-735:
-----------------------------------
    Description: 
The following code fails with a NPE
{code:java}
// code placeholder
Asn1Dumper dumper = new Asn1Dumper();
dumper.decodeAndDump(Base64.getMimeDecoder().decode("oRQwEqADCgEBoQsGCSqGSIb3EgECAg=="));
System.out.println(dumper.output());

{code}
The reason being that Asn1Simple.createSimple(int) returns null for enumeration and Asn1Converter.convertAsSimple(Asn1ParseResult) does not check if the return value of the function is null.

Either Asn1Converter.convertAsSimple(Asn1ParseResult) handles null values or there should be a new Asn1Enumerate subclass, that handles enumerations for decoding.

  was:
The following code fails with a NPE
{code:java}
// code placeholder
Asn1Dumper dumper = new Asn1Dumper();
dumper.decodeAndDump(Base64.getMimeDecoder().decode("oRQwEqADCgEBoQsGCSqGSIb3EgECAg=="));
System.out.println(dumper.output());

{code}
The reason being that Asn1Simple.createSimple(int) returns null for enumeration and Asn1Converter.convertAsSimple(Asn1ParseResult) does not check if the return value of the function is null.



Either Asn1Converter.convertAsSimple(Asn1ParseResult) or there should be a new Asn1Enumerate subclass, that handles enumerations for decoding.


> Cannot decode Asn1 enumerated type
> ----------------------------------
>
>                 Key: DIRKRB-735
>                 URL: https://issues.apache.org/jira/browse/DIRKRB-735
>             Project: Directory Kerberos
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Martin Goldhahn
>            Priority: Minor
>
> The following code fails with a NPE
> {code:java}
> // code placeholder
> Asn1Dumper dumper = new Asn1Dumper();
> dumper.decodeAndDump(Base64.getMimeDecoder().decode("oRQwEqADCgEBoQsGCSqGSIb3EgECAg=="));
> System.out.println(dumper.output());
> {code}
> The reason being that Asn1Simple.createSimple(int) returns null for enumeration and Asn1Converter.convertAsSimple(Asn1ParseResult) does not check if the return value of the function is null.
> Either Asn1Converter.convertAsSimple(Asn1ParseResult) handles null values or there should be a new Asn1Enumerate subclass, that handles enumerations for decoding.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org