[CR2392] Security Profile Purple 67/25967/3
authorOleksandr Andrieiev <o.andrieiev@samsung.com>
Mon, 25 Jun 2018 12:15:45 +0000 (15:15 +0300)
committerAleksey Volkov <a.volkov@samsung.com>
Fri, 29 Jun 2018 08:24:13 +0000 (08:24 +0000)
Updated cred entries check condition, because Purple
profile currently requires mfg cert to be used. Updated
tests and sample application to recognize the profile.

Bug: https://jira.iotivity.org/browse/IOT-3104
Change-Id: I02cb12592c112783d48fd4d5c09b91ec96af5d72
Signed-off-by: Oleksandr Andrieiev <o.andrieiev@samsung.com>
resource/csdk/security/provisioning/sample/oic_svr_db_server_mfg.dat
resource/csdk/security/provisioning/sample/oic_svr_db_server_mfg.json
resource/csdk/security/provisioning/sample/provisioningclient.c
resource/csdk/security/src/spresource.c
resource/csdk/security/unittest/spresource.cpp

index 3144b4c..4fda544 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_server_mfg.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_server_mfg.dat differ
index 6a48dca..ce6aa65 100644 (file)
@@ -1,6 +1,6 @@
 {
     "sp": {
-        "supported_profiles": [ "oic.sec.sp.black", "oic.sec.sp.blue", "oic.sec.sp.baseline" ],
+        "supported_profiles": [ "oic.sec.sp.black", "oic.sec.sp.blue", "oic.sec.sp.purple", "oic.sec.sp.baseline" ],
         "active_profile": "oic.sec.sp.black",
         "credid": 1,
         "rowneruuid": "00000000-0000-0000-0000-000000000000",
index a4fc478..bf4eab8 100644 (file)
@@ -164,7 +164,7 @@ OicSecSp_t gSpDefault =
     0                           // credid
 };
 
-char * gSupportedProfilesAll[] = { "oic.sec.sp.black", "oic.sec.sp.blue", "oic.sec.sp.baseline",  };
+char * gSupportedProfilesAll[] = { "oic.sec.sp.black", "oic.sec.sp.blue", "oic.sec.sp.purple", "oic.sec.sp.baseline",  };
 OicSecSp_t gSpAll =
 {
     3,                      // supportedLen
index a019f62..4d89426 100644 (file)
@@ -538,7 +538,8 @@ bool SpRequiresCred(char* spName)
     }
 
     if ( (0 == strcmp(spName, "oic.sec.sp.black")) ||
-         (0 == strcmp(spName, "oic.sec.sp.blue")))
+         (0 == strcmp(spName, "oic.sec.sp.blue")) ||
+         (0 == strcmp(spName, "oic.sec.sp.purple")))
     {
         return true;
     }
index 305d135..c00a808 100644 (file)
@@ -42,6 +42,7 @@ static void TestInit(OicSecSp_t* testSp, bool* spProps);
 
 static char s_spBlackName[] = "oic.sec.sp.black";
 static char s_spBlueName[] = "oic.sec.sp.blue";
+static char s_spPurpleName[] = "oic.sec.sp.purple";
 static char s_spBaselineName[] = "oic.sec.sp.baseline";
 
 static char* s_profileArray[] = { NULL, NULL, NULL, NULL, NULL, };
@@ -65,10 +66,11 @@ TEST(SPResourceTest, CBORFullEncodingPositive)
     // all supported profiles
     TestInit(&s_testSp, propsToTest);
     SetAllSpProps(propsToTest, true);
-    s_testSp.supportedLen = 3;
+    s_testSp.supportedLen = 4;
     s_testSp.supportedProfiles[0] = s_spBlueName;
     s_testSp.supportedProfiles[1] = s_spBaselineName;
     s_testSp.supportedProfiles[2] = s_spBlackName;
+    s_testSp.supportedProfiles[3] = s_spPurpleName;
     s_testSp.activeProfile = s_spBlackName;
     s_testSp.credid = 1;
     TestEncodeDecode(&s_testSp, propsToTest, true);