From 8b431fbbec8e7bcfa35e20ca38a8573898613a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 11 May 2015 12:54:52 +0200 Subject: [PATCH] Fix dependency issues --- library/ssl_srv.c | 9 ++++++--- library/ssl_tls.c | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/library/ssl_srv.c b/library/ssl_srv.c index 3e2b9017a..b442e653e 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -2725,9 +2725,12 @@ static int ssl_write_certificate_request( mbedtls_ssl_context *ssl ) * opaque DistinguishedName<1..2^16-1>; */ p += 2; - crt = ssl->handshake->sni_ca_chain != NULL ? - ssl->handshake->sni_ca_chain : - ssl->conf->ca_chain; +#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) + if( ssl->handshake->sni_ca_chain != NULL ) + crt = ssl->handshake->sni_ca_chain; + else +#endif + crt = ssl->conf->ca_chain; total_dn_size = 0; while( crt != NULL && crt->version != 0 ) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index be7a25fcc..0a8119e25 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -4032,12 +4032,14 @@ int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl ) mbedtls_x509_crt *ca_chain; mbedtls_x509_crl *ca_crl; +#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) if( ssl->handshake->sni_ca_chain != NULL ) { ca_chain = ssl->handshake->sni_ca_chain; ca_crl = ssl->handshake->sni_ca_crl; } else +#endif { ca_chain = ssl->conf->ca_chain; ca_crl = ssl->conf->ca_crl; @@ -6616,7 +6618,9 @@ void mbedtls_ssl_config_init( mbedtls_ssl_config *conf ) int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf, int endpoint, int transport ) { +#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_SRV_C) int ret; +#endif conf->endpoint = endpoint; conf->transport = transport;