Issue 7595 - OpenLDAP lacks a ECDHE key generation callback
Summary: OpenLDAP lacks a ECDHE key generation callback
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.35
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-21 01:20 UTC by crest@tzi.de
Modified: 2021-09-14 16:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description crest@tzi.de 2013-05-21 01:20:03 UTC
Full_Name: Jan Bramkamp
Version: 2.4.35
OS: FreeBSD 9.1
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (79.230.127.217)


OpenLDAP supports PFS TLS cipher suites using DHE with the
DH *tlso_tmp_dh_cb(SSL*,int,int) callback in libraries/libldap/tls_o.c.
DHE-RSA/DSS cipher suites are very CPU intensive and noticeably increase latency
on low-power hardware. While OpenLDAP supports ECDH-ECDSA cipher suites these
lack the PFS offered by DHE-RSA/DSS cipher suites.

From my initial search it looks like the correct API to register such a callback
would be SSL_CTX_set_tmp_ecdh_callback(), but im not familiar the OpenLDAP code
base so patching it my self could have unintended consequences.

This how the CA was generated:
    CURVE=secp384r1

    openssl ecparam -out private/ca-key.pem -name $CURVE -genkey &&
    openssl req -new -x509 -days 365 -key private/ca-key.pem -out
certs/ca-cert.pem

    openssl ecparam -out private/auth1-key.pem -name $CURVE -genkey &&
    openssl req -new -key private/auth1-key.pem -out newcerts/auth1-csr.pem &&
    openssl ca -config /usr/local/openssl/openssl.cnf -out certs/auth1-cert.pem
-infiles newcerts/auth1-csr.pem

The (EC)DH paramter file was generated with:
    openssl ecparam -name $CURVE

This was tested with slapd linked against OpenSSL 1.0.1e from ports on FreeBSD
9.1/amd64.
Comment 1 Howard Chu 2013-05-22 16:20:52 UTC
crest@tzi.de wrote:
> Full_Name: Jan Bramkamp
> Version: 2.4.35
> OS: FreeBSD 9.1
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (79.230.127.217)
>
>
> OpenLDAP supports PFS TLS cipher suites using DHE with the
> DH *tlso_tmp_dh_cb(SSL*,int,int) callback in libraries/libldap/tls_o.c.
> DHE-RSA/DSS cipher suites are very CPU intensive and noticeably increase latency
> on low-power hardware. While OpenLDAP supports ECDH-ECDSA cipher suites these
> lack the PFS offered by DHE-RSA/DSS cipher suites.
>
>>From my initial search it looks like the correct API to register such a callback
> would be SSL_CTX_set_tmp_ecdh_callback(), but im not familiar the OpenLDAP code
> base so patching it my self could have unintended consequences.
>
> This how the CA was generated:
>      CURVE=secp384r1
>
>      openssl ecparam -out private/ca-key.pem -name $CURVE -genkey &&
>      openssl req -new -x509 -days 365 -key private/ca-key.pem -out
> certs/ca-cert.pem
>
>      openssl ecparam -out private/auth1-key.pem -name $CURVE -genkey &&
>      openssl req -new -key private/auth1-key.pem -out newcerts/auth1-csr.pem &&
>      openssl ca -config /usr/local/openssl/openssl.cnf -out certs/auth1-cert.pem
> -infiles newcerts/auth1-csr.pem
>
> The (EC)DH paramter file was generated with:
>      openssl ecparam -name $CURVE
>
> This was tested with slapd linked against OpenSSL 1.0.1e from ports on FreeBSD
> 9.1/amd64.
>
>
Some background info in this thread 
http://openssl.6102.n7.nabble.com/Problem-with-cipher-suite-ECDHE-ECDSA-AES256-SHA384-td42229.html

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 Howard Chu 2013-09-07 14:41:48 UTC
crest@tzi.de wrote:
> Full_Name: Jan Bramkamp
> Version: 2.4.35
> OS: FreeBSD 9.1
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (79.230.127.217)
>
>
> OpenLDAP supports PFS TLS cipher suites using DHE with the
> DH *tlso_tmp_dh_cb(SSL*,int,int) callback in libraries/libldap/tls_o.c.
> DHE-RSA/DSS cipher suites are very CPU intensive and noticeably increase latency
> on low-power hardware. While OpenLDAP supports ECDH-ECDSA cipher suites these
> lack the PFS offered by DHE-RSA/DSS cipher suites.
>
>>From my initial search it looks like the correct API to register such a callback
> would be SSL_CTX_set_tmp_ecdh_callback(), but im not familiar the OpenLDAP code
> base so patching it my self could have unintended consequences.
>
> This how the CA was generated:
>      CURVE=secp384r1
>
>      openssl ecparam -out private/ca-key.pem -name $CURVE -genkey &&
>      openssl req -new -x509 -days 365 -key private/ca-key.pem -out
> certs/ca-cert.pem
>
>      openssl ecparam -out private/auth1-key.pem -name $CURVE -genkey &&
>      openssl req -new -key private/auth1-key.pem -out newcerts/auth1-csr.pem &&
>      openssl ca -config /usr/local/openssl/openssl.cnf -out certs/auth1-cert.pem
> -infiles newcerts/auth1-csr.pem
>
> The (EC)DH paramter file was generated with:
>      openssl ecparam -name $CURVE
>
> This was tested with slapd linked against OpenSSL 1.0.1e from ports on FreeBSD
> 9.1/amd64.

It seems that current events have focused more attention on Perfect Forward 
Secrecy, now that news about NSA eavesdropping is everywhere. It's worth 
noting Bruce Schneier's recommendation to avoid Elliptic Curve algorithms, 
since their design has been heavily influenced by the NSA.

http://www.theguardian.com/world/2013/sep/05/nsa-how-to-remain-secure-surveillance

(Section 5.)


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 3 Howard Chu 2013-09-07 16:48:23 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Enhancements
Comment 4 Quanah Gibson-Mount 2019-05-06 20:09:28 UTC
changed notes
changed state Test to Release
Comment 5 OpenLDAP project 2019-07-24 18:53:43 UTC
added in master
added in RE24 (2.4.48)
Comment 6 Quanah Gibson-Mount 2019-07-24 18:53:43 UTC
changed notes
changed state Release to Closed
Comment 7 Howard Chu 2021-09-14 16:50:25 UTC
(In reply to Howard Chu from comment #1)

> Some background info in this thread 
> http://openssl.6102.n7.nabble.com/Problem-with-cipher-suite-ECDHE-ECDSA-
> AES256-SHA384-td42229.html

nabble.com seems to have reorganized their domains and the above URL is now broken. The same thread is available at https://www.mail-archive.com/openssl-users@openssl.org/msg69181.html

> -- 
>    -- Howard Chu
>    CTO, Symas Corp.           http://www.symas.com
>    Director, Highland Sun     http://highlandsun.com/hyc/
>    Chief Architect, OpenLDAP  http://www.openldap.org/project/