Giter VIP home page Giter VIP logo

Comments (4)

kimgr avatar kimgr commented on July 24, 2024

The problem is the last component:

sqnInit SEQUENCE (SIZE (3)) OF OCTET STRING (SIZE (6)) DEFAULT {'000000000000'H, '000000000000'H, '000000000000'H }

specifically the curly-brace form on DEFAULT.

We don't yet seem to handle the SequenceOfValue production -- I'm not entirely sure where to put it.

from asn1ate.

kgalhabbo avatar kgalhabbo commented on July 24, 2024

Thank you for your answer. What would you therefore recommend?

from asn1ate.

kimgr avatar kimgr commented on July 24, 2024

I think, and this is a big maybe, that you can omit the DEFAULT clause
entirely.

If I recall correctly, DEFAULTs are handled encode-time, so if you're
decoding, you'll always get a full value. If you're encoding, you'll have
to provide the value explicitly.

That might work.

  • Kim

On Thu, Dec 10, 2015 at 9:11 AM, kgalhabbo [email protected] wrote:

Thank you for your answer. What would you therefore recommend?


Reply to this email directly or view it on GitHub
#24 (comment).

from asn1ate.

kimgr avatar kimgr commented on July 24, 2024

From #26 -- this actually runs clean through the parser, but generates nonsense pyasn1 code:

         Clearance  ::=  SEQUENCE {                                          
               policyId       [0] OBJECT IDENTIFIER,
               classList      [1] ClassList DEFAULT {unclassified},
               securityCategories [2] SET OF SecurityCategory  OPTIONAL
         }

Output:

# the subtype(value={unclassified}) part is not valid Python
namedtype.DefaultedNamedType('classList', ClassList().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)).subtype(value={unclassified})),

from asn1ate.

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.