Comments (11)
Any news?
from asn1tools.
I think you are right about length encoding with uper, but there's exactly difference when encoding UTF8String compared to marben, I paste here wish you can help me find out why, the bold is difference.
from marben:
d6 93 39 8b 26 6d 1a b6 6e e1
cb 0a d2 67 31 64 cd a3 56 cd
dc 39 60 c5 93 36 8d 5b 37 70
e5 81 93 06 2e 16 b1 64 b5 8b
04 0c 5a ba 62 cd d3 06 08 22
d3 a8 38 62 64 66 68 6a 6c 6e
70 72 60 62 64 66 68 6a 6c 6e
70 72 60 62 64 66 68 6a 6c 6e
71 4c bd b2 f2 f3 d3 46 9d d9
d0 69 e6 83 76 fe 88 37 eb
from asn1tools:
d6 93 39 8b 26 6d 1a b6 6e e1
cb 0a d2 67 31 64 cd a3 56 cd
dc 39 60 c5 93 36 8d 5b 37 70
e5 **85d**93 06 2e 16 b1 64 b5 8b
04 0c 5a ba 62 cd d3 06 08 22
d3 a8 38 62 64 66 68 6a 6c 6e
70 72 60 62 64 66 68 6a 6c 6e
70 72 60 62 64 66 68 6a 6c 6e
71 4c bd b2 f2 f3 d3 46 9d d9
d0 69 e6 83 76 fe 88 37 eb **0**
and .asn specification is
UUID ::= SEQUENCE {
uuid PrintableString(SIZE(36)) -- Constrained to an UUID
}
OpOTAAssignmentNotification-Notification ::= SEQUENCE {
installationorder UUID,
timestamp ISOTimeStamp,
newstatus UTF8String(SIZE(2..28)),
reason PrintableString(SIZE(0..22)) OPTIONAL
}
ISOTimeStamp ::= SEQUENCE {
timestamp PrintableString(SIZE(0..24))
}
input data is
UUID = {'uuid': 'VIN1234567890VIN12345678901234567890'}
ISOTimeStamp = {'timestamp': '2018-12-10 15:13:00 EST'}
OpOTAAssignmentNotification_Notification = {'installationorder': UUID,
'timestamp': ISOTimeStamp,
'newstatus': u'1234567890123456789012345678',
'reason': 'everything is not ok'}
Finally, happy Christmas Day!
from asn1tools.
This might be fixed on the master branch. Give it a try and I can create a new release if it works.
from asn1tools.
hello Eric, I just tested on master branch,and no error when check_constraints=True,but asn1tools seem like using per style to encode length.e.g.
uuid::=UTF8String(Size(1..36)), asn1tools don't minus 1 when encoding length, and the encoded result can't be decoded by marben.
Do I think right?
from asn1tools.
Please supply data I can use to reproduce the issue
from asn1tools.
I think Marben is wrong. Size constraints are ignored by PER and UPER for UTF8String as its not a known-multiplier character string type.
See 27.6 in https://www.itu.int/ITU-T/studygroups/com17/languages/X.691-0207.pdf.
from asn1tools.
The new release is called 0.138.0, available on PyPI.
from asn1tools.
ok, thank you for new release, about UTF8String,I should check again.
from asn1tools.
I don't have time to troubleshoot this in detail, but I think asn1tools is correct, and Marben wrong.
from asn1tools.
sorry for interrupting you,but it's because asn specification inconsistent which leads to different encode result.
from asn1tools.
You can give http://asn1-playground.oss.com/ a try. It's pretty helpful troubleshooting bad encodings.
from asn1tools.
Related Issues (20)
- encode_message() fails to validate ASN.1 BIT STRING SIZE constraints
- how to parse the "CONTAING SEQUENCE" msg immediately HOT 1
- Compile nrppa using PER fail
- How to view encoded values
- Test failures with pyparsing 3.1.1 HOT 4
- oer c code generation fails when addition contains a sequence with enums (type error) HOT 2
- decoding erros HOT 9
- SEQUENCE OF has no maximum length HOT 1
- parser claims "syntax error" for `SEQUENCE (SIZE (32)) OF OCTET STRING (SIZE (6))` with `DEFAULT` HOT 4
- How to encode a complex json object ?
- ParseError when compile the ASN1 schema file
- OpenType does not exist for xer
- Changing `numeric_enums` parameter has no effect when `cache_dir` is set and cache previously created
- Example for ETSI CAM-ASN1 to Json Command
- Decode hangs when decoding the output of encode if ASN.1 contains a SEQUENCE of CHOICE of SEQUENCE
- Hello eerimoq
- Error Decoding Indefinite Length ASN.1 Elements Containing Extension Marker HOT 1
- Type 'SetupRelease' not found in module 'EUTRA-RRC-Definitions'.
- UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 3: ordinal not in range(128)
- License of generated code 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 asn1tools.