[IOT-3219] Prevent Iotivity crash at OTM 19/27319/3
authorAleksey Volkov <a.volkov@samsung.com>
Wed, 24 Oct 2018 12:10:12 +0000 (15:10 +0300)
committerNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Mon, 5 Nov 2018 19:19:06 +0000 (19:19 +0000)
Change-Id: Ia3436b8ea9da299084b770c4cd048f626a5d7d5a
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c

index dc798d7..c9df6cd 100644 (file)
@@ -1388,6 +1388,10 @@ static int verifyIdentity( void *data, mbedtls_x509_crt *crt, int depth, uint32_
     OC_UNUSED(data); // no need to pass extra data
     OC_UNUSED(flags); // we do not remove any flags
     static UuidContext_t ctx = { NULL };
+    if (NULL == g_getIdentityCallback)
+    {
+        return MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE;
+    }
     g_getIdentityCallback(&ctx, crt->raw.p, crt->raw.len);
     if (0 == depth) // leaf certificate
     {