//credid
if (strcmp(name, OIC_JSON_CREDID_NAME) == 0)
{
- cborFindResult = cbor_value_get_uint64(&credMap, (uint64_t *) &cred->credId);
+ uint64_t credId = 0;
+ cborFindResult = cbor_value_get_uint64(&credMap, &credId);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding CredId.");
+ cred->credId = (uint16_t)credId;
}
// subjectid
if (strcmp(name, OIC_JSON_SUBJECTID_NAME) == 0)
// credtype
if (strcmp(name, OIC_JSON_CREDTYPE_NAME) == 0)
{
- cborFindResult = cbor_value_get_uint64(&credMap, (uint64_t *) &cred->credType);
+ uint64_t credType = 0;
+ cborFindResult = cbor_value_get_uint64(&credMap, &credType);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding CredType.");
+ cred->credType = (OicSecCredType_t)credType;
}
// privatedata
if (strcmp(name, OIC_JSON_PRIVATEDATA_NAME) == 0)
// Permissions -- Mandatory
if (strcmp(name, OIC_JSON_PERMISSION_NAME) == 0 && cbor_value_is_unsigned_integer(&pdAclMap))
{
- cborFindResult = cbor_value_get_uint64(&pdAclMap,
- (uint64_t *) &pdacl->permission);
+ uint64_t permission = 0;
+ cborFindResult = cbor_value_get_uint64(&pdAclMap, &permission);
+ pdacl->permission = (uint16_t)permission;
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to get value");
}
if (cbor_value_is_map(rootValue))
{
CborValue curVal;
+ uint64_t temp = 0;
// Sequence Number
CborError err = cbor_value_map_find_value(rootValue, OC_RSRVD_NONCE, &curVal);
VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding nonce tag");
- err = cbor_value_get_uint64(&curVal, (uint64_t *)&payload->sequenceNumber);
+ err = cbor_value_get_uint64(&curVal, &temp);
+ payload->sequenceNumber = (uint32_t)temp;
VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding nonce value");
// Max Age
err = cbor_value_map_find_value(rootValue, OC_RSRVD_TTL, &curVal);
VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding ttl tag");
- err = cbor_value_get_uint64(&curVal, (uint64_t *)&payload->maxAge);
+ temp = 0;
+ err = cbor_value_get_uint64(&curVal, &temp);
+ payload->maxAge = (uint32_t)temp;
VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding ttl value");
// Trigger