Commit cd1fc12e authored by Javier Guerra Melgares's avatar Javier Guerra Melgares

Merge branch 'maintenance/v2.10.0'

parents 7fcc50c3 46a29e11
[submodule "extlibs/iotivity-lite"]
path = extlibs/iotivity-lite
url = https://gerrit.iotivity.org/gerrit/iotivity-lite
branch = swig
url = https://gitlab.iotivity.org/iotivity/iotivity-lite.git
branch = master
......@@ -55,9 +55,8 @@ git checkout swig
```
2. Apply all patchs of the OTGC in IoTivity-lite
```
git apply <otgc-linux>/extlibs/patchs/remove_cred_by_credid.patch
git apply <otgc-linux>/extlibs/patchs/bwt_fix.patch
git apply <otgc-linux>/extlibs/patchs/timeout_fix.patch
git apply <otgc-linux>/extlibs/patchs/fix_swig_flags.patch
git apply <otgc-linux>/extlibs/patchs/ignore_cloud_discover_resources.patch
```
3. Go to the **android** directory.
```
......
Subproject commit 66a2d08784903110b7dead5b9a518933a355e1e6
Subproject commit 89a79af890df2084d7ae1e33522b6d0e24a3e9a3
diff --git a/api/oc_server_api.c b/api/oc_server_api.c
index 198fef46..e94cbcb3 100644
--- a/api/oc_server_api.c
+++ b/api/oc_server_api.c
@@ -395,7 +395,13 @@ oc_send_separate_response(oc_separate_response_t *handle,
oc_string(cur->uri), oc_string_len(cur->uri), &cur->endpoint,
cur->method, NULL, 0, OC_BLOCKWISE_SERVER);
if (response_state) {
- goto next_separate_request;
+ if (response_state->payload_size ==
+ response_state->next_block_offset) {
+ oc_blockwise_free_response_buffer(response_state);
+ response_state = NULL;
+ } else {
+ continue;
+ }
}
response_state = oc_blockwise_alloc_response_buffer(
oc_string(cur->uri), oc_string_len(cur->uri), &cur->endpoint,
diff --git a/messaging/coap/engine.c b/messaging/coap/engine.c
index f7bcfce3..b7c1b91a 100644
--- a/messaging/coap/engine.c
+++ b/messaging/coap/engine.c
@@ -274,6 +274,15 @@ coap_receive(oc_message_t *msg)
href, href_len, &msg->endpoint, message->code, message->uri_query,
message->uri_query_len, OC_BLOCKWISE_SERVER);
+ if (request_buffer && request_buffer->payload_size ==
+ request_buffer->next_block_offset) {
+ if ((request_buffer->next_block_offset - incoming_block_len) !=
+ block1_offset) {
+ oc_blockwise_free_request_buffer(request_buffer);
+ request_buffer = NULL;
+ }
+ }
+
if (!request_buffer && block1_num == 0) {
OC_DBG("creating new block-wise request buffer");
request_buffer = oc_blockwise_alloc_request_buffer(
@@ -307,7 +316,6 @@ coap_receive(oc_message_t *msg)
block1_size);
request_buffer->payload_size =
request_buffer->next_block_offset;
- request_buffer->ref_count = 0;
goto request_handler;
}
}
@@ -325,6 +333,13 @@ coap_receive(oc_message_t *msg)
response_buffer = oc_blockwise_find_response_buffer(
href, href_len, &msg->endpoint, message->code, message->uri_query,
message->uri_query_len, OC_BLOCKWISE_SERVER);
+
+ if (response_buffer && (response_buffer->next_block_offset -
+ block2_offset) > block2_size) {
+ oc_blockwise_free_response_buffer(response_buffer);
+ response_buffer = NULL;
+ }
+
if (response_buffer) {
OC_DBG("continuing ongoing block-wise transfer");
uint32_t payload_size = 0;
@@ -342,7 +357,6 @@ coap_receive(oc_message_t *msg)
(oc_blockwise_response_state_t *)response_buffer;
coap_set_header_etag(response, response_state->etag,
COAP_ETAG_LEN);
- response_buffer->ref_count = more;
goto send_message;
} else {
OC_ERR("could not dispatch block");
@@ -410,6 +424,13 @@ coap_receive(oc_message_t *msg)
request_buffer->payload_size = incoming_block_len;
request_buffer->ref_count = 0;
}
+ response_buffer = oc_blockwise_find_response_buffer(
+ href, href_len, &msg->endpoint, message->code, message->uri_query,
+ message->uri_query_len, OC_BLOCKWISE_SERVER);
+ if (response_buffer) {
+ oc_blockwise_free_response_buffer(response_buffer);
+ response_buffer = NULL;
+ }
goto request_handler;
} else {
OC_ERR("incoming payload size exceeds block size");
diff --git a/messaging/coap/observe.c b/messaging/coap/observe.c
index 62192fa5..2847d526 100644
--- a/messaging/coap/observe.c
+++ b/messaging/coap/observe.c
@@ -313,7 +313,12 @@ coap_notify_collection_observers(oc_resource_t *resource,
oc_string_len(obs->resource->uri) - 1, &obs->endpoint, OC_GET, NULL, 0,
OC_BLOCKWISE_SERVER);
if (response_state) {
- continue;
+ if (response_state->payload_size == response_state->next_block_offset) {
+ oc_blockwise_free_response_buffer(response_state);
+ response_state = NULL;
+ } else {
+ continue;
+ }
}
response_state = oc_blockwise_alloc_response_buffer(
oc_string(obs->resource->uri) + 1,
@@ -480,8 +485,7 @@ coap_remove_observers_on_dos_change(size_t device, bool reset)
coap_observer_t *obs = (coap_observer_t *)oc_list_head(observers_list);
while (obs != NULL) {
if (obs->endpoint.device == device &&
- (reset ||
- !oc_sec_check_acl(OC_GET, obs->resource, &obs->endpoint))) {
+ (reset || !oc_sec_check_acl(OC_GET, obs->resource, &obs->endpoint))) {
coap_observer_t *o = obs;
coap_packet_t notification[1];
#ifdef OC_TCP
@@ -638,7 +642,13 @@ coap_notify_observers(oc_resource_t *resource,
oc_string_len(obs->resource->uri) - 1, &obs->endpoint, OC_GET,
NULL, 0, OC_BLOCKWISE_SERVER);
if (response_state) {
- continue;
+ if (response_state->payload_size ==
+ response_state->next_block_offset) {
+ oc_blockwise_free_response_buffer(response_state);
+ response_state = NULL;
+ } else {
+ continue;
+ }
}
response_state = oc_blockwise_alloc_response_buffer(
oc_string(obs->resource->uri) + 1,
diff --git a/swig/Makefile b/swig/Makefile
index 8c42bd3c..83321526 100644
--- a/swig/Makefile
+++ b/swig/Makefile
@@ -77,6 +77,7 @@ endif
ifneq ($(SECURE),0)
EXTRA_FLAG += -DOC_SECURITY
+ SWIG_CFLAG += -DOC_SECURITY
endif
ifeq ($(IDD), 1)
@@ -85,6 +86,7 @@ endif
ifneq ($(PKI),0)
EXTRA_FLAG += -DOC_PKI
+ SWIG_CFLAG += -DOC_PKI
endif
ifeq ($(TCP),1)
diff --git a/swig/swig_interfaces/oc_cloud.i b/swig/swig_interfaces/oc_cloud.i
index 96efda20..dfb825ed 100644
--- a/swig/swig_interfaces/oc_cloud.i
+++ b/swig/swig_interfaces/oc_cloud.i
@@ -331,4 +331,6 @@ int jni_cloud_provision_conf_resource(oc_cloud_context_t *ctx,
}
%}
-%include "oc_cloud.h"
\ No newline at end of file
+%ignore oc_cloud_discover_resources;
+
+%include "oc_cloud.h"
diff --git a/include/oc_pki.h b/include/oc_pki.h
index acbab8c7..c16b512b 100644
--- a/include/oc_pki.h
+++ b/include/oc_pki.h
@@ -45,6 +45,9 @@ int oc_pki_add_trust_anchor(size_t device, const unsigned char *cert,
void oc_pki_set_security_profile(size_t device,
oc_sp_types_t supported_profiles,
oc_sp_types_t current_profile, int mfg_credid);
+
+void oc_pki_remove_credential_by_credid(size_t device, long credid);
+
#ifdef __cplusplus
}
#endif
diff --git a/security/oc_pki.c b/security/oc_pki.c
index a9306c23..52755576 100644
--- a/security/oc_pki.c
+++ b/security/oc_pki.c
@@ -354,6 +354,17 @@ oc_pki_add_trust_anchor(size_t device, const unsigned char *cert,
return pki_add_trust_anchor(device, cert, cert_size, OC_CREDUSAGE_TRUSTCA);
}
+void
+oc_pki_remove_credential_by_credid(size_t device, long credid)
+{
+ oc_sec_cred_t *cred = oc_sec_get_cred_by_credid(credid, device);
+ if (cred)
+ {
+ oc_sec_remove_cred(cred, device);
+ oc_sec_dump_cred(device);
+ }
+}
+
#else /* OC_PKI */
typedef int dummy_declaration;
#endif /* !OC_PKI */
diff --git a/swig/swig_interfaces/oc_pki.i b/swig/swig_interfaces/oc_pki.i
index 2765e562..9910770c 100644
--- a/swig/swig_interfaces/oc_pki.i
+++ b/swig/swig_interfaces/oc_pki.i
@@ -105,4 +105,6 @@ void jni_pki_set_security_profile(size_t device,
}
%}
-%include "oc_pki.h"
\ No newline at end of file
+%rename (removeCredentialByCredid) oc_pki_remove_credential_by_credid;
+
+%include "oc_pki.h"
diff --git a/onboarding_tool/obtmain.c b/onboarding_tool/obtmain.c
index 65bf47fa..a4b066ad 100644
--- a/onboarding_tool/obtmain.c
+++ b/onboarding_tool/obtmain.c
@@ -301,7 +301,7 @@ unowned_device_cb(oc_uuid_t *uuid, oc_endpoint_t *eps, void *data)
eps = eps->next;
}
- oc_do_get("/oic/d", ep, NULL, &get_device, LOW_QOS, unowned_devices);
+ oc_do_get("/oic/d", ep, NULL, &get_device, HIGH_QOS, unowned_devices);
}
static void
@@ -319,7 +319,7 @@ owned_device_cb(oc_uuid_t *uuid, oc_endpoint_t *eps, void *data)
eps = eps->next;
}
- oc_do_get("/oic/d", ep, NULL, &get_device, LOW_QOS, owned_devices);
+ oc_do_get("/oic/d", ep, NULL, &get_device, HIGH_QOS, owned_devices);
}
static void
@@ -1270,9 +1270,9 @@ main(void)
int init;
- static const oc_handler_t handler = {.init = app_init,
- .signal_event_loop = signal_event_loop,
- .requests_entry = issue_requests };
+ static const oc_handler_t handler = { .init = app_init,
+ .signal_event_loop = signal_event_loop,
+ .requests_entry = issue_requests };
oc_storage_config("./onboarding_tool_creds");
oc_set_factory_presets_cb(factory_presets_cb, NULL);
diff --git a/security/oc_obt.c b/security/oc_obt.c
index b6c28499..ebcc8320 100644
--- a/security/oc_obt.c
+++ b/security/oc_obt.c
@@ -358,17 +358,9 @@ free_otm_state(oc_otm_ctx_t *o, int status, oc_obt_otm_t otm)
oc_memb_free(&oc_otm_ctx_m, o);
}
-oc_event_callback_retval_t
-oc_obt_otm_request_timeout_cb(void *data)
-{
- free_otm_state(data, -1, 0);
- return OC_EVENT_DONE;
-}
-
void
oc_obt_free_otm_ctx(oc_otm_ctx_t *ctx, int status, oc_obt_otm_t otm)
{
- oc_remove_delayed_callback(ctx, oc_obt_otm_request_timeout_cb);
free_otm_state(ctx, status, otm);
}
@@ -772,13 +764,6 @@ free_hard_reset_ctx(oc_hard_reset_ctx_t *ctx, int status)
oc_memb_free(&oc_hard_reset_ctx_m, ctx);
}
-static oc_event_callback_retval_t
-hard_reset_timeout_cb(void *data)
-{
- free_hard_reset_ctx(data, -1);
- return OC_EVENT_DONE;
-}
-
static void
hard_reset_cb(int status, void *data)
{
@@ -787,7 +772,6 @@ hard_reset_cb(int status, void *data)
return;
}
d->switch_dos = NULL;
- oc_remove_delayed_callback(data, hard_reset_timeout_cb);
free_hard_reset_ctx(data, status);
}
@@ -821,7 +805,6 @@ oc_obt_device_hard_reset(oc_uuid_t *uuid, oc_obt_device_status_cb_t cb,
}
oc_list_add(oc_hard_reset_ctx_l, d);
- oc_set_delayed_callback(d, hard_reset_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
@@ -855,17 +838,9 @@ free_credprov_state(oc_credprov_ctx_t *p, int status)
oc_memb_free(&oc_credprov_ctx_m, p);
}
-static oc_event_callback_retval_t
-credprov_request_timeout_cb(void *data)
-{
- free_credprov_state(data, -1);
- return OC_EVENT_DONE;
-}
-
static void
free_credprov_ctx(oc_credprov_ctx_t *ctx, int status)
{
- oc_remove_delayed_callback(ctx, credprov_request_timeout_cb);
free_credprov_state(ctx, status);
}
@@ -1382,7 +1357,6 @@ oc_obt_provision_role_certificate(oc_role_t *roles, oc_uuid_t *uuid,
}
oc_list_add(oc_credprov_ctx_l, p);
- oc_set_delayed_callback(p, credprov_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
@@ -1431,7 +1405,6 @@ oc_obt_provision_identity_certificate(oc_uuid_t *uuid, oc_obt_status_cb_t cb,
}
oc_list_add(oc_credprov_ctx_l, p);
- oc_set_delayed_callback(p, credprov_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
@@ -1479,7 +1452,6 @@ oc_obt_provision_pairwise_credentials(oc_uuid_t *uuid1, oc_uuid_t *uuid2,
}
oc_list_add(oc_credprov_ctx_l, p);
- oc_set_delayed_callback(p, credprov_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
@@ -1683,17 +1655,9 @@ free_acl2prov_state(oc_acl2prov_ctx_t *request, int status)
oc_memb_free(&oc_acl2prov_m, request);
}
-static oc_event_callback_retval_t
-acl2prov_timeout_cb(void *data)
-{
- free_acl2prov_state(data, -1);
- return OC_EVENT_DONE;
-}
-
static void
free_acl2prov_ctx(oc_acl2prov_ctx_t *r, int status)
{
- oc_remove_delayed_callback(r, acl2prov_timeout_cb);
free_acl2prov_state(r, status);
}
@@ -1861,7 +1825,6 @@ oc_obt_provision_ace(oc_uuid_t *uuid, oc_sec_ace_t *ace,
}
oc_list_add(oc_acl2prov_l, r);
- oc_set_delayed_callback(r, acl2prov_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
diff --git a/security/oc_obt_internal.h b/security/oc_obt_internal.h
index d2f0dd3d..9d4d7f71 100644
--- a/security/oc_obt_internal.h
+++ b/security/oc_obt_internal.h
@@ -28,9 +28,7 @@ extern "C"
{
#endif
-#define DISCOVERY_CB_PERIOD (5)
-/* Worst case timeout for all onboarding/provisioning sequences */
-#define OBT_CB_TIMEOUT (15)
+#define DISCOVERY_CB_PERIOD (60)
/* Used for tracking owned/unowned devices in oc_obt's internal caches */
typedef struct oc_device_t
diff --git a/security/oc_obt_otm_cert.c b/security/oc_obt_otm_cert.c
index 062b38cb..0f511a64 100644
--- a/security/oc_obt_otm_cert.c
+++ b/security/oc_obt_otm_cert.c
@@ -396,7 +396,7 @@ obt_cert_7(oc_client_response_t *data)
}
/** 7) post acl rowneruuid
- */
+ */
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
@@ -648,7 +648,6 @@ oc_obt_perform_cert_otm(oc_uuid_t *uuid, oc_obt_device_status_cb_t cb,
*/
oc_endpoint_t *ep = oc_obt_get_unsecure_endpoint(device->endpoint);
if (oc_do_get("/oic/d", ep, NULL, &obt_cert_2, HIGH_QOS, o)) {
- oc_set_delayed_callback(o, oc_obt_otm_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
diff --git a/security/oc_obt_otm_justworks.c b/security/oc_obt_otm_justworks.c
index c1ea607e..f4ffeaab 100644
--- a/security/oc_obt_otm_justworks.c
+++ b/security/oc_obt_otm_justworks.c
@@ -395,7 +395,7 @@ obt_jw_7(oc_client_response_t *data)
}
/** 7) post acl rowneruuid
- */
+ */
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
@@ -647,7 +647,6 @@ oc_obt_perform_just_works_otm(oc_uuid_t *uuid, oc_obt_device_status_cb_t cb,
*/
oc_endpoint_t *ep = oc_obt_get_unsecure_endpoint(device->endpoint);
if (oc_do_get("/oic/d", ep, NULL, &obt_jw_2, HIGH_QOS, o)) {
- oc_set_delayed_callback(o, oc_obt_otm_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
diff --git a/security/oc_obt_otm_randompin.c b/security/oc_obt_otm_randompin.c
index 98fb7b1e..b1d03198 100644
--- a/security/oc_obt_otm_randompin.c
+++ b/security/oc_obt_otm_randompin.c
@@ -396,7 +396,7 @@ obt_rdp_6(oc_client_response_t *data)
}
/** 6) post acl rowneruuid
- */
+ */
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
@@ -645,7 +645,6 @@ oc_obt_perform_random_pin_otm(oc_uuid_t *uuid, const unsigned char *pin,
oc_tls_close_connection(ep);
oc_tls_select_psk_ciphersuite();
if (oc_do_get("/oic/d", ep, NULL, &obt_rdp_2, HIGH_QOS, o)) {
- oc_set_delayed_callback(o, oc_obt_otm_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
@@ -718,7 +717,6 @@ oc_obt_request_random_pin(oc_uuid_t *uuid, oc_obt_device_status_cb_t cb,
oc_rep_set_int(root, oxmsel, 1);
oc_rep_end_root_object();
if (oc_do_post()) {
- oc_set_delayed_callback(o, oc_obt_otm_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
}
diff --git a/security/oc_tls.c b/security/oc_tls.c
index ba25168f..983ecbe2 100644
--- a/security/oc_tls.c
+++ b/security/oc_tls.c
@@ -338,6 +338,7 @@ oc_tls_inactive(void *data)
return OC_EVENT_CONTINUE;
}
mbedtls_ssl_close_notify(&peer->ssl_ctx);
+ mbedtls_ssl_close_notify(&peer->ssl_ctx);
oc_tls_free_peer(peer, true);
}
OC_DBG("oc_tls: Terminating DTLS inactivity callback");
@@ -1292,6 +1293,7 @@ oc_tls_close_connection(oc_endpoint_t *endpoint)
{
oc_tls_peer_t *peer = oc_tls_get_peer(endpoint);
if (peer) {
+ mbedtls_ssl_close_notify(&peer->ssl_ctx);
mbedtls_ssl_close_notify(&peer->ssl_ctx);
oc_tls_free_peer(peer, false);
}
@@ -1687,6 +1689,7 @@ read_application_data(oc_tls_peer_t *peer)
if (peer->role == MBEDTLS_SSL_IS_SERVER &&
(peer->endpoint.flags & TCP) == 0) {
mbedtls_ssl_close_notify(&peer->ssl_ctx);
+ mbedtls_ssl_close_notify(&peer->ssl_ctx);
}
oc_tls_free_peer(peer, false);
return;
......@@ -30,7 +30,7 @@ android {
minSdkVersion 21
targetSdkVersion 28
versionCode 13
versionName "2.9.0"
versionName "2.10.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
compileOptions {
......
......@@ -22,28 +22,19 @@
package org.openconnectivity.otgc.data.repository;
import org.iotivity.CborEncoder;
import org.iotivity.OCAceConnectionType;
import org.iotivity.OCAceResource;
import org.iotivity.OCAceWildcard;
import org.iotivity.OCClientResponse;
import org.iotivity.OCEndpoint;
import org.iotivity.OCEndpointUtil;
import org.iotivity.OCMain;
import org.iotivity.OCObt;
import org.iotivity.OCObtAclHandler;
import org.iotivity.OCObtDeviceStatusHandler;
import org.iotivity.OCQos;
import org.iotivity.OCResponseHandler;
import org.iotivity.OCObtStatusHandler;
import org.iotivity.OCSecurityAce;
import org.iotivity.OCStatus;
import org.iotivity.OCSecurityAcl;
import org.iotivity.OCUuid;
import org.iotivity.OCUuidUtil;
import org.openconnectivity.otgc.domain.model.resource.secure.acl.OcAce;
import org.openconnectivity.otgc.domain.model.resource.secure.acl.OcAceResource;
import org.openconnectivity.otgc.domain.model.resource.secure.acl.OcAceSubject;
import org.openconnectivity.otgc.domain.model.resource.secure.acl.OcAceSubjectType;
import org.openconnectivity.otgc.domain.model.resource.secure.acl.OcAcl;
import org.openconnectivity.otgc.utils.constant.OcfResourceUri;
import org.openconnectivity.otgc.utils.constant.OcfWildcard;
import java.io.IOException;
......@@ -65,64 +56,33 @@ public class AmsRepository {
}
public Single<OcAcl> getAcl(String endpoint, String deviceId) {
public Single<OcAcl> getAcl(String deviceId) {
return Single.create(emitter -> {
OCEndpoint ep = OCEndpointUtil.stringToEndpoint(endpoint, new String[1]);
OCUuid uuid = OCUuidUtil.stringToUuid(deviceId);
OCEndpointUtil.setDi(ep, uuid);
OCResponseHandler handler = (OCClientResponse response) -> {
if (response.getCode().equals(OCStatus.OC_STATUS_OK)) {
OcAcl acl = new OcAcl();
acl.parseOCRepresentation(response.getPayload());
emitter.onSuccess(acl);
} else {
Timber.d("GET ACL error - Status code: " + response.getCode());
emitter.onError(new Exception("GET ACL error - Status code: " + response.getCode()));
}
};
if (!OCMain.doGet(OcfResourceUri.ACL2_URI, ep, null, handler, OCQos.HIGH_QOS)) {
emitter.onError(new Exception("GET ACL error"));
}
OCEndpointUtil.freeEndpoint(ep);
});
}
OCObtAclHandler handler = (OCSecurityAcl acl) -> {
if (acl != null) {
OcAcl aclRet = new OcAcl();
aclRet.parseOCRepresentation(acl);
emitter.onSuccess(aclRet);
private Completable provisionAcl(String endpoint, String deviceId, OcAcl acl) {
return Completable.create(emitter -> {
OCEndpoint ep = OCEndpointUtil.stringToEndpoint(endpoint, new String[1]);
OCUuid uuid = OCUuidUtil.stringToUuid(deviceId);
OCEndpointUtil.setDi(ep, uuid);
OCResponseHandler handler = (OCClientResponse response) -> {
OCStatus code = response.getCode();
if (code.equals(OCStatus.OC_STATUS_OK) || code.equals(OCStatus.OC_STATUS_CHANGED)) {
Timber.d("Provision ACL succeeded");
emitter.onComplete();
/* Freeing the ACL structure */
OCObt.freeAcl(acl);
} else {
emitter.onError(new IOException("Provision ACE error"));
String error = "GET ACL error";
Timber.d(error);
emitter.onError(new Exception(error));
}
};
if (OCMain.initPost(OcfResourceUri.ACL2_URI, ep, null, handler, OCQos.LOW_QOS)) {
CborEncoder root = acl.parseToCbor();
if (OCMain.doPost()) {
Timber.d("Sent POST request to /oic/sec/acl2");
} else {
String error = "Could not send POST request to /oic/sec/acl2";
Timber.e(error);
emitter.onError(new Exception(error));
}
int ret = OCObt.retrieveAcl(uuid, handler);
if (ret >= 0) {
Timber.d("Successfully issued request to RETRIEVE /oic/sec/acl2");
} else {
String error = "Could not init POST request to /oic/sec/acl2";
String error = "ERROR issuing request to RETRIEVE /oic/sec/acl2";
Timber.e(error);
emitter.onError(new Exception(error));
}
OCEndpointUtil.freeEndpoint(ep);
});
}
......@@ -162,22 +122,6 @@ public class AmsRepository {
});
}
public Completable provisionUuidAcl(String endpoint, String deviceId, String subjectId, List<String> verticalResources, long permission) {
OcAceSubject subject = new OcAceSubject();
subject.setType(OcAceSubjectType.UUID_TYPE);
subject.setUuid(subjectId);
OcAce ace = new OcAce();
ace.setSubject(subject);
ace.setPermission((permission));