Commit c0a84e80 authored by Kishen Maloor's avatar Kishen Maloor

oc_obt: Close pre-existing connections before OTM

Change-Id: Ie1a687eae30f74df8d0e43ebd587a439bb1cdd68
Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 616f3316
......@@ -549,8 +549,9 @@ obt_cert_3(oc_client_response_t *data)
/** 3) <Open-TLS_ECDSA_with_Mfg_Cert>+post pstat om=4
*/
oc_device_t *device = o->device;
oc_tls_select_cert_ciphersuite();
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
oc_tls_close_connection(ep);
oc_tls_select_cert_ciphersuite();
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_cert_4, HIGH_QOS, o)) {
oc_rep_start_root_object();
oc_rep_set_int(root, om, 4);
......
......@@ -548,8 +548,9 @@ obt_jw_3(oc_client_response_t *data)
/** 3) <Open-anon-ecdh>+post pstat om=4
*/
oc_device_t *device = o->device;
oc_tls_select_anon_ciphersuite();
oc_endpoint_t *ep = oc_obt_get_secure_endpoint(device->endpoint);
oc_tls_close_connection(ep);
oc_tls_select_anon_ciphersuite();
if (oc_init_post("/oic/sec/pstat", ep, NULL, &obt_jw_4, HIGH_QOS, o)) {
oc_rep_start_root_object();
oc_rep_set_int(root, om, 4);
......
......@@ -527,7 +527,7 @@ obt_rdp_3(oc_client_response_t *data)
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);
oc_rep_start_root_object();
/* Set OBT's uuid as devowneruuid */
oc_rep_set_text_string(root, devowneruuid, ouuid);
......@@ -642,8 +642,8 @@ oc_obt_perform_random_pin_otm(oc_uuid_t *uuid, const unsigned char *pin,
/** 1) <Open-TLS-PSK>+get /oic/d
*/
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment