From 8b15a6a399ebfd3eff730f7cae39c4c19129cedf Mon Sep 17 00:00:00 2001 From: "js126.lee" Date: Tue, 21 Mar 2017 15:43:06 +0900 Subject: [PATCH] Fixed bug in compared WILDCARD_SUBJECT_ID Issue : If the first character of deviceuuid generated ramdomly is *(2a) in PT, subjectuuid of cred is set to * wrongly instead of actual deviceuuid during generating cred payload during OT. Change-Id: Idc6587d71456a1eb7a816bd083bfcbb5c94e9c34 Signed-off-by: js126.lee Reviewed-on: https://gerrit.iotivity.org/gerrit/18041 Tested-by: jenkins-iotivity Reviewed-by: Nathan Heldt-Sheller --- resource/csdk/security/src/credresource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 resource/csdk/security/src/credresource.c diff --git a/resource/csdk/security/src/credresource.c b/resource/csdk/security/src/credresource.c old mode 100755 new mode 100644 index 81a4c42..28c2db8 --- a/resource/csdk/security/src/credresource.c +++ b/resource/csdk/security/src/credresource.c @@ -673,7 +673,7 @@ OCStackResult CredToCBORPayload(const OicSecCred_t *credS, uint8_t **cborPayload cborEncoderResult = cbor_encode_text_string(&credMap, OIC_JSON_SUBJECTID_NAME, strlen(OIC_JSON_SUBJECTID_NAME)); VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding Subject Tag."); - inLen = (memcmp(&(cred->subject), &WILDCARD_SUBJECT_ID, WILDCARD_SUBJECT_ID_LEN) == 0) ? + inLen = (memcmp(&(cred->subject), &WILDCARD_SUBJECT_ID, sizeof(OicUuid_t)) == 0) ? WILDCARD_SUBJECT_ID_LEN : sizeof(OicUuid_t); if(inLen == WILDCARD_SUBJECT_ID_LEN) { -- 2.7.4