Added missing DTLS #ifdef guard.
authorSachin Agrawal <sachin.agrawal@intel.com>
Mon, 22 Jun 2015 23:38:58 +0000 (16:38 -0700)
committerSachin Agrawal <sachin.agrawal@intel.com>
Tue, 23 Jun 2015 16:39:36 +0000 (16:39 +0000)
One of the functions only used for DTLS was missing #ifdef guards
resulting in compile warnings.

Change-Id: Ieb0082e1dba2547e8d73d0526cf0aab3bf3af589
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1333
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/security/src/doxmresource.c

index 3b691a5d386c8b666d55af0eb85d8deea5184529..405ccc62781fb663c8e4b7ea8939cad971898000 100755 (executable)
@@ -303,6 +303,10 @@ exit:
     return doxm;
 }
 
+/**
+ * @todo document this function including why code might need to call this.
+ * The current suspicion is that it's not being called as much as it should.
+ */
 static bool UpdatePersistentStorage(OicSecDoxm_t * doxm)
 {
     bool bRet = false;
@@ -594,11 +598,10 @@ OCStackResult CreateDoxmResource()
  */
 void CheckDeviceID()
 {
-    //TODO: Save this deviceID at secure location so that we can retrieve it if the
-    //JSON gets corrupted.
     if(strcmp((char *)gDoxm->deviceID.id, "") == 0 )
     {
         OCFillRandomMem(gDoxm->deviceID.id, sizeof(gDoxm->deviceID.id));
+        UpdatePersistentStorage(gDoxm);
     }
 }