// CborSize is the default cbor payload size being used.
-static const uint16_t CBOR_SIZE = 2048;
+static const uint16_t CBOR_SIZE = 2048*8;
static OicSecAcl_t *gAcl = NULL;
static OCResourceHandle gAclHandle = NULL;
}
}
}
+ memcpy(&(gAcl->rownerID), &(newAcl->rownerID), sizeof(OicUuid_t));
DeleteACLList(newAcl);
{
size_t size = 0;
uint8_t *cborPayload = NULL;
+
if (OC_STACK_OK == AclToCBORPayload(gAcl, &cborPayload, &size))
{
if (UpdateSecureResourceInPS(OIC_JSON_ACL_NAME, cborPayload, size) == OC_STACK_OK)
VERIFY_SUCCESS(TAG, ret == OC_STACK_OK, ERROR);
OICFree(stRowner);
}
+ else if (NULL != gCred)
+ {
+ memcpy(&(headCred->rownerID), &(gCred->rownerID), sizeof(OicUuid_t));
+ }
OICFree(tagName);
}
if (cbor_value_is_valid(&CredRootMap))
{
OCStackResult ret = OC_STACK_ERROR;
OicSecCred_t * temp = NULL;
+ bool validFlag = true;
VERIFY_SUCCESS(TAG, NULL != newCred, ERROR);
//Assigning credId to the newCred
"new credential's ID will be replaced.", temp->credId);
newCred->credId = temp->credId;
ret = OC_STACK_OK;
- goto exit;
+ validFlag = false;
+ break;
}
if (CRED_CMP_ERROR == cmpRes)
{
OIC_LOG_V(WARNING, TAG, "Credential skipped : %d", cmpRes);
ret = OC_STACK_ERROR;
- goto exit;
+ validFlag = false;
+ break;
}
}
- //Append the new Cred to existing list
- LL_APPEND(gCred, newCred);
+ //Append the new Cred to existing list if new Cred is valid
+ if (validFlag)
+ {
+ LL_APPEND(gCred, newCred);
+ }
+ memcpy(&(gCred->rownerID), &(newCred->rownerID), sizeof(OicUuid_t));
if (UpdatePersistentStorage(gCred))
{
ret = OC_STACK_OK;
VERIFY_SUCCESS(TAG, OC_STACK_OK == ret, ERROR);
OICFree(strUuid );
strUuid = NULL;
-
- if (roParsed)
- {
- *roParsed = true;
- }
}
else
{
gPstat->om = pstat->om;
gPstat->tm = pstat->tm;
gPstat->cm = pstat->cm;
+ memcpy(&(gPstat->rownerID), &(pstat->rownerID), sizeof(OicUuid_t));
// Convert pstat data into CBOR for update to persistent storage
if (UpdatePersistentStorage(gPstat))