You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/05/17 20:52:01 UTC

[38/50] [abbrv] incubator-mynewt-core git commit: BLE Host - Rename sec procs to match spec language

BLE Host - Rename sec procs to match spec language


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/aeb46aba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/aeb46aba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/aeb46aba

Branch: refs/heads/master
Commit: aeb46abade038e6b62b0b7603455e8e8eda01bac
Parents: 4d5aa14
Author: Christopher Collins <cc...@apache.org>
Authored: Mon May 16 13:03:26 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon May 16 19:47:00 2016 -0700

----------------------------------------------------------------------
 net/nimble/host/src/ble_gap.c           |  5 ++---
 net/nimble/host/src/ble_l2cap_sm.c      | 19 ++++++++++---------
 net/nimble/host/src/ble_l2cap_sm_priv.h |  4 ++--
 3 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/aeb46aba/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index 14c921a..b43535c 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -816,7 +816,6 @@ ble_gap_rx_conn_complete(struct hci_le_conn_complete *evt)
     }
 
     /* We verified that there is a free connection when the procedure began. */
-    /* XXX: Revisit this; ensure this is guaranteed. */
     conn = ble_hs_conn_alloc();
     BLE_HS_DBG_ASSERT(conn != NULL);
 
@@ -1989,7 +1988,7 @@ ble_gap_security_initiate(uint16_t conn_handle)
         return BLE_HS_EROLE;
     }
 
-    rc = ble_l2cap_sm_initiate(conn_handle);
+    rc = ble_l2cap_sm_pair_initiate(conn_handle);
     return rc;
 }
 
@@ -2012,7 +2011,7 @@ ble_gap_encryption_initiate(uint16_t conn_handle,
         return BLE_HS_EROLE;
     }
 
-    rc = ble_l2cap_sm_sec_initiate(conn_handle, ltk, ediv, rand_val, auth);
+    rc = ble_l2cap_sm_enc_initiate(conn_handle, ltk, ediv, rand_val, auth);
     return rc;
 }
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/aeb46aba/net/nimble/host/src/ble_l2cap_sm.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_sm.c b/net/nimble/host/src/ble_l2cap_sm.c
index 81b5996..a8fe98f 100644
--- a/net/nimble/host/src/ble_l2cap_sm.c
+++ b/net/nimble/host/src/ble_l2cap_sm.c
@@ -1348,7 +1348,6 @@ ble_l2cap_sm_rx_key_exchange(uint16_t conn_handle, uint8_t op,
     return rc;
 }
 
-
 /*****************************************************************************
  * $rx                                                                       *
  *****************************************************************************/
@@ -1806,15 +1805,16 @@ ble_l2cap_sm_heartbeat(void)
     }
 }
 
+/**
+ * Initiates the pairing procedure for the specified connection.
+ */
 int
-ble_l2cap_sm_initiate(uint16_t conn_handle)
+ble_l2cap_sm_pair_initiate(uint16_t conn_handle)
 {
     struct ble_l2cap_sm_proc *proc;
     int rc;
 
-    /* Make sure a pairing operation for this connection is not already in
-     * progress.
-     */
+    /* Make sure a procedure isn't already in progress for this connection. */
     ble_hs_lock();
     proc = ble_l2cap_sm_proc_find(conn_handle, BLE_L2CAP_SM_PROC_STATE_NONE,
                                   -1, NULL);
@@ -1845,8 +1845,11 @@ done:
     return rc;
 }
 
+/**
+ * Initiates the encryption procedure for the specified connection.
+ */
 int
-ble_l2cap_sm_sec_initiate(uint16_t conn_handle,
+ble_l2cap_sm_enc_initiate(uint16_t conn_handle,
                           uint8_t *ltk,
                           uint16_t ediv,
                           uint64_t rand_val,
@@ -1855,9 +1858,7 @@ ble_l2cap_sm_sec_initiate(uint16_t conn_handle,
     struct ble_l2cap_sm_proc *proc;
     int rc;
 
-    /* Make sure a pairing operation for this connection is not already in
-     * progress.
-     */
+    /* Make sure a procedure isn't already in progress for this connection. */
     ble_hs_lock();
     proc = ble_l2cap_sm_proc_find(conn_handle, BLE_L2CAP_SM_PROC_STATE_NONE,
                                   -1, NULL);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/aeb46aba/net/nimble/host/src/ble_l2cap_sm_priv.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_sm_priv.h b/net/nimble/host/src/ble_l2cap_sm_priv.h
index 0ed311d..5838ba5 100644
--- a/net/nimble/host/src/ble_l2cap_sm_priv.h
+++ b/net/nimble/host/src/ble_l2cap_sm_priv.h
@@ -211,8 +211,8 @@ void ble_l2cap_sm_rx_encryption_change(struct hci_encrypt_change *evt);
 int ble_l2cap_sm_rx_lt_key_req(struct hci_le_lt_key_req *evt);
 
 void ble_l2cap_sm_heartbeat(void);
-int ble_l2cap_sm_initiate(uint16_t conn_handle);
-int ble_l2cap_sm_sec_initiate(uint16_t conn_handle, uint8_t *ltk,
+int ble_l2cap_sm_pair_initiate(uint16_t conn_handle);
+int ble_l2cap_sm_enc_initiate(uint16_t conn_handle, uint8_t *ltk,
                           uint16_t ediv, uint64_t rand_val, int auth);
 int ble_l2cap_sm_init(void);