Map the error code of CAGenerateToken() to OCStackResult. 13/212713/1
authorSenthil Kumar G S <senthil.gs@samsung.com>
Mon, 15 Jul 2019 12:37:54 +0000 (18:07 +0530)
committerSudipto <sudipto.bal@samsung.com>
Mon, 26 Aug 2019 06:53:01 +0000 (12:23 +0530)
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 <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
resource/csdk/stack/src/ocstack.c

index ce79291..dce6116 100644 (file)
@@ -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;
     }