-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hexa Value Constraint #35
Comments
Hello Mourad, I'm having trouble seeing the bigger picture. What do you suggest asn1ate is doing wrong? Thanks! |
Sorry I did the issue too quickly. If ASN1 file define a variable with the terms : "fileID OCTET STRING (SIZE(2))" eg: fileID = '0102' or in the function ValueSizeConstraint (in constraint.py) to day : line 106 : l = len(value) in my case it correct the problem |
But it could very well be that asn1ate is producing the wrong data for pyasn1, so I don't think you should modify pyasn1. Can you create a reproducible example and run it by the pyasn1 mailing list (cc me), and maybe we can work out together where the problem is, and how it should be solved? |
oh yes I'm quite lost in files :D |
Hi Kim, In fact the probleme is not in pyasn1, i was thinking that pyasn1 was expecting an hexa like 'FF0D' but it wait for a b'\xFF\x0D', so the length in string is the double. in asn1ate, a default Value 'FF0D'H is converted to 'FF0D'H (not a pretty python syntax) when it have to be converted by b'\xFF\x0D' to be pretty regarding to pyasn1 Sorry for the confusing issue :) Mourad |
I think I understand what the problem is now, but a small, contained example ASN.1 fragment would definitely help. |
Here it is: exctracted from the SimAlliance ASN1 ApplicationInstance ::= SEQUENCE { applicationSpecificParametersC9 [PRIVATE 9] OCTET STRING, The line lifeCycleState [3] OCTET STRING (SIZE(1)) DEFAULT '07'H, define a Default value to '07'H Regards |
Thanks, just what I needed. I'll try and look into this. |
Hi guys,
found a new issue, regarding to the size constraint:
In case of a HexaString, the length have to be div by 2
file : constraint.py
function : ValueSizeConstraint
line 106 : l = len(value)/2 to count the number of OCTET
bye
Mourad
The text was updated successfully, but these errors were encountered: