Commit 5c831e69 authored by Aleksey's avatar Aleksey Committed by Randeep

[IOT-2709] MOT fail fix

This change revert some lines from
https://gerrit.iotivity.org/gerrit/22153

This is workaround to keep compatibility with other modules
 which use credentials with rownerId inside.

Anyway, this behavior should be refactored in next releases.

Change-Id: Ib338ba1e41366c40f878743080d9271446d95fff
Signed-off-by: Aleksey's avatarAleksey Volkov <a.volkov@samsung.com>
parent e259c590
......@@ -562,8 +562,9 @@ struct OicSecCred
#endif /* __WITH_DTLS__ or __WITH_TLS__*/
OicSecKey_t privateData; // 6:R:S:N:oic.sec.key
char *period; // 7:R:S:N:String
OicUuid_t rownerID; // 8:R:S:Y:oic.uuid
#ifdef MULTIPLE_OWNER
OicUuid_t *eownerID; //8:R:S:N:oic.uuid
OicUuid_t *eownerID; //9:R:S:N:oic.uuid
#endif //MULTIPLE_OWNER
OicSecCred_t *next;
};
......
......@@ -1333,7 +1333,6 @@ OicSecCred_t * GenerateCredential(const OicUuid_t * subject, OicSecCredType_t cr
{
OIC_LOG(DEBUG, TAG, "IN GenerateCredential");
OC_UNUSED(rownerID);
(void)publicData;
OCStackResult ret = OC_STACK_ERROR;
......@@ -1372,6 +1371,8 @@ OicSecCred_t * GenerateCredential(const OicUuid_t * subject, OicSecCredType_t cr
cred->privateData.encoding = privateData->encoding;
}
VERIFY_NOT_NULL(TAG, rownerID, ERROR);
memcpy(&cred->rownerID, rownerID, sizeof(OicUuid_t));
#ifdef MULTIPLE_OWNER
if(eownerID)
......@@ -1730,6 +1731,12 @@ OCStackResult AddCredential(OicSecCred_t * newCred)
LL_APPEND(gCred, newCred);
OicUuid_t emptyOwner = { .id = {0} };
if (memcmp(&(newCred->rownerID), &emptyOwner, sizeof(OicUuid_t)) != 0)
{
memcpy(&(gRownerId), &(newCred->rownerID), sizeof(OicUuid_t));
}
saveToDB:
if (UpdatePersistentStorage(gCred))
......
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