From: Chul Lee Date: Wed, 26 Oct 2016 05:46:15 +0000 (+0900) Subject: [IOT-1473] Modify the return value of MOT related API. X-Git-Tag: 1.2.1~216 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdb522e7b45d8852ea63316f77540c38f2007c32;p=platform%2Fupstream%2Fiotivity.git [IOT-1473] Modify the return value of MOT related API. Change-Id: I9e2a6d79358538896c64e5870d96c0ca796a0b6e Signed-off-by: Chul Lee Reviewed-on: https://gerrit.iotivity.org/gerrit/13687 Tested-by: jenkins-iotivity Reviewed-by: dongik Lee Reviewed-by: Randeep Singh (cherry picked from commit bbe7232e50edc0e1db38a45f17fba8e5da26612a) Reviewed-on: https://gerrit.iotivity.org/gerrit/13793 --- diff --git a/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c b/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c index 76c2684..492c184 100644 --- a/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c +++ b/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c @@ -327,15 +327,16 @@ exit: OCStackResult MOTSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo, const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback) { - OCStackResult postMomRes = OC_STACK_INVALID_PARAM; + OCStackResult postMomRes = OC_STACK_INVALID_CALLBACK; OicSecDoxm_t* doxm = NULL; uint8_t* doxmPayload = NULL; size_t doxmPayloadLen = 0; OIC_LOG(DEBUG, TAG, "IN MOTSelectOTMethod"); - VERIFY_NON_NULL(TAG, targetDeviceInfo, ERROR); VERIFY_NON_NULL(TAG, resultCallback, ERROR); + postMomRes = OC_STACK_INVALID_PARAM; + VERIFY_NON_NULL(TAG, targetDeviceInfo, ERROR); bool isValidOxmsel = false; for(size_t i = 0; i < targetDeviceInfo->doxm->oxmLen; i++) @@ -383,7 +384,7 @@ exit: OCStackResult MOTProvisionPreconfigPIN(void *ctx, const OCProvisionDev_t *targetDeviceInfo, const char* preconfPIN, size_t preconfPINLen, OCProvisionResultCB resultCallback) { - OCStackResult postCredRes = OC_STACK_INVALID_PARAM; + OCStackResult postCredRes = OC_STACK_INVALID_CALLBACK; bool freeFlag = true; OCSecurityPayload* secPayload = NULL; MOTContext_t *motCtx = NULL; @@ -391,8 +392,9 @@ OCStackResult MOTProvisionPreconfigPIN(void *ctx, const OCProvisionDev_t *target OIC_LOG(DEBUG, TAG, "IN MOTProvisionPreconfigPIN"); - VERIFY_NON_NULL(TAG, targetDeviceInfo, ERROR); VERIFY_NON_NULL(TAG, resultCallback, ERROR); + postCredRes = OC_STACK_INVALID_PARAM; + VERIFY_NON_NULL(TAG, targetDeviceInfo, ERROR); VERIFY_NON_NULL(TAG, preconfPIN, ERROR); VERIFY_SUCCESS(TAG, (0 != preconfPINLen), ERROR); VERIFY_SUCCESS(TAG, (0 != preconfPINLen && OXM_PRECONFIG_PIN_SIZE >= preconfPINLen), ERROR);