Comments (17)
@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.
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.
I removed (IA5String) part, but still doesn't work correctly.
from asn1ate.
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.
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.
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.
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.
I think this ASN.1 file may be too long for pyparsing to handler this @kimgr
from asn1ate.
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.
Oh my god! Anyway ,thank you very much
from asn1ate.
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.
@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.
@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.
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.
from asn1ate.
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.
@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)
- output missing size constaint HOT 6
- multi-module asn files don't work HOT 8
- default vales for enums need to be strings HOT 4
- Support for CLASS ... WITH SYNTAX ... HOT 6
- to support Brace value notation assignment HOT 4
- Emits invalid python for `BOOLEAN true` HOT 1
- Failure parsing minimal example with VisibleString HOT 3
- restricted_integer_type range constraint HOT 2
- Parsing Error: pyparsing.ParseException: Expected "DEFINITIONS" HOT 5
- resolve imported type declarations HOT 1
- KeyError: if the type is in another module. HOT 2
- single value and range constraint with both '..' and '|' HOT 3
- KeyError EXTERNAL HOT 6
- asn1ate generates incorrect code for DefaultedNamedType
- Feauture Request for 0.6.1: Parsing DEFAULT with structure HOT 1
- interdependent asn1 files to py files HOT 2
- asn1ate needs wheels HOT 9
- PyParsing issue (and work-around) HOT 4
- ParseException: Expected Keyword 'DEFINITIONS', found 'AUTOMATIC' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asn1ate.