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

fileinfo emits non-printable characters for "Subject name" of a digital certificate #253

Closed
s3rvac opened this issue Mar 19, 2018 · 1 comment

Comments

@s3rvac
Copy link
Member

s3rvac commented Mar 19, 2018

In the text mode, fileinfo emits non-printable characters for Subject name of a digital certificate of the attached PE file.

Input

Run

$ retdec-fileinfo --verbose FILE

where FILE is:

Output

non-printable-characters-pe-certificate

The ordinal value of the two non-printable characters is 0 (i.e. they are null bytes).

Expected output

Certificate #0
Subject name        : Microsoft Windows 20\x00\x00 Publisher
Subject organization: Microsoft Corporation
Subject             : /C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/OU=Copyright (c) 20\x00\x00 Microsoft Corp./CN=Microsoft Windows 20\x00\x00 Publisher
Issuer name         : Microsoft Windows Verification Intermediate PCA

That is, Subject name should be properly escaped, just like Subject.

Notes

  • What is interesting is that in the JSON mode, the characters get properly escaped:
    $ retdec-fileinfo --verbose --json FILE
    ...
            "subject" :
            {
                "commonName" : "Microsoft Windows 20\\x00\\x00 Publisher",
                ...
            }
    ...
    
    There seems to be an inconsistency between the escaping in the text and JSON modes.

Configuration

  • Commit: a24aabb (current master)
  • 64b Arch Linux, GCC 7.3.0, Debug build of RetDec
@metthal
Copy link
Member

metthal commented Mar 20, 2018

Fixed in 0a70ec5.

@metthal metthal closed this as completed Mar 20, 2018
metthal added a commit to avast/retdec-regression-tests that referenced this issue Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants