Commit de38f5d8 authored by George Nash's avatar George Nash

IOT-2539 Removed unused-function

The CompareCredential function is unused. Any code
that is unused is not maintained. This removes the
unused function. If the CompareCredential is needed
in the future it can be restored by reverting this
commit.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: Ib5c1fee9a2bd90db3b55066a6e3b057760199b68
Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21747Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarKevin Kane <kkane@microsoft.com>
Reviewed-by: default avatarMats Wichmann <mats@linux.com>
Reviewed-by: default avatarRick Bell <richard.s.bell@intel.com>
(cherry picked from commit fa9191dc)
parent a54db53f
......@@ -1658,112 +1658,6 @@ exit:
return false;
}
/**
* Compares credential
*
* @return CRED_CMP_EQUAL if credentials are equal
* CRED_CMP_NOT_EQUAL if not equal
* otherwise error.
*/
static CredCompareResult_t CompareCredential(const OicSecCred_t * l, const OicSecCred_t * r)
{
CredCompareResult_t cmpResult = CRED_CMP_ERROR;
bool isCompared = false;
OIC_LOG(DEBUG, TAG, "IN CompareCredetial");
VERIFY_NOT_NULL(TAG, l, ERROR);
VERIFY_NOT_NULL(TAG, r, ERROR);
cmpResult = CRED_CMP_NOT_EQUAL;
VERIFY_SUCCESS(TAG, (l->credType == r->credType), INFO);
VERIFY_SUCCESS(TAG, (0 == memcmp(l->subject.id, r->subject.id, sizeof(l->subject.id))), INFO);
VERIFY_SUCCESS(TAG, (0 == memcmp(&l->roleId, &r->roleId, sizeof(l->roleId))), INFO);
switch(l->credType)
{
case SYMMETRIC_PAIR_WISE_KEY:
case SYMMETRIC_GROUP_KEY:
case PIN_PASSWORD:
{
if(l->privateData.data && r->privateData.data)
{
VERIFY_SUCCESS(TAG, IsSameSecKey(&l->privateData, &r->privateData), INFO);
isCompared = true;
}
break;
}
#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
case ASYMMETRIC_KEY:
case SIGNED_ASYMMETRIC_KEY:
{
if(l->publicData.data && r->publicData.data)
{
VERIFY_SUCCESS(TAG, IsSameSecKey(&l->publicData, &r->publicData), INFO);
isCompared = true;
}
if(l->optionalData.data && r->optionalData.data)
{
VERIFY_SUCCESS(TAG, IsSameSecOpt(&l->optionalData, &r->optionalData), INFO);
isCompared = true;
}
if(l->credUsage && r->credUsage)
{
VERIFY_SUCCESS(TAG, (strlen(l->credUsage) == strlen(r->credUsage)), INFO);
VERIFY_SUCCESS(TAG, (0 == strncmp(l->credUsage, r->credUsage, strlen(l->credUsage))), INFO);
isCompared = true;
}
break;
}
case ASYMMETRIC_ENCRYPTION_KEY:
{
if(l->privateData.data && r->privateData.data)
{
VERIFY_SUCCESS(TAG, IsSameSecKey(&l->privateData, &r->privateData), INFO);
isCompared = true;
}
if(l->publicData.data && r->publicData.data)
{
VERIFY_SUCCESS(TAG, IsSameSecKey(&l->publicData, &r->publicData), INFO);
isCompared = true;
}
if(l->optionalData.data && r->optionalData.data)
{
VERIFY_SUCCESS(TAG, IsSameSecOpt(&l->optionalData, &r->optionalData), INFO);
isCompared = true;
}
break;
}
#endif //__WITH_DTLS__ or __WITH_TLS__
default:
{
cmpResult = CRED_CMP_ERROR;
break;
}
}
if(isCompared)
{
OIC_LOG(DEBUG, TAG, "Same Credentials");
cmpResult = CRED_CMP_EQUAL;
}
else
{
OIC_LOG(DEBUG, TAG, "Can not find the key data in credential");
cmpResult = CRED_CMP_ERROR;
}
exit:
OIC_LOG(DEBUG, TAG, "OUT CompareCredetial");
return cmpResult;
}
#if ((defined(__WITH_DTLS__) || defined(__WITH_TLS__)) && defined(MULTIPLE_OWNER))
static bool IsNewPreconfigPinCredential(OicSecCred_t * oldCred, OicSecCred_t * newCred)
{
......
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