[Cryptography] Heartbleed and fundamental crypto programming practices

Christian Huitema huitema at huitema.net
Sat Apr 26 21:21:20 EDT 2014


> > Whoever designed ASN.1 must have been smoking something.  Is there a
> > reason to keep on using it?
> 
> It's a CCITT (now ITU) standard. Like all ITU standards, it was done by
people
> with severe anocranial inversion.

I remember writing a stub compiler for the language. That compiler was
contributed by Siemens to OSF DCE.

There was indeed lots of gratuitous complexity in ASN.1. Why was there a
need for SEQUENCE and SET, or a distinction between SEQUENCE OF and SET OF?
Why was there a need for both IMPLICIT and EXPLICIT tags? Why where there
three types of tag numbers? Why have two ways to encode the length of a
structure type? The worse was probably the extension method. All these extra
definitions created some joy in the tests. However, by the end of the effort
(in 1992) we had generated code that was reasonably fast and safe. After
all, it is a TLV specification, so the stub compiler could include
systematic checks for consistency, buffer overflow, etc. And we had great
fuzz testing to prove it. 

But the worse part of ASN.1 was the way extensions were defined. The early
definition with ANY and MACRO was bad enough, but then the table extensions
went way beyond what would make sense in a data description language. That's
really what you get when a language is defined by committee...

-- Christian Huitema





More information about the cryptography mailing list