[IOT-2036] Fix empty string device ID
authorDmitriy Zhuravlev <d.zhuravlev@samsung.com>
Sat, 13 May 2017 14:56:26 +0000 (17:56 +0300)
committerUze Choi <uzchoi@samsung.com>
Mon, 15 May 2017 01:23:56 +0000 (01:23 +0000)
Allow to load PSK suites in case of empty deviceId

Change-Id: Idaf55bb3624c2f1d1a1825b0cdcaaa1bdd7d5caf
Signed-off-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19867
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-by: Senthil Kumar G S <senthil.gs@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
resource/csdk/security/src/credresource.c

index dab263c..e3210a3 100644 (file)
@@ -3571,7 +3571,7 @@ void InitCipherSuiteListInternal(bool * list, const char * usage, const char *de
             {
                 OicUuid_t uuid;
 
-                if (NULL == deviceId ||
+                if (NULL == deviceId || deviceId[0] == '\0' ||
                     OC_STACK_OK != ConvertStrToUuid(deviceId, &uuid) ||
                     0 == memcmp(uuid.id, temp->subject.id, sizeof(uuid.id)))
                 {