#include "cainterface.h"
#include "pmtypes.h"
#include "pmutility.h"
+#include "srmutility.h"
#include "provisioningdatabasemanager.h"
#include "base64.h"
#include "utlist.h"
/**
* Macro to verify argument is not equal to NULL.
- * eg: VERIFY_NON_NULL(TAG, ptrData, ERROR,OC_STACK_ERROR);
+ * eg: VERIFY_NON_NULL_RET(TAG, ptrData, ERROR,OC_STACK_ERROR);
*/
-#define VERIFY_NON_NULL(tag, arg, logLevel, retValue) { if (NULL == (arg)) \
+#define VERIFY_NON_NULL_RET(tag, arg, logLevel, retValue) { if (NULL == (arg)) \
{ OIC_LOG((logLevel), tag, #arg " is NULL"); return retValue; } }
/**
* Macro to verify success of operation.
- * eg: VERIFY_SUCCESS(TAG, OC_STACK_OK == foo(), ERROR, OC_STACK_ERROR);
+ * eg: VERIFY_SUCCESS_RET(TAG, OC_STACK_OK == foo(), ERROR, OC_STACK_ERROR);
*/
-#define VERIFY_SUCCESS(tag, op, logLevel, retValue) { if (!(op)) \
+#define VERIFY_SUCCESS_RET(tag, op, logLevel, retValue) { if (!(op)) \
{OIC_LOG((logLevel), tag, #op " failed!!"); return retValue;} }
static OCStackApplicationResult provisionCredentialCB2(void *ctx, OCDoHandle UNUSED,
OCClientResponse *clientResponse)
{
- VERIFY_NON_NULL(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
CredentialData_t *credData = (CredentialData_t *) ctx;
(void)UNUSED;
static OCStackApplicationResult provisionCredentialCB1(void *ctx, OCDoHandle UNUSED,
OCClientResponse *clientResponse)
{
- VERIFY_NON_NULL(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
(void)UNUSED;
CredentialData_t* credData = (CredentialData_t*) ctx;
OICFree(credData->credInfoFirst);
++(certData->numOfResults);
}
-/**
- * Internal function for handling credential generation and sending cretificate credential.
- *
- * @param[in] cred Instance of cred resource.
- * @param[in] deviceInfo information about device to which credential is to be provisioned.
- * @param[in] responseHandler callbak called by OC stack when request API receives response.
- * @return OC_STACK_OK in case of success and other value otherwise.
- */
-static OCStackResult provisionCertCred(const OicSecCred_t *cred,
- const OCProvisionDev_t *deviceInfo, CertData_t *certData,
- OCClientResponseHandler responseHandler)
-{
- OCSecurityPayload* secPayload = (OCSecurityPayload*)OICCalloc(1, sizeof(OCSecurityPayload));
- if(!secPayload)
- {
- OIC_LOG(ERROR, TAG, "Failed to memory allocation");
- return OC_STACK_NO_MEMORY;
- }
- secPayload->base.type = PAYLOAD_TYPE_SECURITY;
- int secureFlag = 0;
- OCStackResult res = CredToCBORPayload(cred, &secPayload->securityData,
- &secPayload->payloadSize, secureFlag);
-
- if ((OC_STACK_OK != res) || (NULL == secPayload->securityData))
- {
- OICFree(secPayload);
- OIC_LOG(ERROR, TAG, "Failed to CredToCBORPayload");
- return OC_STACK_NO_MEMORY;
- }
-
- OIC_LOG(DEBUG, TAG, "Created payload for Cred:");
- OIC_LOG_BUFFER(DEBUG, TAG, secPayload->securityData, secPayload->payloadSize);
- char query[MAX_URI_LENGTH + MAX_QUERY_LENGTH] = {0};
- if(!PMGenerateQuery(true,
- deviceInfo->endpoint.addr,
- deviceInfo->securePort,
- deviceInfo->connType,
- query, sizeof(query), OIC_RSRC_CRED_URI))
- {
- OIC_LOG(ERROR, TAG, "DeviceDiscoveryHandler : Failed to generate query");
- OCPayloadDestroy((OCPayload *)secPayload);
- return OC_STACK_ERROR;
- }
- OIC_LOG_V(DEBUG, TAG, "Query=%s", query);
-
- OCCallbackData cbData = {.context=NULL, .cb=NULL, .cd=NULL};
- cbData.cb = responseHandler;
- cbData.context = (void *) certData;
- cbData.cd = NULL;
-
- OCDoHandle handle = NULL;
- OCMethod method = OC_REST_POST;
- OCStackResult ret = OCDoResource(&handle, method, query, 0, (OCPayload*)secPayload,
- deviceInfo->connType, OC_HIGH_QOS, &cbData, NULL, 0);
- OIC_LOG_V(INFO, TAG, "OCDoResource::Certificate provisioning returned : %d",ret);
- if (ret != OC_STACK_OK)
- {
- OIC_LOG(ERROR, TAG, "OCStack resource error");
- }
-
- return ret;
-}
-
OCStackResult SRPRegisterTrustCertChainNotifier(void *ctx, TrustCertChainChangeCB callback)
{
if (g_trustCertChainNotifier.callback)
static OCStackApplicationResult provisionCertCB(void *ctx, OCDoHandle UNUSED,
OCClientResponse *clientResponse)
{
- VERIFY_NON_NULL(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
CertData_t *certData = (CertData_t *) ctx;
(void)UNUSED;
OCProvisionResultCB resultCallback = certData->resultCallback;
- OIC_LOG(INFO, TAG, "provisionCertCred called");
+ OIC_LOG(INFO, TAG, "provisionCertCB called");
if (clientResponse)
{
if(OC_STACK_RESOURCE_CHANGED == clientResponse->result)
const OCProvisionDev_t *selectedDeviceInfo, OCProvisionResultCB resultCallback)
{
OIC_LOG(INFO, TAG, "In SRPProvisionTrustCertChain");
- VERIFY_NON_NULL(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
- if (SIGNED_ASYMMETRIC_KEY != type || NULL == type)
+ VERIFY_NON_NULL_RET(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
+ if (SIGNED_ASYMMETRIC_KEY != type)
{
OIC_LOG(INFO, TAG, "Invalid key type");
return OC_STACK_INVALID_PARAM;
OICFree(certData);
}
- VERIFY_SUCCESS(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
+ VERIFY_SUCCESS_RET(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
return OC_STACK_OK;
}
OicEncodingType_t encodingType, uint16_t *credId)
{
OIC_LOG(DEBUG, TAG, "IN SRPSaveTrustCertChain");
- VERIFY_NON_NULL(TAG, trustCertChain, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, credId, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, trustCertChain, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, credId, ERROR, OC_STACK_INVALID_PARAM);
OCStackResult res = OC_STACK_ERROR;
OicSecCred_t *cred = (OicSecCred_t *)OICCalloc(1, sizeof(*cred));
- VERIFY_NON_NULL(TAG, cred, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, cred, ERROR, OC_STACK_NO_MEMORY);
memcpy(cred->subject.id, &WILDCARD_SUBJECT_ID, WILDCARD_SUBJECT_ID_LEN);
cred->credUsage= (char *)OICCalloc(1, strlen(TRUST_CA)+1 );
- VERIFY_NON_NULL(TAG, cred->credUsage, ERROR, OC_STACK_NO_MEMORY);
- OICStrcpy(cred->credUsage, strlen(TRUST_CA) + 1, TRUST_CA) ;
+ VERIFY_NON_NULL_RET(TAG, cred->credUsage, ERROR, OC_STACK_NO_MEMORY);
+ OICStrcpy(cred->credUsage, strlen(TRUST_CA) + 1, TRUST_CA);
cred->credType = SIGNED_ASYMMETRIC_KEY;
if (encodingType == OIC_ENCODING_PEM)
{
cred->optionalData.data = (uint8_t *)OICCalloc(1, chainSize + 1);
- VERIFY_NON_NULL(TAG, cred->optionalData.data, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, cred->optionalData.data, ERROR, OC_STACK_NO_MEMORY);
cred->optionalData.len = chainSize + 1;
}
else
{
cred->optionalData.data = (uint8_t *)OICCalloc(1, chainSize);
- VERIFY_NON_NULL(TAG, cred->optionalData.data, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, cred->optionalData.data, ERROR, OC_STACK_NO_MEMORY);
cred->optionalData.len = chainSize;
}
memcpy(cred->optionalData.data, trustCertChain, chainSize);
if (g_trustCertChainNotifier.callback)
{
uint8_t *certChain = (uint8_t*)OICCalloc(1, sizeof(uint8_t) * chainSize);
- VERIFY_NON_NULL(TAG, certChain, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, certChain, ERROR, OC_STACK_NO_MEMORY);
memcpy(certChain, trustCertChain, chainSize);
- g_trustCertChainNotifier.callback(g_trustCertChainNotifier.context, credId,
+ g_trustCertChainNotifier.callback(g_trustCertChainNotifier.context, *credId,
certChain, chainSize);
OICFree(certChain);
}
OCStackResult SRPSaveOwnCertChain(OicSecCert_t * cert, OicSecKey_t * key, uint16_t *credId)
{
OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
- VERIFY_NON_NULL(TAG, cert, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, cert->data, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, key, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, key->data, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, credId, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, cert, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, cert->data, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, key, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, key->data, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, credId, ERROR, OC_STACK_INVALID_PARAM);
OCStackResult res = OC_STACK_ERROR;
OicSecCred_t *cred = (OicSecCred_t *)OICCalloc(1, sizeof(*cred));
- VERIFY_NON_NULL(TAG, cred, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, cred, ERROR, OC_STACK_NO_MEMORY);
OIC_LOG_V(DEBUG, TAG, "IN: %s", __func__);
}
cred->credUsage= (char *)OICCalloc(1, strlen(PRIMARY_CERT)+1 );
- VERIFY_NON_NULL(TAG, cred->credUsage, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, cred->credUsage, ERROR, OC_STACK_NO_MEMORY);
OICStrcpy(cred->credUsage, strlen(PRIMARY_CERT) + 1, PRIMARY_CERT) ;
cred->credType = SIGNED_ASYMMETRIC_KEY;
OicSecCert_t *publicData = &cred->publicData;
publicData->data = (uint8_t *)OICCalloc(1, cert->len);
- VERIFY_NON_NULL(TAG, publicData->data, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, publicData->data, ERROR, OC_STACK_NO_MEMORY);
memcpy(publicData->data, cert->data, cert->len);
publicData->len = cert->len;
OicSecKey_t *privateData = &cred->privateData;
privateData->data = (uint8_t *)OICCalloc(1, key->len);
- VERIFY_NON_NULL(TAG, privateData->data, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, privateData->data, ERROR, OC_STACK_NO_MEMORY);
memcpy(privateData->data, key->data, key->len);
privateData->len = key->len;
privateData->encoding = key->encoding;
const OCProvisionDev_t *pDev2,
OCProvisionResultCB resultCallback)
{
- VERIFY_NON_NULL(TAG, pDev1, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, pDev1, ERROR, OC_STACK_INVALID_PARAM);
if (SYMMETRIC_PAIR_WISE_KEY == type)
{
- VERIFY_NON_NULL(TAG, pDev2, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, pDev2, ERROR, OC_STACK_INVALID_PARAM);
}
if (!resultCallback)
{
OCStackResult res = PMGeneratePairWiseCredentials(type, keySize, &provTooldeviceID,
&firstDevice->doxm->deviceID, &secondDevice->doxm->deviceID,
&firstCred, &secondCred);
- VERIFY_SUCCESS(TAG, (res==OC_STACK_OK), ERROR, OC_STACK_ERROR);
+ VERIFY_SUCCESS_RET(TAG, (res==OC_STACK_OK), ERROR, OC_STACK_ERROR);
OIC_LOG(INFO, TAG, "Credentials generated successfully");
CredentialData_t *credData =
(CredentialData_t *) OICCalloc(1, sizeof(CredentialData_t));
OICFree(credData);
}
OIC_LOG_V(INFO, TAG, "provisionCredentials returned: %d",res);
- VERIFY_SUCCESS(TAG, (res==OC_STACK_OK), ERROR, OC_STACK_ERROR);
+ VERIFY_SUCCESS_RET(TAG, (res==OC_STACK_OK), ERROR, OC_STACK_ERROR);
return res;
}
default:
{
OIC_LOG_V(INFO, TAG, "Inside SRPProvisionACLCB.");
(void)UNUSED;
- VERIFY_NON_NULL(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
ACLData_t *aclData = (ACLData_t*)ctx;
OCProvisionResultCB resultCallback = aclData->resultCallback;
OCStackResult SRPProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
OicSecAcl_t *acl, OCProvisionResultCB resultCallback)
{
- VERIFY_NON_NULL(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, acl, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
+ VERIFY_NON_NULL_RET(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, acl, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
// if rowneruuid is empty, set it to device ID
OicUuid_t emptyOwner = {.id = {0} };
OICFree(aclData->resArr);
OICFree(aclData);
}
- VERIFY_SUCCESS(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
+ VERIFY_SUCCESS_RET(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
return OC_STACK_OK;
}
OCStackResult SRPSaveACL(const OicSecAcl_t *acl)
{
OIC_LOG(DEBUG, TAG, "IN SRPSaveACL");
- VERIFY_NON_NULL(TAG, acl, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, acl, ERROR, OC_STACK_INVALID_PARAM);
OCStackResult res = InstallACL(acl);
{
OIC_LOG_V(INFO, TAG, "Inside SRPProvisionDirectPairingCB.");
(void)UNUSED;
- VERIFY_NON_NULL(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
PconfData_t *pconfData = (PconfData_t*)ctx;
OCProvisionResultCB resultCallback = pconfData->resultCallback;
OCStackResult SRPProvisionDirectPairing(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
OicSecPconf_t *pconf, OCProvisionResultCB resultCallback)
{
- VERIFY_NON_NULL(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, pconf, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
+ VERIFY_NON_NULL_RET(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, pconf, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
// check direct-pairing capability
if (true != selectedDeviceInfo->doxm->dpc)
OICFree(pconfData->resArr);
OICFree(pconfData);
}
- VERIFY_SUCCESS(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
+ VERIFY_SUCCESS_RET(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
return OC_STACK_OK;
}
char reqBuf[MAX_URI_LENGTH + MAX_QUERY_LENGTH] = {0};
int snRet = 0;
//coaps://0.0.0.0:5684/oic/sec/cred?subjectid=(Canonical ENCODED UUID)
- char *srpUri = SRP_FORM_DELETE_CREDENTIAL;
+ const char *srpUri = SRP_FORM_DELETE_CREDENTIAL;
#ifdef __WITH_TLS__
if(CA_ADAPTER_TCP == destDev->endpoint.adapter)
{
{
(void) handle;
OIC_LOG(DEBUG, TAG, "IN SRPUnlinkDevice2CB");
- VERIFY_NON_NULL(TAG, unlinkCtx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, unlinkCtx, ERROR, OC_STACK_DELETE_TRANSACTION);
UnlinkData_t* unlinkData = (UnlinkData_t*)unlinkCtx;
if (clientResponse)
OCClientResponse *clientResponse)
{
OIC_LOG_V(INFO, TAG, "Inside SRPUnlinkDevice1CB ");
- VERIFY_NON_NULL(TAG, unlinkCtx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, unlinkCtx, ERROR, OC_STACK_DELETE_TRANSACTION);
UnlinkData_t* unlinkData = (UnlinkData_t*)unlinkCtx;
(void) handle;
}
UnlinkData_t* unlinkData = (UnlinkData_t*)OICCalloc(1, sizeof(UnlinkData_t));
- VERIFY_NON_NULL(TAG, unlinkData, ERROR, OC_STACK_NO_MEMORY);
+ VERIFY_NON_NULL_RET(TAG, unlinkData, ERROR, OC_STACK_NO_MEMORY);
//Initialize unlink data
unlinkData->ctx = ctx;
//Save the deleted status in delDevCtx
(void)handle;
OIC_LOG_V(INFO, TAG, "Inside SRPRemoveDeviceCB.");
- VERIFY_NON_NULL(TAG, delDevCtx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, delDevCtx, ERROR, OC_STACK_DELETE_TRANSACTION);
OCStackResult res = OC_STACK_ERROR;
RemoveData_t* removeData = (RemoveData_t*)delDevCtx;
//Save the deleted status in delDevCtx
(void)handle;
OIC_LOG_V(INFO, TAG, "Inside SRPSyncDeviceCredCB.");
- VERIFY_NON_NULL(TAG, delDevCtx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, delDevCtx, ERROR, OC_STACK_DELETE_TRANSACTION);
OCStackResult res = OC_STACK_ERROR;
RemoveData_t* removeData = (RemoveData_t*)delDevCtx;
* @return OC_STACK_DELETE_TRANSACTION to delete the transaction
* and OC_STACK_KEEP_TRANSACTION to keep it.
*/
-static OCStackApplicationResult SRPSyncDeviceACLCB(void *ctx, OCDoHandle handle,
+static OCStackApplicationResult SRPSyncDeviceACLCB(void *ctx, OCDoHandle UNUSED,
OCClientResponse *clientResponse)
{
+ (void)ctx;
+ (void)UNUSED;
+ (void)clientResponse;
return OC_STACK_DELETE_TRANSACTION;
}
* Callback handler of device remote reset.
*
* @param[in] ctx ctx value passed to callback from calling function.
- * @param[in] handle handle to an invocation
+ * @param[in] UNUSED handle to an invocation
* @param[in] clientResponse Response from queries to remote servers.
* @return OC_STACK_DELETE_TRANSACTION to delete the transaction
* and OC_STACK_KEEP_TRANSACTION to keep it.
*/
-static OCStackApplicationResult SRPResetDeviceCB(void *ctx, OCDoHandle handle,
+static OCStackApplicationResult SRPResetDeviceCB(void *ctx, OCDoHandle UNUSED,
OCClientResponse *clientResponse)
{
OIC_LOG(DEBUG, TAG, "IN SRPResetDeviceCB");
+ (void)UNUSED;
if(OC_STACK_OK == clientResponse->result)
{
OIC_LOG(DEBUG, TAG, "Change Target Device Pstat Cm SUCCEEDED");
}
static OCStackResult GetListofDevToReqDeleteCred(const OCProvisionDev_t* pRevokeTargetDev,
- OCProvisionDev_t* pOwnedDevList,
+ const OCProvisionDev_t* pOwnedDevList,
OCUuidList_t* pLinkedUuidList,
OCProvisionDev_t** ppLinkedDevList,
size_t *numOfLinkedDev)
if (pOwnedDevList)
{
// If this linked device is alive (power-on), add the deivce to the list.
- OCProvisionDev_t *curDev = NULL, *tmpDev = NULL;
+ const OCProvisionDev_t *curDev = NULL;
+ const OCProvisionDev_t *tmpDev = NULL;
LL_FOREACH_SAFE(pOwnedDevList, curDev, tmpDev)
{
if (memcmp(curDev->doxm->deviceID.id, curUuid->dev.id, sizeof(curUuid->dev.id)) == 0)
{
OIC_LOG_V(INFO, TAG, "Inside SRPGetCredResourceCB.");
(void)UNUSED;
- VERIFY_NON_NULL(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
GetSecData_t *GetSecData = (GetSecData_t*)ctx;
OCProvisionResultCB resultCallback = GetSecData->resultCallback;
size_t size = ((OCSecurityPayload*)clientResponse->payload)->payloadSize;
OIC_LOG_BUFFER(DEBUG, TAG, payload, size);
+ (void)size;
+ (void)payload;
registerResultForGetCredResourceCB(GetSecData, OC_STACK_OK);
((OCProvisionResultCB)(resultCallback))(GetSecData->ctx, GetSecData->numOfResults,
OCStackResult SRPGetCredResource(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
OCProvisionResultCB resultCallback)
{
- VERIFY_NON_NULL(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
+ VERIFY_NON_NULL_RET(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
char query[MAX_URI_LENGTH + MAX_QUERY_LENGTH] = {0};
if(!PMGenerateQuery(true,
OICFree(GetSecData->resArr);
OICFree(GetSecData);
}
- VERIFY_SUCCESS(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
+ VERIFY_SUCCESS_RET(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
OIC_LOG(DEBUG, TAG, "OUT SRPGetCredResource");
return OC_STACK_OK;
{
OIC_LOG_V(INFO, TAG, "Inside SRPGetACLResourceCB.");
(void)UNUSED;
- VERIFY_NON_NULL(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
+ VERIFY_NON_NULL_RET(TAG, ctx, ERROR, OC_STACK_DELETE_TRANSACTION);
GetSecData_t *GetSecData = (GetSecData_t*)ctx;
OCProvisionResultCB resultCallback = GetSecData->resultCallback;
size_t size = ((OCSecurityPayload*)clientResponse->payload)->payloadSize;
OIC_LOG_BUFFER(DEBUG, TAG, payload, size);
+ (void)payload;
+ (void)size;
registerResultForGetACLResourceCB(GetSecData, OC_STACK_OK);
((OCProvisionResultCB)(resultCallback))(GetSecData->ctx, GetSecData->numOfResults,
OCStackResult SRPGetACLResource(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
OCProvisionResultCB resultCallback)
{
- VERIFY_NON_NULL(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
+ VERIFY_NON_NULL_RET(TAG, selectedDeviceInfo, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL_RET(TAG, resultCallback, ERROR, OC_STACK_INVALID_CALLBACK);
char query[MAX_URI_LENGTH + MAX_QUERY_LENGTH] = {0};
if(!PMGenerateQuery(true,
OICFree(GetSecData->resArr);
OICFree(GetSecData);
}
- VERIFY_SUCCESS(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
+ VERIFY_SUCCESS_RET(TAG, (OC_STACK_OK == ret), ERROR, OC_STACK_ERROR);
OIC_LOG(DEBUG, TAG, "OUT SRPGetACLResource");
return OC_STACK_OK;