FIY

It’s prob­a­bly worth not­ing at this point that there are a few lessons to the debian OpenSSL débâcle:

  1. There is now a corol­lary to “do not write your own cryp­to­graphic rou­tines”: “do not fix bugs in some­one else’s cryp­to­graphic rou­tines.” If there is a anno­tated view of the OpenSSL tree (I don’t know/don’t care), the DD who patched OpenSSL would have been bet­ter off con­tact­ing the per­son who wrote the offend­ing line in the orig­i­nal source than try­ing to find the cor­rect channel.
  2. Developers must pub­lish cor­rect infor­ma­tion on how to con­tact them. Incorrect infor­ma­tion on the OpenSSL web­site main­te­nance is just as much to blame for this as the DD in ques­tion, who did ask the sug­gested chan­nels about his patch.
  3. Distros should have peer review of patches in security-critical code — by expe­ri­enced devel­op­ers — if they do not already.
  4. Rather than all the bitch­ing, remem­ber that the cen­tral tenet of F/LOSS is Fix It Yourself. This does not cease to apply sim­ply because the prob­lem exists in some­thing you depend on. If any­thing, it should empha­size how nec­es­sary it is.

3 Responses

  1. Sven Neumann says:

    It would also have helped a lot if the openssl code was prop­erly com­mented. If it would have been obvi­ous that entropy from a ran­dom num­ber gen­er­a­tor is being added here, then no one would have con­sid­ered to remove that line. But it looks like not even the most impor­tant parts of the code are documented.

    Another thing that is obvi­ously miss­ing from the openssl code base are unit tests. It’s not rocket sci­ence to gen­er­ate a small amount of keys and to check their dis­tri­b­u­tion in the key space. If such a test would have existed and if it would have been run as part of ‘make check’, then this dis­as­ter would not have happened.

  2. James Cape says:

    No doubt, but given that the OpenSSL code is just whack to begin with (I mean seri­ously, have you ever tried using the OpenSSL com­mand line with­out find­ing some recipe for what you want to do), that’s not really rea­son­able to expect them to fol­low good prac­tices WRT code and testing.

    AFAIK, you can­not rea­son­ably depend on the non-standard, undoc­u­mented behav­ior of hav­ing unini­tial­ized mem­ory be some­thing ran­dom. Any plat­form that zeros unini­tial­ized mem­ory — e.g. as part of some app-isolating “secure vir­tual mem­ory” — would also exhibit the same behavior.

  3. Sven Neumann says:

    Please do not con­fuse things here. The patch in ques­tion was remov­ing two lines. One was the use of unini­tialised mem­ory, which is indeed a very ques­tion­able and unre­li­able source of entropy. The other line in the patch looked almost iden­ti­cal, but it was the call where the result of the ran­dom num­ber gen­er­a­tor was added as entropy source. Removing that call is what caused the problem.

Leave a Reply

*