Comments (4)
Not completely sure how nested tags in constructions like [0] [1] INTEGER
work under IMPLICIT TAGS
?!?
Not sure it ever happens (that is, if it is permitted by ASN.1) but our DER_PIMP_
definitions may lead to strange things when they start with [1]
and are called with the [0]
as their implicit_tag
parameter.
Ignoring this for now, who knows if we'll discover a bug due to it... unlikely to ever be used though.
from quick-der.
Solved in 5056727, albeit with the remark above this one.
For what it's worth:
#define DER_PACK_rfc4511_BindRequest \
DER_PACK_ENTER | DER_TAG_APPLICATION(0), \
DER_PACK_STORE | DER_TAG_INTEGER, \
DER_PACK_rfc4511_LDAPDN, \
DER_PACK_rfc4511_AuthenticationChoice, \
DER_PACK_LEAVE
#define DER_PACK_rfc4511_AuthenticationChoice \
DER_PACK_CHOICE_BEGIN, \
DER_PACK_STORE | DER_TAG_CONTEXT(0), \
DER_PIMP_rfc4511_SaslCredentials(DER_TAG_CONTEXT(3))/* ...ASN.1 extensio
ns... */, \
DER_PACK_CHOICE_END
So it looks like the requested change has been made.
from quick-der.
An extension to the latter / closing remarks...
In addition, note how the call to DER_PIMP_rfc4511_SaslCredentials
is now parameterised with the implicit tag (which is pushed down into the definition) where it is used to replace the DER_PIMP_
definition's outer tag:
#define DER_PIMP_rfc4511_SaslCredentials(implicit_tag) \
DER_PACK_rfc4511_LDAPString, \
DER_PACK_OPTIONAL, \
DER_PACK_STORE | DER_TAG_OCTETSTRING
This, however, is wrong. It lacks the SEQUENCE
around these statements, which it should have replaced. Confusing, because we've also made initial code that used the DER_PIMP_
for COMPONENTS OF
.
This seems like good grounds to re-open the issue.
from quick-der.
We still generate
#define DER_PACK_rfc4511_AuthenticationChoice \
DER_PACK_CHOICE_BEGIN, \
DER_PACK_STORE | DER_TAG_CONTEXT(0), \
DER_PIMP_rfc4511_SaslCredentials(DER_TAG_CONTEXT(3))/* ...ASN.1 extensions... */, \
DER_PACK_CHOICE_END
so storing the [0]
tagged whatever-it-is, and we still push the implied [3]
tag into the DER_PIMP_rfc4511_SaslCredentials
, but now we generate a proper wrapper in the latter:
#define DER_PIMP_rfc4511_SaslCredentials(implicit_tag) \
DER_PACK_ENTER | implicit_tag, \
DER_PACK_rfc4511_LDAPString, \
DER_PACK_OPTIONAL, \
DER_PACK_STORE | DER_TAG_OCTETSTRING, \
DER_PACK_LEAVE
Nice.
Note that the reference from DER_PACK_
to DER_PIMP_
is where you can see IMPLICIT TAGS
. For Kerberos, you won't find that.
Something else worth noting is this distinction:
#define DER_PIMP_rfc4511_AuthenticationChoice(implicit_tag) \
DER_PACK_ENTER | implicit_tag, \
DER_PACK_CHOICE_BEGIN, \
DER_PACK_STORE | DER_TAG_CONTEXT(0), \
DER_PIMP_rfc4511_SaslCredentials(DER_TAG_CONTEXT(3))/* ...ASN.1 extensions... */, \
DER_PACK_CHOICE_END, \
DER_PACK_LEAVE
#define DER_PACK_rfc4511_AuthenticationChoice \
DER_PACK_CHOICE_BEGIN, \
DER_PACK_STORE | DER_TAG_CONTEXT(0), \
DER_PIMP_rfc4511_SaslCredentials(DER_TAG_CONTEXT(3))/* ...ASN.1 extensions... */, \
DER_PACK_CHOICE_END
Here the DER_PIMP_
has a CHOICE
on the outside, which must never take over a tag; this is probably avoided by ASN.1 but in cases where it isn't we generate the extra outside wrapper for the pushed-down implicit_tag
.
from quick-der.
Related Issues (20)
- port asn2quickder to Pythonic argument-handling
- asn2quickder doesn't support AUTOMATIC TAGS HOT 1
- 'NoneType' object has no attribute 'symbols_imported' using latest asn1ate HOT 3
- cmaking current master fails HOT 1
- Enable travis-ci HOT 5
- Constraints ignored by Quick DER
- Generate hyperlinked ASN.1 (waiting for YOU) HOT 1
- use semantic versioning HOT 3
- der_unpack() can use const for input cursor HOT 3
- On OS X shared libraries have .dylib extension HOT 2
- Consider return-type consistency of der_pack() HOT 3
- Consider adding (very) long tags HOT 2
- Consider splitting into multiple (packages|repo) HOT 6
- Dependency sort assignments in a module by default HOT 1
- Python module doesn't install correctly when installed in developer mode HOT 2
- der_unpack() modifies dercursor HOT 3
- Add der_cmp_INTEGER() HOT 1
- Iteration is a nuisance HOT 2
- CMake EXPORT broken on POSIX HOT 1
- SEQUENCE of OPTIONs packs to 0 bytes HOT 7
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 quick-der.