[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sins of DER (was Re: propagation control)
At 03:02 PM 4/24/97 -0400, David P. Kemp wrote:
>> From: "Phillip M. Hallam-Baker" <hallam@ai.mit.edu>
>>
>> This is of course very ASN.1, I don't mind ASN.1 except for the DER
>> rules which are completely braindamaged. If it had been made an
>> absolute requirement that every structure should be capable of
>> being encoded and decoded using a simple linear descent the problem
>> would not occur.
>
>
>I noticed you were very careful to specify DER, as opposed to BER.
>The Basic Encoding Rules (BER), of course, allow you to specify length of
>an object explicitly at the beginning, or implicitly by sending an
>end token when the object is finished.
David,
I know this is a rat hole, way off topic, but I believe the
real problem with DER isn't that everything needs to be prefixed by
a length but rather that the lengths aren't locally knowable (without
a recursive examination of the structure all the way to its leaves).
A list (SEQUENCE OF, SET OF, ...) should have the number of
elements prefixed, not the number of bytes. The only thing which should
have # of bytes out front is a byte string. SEQUENCE should not have
any length prefix, since you know what's coming.
Of course, this isn't the only problem with ASN.1, but it's
a big one. It makes encoding extremely ugly and makes decoding more
involved (by giving more errors to check).
- Carl
+------------------------------------------------------------------+
|Carl M. Ellison cme@cybercash.com http://www.clark.net/pub/cme |
|CyberCash, Inc. http://www.cybercash.com/ |
|207 Grindall Street PGP 2.6.2: 61E2DE7FCB9D7984E9C8048BA63221A2 |
|Baltimore MD 21230-4103 T:(410) 727-4288 F:(410)727-4293 |
+------------------------------------------------------------------+