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

Show SAN extension as string not HEX #5

Closed
RufusJWB opened this issue Jan 28, 2019 · 4 comments
Closed

Show SAN extension as string not HEX #5

RufusJWB opened this issue Jan 28, 2019 · 4 comments

Comments

@RufusJWB
Copy link
Contributor

RufusJWB commented Jan 28, 2019

It would be helpful, if the SAN extension wouldn't be shown as HEX but as ASCII strings:

image

@Crypt32
Copy link
Collaborator

Crypt32 commented Jan 28, 2019

Unfortunately, it is not possible at the moment and is known limitation. SAN extension is a GeneralName which is a choice of implicitly tagged alternative names:

GeneralName ::= CHOICE 
{
  otherName              [0] IMPLICIT OtherName,
  rfc822Name             [1] IMPLICIT IA5STRING,
  dNSName                [2] IMPLICIT IA5STRING,
  x400Address            [3] IMPLICIT SeqOfAny,       --Not supported
  directoryName          [4] EXPLICIT ANY,    
  ediPartyName           [5] IMPLICIT SeqOfAny,
  uniformResourceLocator [6] IMPLICIT IA5STRING,
  iPAddress              [7] IMPLICIT OCTETSTRING,
  registeredID           [8] IMPLICIT EncodedObjectID --Not supported
}

ASN.1 editor decodes arbitrary data and do not attempt to parse complex data types. That is, when decoding the SAN extension, the tool has no idea what it is decoding and can't decode implicitly tagged types, because context is unknown. In order to properly represent SAN choice, the tool must have a context and use complex heurestics and predefined tables of known X.509 types. For example, authority key identifier extension uses implicitly tagged choice. But it can be a hash of issuer public key, which is a hex string, not encoded ASCII characters.

The only exception was made for uniformResourceLocator because I never faced so large choice in X.509 apart from URI alternative name, thus I'm decoding it as text at my own risk.

@RufusJWB
Copy link
Contributor Author

Do I understand it correctly, that the ASN.1 editor would need to know the x509 grammar to decode the SAN extension correctly?

@ralienpp
Copy link

ralienpp commented Nov 30, 2023

@Crypt32, would it be possible to add a context menu entry called View as text?

Asn1Editor doesn't need to be extended in way that makes it capable of figuring out what data it is looking at - the decision is delegated to a human.

It would be beneficial for my use case, where I have a file open for many hours at a time - a few manual clicks aren't a burden, but the ability to see the data as text in multiple nodes would surely make my life easier.

p.s. I don't mean that this should be done specifically for the SAN extension, but to any node in the tree.

Crypt32 added a commit that referenced this issue Dec 17, 2023
…rintable text mode as long as context-specific value consist only of printable ASCII characters
Crypt32 added a commit that referenced this issue Dec 17, 2023
Crypt32 added a commit that referenced this issue Dec 17, 2023
* #5 added an ability to view and edit some context-specific types in printable text mode as long as context-specific value consist only of printable ASCII characters

* #5 do not allow text mode when value doesn't support user-friendly text and enforce Hex radiobutton

* added missing statusbar label
@Crypt32
Copy link
Collaborator

Crypt32 commented Dec 17, 2023

Implemented in v23.12.17

@Crypt32 Crypt32 closed this as completed Dec 17, 2023
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

3 participants