▲ | cryptonector 5 days ago | |||||||
Details please. Things people say who know very little about ASN.1: - it's bloated! (it's not) - it's had lots of vulnerabilities! (mainly in hand-coded codecs) - it's expensive (it's not -- it's free and has been for two decades) - it's ugly (well, sure, but so is PB's IDL) - the language is context-dependent, making it harder to write a parser for (this is quite true, but so what, it's not that big a deal) The vulnerabilities were only ever in implementations, and almost entirely in cases of hand-coded codecs, and the thing that made many of these vulnerabilities possible was the use of tag-length-value encoding rules (BER/DER/CER) which, ironically, Protocol Buffers bloody is too. If you have a different objections to ASN.1, please list them. | ||||||||
▲ | theamk 4 days ago | parent [-] | |||||||
Neither of those, the main problems are: - There is no backward or forward compatibility by default. (Sure, you can have every SEQUENCE have all fields OPTIONAL and ... at the end, but how many real-life schemas like that you have seen? Almost every ASN.1 you can find on the internet is static SEQUENCE, with no extensibility whatsoever) - Tools are bad. Yes, protoc can be a PITA to integrate into build system, but at least it (1) exists, (2) well-tested (3) supports many languages. Compared to ASN.1 where the good tooling is so rare, people routinely manually parse/generate the files! - Honorable mention: using "tag" in TLV to describe only the type and not field name - that SEQUENCE(30) tag will be all over the place, and the contents will be wildly different. Compare to protobuf, where the "tag" is field index, and that's exactly what allows such a great forward/backward compatibility. (Could ASN.1 fix those problems? Not sure. Yes, maybe one could write better tooling, but all the existing users know that extensibility is for the weak, and non-optional SEQUENCEs are the way to go. It is easier to write all-new format than try to change existing conventions.) | ||||||||
|