aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Volkov <a.volkov@samsung.com>2018-11-20 10:22:36 +0200
committerAleksey Volkov <a.volkov@samsung.com>2018-11-20 10:22:36 +0200
commit34ed55ce4f2ae794a09dfc2b3f3eaa56ab90c77a (patch)
tree7a7bd627abfbd697978123c2d9490a133412bd19
parent2d036285d22b7e201fe00a5405d3fc0aefe5722a (diff)
[IOT-3229] Reset mbedtls verify callback
Reset X509 verify callback in the global mbedtls context in case if the identity callback isn't set. Change-Id: Ib1abfa00753b971d4eda85cfc18ebcc3a7b0707d Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
-rw-r--r--resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
index af3bf6e..a57e4d9 100644
--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
@@ -1421,10 +1421,8 @@ static SslEndPoint_t * NewSslEndPoint(const CAEndpoint_t * endpoint, mbedtls_ssl
tep->sep.endpoint = *endpoint;
tep->sep.endpoint.flags = (CATransportFlags_t)(tep->sep.endpoint.flags | CA_SECURE);
- if (g_getIdentityCallback != NULL)
- {
- mbedtls_ssl_conf_verify(config, verifyIdentity, NULL);
- }
+ mbedtls_ssl_conf_verify(config, g_getIdentityCallback ? verifyIdentity : NULL, NULL);
+
if(0 != mbedtls_ssl_setup(&tep->ssl, config))
{
OIC_LOG(ERROR, NET_SSL_TAG, "Setup failed");