Merge branch 'master' into security-summit
[platform/upstream/iotivity.git] / resource / csdk / security / src / doxmresource.c
index f561f9d..0f6092d 100644 (file)
@@ -47,7 +47,7 @@
 #include <strings.h>
 #endif
 
-#define TAG  PCF("SRM-DOXM")
+#define TAG  "SRM-DOXM"
 
 static OicSecDoxm_t        *gDoxm = NULL;
 static OCResourceHandle    gDoxmHandle = NULL;
@@ -367,7 +367,7 @@ static bool ValidateQuery(const char * query)
     // access rules. Eventually, the PE and PM code will
     // not send a request to the /doxm Entity Handler at all
     // if it should not respond.
-    OC_LOG (INFO, TAG, PCF("In ValidateQuery"));
+    OC_LOG (INFO, TAG, "In ValidateQuery");
     if(NULL == gDoxm)
     {
         return false;
@@ -428,12 +428,12 @@ static OCEntityHandlerResult HandleDoxmGetRequest (const OCEntityHandlerRequest
     char* jsonStr = NULL;
     OCEntityHandlerResult ehRet = OC_EH_OK;
 
-    OC_LOG (INFO, TAG, PCF("Doxm EntityHandle processing GET request"));
+    OC_LOG (INFO, TAG, "Doxm EntityHandle processing GET request");
 
     //Checking if Get request is a query.
     if(ehRequest->query)
     {
-        OC_LOG (INFO, TAG, PCF("HandleDoxmGetRequest processing query"));
+        OC_LOG (INFO, TAG, "HandleDoxmGetRequest processing query");
         if(!ValidateQuery(ehRequest->query))
         {
             ehRet = OC_EH_ERROR;
@@ -452,7 +452,7 @@ static OCEntityHandlerResult HandleDoxmGetRequest (const OCEntityHandlerRequest
     // Send response payload to request originator
     if(OC_STACK_OK != SendSRMResponse(ehRequest, ehRet, jsonStr))
     {
-        OC_LOG (ERROR, TAG, PCF("SendSRMResponse failed in HandleDoxmGetRequest"));
+        OC_LOG (ERROR, TAG, "SendSRMResponse failed in HandleDoxmGetRequest");
     }
 
     OICFree(jsonStr);
@@ -488,7 +488,7 @@ static OCEntityHandlerResult AddOwnerPSK(const CAEndpoint_t* endpoint,
                     sizeof(base64Buff), &outLen);
     VERIFY_SUCCESS(TAG, b64Ret == B64_OK, ERROR);
 
-    OC_LOG (INFO, TAG, PCF("Doxm EntityHandle  generating Credential"));
+    OC_LOG (INFO, TAG, "Doxm EntityHandle  generating Credential");
     cred = GenerateCredential(&ptDoxm->owner, SYMMETRIC_PAIR_WISE_KEY,
                               NULL, base64Buff, ownLen, &ptDoxm->owner);
     VERIFY_NON_NULL(TAG, cred, ERROR);
@@ -509,7 +509,7 @@ exit:
 
 static OCEntityHandlerResult HandleDoxmPutRequest (const OCEntityHandlerRequest * ehRequest)
 {
-    OC_LOG (INFO, TAG, PCF("Doxm EntityHandle  processing PUT request"));
+    OC_LOG (INFO, TAG, "Doxm EntityHandle  processing PUT request");
     OCEntityHandlerResult ehRet = OC_EH_ERROR;
     OicUuid_t emptyOwner = {.id = {0}};
 
@@ -531,7 +531,7 @@ static OCEntityHandlerResult HandleDoxmPutRequest (const OCEntityHandlerRequest
              */
             if ((false == gDoxm->owned) && (false == newDoxm->owned))
             {
-                OC_LOG (INFO, TAG, PCF("Doxm EntityHandle  enabling AnonECDHCipherSuite"));
+                OC_LOG (INFO, TAG, "Doxm EntityHandle  enabling AnonECDHCipherSuite");
 #ifdef __WITH_DTLS__
                 ehRet = (CAEnableAnonECDHCipherSuite(true) == CA_STATUS_OK) ? OC_EH_OK : OC_EH_ERROR;
 #endif //__WITH_DTLS__
@@ -556,7 +556,7 @@ static OCEntityHandlerResult HandleDoxmPutRequest (const OCEntityHandlerRequest
                 OCServerRequest *request = (OCServerRequest *)ehRequest->requestHandle;
 
                 //Generating OwnerPSK
-                OC_LOG (INFO, TAG, PCF("Doxm EntityHandle  generating OwnerPSK"));
+                OC_LOG (INFO, TAG, "Doxm EntityHandle  generating OwnerPSK");
 
                 //Generate new credential for provisioning tool
                 ehRet = AddOwnerPSK((CAEndpoint_t *)&request->devAddr, newDoxm,
@@ -681,7 +681,7 @@ exit:
     //Send payload to request originator
     if(OC_STACK_OK != SendSRMResponse(ehRequest, ehRet, NULL))
     {
-        OC_LOG (ERROR, TAG, PCF("SendSRMResponse failed in HandlePstatPostRequest"));
+        OC_LOG (ERROR, TAG, "SendSRMResponse failed in HandlePstatPostRequest");
     }
     DeleteDoxmBinData(newDoxm);
 
@@ -706,7 +706,7 @@ OCEntityHandlerResult DoxmEntityHandler (OCEntityHandlerFlag flag,
 
     if (flag & OC_REQUEST_FLAG)
     {
-        OC_LOG (INFO, TAG, PCF("Flag includes OC_REQUEST_FLAG"));
+        OC_LOG (INFO, TAG, "Flag includes OC_REQUEST_FLAG");
         switch (ehRequest->method)
         {
             case OC_REST_GET:
@@ -744,7 +744,7 @@ OCStackResult CreateDoxmResource()
 
     if (OC_STACK_OK != ret)
     {
-        OC_LOG (FATAL, TAG, PCF("Unable to instantiate Doxm resource"));
+        OC_LOG (FATAL, TAG, "Unable to instantiate Doxm resource");
         DeInitDoxmResource();
     }
     return ret;
@@ -773,7 +773,7 @@ static OCStackResult CheckDeviceID()
     {
         if (OCGenerateUuid(gDoxm->deviceID.id) != RAND_UUID_OK)
         {
-            OC_LOG(FATAL, TAG, PCF("Generate UUID for Server Instance failed!"));
+            OC_LOG(FATAL, TAG, "Generate UUID for Server Instance failed!");
             return ret;
         }
         ret = OC_STACK_OK;
@@ -781,7 +781,7 @@ static OCStackResult CheckDeviceID()
         if (UpdatePersistentStorage(gDoxm))
         {
             //TODO: After registering PSI handler in all samples, do ret = OC_STACK_OK here.
-            OC_LOG(FATAL, TAG, PCF("UpdatePersistentStorage failed!"));
+            OC_LOG(FATAL, TAG, "UpdatePersistentStorage failed!");
         }
     }
     else
@@ -797,7 +797,7 @@ static OCStackResult CheckDeviceID()
  */
 static OicSecDoxm_t* GetDoxmDefault()
 {
-    OC_LOG (INFO, TAG, PCF("GetDoxmToDefault"));
+    OC_LOG (INFO, TAG, "GetDoxmToDefault");
     return &gDefaultDoxm;
 }
 
@@ -844,7 +844,7 @@ OCStackResult InitDoxmResource()
     }
     else
     {
-        OC_LOG (ERROR, TAG, PCF("CheckDeviceID failed"));
+        OC_LOG (ERROR, TAG, "CheckDeviceID failed");
     }
     OICFree(jsonSVRDatabase);
     return ret;