During OTM, the DOXM resource is accessed while the SSL lock is
held. Attempting to assert roles causes this lock to be acquired
again, and recursive locking is not supported. Therefore, don't
automatically assert roles when accessing DOXM. Since this
resource seems to only be accessed either anonymously or with an
owner PSK, this shouldn't be needed, anyway.
Change-Id: I4b04d24544a5049d3a91827753d565e118cbf9d5
Signed-off-by: Kevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19237
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
{
OIC_LOG_V(DEBUG, NET_SSL_TAG, "In %s", __func__);
+ oc_mutex_assert_owner(g_sslContextMutex, false);
oc_mutex_lock(g_sslContextMutex);
if (NULL == g_caSslContext)
{
#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
/* Check whether we should assert role certificates before making this request. */
if ((endpoint.flags & CA_SECURE) &&
- (strcmp(requestInfo.info.resourceUri, OIC_RSRC_ROLES_URI) != 0))
+ (strcmp(requestInfo.info.resourceUri, OIC_RSRC_ROLES_URI) != 0) &&
+ (strcmp(requestInfo.info.resourceUri, OIC_RSRC_DOXM_URI) != 0))
{
CASecureEndpoint_t sep;
CAResult_t caRes = CAGetSecureEndpointData(&endpoint, &sep);