From: Senthil Kumar G S Date: Mon, 15 Jul 2019 12:37:54 +0000 (+0530) Subject: Map the error code of CAGenerateToken() to OCStackResult. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=79180296017c57ab0e042b7a51c5f02c6d4ed25d;p=platform%2Fupstream%2Fiotivity.git Map the error code of CAGenerateToken() to OCStackResult. CAGenerateToken could fail for memory overflow or invalid token parameters. Currently, from OCDoRequest(), we return OC_STACK_ERROR for all failure cases. This commit maps the error code to OCStackResult. https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/a7e9837b18e33dd536af97f5c9ad35417b9457b8 (cherry-picked from a7e9837b18e33dd536af97f5c9ad35417b9457b8) Change-Id: Ib26555a13eba9e7d925b0eb1db13b4fc12f74c6f Signed-off-by: Senthil Kumar G S Signed-off-by: Sudipto --- diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index ce79291..dce6116 100644 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -3057,7 +3057,7 @@ OCStackResult OCDoRequest(OCDoHandle *handle, if (caResult != CA_STATUS_OK) { OIC_LOG(ERROR, TAG, "CAGenerateToken error"); - result= OC_STACK_ERROR; + result = CAResultToOCResult(caResult); goto exit; }