The enum types for forbidden request and unauthorized request in
CAResponseResult_t added as part of security where misisng in a sanity
check switch case. This caused the forbidden and unauthorized response
codes to be classified as invalid.
Change-Id: Idc53a50422e3d5e43a847395a2389da351ea6baf
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1610
Reviewed-by: Erich Keane <erich.keane@intel.com>
Reviewed-by: Sachin Agrawal <sachin.agrawal@intel.com>
Tested-by: Sachin Agrawal <sachin.agrawal@intel.com>
}
// check the result value of response info.
+ // Keep this check in sync with CAResponseResult_t
switch (rep->result)
{
case CA_EMPTY:
case CA_CHANGED:
case CA_CONTENT:
case CA_BAD_REQ:
+ case CA_UNAUTHORIZED_REQ:
case CA_BAD_OPT:
+ case CA_FORBIDDEN_REQ:
case CA_NOT_FOUND:
case CA_INTERNAL_SERVER_ERROR:
case CA_RETRANSMIT_TIMEOUT:
break;
default:
- OIC_LOG(ERROR, TAG, "Response status code is invalid number");
+ OIC_LOG_V(ERROR, TAG, "Response code %u is invalid", rep->result);
return NULL;
}