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

Continuous OCTET STRING JER string #137

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

v0-e
Copy link

@v0-e v0-e commented Oct 10, 2023

Per X.697 (section 25.3), a JER-encoded OCTET STRING must be a JSON string with continuous hexadecimal digits.
To be a valid JSON string, the output also cannot have line breaks.
This PR fixes both of these issues.

Consider the definition TEST,

TEST ::= SEQUENCE {
   i1 INTEGER,
   os OCTET STRING,
   i2 INTEGER
}

With i1=1, os={1,2,...,32}, and i2=2, this currently encodes to,

{
"TEST":{

    "i1": 1,
    "os":
        00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
        "02 00 00 00 00 00 00 00 18 19 1A 1B 1C 1D 1E 1F"
    ,
    "i2": 2}
}

With this PR the above becomes,

{
"TEST":{

    "i1": 1,
    "os": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
    "i2": 2}
}

@mouse07410 mouse07410 merged commit 84d3a59 into mouse07410:vlm_master Oct 10, 2023
1 check passed
@v0-e v0-e deleted the whole-os branch November 30, 2023 11:51
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

Successfully merging this pull request may close these issues.

2 participants