From: Dan Mihai Date: Wed, 19 Apr 2017 19:07:07 +0000 (-0700) Subject: [IOT-2067] Don't call ConvertUuidToStr from ocprovision X-Git-Tag: 1.3.0~255 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed741f77b7cc5263b44ee3b8fa03fdb28bed80f1;p=platform%2Fupstream%2Fiotivity.git [IOT-2067] Don't call ConvertUuidToStr from ocprovision Don't call ConvertUuidToStr from ocprovision and the C++ apps linking with this library. Change-Id: Ie440f0d368b3bdc15a5055eb1161b0f33586a375 Signed-off-by: Dan Mihai Reviewed-on: https://gerrit.iotivity.org/gerrit/19173 Tested-by: jenkins-iotivity Reviewed-by: Dave Thaler --- diff --git a/resource/csdk/stack/octbstack_product_secured.def b/resource/csdk/stack/octbstack_product_secured.def index 14df087..7d93d84 100644 --- a/resource/csdk/stack/octbstack_product_secured.def +++ b/resource/csdk/stack/octbstack_product_secured.def @@ -1,8 +1,6 @@ ; Windows octbstack.dll exports that are required for both products and tests, ; but only when building with SECURED=1. -ConvertUuidToStr - OCAssertRoles OCConfigSelfOwnership OCConvertDerCSRToPem diff --git a/resource/provisioning/src/OCProvisioningManager.cpp b/resource/provisioning/src/OCProvisioningManager.cpp index 8362831..6ebe118 100644 --- a/resource/provisioning/src/OCProvisioningManager.cpp +++ b/resource/provisioning/src/OCProvisioningManager.cpp @@ -19,6 +19,7 @@ * *****************************************************************/ #include "ocstack.h" +#include "ocrandom.h" #include "srmutility.h" #include "base64.h" #include "OCProvisioningManager.hpp" @@ -1489,19 +1490,19 @@ namespace OC std::string OCSecureResource::getDeviceID() { std::ostringstream deviceId(""); - char *devID = nullptr; + char devID[UUID_STRING_SIZE]; validateSecureResource(); - if (OC_STACK_OK == ConvertUuidToStr(&(devPtr->doxm->deviceID), &devID)) + if (OCConvertUuidToString(devPtr->doxm->deviceID.id, devID)) { deviceId << devID; - free(devID); } else { oclog() <<"Can not convert uuid to struuid"; } + return deviceId.str(); }