question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Including uninitialized, optional, SetOf?

See original GitHub issue

Hi,

After https://github.com/etingof/pyasn1/commit/6fa0e312ea80713983b1a3c1e4529e7452b0e0fe I observe that an uninitialized, and optional, SetOf is being included in the encoded data.

In my case it’s a PrivateKeyInfo structure (https://github.com/etingof/pyasn1-modules/blob/master/pyasn1_modules/rfc5208.py#L49) and before the change the attributes was not being included:

    0:d=0  hl=4 l=1213 cons: SEQUENCE          
    4:d=1  hl=2 l=   1 prim:  INTEGER           :00
    7:d=1  hl=2 l=  13 cons:  SEQUENCE          
    9:d=2  hl=2 l=   9 prim:   OBJECT            :rsaEncryption
   20:d=2  hl=2 l=   0 prim:   NULL              
   22:d=1  hl=4 l=1191 prim:  OCTET STRING      [HEX DUMP]:308204A3...

But after they are:

    0:d=0  hl=4 l=1215 cons: SEQUENCE          
    4:d=1  hl=2 l=   1 prim:  INTEGER           :00
    7:d=1  hl=2 l=  13 cons:  SEQUENCE          
    9:d=2  hl=2 l=   9 prim:   OBJECT            :rsaEncryption
   20:d=2  hl=2 l=   0 prim:   NULL              
   22:d=1  hl=4 l=1191 prim:  OCTET STRING      [HEX DUMP]:308204A...
 1217:d=1  hl=2 l=   0 cons:  cont [ 0 ]  

I can get rid of it if I include attributes with an empty attribute, but it seems weird to me that I have to.

Is this how it’s supposed to be? Thanks.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Header <boost/optional/optional.hpp> - Boost C++ Libraries
A formally uninitialized optional object has conceptually no value at all and ... an optional<T> extends such a set of values with a...
Read more >
How to get around GCC '*((void*)& b +4)' may be used ...
This is valid behavior for an optional. 'a != b' Should be true if both optionals are uninitialized. So this should be valid...
Read more >
Boost.Optional
Since the purpose of optional is to allow us to use objects with a formal uninitialized additional state, the interface could try to...
Read more >
When to use boost::Optional? - Tech Study Blog
when a variable is declared as optional and no initial value is given, the variable is formally uninitialized. A formally uninitialized optional ......
Read more >
Better Uninitialized Warnings
Produce the most precise warnings possible. Ideally, when more optimisations are used, more false positives are detected and not warned. This ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found