Giter VIP home page Giter VIP logo

Comments (11)

eerimoq avatar eerimoq commented on July 22, 2024 1

Any news?

from asn1tools.

xusunny avatar xusunny commented on July 22, 2024 1

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.

eerimoq avatar eerimoq commented on July 22, 2024

This might be fixed on the master branch. Give it a try and I can create a new release if it works.

from asn1tools.

xusunny avatar xusunny commented on July 22, 2024

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.

eerimoq avatar eerimoq commented on July 22, 2024

Please supply data I can use to reproduce the issue

from asn1tools.

eerimoq avatar eerimoq commented on July 22, 2024

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.

eerimoq avatar eerimoq commented on July 22, 2024

The new release is called 0.138.0, available on PyPI.

from asn1tools.

xusunny avatar xusunny commented on July 22, 2024

ok, thank you for new release, about UTF8String,I should check again.

from asn1tools.

eerimoq avatar eerimoq commented on July 22, 2024

I don't have time to troubleshoot this in detail, but I think asn1tools is correct, and Marben wrong.

from asn1tools.

xusunny avatar xusunny commented on July 22, 2024

sorry for interrupting you,but it's because asn specification inconsistent which leads to different encode result.

from asn1tools.

eerimoq avatar eerimoq commented on July 22, 2024

You can give http://asn1-playground.oss.com/ a try. It's pretty helpful troubleshooting bad encodings.

from asn1tools.

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.