Blame SOURCES/openldap-openssl-ITS7595-Add-EC-support-2.patch
|
|
57672d |
ITS#7595 don't try to use EC if OpenSSL lacks it
|
|
|
57672d |
|
|
|
57672d |
Cherry-picked upstream 721e46fe6695077d63a3df6ea2e397920a72308d
|
|
|
57672d |
Author: Howard Chu <hyc@openldap.org>
|
|
|
57672d |
Date: Sun Sep 8 06:32:23 2013 -0700
|
|
|
57672d |
|
|
|
57672d |
diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c
|
|
|
57672d |
index 1a81bc625..71c2b055c 100644
|
|
|
57672d |
--- a/libraries/libldap/tls_o.c
|
|
|
57672d |
+++ b/libraries/libldap/tls_o.c
|
|
|
57672d |
@@ -321,8 +321,12 @@ tlso_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
|
|
|
57672d |
DH_free( dh );
|
|
|
57672d |
}
|
|
|
57672d |
|
|
|
57672d |
-#ifdef SSL_OP_SINGLE_ECDH_USE
|
|
|
57672d |
if ( is_server && lo->ldo_tls_ecname ) {
|
|
|
57672d |
+#ifdef OPENSSL_NO_EC
|
|
|
57672d |
+ Debug( LDAP_DEBUG_ANY,
|
|
|
57672d |
+ "TLS: Elliptic Curves not supported.\n", 0,0,0 );
|
|
|
57672d |
+ return -1;
|
|
|
57672d |
+#else
|
|
|
57672d |
EC_KEY *ecdh;
|
|
|
57672d |
|
|
|
57672d |
int nid = OBJ_sn2nid( lt->lt_ecname );
|
|
|
57672d |
@@ -344,8 +348,8 @@ tlso_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
|
|
|
57672d |
SSL_CTX_set_tmp_ecdh( ctx, ecdh );
|
|
|
57672d |
SSL_CTX_set_options( ctx, SSL_OP_SINGLE_ECDH_USE );
|
|
|
57672d |
EC_KEY_free( ecdh );
|
|
|
57672d |
- }
|
|
|
57672d |
#endif
|
|
|
57672d |
+ }
|
|
|
57672d |
|
|
|
57672d |
if ( tlso_opt_trace ) {
|
|
|
57672d |
SSL_CTX_set_info_callback( ctx, tlso_info_cb );
|