Including uninitialized, optional, SetOf?
See original GitHub issueHi,
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:
- Created 6 years ago
- Reactions:4
- Comments:7 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ashafer01 See https://github.com/magnuswatn/pyjks/commit/3b15250a31079550cf4a73cb43547c33624dc7d6
This also works: https://github.com/magnuswatn/pyjks/commit/76f28c75b95e99b216be15c0043c3101891c983d
Any change for a update here?