Subjectuuid wildcard fix 92/27892/3
authorAleksey Volkov <a.volkov@samsung.com>
Mon, 28 Jan 2019 14:17:26 +0000 (16:17 +0200)
committerAleksey Volkov <a.volkov@samsung.com>
Tue, 29 Jan 2019 11:20:57 +0000 (11:20 +0000)
subjectuuid field of credential entry is changing in case of it has
'*' or zeroid value and credential type is 'SIGNED_ASYMMETRIC_KEY'.

For the trustca credusage this cause a verification error.

Change-Id: I889d9e982b5be5fea1d872eebb83734288cde3e6
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
resource/csdk/security/src/credresource.c

index c6b57b2..aaf4451 100644 (file)
@@ -150,7 +150,8 @@ static bool CheckSubjectOfCertificate(OicSecCred_t* cred, OicUuid_t deviceID)
 #if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
     const OicUuid_t emptyUuid = { .id = { 0 } };
 
-    if ( SIGNED_ASYMMETRIC_KEY == cred->credType)
+    if ( SIGNED_ASYMMETRIC_KEY == cred->credType
+        && 0 != strcmp(cred->credUsage, TRUST_CA) )
     {
         if((0 == memcmp(cred->subject.id, emptyUuid.id, sizeof(cred->subject.id))) ||
             (0 == memcmp(cred->subject.id, &WILDCARD_SUBJECT_ID, sizeof(cred->subject.id))))