Menu

#59 Change Built-in Diffie-Hellman key from 512 to 2048 bits

None
closed-fixed
nobody
None
5
2015-07-07
2015-06-11
No

Tls.c defines a 512bit DH parameter (unless #NO_DH is defined, which I gather it normally isn't, e.g. for ActiveState's builds).

This should be replaced with a static 2048 bit key, given small keys are no longer deemed secure enough for use; see e.g. https://weakdh.org/sysadmin.html

I would suggest an option be added to supply an external DH params file as well, so that this can be changed without recompiling.

Discussion

  • Steve Redler

    Steve Redler - 2015-06-21

    I agree with Mark, the dhparam should be broken out as an option.

    For some time now I've replaced the 512bit dhparam with a 4096 bit one on my builds and it works well, but a command line option would be best, perhaps it would override a default 2048bit built-in dhparam.

    Steve Redler IV
    SR Technology

     
  • Andreas Kupries

    Andreas Kupries - 2015-06-22

    I agree as well to
    - having an option, and
    - a better default
    Are either of you willing to supply a patch I can apply ?

     
    • Mark Roseman

      Mark Roseman - 2015-07-01

      Andreas, I’ve posted a patch which both changes the default and adds a new option to specify the DH file. I’d greatly appreciate if when you get a chance you could take a look and perhaps get it incorporated.

      Thanks!
      Mark

       
  • Mark Roseman

    Mark Roseman - 2015-06-25

    in a bit of a hurry, but here at least is a patch to give a better default..

     
  • Mark Roseman

    Mark Roseman - 2015-07-01

    Had a chance to get back to this. This patch both changes the default compiled-in key to 2048 bits, and also adds a "-dhparams" option which allows you to specify an external file containing the parameters.

    Notes:

    1. The external file is read on demand for each new connection, so changes made to that file will be used for future connections.
    2. I changed the #define from NO_DH to OPENSSL_NO_DH as reflected in more recent versions of OpenSSL. The SF CVS only goes back so far, so I have no idea if anyone actually uses that, or if it was just carried along from OpenSSL sample code at the time.
    3. If for some reason that #define is set and a -dhparams option is provided, the code throws an error ("DH parameter support not available"); this seems to map onto what happens if protocol options are provided (e.g. -ssl3) but not compiled in.
    4. Apologies for any other formatting, error handling, etc. errors.
     
  • Jeremy Sowden

    Jeremy Sowden - 2015-07-04

    I've made a few small corrections.

     
  • Mark Roseman

    Mark Roseman - 2015-07-06

    Thanks very much for the corrections Jeremy.

     
  • Andreas Kupries

    Andreas Kupries - 2015-07-07

    I made a test build last night using Jeremy's patch.

    The package built fine on all my platforms.

    After updating the Tcl installation on https://www.tcl.tk with that build (*) and restarting the tclhttpd serving it the logjam page () now tells me that our server is "safe from the logjam attack" (finally). Thanks for that work.

    () The https://weakdh.org/sysadmin.html
    (
    *) Currently labeled as v1.6.6.1. On official commit I will make this v1.6.7

     
  • Andreas Kupries

    Andreas Kupries - 2015-07-07

    Patch committed. Version is 1.6.7 now.
    IMHO this ticket can now be closed.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2015-07-07
    • status: open --> closed-fixed
    • Group: -->