Giter VIP home page Giter VIP logo

Comments (17)

kimgr avatar kimgr commented on August 28, 2024 1

@SuperXiaoxiong I'm glad to hear! Was this the only change you had to make to parse the Kerberos ASN.1? If so, it sounds like a priority to improve asn1ate support for constrained integers.

from asn1ate.

kimgr avatar kimgr commented on August 28, 2024

I haven't seen the GeneralString (IA5String) constraint syntax before, and I'm not sure what it means. Do you know? If you're just interested in getting this to work on your end, I think you can remove the (IA5String) part, it appears it was added to constrain the range of allowed strings.

from asn1ate.

gollda avatar gollda commented on August 28, 2024

I removed (IA5String) part, but still doesn't work correctly.

from asn1ate.

kimgr avatar kimgr commented on August 28, 2024

I think you need to be more specific for me to be able to help. It's quite possible that the Kerberos spec contains more constructs that asn1ate doesn't support.

from asn1ate.

gollda avatar gollda commented on August 28, 2024

I don't know. I'm just used official ASN.1 notation from Apache wiki. I'd love to tell you where is wrong but I don't know. Output from console is:
Traceback (most recent call last):
File "pyasn1gen.py", line 628, in
sys.exit(main())
File "pyasn1gen.py", line 606, in main
parse_tree = parser.parse_asn1(asn1def)
File "/usr/local/lib/python2.7/dist-packages/asn1ate/parser.py", line 40, in parse_asn1
parse_result = grammar.parseString(asn1_definition)
File "/usr/local/lib/python2.7/dist-packages/pyparsing.py", line 1613, in parseString
raise exc
pyparsing.ParseException: Expected "END" (at char 4113), (line:132, col:30)

thank you for your patience :)

from asn1ate.

kimgr avatar kimgr commented on August 28, 2024

Here's a clue:

(line:132, col:30)

If you know your way around ASN.1, you may be able to change it to something simpler.

I wish asn1ate's parser error reporting was better, but I haven't investigated how to improve it.

from asn1ate.

SuperXiaoxiong avatar SuperXiaoxiong commented on August 28, 2024

So, I wonder how you solve the problem @gollda ,I also want to translate ASN.1 grammar of Kerberos from, Could you give me some tips

from asn1ate.

SuperXiaoxiong avatar SuperXiaoxiong commented on August 28, 2024

I think this ASN.1 file may be too long for pyparsing to handler this @kimgr

from asn1ate.

gollda avatar gollda commented on August 28, 2024

Hi, it is reaaaaally long time ago, so now I can't remember on ti. Anyway I stoped working on this beacause it was my subject of my diploma thesis and my tutor leave the company where I worked on this. So I didn't have anybody who lead me.

from asn1ate.

SuperXiaoxiong avatar SuperXiaoxiong commented on August 28, 2024

Oh my god! Anyway ,thank you very much

from asn1ate.

kimgr avatar kimgr commented on August 28, 2024

I don't think it's size-related, there's probably just some ASN.1 syntax in the file that isn't supported by asn1ate. I know most Kerberos specs use advanced ASN.1 features, so they're not easily translatable. If you can be more specific about what's going wrong (what does the ASN.1 look like, what does asn1ate say, what did you try, etc), I might be able to suggest a workaround.

from asn1ate.

SuperXiaoxiong avatar SuperXiaoxiong commented on August 28, 2024

@kimgr Apologize for being late, I have met the same questions with gollda. When I remove the (IA5String) part, there is an error in (line:132, col:30)

132   KDC-REQ         ::= SEQUENCE {
133              -- NOTE: first tag is [1], not [0]
134               pvno            [1] INTEGER (5) ,
135               msg-type        [2] INTEGER (10 -- AS -- | 12 -- TGS --),
136              padata          [3] SEQUENCE OF PA-DATA OPTIONAL
137                                   -- NOTE: not empty --,
138               req-body        [4] KDC-REQ-BODY
139       }

there is the source of the asn.1 https://cwiki.apache.org/confluence/display/DIRxSRVx10/Kerberos+ASN.1+codec
If there any way to help us solve the problem ,Just tell me , Thank you for the reply

from asn1ate.

SuperXiaoxiong avatar SuperXiaoxiong commented on August 28, 2024

@gollda I am so sorry for that , Could tell me your tutor's github or twitter , I am working on kerberos for a while . Congratulations on your graduation and having a good job, Thank you

from asn1ate.

kimgr avatar kimgr commented on August 28, 2024

@SuperXiaoxiong

135 msg-type [2] INTEGER (10 -- AS -- | 12 -- TGS --),

I suspect this constrained integer isn't supported by asn1ate. you can just remove the constraint and say:

msg-type [2] INTEGER,

And make sure you validate in the application layer.

from asn1ate.

SuperXiaoxiong avatar SuperXiaoxiong commented on August 28, 2024

from asn1ate.

SuperXiaoxiong avatar SuperXiaoxiong commented on August 28, 2024

Thanks, @kimgr You are right, and your work is very nice 。The problem solved while I only need to make a little adjustments , Thank you once again!

from asn1ate.

SuperXiaoxiong avatar SuperXiaoxiong commented on August 28, 2024

@kimgr (⊙o⊙)… but maybe there are some little unknown problem .
AttributeError: 'Module' object has no attribute 'resolve_tag_implicitness'
I just use another version for convience https://github.com/etingof/asn1ate.git, etingof's asn1ate ,a fork of you, It's also very nice,For your information.
but thank you anyway,Help me solve my problem. I think the support for constrained integers is the next step too.
The most important, It's very amaing to do a such a big project alone , you deserve the world's praise

Traceback (most recent call last):
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 649, in <module>
    sys.exit(main())
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 640, in main
    generate_pyasn1(module, output_file, modules)
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 523, in generate_pyasn1
    return Pyasn1Backend(sema_module, out_stream, referenced_modules).generate_c
ode()
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 145, in generate_code
    details = self.generate_definition(assignment)
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 159, in generate_definition

    return self.generate_defn(assigned_type, type_decl)
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 171, in generate_defn
    return generator(class_name, t)
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 280, in defn_collection_typ
e
    fragment.write_line('%s.componentType = %s' % (class_name, self.generate_exp
r(t.type_decl)))
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 167, in generate_expr
    return generator(t)
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 308, in inline_constructed_
type
    fragment.write_block(self.inline_component_types(t.components))
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 321, in inline_component_ty
pes
    component_exprs.append(self.generate_expr(c))
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 167, in generate_expr
    return generator(t)
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 427, in inline_component_ty
pe
    return "namedtype.NamedType('%s', %s)" % (t.identifier, self.generate_expr(t
.type_decl))
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 167, in generate_expr
    return generator(t)
  File "./asn1ate-master/asn1ate/pyasn1gen.py", line 328, in inline_tagged_type
    implicitness = self.sema_module.resolve_tag_implicitness(t.implicitness, t.t
ype_decl)
AttributeError: 'Module' object has no attribute 'resolve_tag_implicitness'

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.