Commit 984bb16d authored by Nathan Heldt-Sheller's avatar Nathan Heldt-Sheller

[IOT-1763] CR 32 Device Onboarding State implementation

Implementation of CR 32 "Device Offboarding and Soft Reset".

Note that there are a handful of minor updates still to be
done after the provisioning tool is fully updated, but this
can be done during QA cycle after merge to 1.3-rel. See [IOT-2023].

Note also that the unit tests are not written yet; however,
the critical onboarding path from RFOTM->RFPRO->RFNOP has been
verified using the provisioning tool sample app. See [IOT-2024].

patch set 2,3: rebase
patch set 4,5: address review comments
patch set 6,7: fix jenkins issues
patch set 8: rebase
patch set 9: fix jenkins issues
patch set 10: rebase
patsh set 11: address review comments

Change-Id: I7dc8adb5ad90bd168f3ab485461568b9ab7805e0
Signed-off-by: Nathan Heldt-Sheller's avatarNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18723Reviewed-by: default avatarKevin Kane <kkane@microsoft.com>
Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
parent 2696830c
......@@ -118,7 +118,8 @@ libocsrm_src = [
OCSRM_SRC + 'srmutility.c',
OCSRM_SRC + 'iotvticalendar.c',
OCSRM_SRC + 'base64.c',
OCSRM_SRC + 'directpairing.c'
OCSRM_SRC + 'directpairing.c',
OCSRM_SRC + 'deviceonboardingstate.c'
]
if libocsrm_env.get('SECURED') == '1':
......
//******************************************************************
//
// Copyright 2017 Intel OpenSource Technology Center All Rights Reserved.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#ifndef DEVICEONBOARDINGSTATE_H_
#define DEVICEONBOARDINGSTATE_H_
#include "octypes.h"
#include "securevirtualresourcetypes.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Get the current Device Onboarding State (pstat.dos).
*
* @param[out] dos Pointer to contain the values of current state (pstat.dos)
*
* @return ::OC_STACK_OK If no errors and dos is filled in successfully.
::OC_STACK_ERROR If dos is NOT filled in successfully.
*/
OCStackResult GetDos(OicSecDostype_t *dos);
/**
* Set the Device Onboarding State (pstat.dos) to a new state.
*
* Note that all requirements for entering new state should typically be set
* prior to making this call, typically by the Onboarding Tool (OBT). The
* exceptions are Properties that are set by the Server itself. See
* OCF Security Specification, Security Resources chapters for details.
*
* @param[in] state Value of new desired state (pstat.dos.state)
*
* @return ::OC_STACK_OK if successful change to newState
* ::OC_STACK_FORBIDDEN_REQ if state change preconditions not met
* ::OC_STACK_INTERNAL_SERVER_ERROR if SVRs left in potentially unstable state
*/
OCStackResult SetDosState(const OicSecDeviceOnboardingState_t state);
#ifdef __cplusplus
}
#endif
#endif /* DEVICEONBOARDINGSTATE_H_ */
......@@ -95,43 +95,69 @@ OCStackResult SetDoxmDeviceIDSeed(const uint8_t* seed, size_t seedSize);
#endif
/**
* This method returns the SRM device ID for this device.
* Get the doxm.deviceuuid value for this device.
*
* @return ::OC_STACK_OK for Success, otherwise some error value.
* @param[out] deviceuuid ptr to contain a copy of doxm.deviceuuid value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetDoxmDeviceID(OicUuid_t *deviceID);
OCStackResult GetDoxmDeviceID(OicUuid_t *deviceuuid);
/**
* This method changes the SRM device ID for this device.
* This api will update device Id iff device is in unowned state.
* @return ::OC_STACK_OK for Success, otherwise some error value.
* Set the doxm.deviceuuid value for this device.
*
* @param[in] deviceuuid ptr to value to be copied into doxm.deviceuuid.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetDoxmDeviceID(const OicUuid_t *deviceuuid);
/**
* Get the doxm.devowneruuid value for this device.
*
* @param[out] devowneruuid ptr to contain a copy of doxm.devowneruuid value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetDoxmDeviceID(const OicUuid_t *deviceID);
OCStackResult GetDoxmDevOwnerId(OicUuid_t *devowneruuid);
/**
* Gets the OicUuid_t value for the owner of this device.
* Set the doxm.deviceuuid value for this device.
*
* @param devownerid a pointer to be assigned to the devownerid property
* @return ::OC_STACK_OK if devownerid is assigned correctly, else ::OC_STACK_ERROR.
* @param[in] deviceuuid ptr to value to be copied into doxm.deviceuuid.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetDoxmDevOwnerId(OicUuid_t *devownerid);
OCStackResult SetDoxmDevOwnerId(const OicUuid_t *devowneruuid);
/**
* Gets the bool state of "isOwned" property on the doxm resource.
* Get the doxm.isowned value for this device.
*
* @param isOwned a pointer to be assigned to isOwned property
* @return ::OC_STACK_OK if isOwned is assigned correctly, else ::OC_STACK_ERROR.
* @param[out] isowned ptr to contain a copy of doxm.isowned value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetDoxmIsOwned(bool *isOwned);
OCStackResult GetDoxmIsOwned(bool *isowned);
/**
* Gets the OicUuid_t value for the rowneruuid of the doxm resource.
* Set the doxm.isowned value for this device.
*
* @param rowneruuid a pointer to be assigned to the rowneruuid property
* @return ::OC_STACK_OK if rowneruuid is assigned correctly, else ::OC_STACK_ERROR.
* @param[in] isowned ptr to value to be copied into doxm.isowned.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetDoxmIsOwned(const bool isowned);
/**
* Get the doxm.rowneruuid value for this device.
*
* @param[out] rowneruuid ptr to contain a copy of rowneruuid value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetDoxmRownerId(OicUuid_t *rowneruuid);
/**
* Set the doxm.rowneruuid value for this device.
*
* @param[in] rowneruuid ptr to value to be copied into doxm.rowneruuid.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetDoxmRownerId(const OicUuid_t *rowneruuid);
#ifdef MULTIPLE_OWNER
/**
* Compare the UUID to SubOwner.
......@@ -196,7 +222,7 @@ OCStackResult SetDoxmSelfOwnership(const OicUuid_t* newROwner);
* struct with the values from another /oic/sec/doxm struct.
*
* @param src is a pointer to the source @ref OicSecDoxm_t data.
* @param dst is a pointer to the destination @ref OicSecDoxm_t data.
* @param dst is a pointer to the destination @ref OicSecDoxm_t data.
*
* @retval ::OC_STACK_OK for Success, otherwise some error value
*/
......
......@@ -78,28 +78,100 @@ void DeletePstatBinData(OicSecPstat_t* pstat);
void RestorePstatToInitState();
/**
* Internal function to update resource owner
* Get the pstat.rowneruuid value for this device.
*
* @param newROwner new owner
* @param[out] rowneruuid ptr to contain a copy of pstat.rowneruuid value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetPstatRownerId(OicUuid_t *rowneruuid);
/**
* Set the pstat.rowneruuid value for this device.
*
* @retval ::OC_STACK_OK for Success, otherwise some error value
* @param[in] rowneruuid ptr to value to be copied into pstat.rowneruuid.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetPstatRownerId(const OicUuid_t* newROwner);
OCStackResult SetPstatRownerId(const OicUuid_t* rowneruuid);
/**
* Gets the OicUuid_t value for the rownerid of the pstat resource.
* Get the pstat.dos.s value for this device.
*
* @param rowneruuid a pointer to be assigned to the rowneruuid property
* @return ::OC_STACK_OK if rowneruuid is assigned correctly, else ::OC_STACK_ERROR.
* @param[out] s ptr to contain a copy of pstat.dos.s value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetPstatRownerId(OicUuid_t *rowneruuid);
OCStackResult GetPstatDosS(OicSecDeviceOnboardingState_t *s);
/**
* Set the pstat.dos.s value for this device.
*
* @param[in] s value to be copied into pstat.dos.s.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetPstatDosS(const OicSecDeviceOnboardingState_t s);
/**
* Get the pstat.dos.p value for this device.
*
* @param[out] p ptr to contain a copy of pstat.dos.p value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetPstatDosP(bool *p);
/**
* Set the pstat.dos.p value for this device.
*
* @param[in] p value to be copied into pstat.dos.p.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetPstatDosP(const bool p);
/**
* Get the pstat.isop value for this device.
*
* @param[out] isop ptr to contain a copy of pstat.isop value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetPstatIsop(bool *isop);
/**
* Set the pstat.isop value for this device.
*
* @param[in] isop value to be copied into pstat.isop.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetPstatIsop(const bool isop);
/**
* Get the pstat.cm value for this device.
*
* @param[out] cm ptr to contain a copy of pstat.cm value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetPstatCm(OicSecDpm_t *cm);
/**
* Set the pstat.cm value for this device.
*
* @param[in] cm value to be copied into pstat.cm.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult SetPstatCm(const OicSecDpm_t cm);
/**
* Get the pstat.tm value for this device.
*
* @param[out] tm ptr to contain a copy of pstat.tm value.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
OCStackResult GetPstatTm(OicSecDpm_t *tm);
/**
* This function returns the "isop" status of the device.
* Set the pstat.tm value for this device.
*
* @return true iff pstat.isop == 1, else false
* @param[in] tm value to be copied into pstat.tm.
* @return ::OC_STACK_OK if value is copied successfully, else ::OC_STACK_ERROR.
*/
bool GetPstatIsop();
OCStackResult SetPstatTm(const OicSecDpm_t tm);
/**
* Internal function to change pastat resource to Ready for Normal Operation.
......
......@@ -62,6 +62,15 @@ struct OicParseQueryIter
#define VERIFY_SUCCESS(tag, op, logLevel) do{ if (!(op)) \
{OIC_LOG((logLevel), tag, #op " failed!!"); goto exit; } }while(0)
/**
* Macro to verify expression evaluates to bool true.
* eg: VERIFY_TRUE(TAG, OC_STACK_OK == foo(), ERROR);
* @note Invoking function must define "exit:" label for goto functionality to work correctly.
*/
#define VERIFY_TRUE(tag, op, logLevel) do{ if (!(op)) \
{OIC_LOG_V((logLevel), tag, "%s:" #op "evaluates to false!",__func__); \
goto exit; } }while(0)
/**
* Macro to verify success of operation.
* eg: VERIFY_SUCCESS_RETURN(TAG, OC_STACK_OK == foo(), ERROR, OC_STACK_ERROR);
......@@ -135,6 +144,21 @@ OCStackResult ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid);
*/
OCStackResult ConvertStrToUuid(const char* strUuid, OicUuid_t* uuid);
/**
* Compares two OicUuid_t structs.
*
* @return true if the two OicUuid_t structs are equal, else false.
*/
bool UuidCmp(const OicUuid_t *firstId, const OicUuid_t *secondId);
extern const OicUuid_t THE_NIL_UUID;
/**
* OicUuid_t to Nil UUID {.id={0000000000000000}}
*
* @return true if the OicUuid_t is the Nil UUID
*/
bool IsNilUuid(const OicUuid_t *uuid);
#if defined(__WITH_DTLS__) || defined (__WITH_TLS__)
/**
......
......@@ -2489,8 +2489,8 @@ OCStackResult PostNormalOperationStatus(OTMContext_t* otmCtx)
return OC_STACK_INVALID_PARAM;
}
//Set isop to true.
otmCtx->selectedDeviceInfo->pstat->isOp = true;
// TODO [IOT-1763] put RFPRO and other pstat.dos.s updates in the right places.
otmCtx->selectedDeviceInfo->pstat->dos.state = DOS_RFNOP;
OCSecurityPayload *secPayload = (OCSecurityPayload *)OICCalloc(1, sizeof(OCSecurityPayload));
if (!secPayload)
......@@ -2549,11 +2549,19 @@ OCStackResult ConfigSelfOwnership(void)
OIC_LOG (ERROR, TAG, "Unable to retrieve doxm owned state");
return OC_STACK_ERROR;
}
if( (true == isDeviceOwned) ||(true == GetPstatIsop()) )
bool isop = false;
if (OC_STACK_OK != GetPstatIsop(&isop))
{
OIC_LOG(ERROR, TAG, "Failed to get pstat.isop.");
return OC_STACK_ERROR;
}
if (isDeviceOwned || isop )
{
OIC_LOG(ERROR, TAG, "The state of device is not Ready for Ownership transfer.");
return OC_STACK_ERROR;
}
OicUuid_t deviceID = {.id={0}};
if ( OC_STACK_OK != GetDoxmDeviceID(&deviceID) )
{
......
......@@ -2371,8 +2371,8 @@ OCStackResult GetDefaultACL(OicSecAcl_t** defaultAcl)
OicSecRsrc_t* credRsrc = NULL;
OicSecRsrc_t* rolesRsrc = NULL;
/*
* Note that all Ace_t and Rsrc_t objects will be freed on error by
/*
* Note that all Ace_t and Rsrc_t objects will be freed on error by
* DeleteACLList(acl). We LL_APPEND these objects to the acl object as soon
* as they are allocated.
*/
......@@ -2538,7 +2538,7 @@ OCStackResult GetDefaultACL(OicSecAcl_t** defaultAcl)
memcpy(&fullPermAce->subjectuuid, &WILDCARD_SUBJECT_ID, sizeof(fullPermAce->subjectuuid));
// Resources -- Mandatory
// /oic/sec/roles
// /oic/sec/roles
rolesRsrc = (OicSecRsrc_t*)OICCalloc(1, sizeof(OicSecRsrc_t));
VERIFY_NOT_NULL(TAG, rolesRsrc, ERROR);
LL_APPEND(fullPermAce->resources, rolesRsrc);
......@@ -3096,11 +3096,10 @@ exit:
OCStackResult GetAclRownerId(OicUuid_t *rowneruuid)
{
OCStackResult retVal = OC_STACK_ERROR;
if (gAcl)
if (gAcl && rowneruuid)
{
*rowneruuid = gAcl->rownerID;
retVal = OC_STACK_OK;
memcpy(&(rowneruuid->id), &(gAcl->rownerID.id), sizeof(rowneruuid->id));
return OC_STACK_OK;
}
return retVal;
return OC_STACK_ERROR;
}
......@@ -770,7 +770,7 @@ OCStackResult CredToCBORPayload(const OicSecCred_t *credS, uint8_t **cborPayload
cborEncoderResult = cbor_encode_text_string(&roleIdMap, OIC_JSON_ROLE_NAME, strlen(OIC_JSON_ROLE_NAME));
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding role tag");
cborEncoderResult = cbor_encode_text_string(&roleIdMap, cred->roleId.id, strlen(cred->roleId.id));
VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding role value");
......@@ -2967,13 +2967,12 @@ exit:
OCStackResult GetCredRownerId(OicUuid_t *rowneruuid)
{
OCStackResult retVal = OC_STACK_ERROR;
if (gCred)
if (gCred && rowneruuid)
{
*rowneruuid = gCred->rownerID;
retVal = OC_STACK_OK;
memcpy(&(rowneruuid->id), &(gCred->rownerID.id), sizeof(rowneruuid->id));
return OC_STACK_OK;
}
return retVal;
return OC_STACK_ERROR;
}
#if defined (__WITH_TLS__) || defined(__WITH_DTLS__)
......
//******************************************************************
//
// Copyright 2017 Intel OpenSource Technology Center All Rights Reserved.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "deviceonboardingstate.h"
#include "srmutility.h"
#include "octypes.h"
#include "logger.h"
#include "securevirtualresourcetypes.h"
#include "srmresourcestrings.h"
#include "aclresource.h"
#include "amaclresource.h"
#include "credresource.h"
#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
#include "crlresource.h"
#endif /* (__WITH_DTLS__) || (__WITH_TLS__) */
#include "doxmresource.h"
#include "pstatresource.h"
#define TAG "OIC_SRM_DOS"
/**
* @return true if changing from oldState to newState is valid transition.
*/
static bool IsValidStateTransition(OicSecDeviceOnboardingState_t oldState,
OicSecDeviceOnboardingState_t newState)
{
bool ret = false;
switch (newState)
{
case DOS_RESET:
ret = true;
break;
case DOS_RFNOP:
if (DOS_RFPRO == oldState)
{
ret = true;
}
break;
case DOS_RFOTM:
if (DOS_RESET == oldState)
{
ret = true;
}
break;
case DOS_RFPRO:
if (DOS_RFNOP == oldState
|| DOS_RFOTM == oldState
|| DOS_SRESET == oldState)
{
ret = true;
}
break;
case DOS_SRESET:
if (DOS_RFNOP == oldState
|| DOS_RFPRO == oldState)
{
ret = true;
}
break;
}
OIC_LOG_V(INFO, TAG, "%s: returning %s.", __func__, ret?"true":"false");
return ret;
}
/**
* @return true if Device meets requirements to enter RFNOP DOS.
*/
static bool IsReadyToEnterRFNOP()
{
bool ret = false;
bool tempBool = false;
OicUuid_t tempUuid = {.id={0}};
// Note: pstat.dos.p asserted by DoStateChange(), so not checked here.
// Verify doxm.owned == TRUE.
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmIsOwned(&tempBool), ERROR);
VERIFY_TRUE(TAG, tempBool, WARNING);
// Verify doxm.devowneruuid != nil UUID.
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmDevOwnerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
// Verify doxm.deviceuuid != nil UUID.
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmDeviceID(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
// Verify oxmsel was the actual OTM used (no-op: CTT will verify this during
// certification testing, as it requires OBT cooperation to verify).
// Verify pstat.isop == false (Server sets isop on entry)
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetPstatIsop(&tempBool), ERROR);
VERIFY_TRUE(TAG, !tempBool, WARNING);
// Verify implemented SVRs with rowneruuid Property have non-Nil rowneruuid
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetAclRownerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetCredRownerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmRownerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetPstatRownerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
// Verify each rowneruuid, devowneruuid has a corresponding /cred entry
// TODO [IOT-2023]
ret = true;
exit:
OIC_LOG_V(DEBUG, TAG, "%s: returning %s.", __func__, ret?"true":"false");
return ret;
}
/**
* @return true if Device meets requirements to enter RFOTM DOS.
*/
static bool IsReadyToEnterRFOTM()
{
bool ret = false;
bool tempBool = false;
OicUuid_t tempUuid = {.id={0}};
// Note: pstat.dos.p asserted by DoStateChange(), so not checked here.
// Verify doxm.owned == FALSE.
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmIsOwned(&tempBool), ERROR);
VERIFY_TRUE(TAG, !tempBool, WARNING);
// Verify doxm.devowneruuid == nil UUID.
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmDevOwnerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
// Check and log whether doxm.deviceuuid == nil UUID ("may" reqt not "shall")
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmDeviceID(&tempUuid), ERROR);
if (!IsNilUuid(&tempUuid))
{
OIC_LOG_V(INFO, TAG, "%s: doxm.deviceuuid != Nil UUID... allowed but noted.",
__func__);
}
ret = true;
exit:
OIC_LOG_V(DEBUG, TAG, "%s: returning %s.", __func__, ret?"true":"false");
return ret;
}
/**
* @return true if Device meets requirements to enter RFPRO DOS.
*/
static bool IsReadyToEnterRFPRO()
{
bool ret = false;
bool tempBool = false;
OicUuid_t tempUuid = {.id={0}};
// Note: pstat.dos.p asserted by DoStateChange(), so not checked here.
// Verify doxm.owned == TRUE.
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmIsOwned(&tempBool), ERROR);
VERIFY_TRUE(TAG, tempBool, WARNING);
// Verify doxm.devowneruuid != nil UUID.
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmDevOwnerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
// Verify doxm.deviceuuid != nil UUID.
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmDeviceID(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
// doxm.sct and doxm.oxmsel retain previous values (checked by CTT)
// Verify implemented SVRs with rowneruuid Property have non-Nil rowneruuid
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetAclRownerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetCredRownerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetDoxmRownerId(&tempUuid), ERROR);
VERIFY_TRUE(TAG, !IsNilUuid(&tempUuid), WARNING);
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetPstatRownerId(&