Commit 5af61037 authored by Kishen Maloor's avatar Kishen Maloor

oc_obt_otm_*: query oxms before selecting oxm

Change-Id: Iad1ae241333d546c34aa4715942d3dd9752647cc
Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent bb56ee3c
......@@ -578,10 +578,21 @@ obt_cert_2(oc_client_response_t *data)
goto err_obt_cert_2;
}
char *icv = NULL;
size_t icv_len = 0;
if (oc_rep_get_string(data->payload, "icv", &icv, &icv_len)) {
/* TODO: Record icv here */
int64_t *oxms = NULL;
size_t oxms_len = 0;
if (oc_rep_get_int_array(data->payload, "oxms", &oxms, &oxms_len)) {
size_t i;
for (i = 0; i < oxms_len; i++) {
if (oxms[i] == OC_OXMTYPE_MFG_CERT) {
break;
}
}
if (i == oxms_len) {
goto err_obt_cert_2;
}
/** 2) post doxm oxmsel=2
*/
oc_device_t *device = o->device;
......@@ -602,7 +613,7 @@ err_obt_cert_2:
/*
OTM sequence:
1) get /oic/d
1) get doxm
2) post doxm oxmsel=2
3) <Open-TLS_ECDSA_with_Mfg_Cert>+post pstat om=4
4) post doxm devowneruuid
......@@ -644,10 +655,10 @@ oc_obt_perform_cert_otm(oc_uuid_t *uuid, oc_obt_device_status_cb_t cb,
o->cb.data = data;
o->device = device;
/** 1) get /oic/d
/** 1) get doxm
*/
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)) {
if (oc_do_get("/oic/sec/doxm", ep, NULL, &obt_cert_2, HIGH_QOS, o)) {
oc_set_delayed_callback(o, oc_obt_otm_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
......
......@@ -577,10 +577,21 @@ obt_jw_2(oc_client_response_t *data)
goto err_obt_jw_2;
}
char *icv = NULL;
size_t icv_len = 0;
if (oc_rep_get_string(data->payload, "icv", &icv, &icv_len)) {
/* TODO: Record icv here */
int64_t *oxms = NULL;
size_t oxms_len = 0;
if (oc_rep_get_int_array(data->payload, "oxms", &oxms, &oxms_len)) {
size_t i;
for (i = 0; i < oxms_len; i++) {
if (oxms[i] == OC_OXMTYPE_JW) {
break;
}
}
if (i == oxms_len) {
goto err_obt_jw_2;
}
/** 2) post doxm oxmsel=0
*/
oc_device_t *device = o->device;
......@@ -601,7 +612,7 @@ err_obt_jw_2:
/*
OTM sequence:
1) get /oic/d
1) get doxm
2) post doxm oxmsel=0
3) <Open-anon-ecdh>+post pstat om=4
4) post doxm devowneruuid
......@@ -643,10 +654,10 @@ oc_obt_perform_just_works_otm(oc_uuid_t *uuid, oc_obt_device_status_cb_t cb,
o->cb.data = data;
o->device = device;
/** 1) get /oic/d
/** 1) get doxm
*/
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)) {
if (oc_do_get("/oic/sec/doxm", ep, NULL, &obt_jw_2, HIGH_QOS, o)) {
oc_set_delayed_callback(o, oc_obt_otm_request_timeout_cb, OBT_CB_TIMEOUT);
return 0;
}
......
......@@ -32,42 +32,42 @@
/* Random PIN OTM */
static void
obt_rdp_14(oc_client_response_t *data)
obt_rdp_13(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_14");
OC_DBG("In obt_rdp_13");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
return;
}
/** 14) <close DTLS>
/** 13) <close DTLS>
*/
oc_obt_free_otm_ctx(o, 0, OC_OBT_OTM_RDP);
}
static void
obt_rdp_13(oc_client_response_t *data)
obt_rdp_12(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_13");
OC_DBG("In obt_rdp_12");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_13;
goto err_obt_rdp_12;
}
/** 13) post pstat s=rfnop
/** 12) post pstat s=rfnop
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_rdp_14, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_rdp_13, HIGH_QOS, o)) {
oc_rep_start_root_object();
oc_rep_set_object(root, dos);
oc_rep_set_int(dos, s, OC_DOS_RFNOP);
......@@ -78,28 +78,28 @@ obt_rdp_13(oc_client_response_t *data)
}
}
err_obt_rdp_13:
err_obt_rdp_12:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_12(oc_client_response_t *data)
obt_rdp_11(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_12");
OC_DBG("In obt_rdp_11");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_12;
goto err_obt_rdp_11;
}
/** 12) post acl2 with ACEs for res, p, d, csr, sp
/** 11) post acl2 with ACEs for res, p, d, csr, sp
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/acl2", ep, NULL, &obt_rdp_13, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/acl2", ep, NULL, &obt_rdp_12, HIGH_QOS, o)) {
char uuid[OC_UUID_LEN];
oc_uuid_t *my_uuid = oc_core_get_device_id(0);
oc_uuid_to_str(my_uuid, uuid, OC_UUID_LEN);
......@@ -180,55 +180,55 @@ obt_rdp_12(oc_client_response_t *data)
}
}
err_obt_rdp_12:
err_obt_rdp_11:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_11(oc_client_response_t *data)
obt_rdp_10(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_11");
OC_DBG("In obt_rdp_10");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_11;
goto err_obt_rdp_10;
}
/** 11) delete acl2
/** 10) delete acl2
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_do_delete("/oic/sec/acl2", ep, NULL, &obt_rdp_12, HIGH_QOS, o)) {
if (oc_do_delete("/oic/sec/acl2", ep, NULL, &obt_rdp_11, HIGH_QOS, o)) {
return;
}
err_obt_rdp_11:
err_obt_rdp_10:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_10(oc_client_response_t *data)
obt_rdp_9(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_10");
OC_DBG("In obt_rdp_9");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_10;
goto err_obt_rdp_9;
}
/** 10) <close DTLS>+<Open-TLS-PSK>+post pstat s=rfpro
/** 9) <close DTLS>+<Open-TLS-PSK>+post pstat s=rfpro
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
oc_tls_close_connection(ep);
oc_tls_select_psk_ciphersuite();
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_rdp_11, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_rdp_10, HIGH_QOS, o)) {
oc_rep_start_root_object();
oc_rep_set_object(root, dos);
oc_rep_set_int(dos, s, OC_DOS_RFPRO);
......@@ -239,30 +239,30 @@ obt_rdp_10(oc_client_response_t *data)
}
}
err_obt_rdp_10:
err_obt_rdp_9:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_9(oc_client_response_t *data)
obt_rdp_8(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_9");
OC_DBG("In obt_rdp_8");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_9;
goto err_obt_rdp_8;
}
oc_sec_dump_cred(0);
/** 9) post doxm owned = true
/** 8) post doxm owned = true
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/doxm", ep, NULL, &obt_rdp_10, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/doxm", ep, NULL, &obt_rdp_9, HIGH_QOS, o)) {
oc_rep_start_root_object();
oc_rep_set_boolean(root, owned, true);
oc_rep_end_root_object();
......@@ -271,21 +271,21 @@ obt_rdp_9(oc_client_response_t *data)
}
}
err_obt_rdp_9:
err_obt_rdp_8:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_8(oc_client_response_t *data)
obt_rdp_7(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_8");
OC_DBG("In obt_rdp_7");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_8;
goto err_obt_rdp_7;
}
oc_device_t *device = o->device;
......@@ -304,7 +304,7 @@ obt_rdp_8(oc_client_response_t *data)
device->uuid.id, 16, my_uuid->id, 16, key, 16);
#undef OXM_RDP
if (!derived) {
goto err_obt_rdp_8;
goto err_obt_rdp_7;
}
int credid = oc_sec_add_new_cred(0, false, NULL, -1, OC_CREDTYPE_PSK,
......@@ -312,7 +312,7 @@ obt_rdp_8(oc_client_response_t *data)
16, key, 0, 0, NULL, NULL, NULL);
if (credid == -1) {
goto err_obt_rdp_8;
goto err_obt_rdp_7;
}
oc_sec_cred_t *oc = oc_sec_get_cred_by_credid(credid, 0);
......@@ -322,7 +322,7 @@ obt_rdp_8(oc_client_response_t *data)
/** 7) post cred rowneruuid, cred
*/
if (oc_init_post("/oic/sec/cred", ep, NULL, &obt_rdp_9, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/cred", ep, NULL, &obt_rdp_8, HIGH_QOS, o)) {
oc_rep_start_root_object();
oc_rep_set_array(root, creds);
oc_rep_object_array_start_item(creds);
......@@ -344,28 +344,28 @@ obt_rdp_8(oc_client_response_t *data)
}
}
err_obt_rdp_8:
err_obt_rdp_7:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_7(oc_client_response_t *data)
obt_rdp_6(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_7");
OC_DBG("In obt_rdp_6");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_7;
goto err_obt_rdp_6;
}
/** 7) post pstat rowneruuid
/** 6) post pstat rowneruuid
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_rdp_8, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_rdp_7, HIGH_QOS, o)) {
oc_uuid_t *my_uuid = oc_core_get_device_id(0);
char uuid[OC_UUID_LEN];
oc_uuid_to_str(my_uuid, uuid, OC_UUID_LEN);
......@@ -378,29 +378,29 @@ obt_rdp_7(oc_client_response_t *data)
}
}
err_obt_rdp_7:
err_obt_rdp_6:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_6(oc_client_response_t *data)
obt_rdp_5(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_6");
OC_DBG("In obt_rdp_5");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_6;
goto err_obt_rdp_5;
}
/** 6) post acl rowneruuid
/** 5) post acl rowneruuid
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/acl2", ep, NULL, &obt_rdp_7, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/acl2", ep, NULL, &obt_rdp_6, HIGH_QOS, o)) {
oc_uuid_t *my_uuid = oc_core_get_device_id(0);
char uuid[OC_UUID_LEN];
oc_uuid_to_str(my_uuid, uuid, OC_UUID_LEN);
......@@ -413,29 +413,29 @@ obt_rdp_6(oc_client_response_t *data)
}
}
err_obt_rdp_6:
err_obt_rdp_5:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_5(oc_client_response_t *data)
obt_rdp_4(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_5");
OC_DBG("In obt_rdp_4");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_5;
goto err_obt_rdp_4;
}
/** 5) post doxm rowneruuid
/** 4) post doxm rowneruuid
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/doxm", ep, NULL, &obt_rdp_6, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/doxm", ep, NULL, &obt_rdp_5, HIGH_QOS, o)) {
oc_uuid_t *my_uuid = oc_core_get_device_id(0);
char uuid[OC_UUID_LEN];
oc_uuid_to_str(my_uuid, uuid, OC_UUID_LEN);
......@@ -449,24 +449,24 @@ obt_rdp_5(oc_client_response_t *data)
}
}
err_obt_rdp_5:
err_obt_rdp_4:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_4(oc_client_response_t *data)
obt_rdp_3(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_4");
OC_DBG("In obt_rdp_3");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_4;
goto err_obt_rdp_3;
}
/** 4) generate random deviceuuid; <store new peer uuid>; post doxm deviceuuid
/** 3) generate random deviceuuid; <store new peer uuid>; post doxm deviceuuid
*/
oc_uuid_t dev_uuid = { 0 };
oc_gen_uuid(&dev_uuid);
......@@ -491,7 +491,7 @@ obt_rdp_4(oc_client_response_t *data)
}
ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/doxm", ep, NULL, &obt_rdp_5, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/doxm", ep, NULL, &obt_rdp_4, HIGH_QOS, o)) {
oc_rep_start_root_object();
/* Set random uuid as deviceuuid */
......@@ -502,28 +502,28 @@ obt_rdp_4(oc_client_response_t *data)
}
}
err_obt_rdp_4:
err_obt_rdp_3:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_3(oc_client_response_t *data)
obt_rdp_2(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_3");
OC_DBG("In obt_rdp_2");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_3;
goto err_obt_rdp_2;
}
/** 3) post doxm devowneruuid
/** 2) post doxm devowneruuid
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/doxm", ep, NULL, &obt_rdp_4, HIGH_QOS, o)) {
if (oc_init_post("/oic/sec/doxm", ep, NULL, &obt_rdp_3, HIGH_QOS, o)) {
oc_uuid_t *my_uuid = oc_core_get_device_id(0);
char ouuid[OC_UUID_LEN];
oc_uuid_to_str(my_uuid, ouuid, OC_UUID_LEN);
......@@ -537,61 +537,25 @@ obt_rdp_3(oc_client_response_t *data)
}
}
err_obt_rdp_3:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
static void
obt_rdp_2(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rdp_2");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rdp_2;
}
char *icv = NULL;
size_t icv_len = 0;
if (oc_rep_get_string(data->payload, "icv", &icv, &icv_len)) {
/* TODO: Record icv here */
/** 2) post pstat om=4
*/
oc_device_t *device = o->device;
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_rdp_3, HIGH_QOS, o)) {
oc_rep_start_root_object();
oc_rep_set_int(root, om, 4);
oc_rep_end_root_object();
if (oc_do_post()) {
return;
}
}
}
err_obt_rdp_2:
oc_obt_free_otm_ctx(o, -1, OC_OBT_OTM_RDP);
}
/*
OTM sequence:
1) provision PSK cred locally+<Open-TLS-PSK>+get /oic/d
2) post pstat om=4
3) post doxm devowneruuid
4) generate random deviceuuid; <store new peer uuid>; post doxm deviceuuid
5) post doxm rowneruuid
6) post acl rowneruuid
7) post pstat rowneruuid
8) post cred rowneruuid, cred
9) post doxm owned = true
10) <close DTLS>+<Open-TLS-PSK>+post pstat s=rfpro
11) delete acl2
12) post acl2 with ACEs for res, p, d, csr, sp
13) post pstat s=rfnop
14) <close DTLS>
1) provision PSK cred locally+<Open-TLS-PSK>+post pstat om=4
2) post doxm devowneruuid
3) generate random deviceuuid; <store new peer uuid>; post doxm deviceuuid
4) post doxm rowneruuid
5) post acl rowneruuid
6) post pstat rowneruuid
7) post cred rowneruuid, cred
8) post doxm owned = true
9) <close DTLS>+<Open-TLS-PSK>+post pstat s=rfpro
10) delete acl2
11) post acl2 with ACEs for res, p, d, csr, sp
12) post pstat s=rfnop
13) <close DTLS>
*/
int
oc_obt_perform_random_pin_otm(oc_uuid_t *uuid, const unsigned char *pin,
......@@ -639,14 +603,19 @@ oc_obt_perform_random_pin_otm(oc_uuid_t *uuid, const unsigned char *pin,
o->cb.data = data;
o->device = device;
/** 1) <Open-TLS-PSK>+get /oic/d
/** 1) <Open-TLS-PSK>+post pstat om=4
*/
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
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;
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_rdp_2, HIGH_QOS, o)) {
oc_rep_start_root_object();
oc_rep_set_int(root, om, 4);
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;
}
}
oc_sec_cred_t *c = oc_sec_get_cred_by_credid(credid, 0);
......@@ -661,6 +630,26 @@ oc_obt_perform_random_pin_otm(oc_uuid_t *uuid, const unsigned char *pin,
/* Request a peer device to generate and display a Random PIN */
static void
obt_rrdp_3(oc_client_response_t *data)
{
if (!oc_obt_is_otm_ctx_valid(data->user_data)) {
return;
}
OC_DBG("In obt_rrdp_3");
oc_otm_ctx_t *o = (oc_otm_ctx_t *)data->user_data;
if (data->code >= OC_STATUS_BAD_REQUEST) {
goto err_obt_rrdp_3;
}
oc_obt_free_otm_ctx(o, 0, OC_OBT_RDP);
return;
err_obt_rrdp_3:
oc_obt_free_otm_ctx(o, -1, OC_OBT_RDP);
}
static void
obt_rrdp_2(oc_client_response_t *data)
{
......@@ -674,17 +663,45 @@ obt_rrdp_2(oc_client_response_t *data)
goto err_obt_rrdp_2;
}
oc_obt_free_otm_ctx(o, 0, OC_OBT_RDP);
return;
int64_t *oxms = NULL;
size_t oxms_len = 0;
if (oc_rep_get_int_array(data->payload, "oxms", &oxms, &oxms_len)) {