Commit 2cd19c54 authored by Oleksandr Dmytrenko's avatar Oleksandr Dmytrenko Committed by Aleksey

some errors fix

crosses initialization and invalid conversion errors fix

Change-Id: I55cce4178f14eb1a7e5b45704650696d18b9ddec
Signed-off-by: default avatarOleksandr Dmytrenko <o.dmytrenko@samsung.com>
parent aaa819da
......@@ -627,7 +627,7 @@ OCStackResult OC_CALL OCUnlinkDevices(void* ctx,
OCProvisionResultCB resultCallback)
{
OIC_LOG(INFO, TAG, "IN OCUnlinkDevices");
OCUuidList_t* idList = NULL;
OCUuidList_t *idList = NULL, *curDev = NULL;
size_t numOfDev = 0;
if (!pTargetDev1 || !pTargetDev2 || !pTargetDev1->doxm || !pTargetDev2->doxm)
......@@ -661,7 +661,7 @@ OCStackResult OC_CALL OCUnlinkDevices(void* ctx,
}
// Check the linked devices contains the second device. If yes send credential DELETE request.
OCUuidList_t* curDev = idList;
curDev = idList;
while (NULL != curDev)
{
if (memcmp(pTargetDev2->doxm->deviceID.id, curDev->dev.id, sizeof(curDev->dev.id)) == 0)
......@@ -699,7 +699,7 @@ static OCStackResult RemoveDeviceInfoFromLocal(const OCProvisionDev_t* pTargetDe
if (res != OC_STACK_RESOURCE_DELETED)
{
OIC_LOG(ERROR, TAG, "RemoveDeviceInfoFromLocal : Failed to remove credential.");
goto error;
return OC_STACK_ERROR;
}
}
/**
......@@ -730,7 +730,6 @@ static OCStackResult RemoveDeviceInfoFromLocal(const OCProvisionDev_t* pTargetDe
OICFree(endpoint);
OIC_LOG(DEBUG, TAG, "OUT RemoveDeviceInfoFromLocal");
error:
return res;
}
......@@ -826,6 +825,8 @@ OCStackResult OC_CALL OCRemoveDeviceWithUuid(void* ctx, unsigned short waitTimeF
bool discoverdFlag = false;
OCProvisionDev_t* pOwnedDevList = NULL;
OCStackResult resReq = OC_STACK_CONTINUE;
OCUuidList_t* linkedDevices = NULL;
size_t numOfLinkedDevices = 0;
if (!pTargetUuid || 0 == waitTimeForOwnedDeviceDiscovery)
{
......@@ -863,8 +864,6 @@ OCStackResult OC_CALL OCRemoveDeviceWithUuid(void* ctx, unsigned short waitTimeF
}
memcpy(pTargetDev->doxm->deviceID.id, pTargetUuid->id, sizeof(pTargetUuid->id));
OCUuidList_t* linkedDevices = NULL;
size_t numOfLinkedDevices = 0;
res = PDMGetLinkedDevices(pTargetUuid, &linkedDevices, &numOfLinkedDevices);
if(OC_STACK_OK != res)
{
......
......@@ -109,7 +109,7 @@ OCStackResult CreateSecureSessionJustWorksCallback(OTMContext_t* otmCtx)
}
OIC_LOG(INFO, TAG, "Anonymous cipher suite Enabled.");
caresult = CASelectCipherSuite(MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256, otmCtx->selectedDeviceInfo->endpoint.adapter);
caresult = CASelectCipherSuite(MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256, (CATransportAdapter_t)otmCtx->selectedDeviceInfo->endpoint.adapter);
if (CA_STATUS_OK != caresult)
{
OIC_LOG_V(ERROR, TAG, "Failed to select TLS_ECDH_anon_WITH_AES_128_CBC_SHA256");
......
......@@ -154,7 +154,7 @@ OCStackResult CreateSecureSessionMCertificateCallback(OTMContext_t* otmCtx)
OIC_LOG(INFO, TAG, "Anonymous cipher suite disabled.");
caresult = CASelectCipherSuite(MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8,
otmCtx->selectedDeviceInfo->endpoint.adapter);
(CATransportAdapter_t)otmCtx->selectedDeviceInfo->endpoint.adapter);
if (CA_STATUS_OK != caresult)
{
OIC_LOG_V(ERROR, TAG, "Failed to select MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8");
......
......@@ -150,7 +150,7 @@ OCStackResult CreateSecureSessionRandomPinCallback(OTMContext_t* otmCtx)
}
OIC_LOG(INFO, TAG, "Anonymous cipher suite disabled.");
caresult = CASelectCipherSuite(MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, otmCtx->selectedDeviceInfo->endpoint.adapter);
caresult = CASelectCipherSuite(MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, (CATransportAdapter_t)otmCtx->selectedDeviceInfo->endpoint.adapter);
if (CA_STATUS_OK != caresult)
{
OIC_LOG_V(ERROR, TAG, "Failed to select TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256");
......
......@@ -503,10 +503,11 @@ OCProvisionDev_t* PMCloneOCProvisionDevList(const OCProvisionDev_t* src)
return NULL;
}
OCProvisionDev_t* current = NULL;
OCProvisionDev_t* newDev = PMCloneOCProvisionDev(src);
VERIFY_NOT_NULL(TAG, newDev, ERROR);
OCProvisionDev_t* current = newDev;
current = newDev;
for (OCProvisionDev_t* next = src->next; NULL != next; next = next->next)
{
current->next = PMCloneOCProvisionDev(next);
......@@ -567,12 +568,12 @@ bool OC_CALL PMGenerateQuery(bool isSecure,
}
int snRet = 0;
char* prefix = (isSecure == true) ? COAPS_PREFIX : COAP_PREFIX;
char* prefix = (char *)((isSecure == true) ? COAPS_PREFIX : COAP_PREFIX);
switch(connType & CT_MASK_ADAPTER)
{
case CT_ADAPTER_TCP:
prefix = (isSecure == true) ? COAPS_TCP_PREFIX : COAP_TCP_PREFIX;
prefix = (char*)((isSecure == true) ? COAPS_TCP_PREFIX : COAP_TCP_PREFIX);
/* fall through */
case CT_ADAPTER_IP:
switch(connType & CT_MASK_FLAGS & ~CT_FLAG_SECURE)
......@@ -1044,7 +1045,7 @@ OCStackResult PMSingleDeviceDiscovery(unsigned short waittime, const OicUuid_t*
}
DiscoveryInfo *pDInfo = OICCalloc(1, sizeof(DiscoveryInfo));
DiscoveryInfo *pDInfo = (DiscoveryInfo *)OICCalloc(1, sizeof(DiscoveryInfo));
if(NULL == pDInfo)
{
OIC_LOG(ERROR, TAG, "PMSingleDeviceDiscovery : Memory allocation failed.");
......@@ -1140,7 +1141,7 @@ OCStackResult PMDeviceDiscovery(unsigned short waittime, bool isOwned, OCProvisi
const char DOXM_OWNED_FALSE_MULTICAST_QUERY[] = "/oic/sec/doxm?Owned=FALSE";
const char DOXM_OWNED_TRUE_MULTICAST_QUERY[] = "/oic/sec/doxm?Owned=TRUE";
DiscoveryInfo *pDInfo = OICCalloc(1, sizeof(DiscoveryInfo));
DiscoveryInfo *pDInfo = (DiscoveryInfo *)OICCalloc(1, sizeof(DiscoveryInfo));
if(NULL == pDInfo)
{
OIC_LOG(ERROR, TAG, "PMDeviceDiscovery : Memory allocation failed.");
......@@ -1242,7 +1243,7 @@ OCStackResult PMSingleDeviceDiscoveryInUnicast(unsigned short waittime, const Oi
hostAddress = "";
}
snprintf(query, MAX_URI_LENGTH + MAX_QUERY_LENGTH + 1, "%s/oic/sec/doxm", hostAddress);
connType = connType & CT_MASK_ADAPTER;
connType = (OCConnectivityType)(connType & CT_MASK_ADAPTER);
OCDoHandle handle = NULL;
res = OCDoResource(&handle, OC_REST_DISCOVER, query, 0, 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment