Code Monkey home page Code Monkey logo

Comments (10)

eerimoq avatar eerimoq commented on July 29, 2024

Please attach EtsiTs102941MessagesItss.asn to make it possible to easily reproduce the issue.

from asn1tools.

Bujko avatar Bujko commented on July 29, 2024

Here it is with the key included.

Issue.zip

from asn1tools.

eerimoq avatar eerimoq commented on July 29, 2024

The problem is that a floating point number is not allowed encoding an integer. Replace generation_time = calendar.timegm(time.gmtime())-time.mktime(t) with generation_time = int(calendar.timegm(time.gmtime())-time.mktime(t)) and the example works.

from asn1tools.

eerimoq avatar eerimoq commented on July 29, 2024

The syntax in this specification is unlike anything I've seen before. I'll do my best adding support for the missing functionality.

from asn1tools.

Bujko avatar Bujko commented on July 29, 2024

Thank you so much for the fast response. It is working correctli.

from asn1tools.

eerimoq avatar eerimoq commented on July 29, 2024

Do you have the unmodified ASN.1-specification as well? I could use it as a test case when inplementing support for more ASN.1 syntax.

from asn1tools.

Bujko avatar Bujko commented on July 29, 2024

Here are the files.

With pyasn1 I can not use this definitions (it failed on "WITH COMPONENTS" and some other specific parts). Also the import export part is not working. With pyasn1 and I could not figure out how can I do this with your library.

Hope that it is helping you and I cut of every modifications.
I think that the EtsiTs103097 and the Ieee files will be enough because the EtsiTs102941 asn file includes more than one asn1 architecture.

I am working with the Ieee 1609.2 (2016) and the EtsiTs103097 v 1.3.1 standards.

These defines COER encoding.

I have try to find out, based on the documentation, that what kind of OER do you use.
Is it BASIC or CANONICAL OER?

If I can help you with anything let me know about it.

Iee1609dot2_asn1_files.zip

from asn1tools.

eerimoq avatar eerimoq commented on July 29, 2024

Thank you very much for the files! I'll have a look at them and likely improve the parser soon.

The OER codec in asn1tools is implementing the BASIC version of the encoding. I'm continuously improving asn1tools and adding more encodings. COER is likely to be added in the future, along with CER. Feel free to start the implementation yourself and we can implement it together. We can probably reuse some of the OER implementation already in place in asn1tools/codecs/oer.py.

Adding support for more syntax in the parser is quite challenging as the parser implementation is very hard to understand. I get confused every time I open that file. I wouldn't recommend you to help out in that file.

from asn1tools.

Bujko avatar Bujko commented on July 29, 2024

I have created IEEE 1609dot2 certificate and I passed it to a java code. It seems to be correct COER encoded.

from asn1tools.

eerimoq avatar eerimoq commented on July 29, 2024

I fixed a bug not allowing EXPORTS ALL;, and added support for types in constraints. Now only a few manual modifications have to be done to make IEEE 1609dot2 compile.

Replace this section with:

NinetyDegreeInt ::= INTEGER {
    min (-900000000),
    max (900000000),
    unknown (900000001)
} (-900000000..900000001)

KnownLatitude ::= NinetyDegreeInt (-900000000..900000000)

UnknownLatitude ::= NinetyDegreeInt (900000001) -- Minus 90 deg to +90
                                              -- deg in microdegree
                                              -- intervals

OneEightyDegreeInt ::= INTEGER {
    min (-1799999999),
    max (1800000000),
    unknown (1800000001)
} (-1799999999..1800000001)

KnownLongitude ::= OneEightyDegreeInt (-1799999999..1800000000)

UnknownLongitude ::= OneEightyDegreeInt (1800000001)

Here is a test that does similar encoding as in your example: https://github.com/eerimoq/asn1tools/blob/master/tests/test_oer.py#L685-L751

from asn1tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.