aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKishen Maloor <kishen.maloor@intel.com>2018-12-11 17:14:49 -0800
committerKishen Maloor <kishen.maloor@intel.com>2018-12-14 04:05:15 +0000
commit4f045e4a0f6d05a564877a6413cf33a51173fe25 (patch)
tree43feb41f7ec00d8c9d25c7723d74d9a6edd8ebbb
parentb73ed00cbb99539b3f9866965781bdba96aa3f0d (diff)
oc_core_res: fix oc_core_get_resource_by_uri
Change-Id: Idd970eec049a3d9b63be3ba5384d370bb50ad6bd Signed-off-by: Kishen Maloor <kishen.maloor@intel.com> Reviewed-on: https://gerrit.iotivity.org/gerrit/27763
-rw-r--r--api/oc_core_res.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/api/oc_core_res.c b/api/oc_core_res.c
index 61bd33f..0c75c16 100644
--- a/api/oc_core_res.c
+++ b/api/oc_core_res.c
@@ -524,8 +524,8 @@ oc_core_get_resource_by_uri(const char *uri, size_t device)
type = OCF_INTROSPECTION_DATA;
}
#ifdef OC_SECURITY
- else if ((strlen(uri) - skip) == 11 &&
- memcmp(uri + skip, "oic/sec/doxm", 11) == 0) {
+ else if ((strlen(uri) - skip) == 12 &&
+ memcmp(uri + skip, "oic/sec/doxm", 12) == 0) {
type = OCF_SEC_DOXM;
} else if ((strlen(uri) - skip) == 12 &&
memcmp(uri + skip, "oic/sec/pstat", 12) == 0) {
@@ -533,10 +533,19 @@ oc_core_get_resource_by_uri(const char *uri, size_t device)
} else if ((strlen(uri) - skip) == 12 &&
memcmp(uri + skip, "oic/sec/acl2", 12) == 0) {
type = OCF_SEC_ACL;
- } else if ((strlen(uri) - skip) == 11 &&
- strncmp(uri + skip, "oic/sec/cred", 11) == 0) {
+ } else if ((strlen(uri) - skip) == 12 &&
+ strncmp(uri + skip, "oic/sec/cred", 12) == 0) {
type = OCF_SEC_CRED;
}
+#ifdef OC_PKI
+ else if ((strlen(uri) - skip) == 10 &&
+ strncmp(uri + skip, "oic/sec/sp", 10) == 0) {
+ type = OCF_SEC_SP;
+ } else if ((strlen(uri) - skip) == 11 &&
+ strncmp(uri + skip, "oic/sec/csr", 11) == 0) {
+ type = OCF_SEC_CSR;
+ }
+#endif /* OC_PKI */
#endif /* OC_SECURITY */
else {
return NULL;