Closed jet-mark closed 11 months ago
@jet-mark did you have a chance to try decoding what's ASN1C encodes with your patch, against NOKALVA OSS playground https://asn1.io/asn1playground/ ? That would be the final validation of your patch, I think...?
from my testing, the decode works after encoding (I have a unit test that encodes the structure, decodes the output, and then checks input vs output).
I will check out the playground soon - and update when I have done.
@jet-mark please feel free to add your unit test to this repo as well.
Maybe, you'd like to create a PR?
@mouse07410 I notice that you've committed my suggested diffs. Thank you.
I have created a Unit-Test that identifies the original issue (and works with the fix in place) using the test-c-compiler infrastructure already in place (the relevant UT didn't actually do anything previously). Unfortunately, I don't appear to be able to push a local branch, and so cannot create a PR for it.
So, I'm attaching the logs and diffs to this comment in case you want to update the tests. ut_logs.txt choice-59.diffs.txt
(Unfortunately I still haven't managed to check with the playground yet)
@jet-mark I assume all your checks and tests pass now, so closing this issue.
Please feel free to re-open, if you think it's still unresolved.
When attempting to encode an extension that is an open-type, the output is invalid. No error is raised during encode; but the decode of the buffer fails.
An example of the failed item is the actionDefinition-Format5 item specified by:
Taken from: https://gitlab.eurecom.fr/mosaic5g/flexric/-/blob/master/src/sm/kpm_sm_v2.02/ie/e2sm-kpmv2.02.asn1?ref_type=heads#L207
Checking the encode/decode functionality in constr_CHOICE_aper.c, they were not mirror images of each other - and by making them almost mirror images, it works. I am using these diffs, and it appears to work: