Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Dynamic compilation of an ASN.1 object #2

Open
H21lab opened this issue Nov 16, 2017 · 4 comments
Open

Dynamic compilation of an ASN.1 object #2

H21lab opened this issue Nov 16, 2017 · 4 comments

Comments

@H21lab
Copy link
Contributor

H21lab commented Nov 16, 2017

Is there a way of doing Dynamic ASN.1 compilation in pycrate in similar way as in libmich (in libmich it was by using inline)? Some example would be very useful. Thank you

@mitshell
Copy link
Contributor

mitshell commented Nov 16, 2017

No, this is not supported (yet). Things on the ASN.1 side changed quite a lot, compared to libmich. In particular, all objects compiled are kept in their module (e.g. in GLOBAL.MOD['SomeModule']).

I may be able to make a specific part / function in the ASN.1 runtime (that import the whole ASN.1 compiler) and compile some object defined within a Python string into an object into the GLOBAL.MOD['_USER_'] special module.
Would that help ?

@H21lab
Copy link
Contributor Author

H21lab commented Nov 17, 2017

Yes, I think this would help. To me this is useful for importing only selected objects from ASN.1 files instead of compiling the whole ASN.1 files. By this the light scripts could be created without too much dependencies.

@mitshell
Copy link
Contributor

As a workaround, you can also strip an ASN.1 definition with only the definitions you need, and compile it into a Python file. You will then just need to load this Python file to get the objects you want.

I have not much time yet to work on the ASN.1 compiler side, unfortunately. Hence, this issue may stay open for few months.

@H21lab
Copy link
Contributor Author

H21lab commented Nov 17, 2017

Thank you for the feedback. I made workaround in this way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants