You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2019/06/17 14:05:05 UTC

[mynewt-nimble] branch master updated (9633764 -> e46fdc9)

This is an automated email from the ASF dual-hosted git repository.

andk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git.


    from 9633764  apps/btshell: Provide consistent address input
     new f1e9720  nimble/ll: Add helper to check if addr is identity
     new e46fdc9  nimble/ll: Fix peer address check with privacy

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nimble/controller/include/controller/ble_ll.h | 3 +++
 nimble/controller/src/ble_ll.c                | 6 ++++++
 nimble/controller/src/ble_ll_conn.c           | 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)


[mynewt-nimble] 01/02: nimble/ll: Add helper to check if addr is identity

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit f1e9720bc313fd2a3a3380dad9746abb338503ac
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Jun 17 15:27:57 2019 +0200

    nimble/ll: Add helper to check if addr is identity
---
 nimble/controller/include/controller/ble_ll.h | 3 +++
 nimble/controller/src/ble_ll.c                | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/nimble/controller/include/controller/ble_ll.h b/nimble/controller/include/controller/ble_ll.h
index 98ec8e3..c1ced36 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -438,6 +438,9 @@ uint16_t ble_ll_pdu_max_tx_octets_get(uint32_t usecs, int phy_mode);
 /* Is this address a resolvable private address? */
 int ble_ll_is_rpa(uint8_t *addr, uint8_t addr_type);
 
+/* Is this address an identity address? */
+int ble_ll_addr_is_id(uint8_t *addr, uint8_t addr_type);
+
 /* Is 'addr' our device address? 'addr_type' is public (0) or random (!=0) */
 int ble_ll_is_our_devaddr(uint8_t *addr, int addr_type);
 
diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index e8bfd28..1b9639f 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -426,6 +426,12 @@ ble_ll_is_rpa(uint8_t *addr, uint8_t addr_type)
     return rc;
 }
 
+int
+ble_ll_addr_is_id(uint8_t *addr, uint8_t addr_type)
+{
+    return !addr_type || ((addr[5] & 0xc0) == 0xc0);
+}
+
 /* Checks to see that the device is a valid random address */
 int
 ble_ll_is_valid_random_addr(uint8_t *addr)


[mynewt-nimble] 02/02: nimble/ll: Fix peer address check with privacy

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit e46fdc90e0b4183ee87d37e8746170f9b2a2b25b
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Jun 17 15:28:10 2019 +0200

    nimble/ll: Fix peer address check with privacy
    
    We should explicitly chceck if AdvA is identity instead of just
    comparing address types. Comparing address types can give incorrect
    result if peer identity address is static random since both static
    random and RPA are random addresses.
---
 nimble/controller/src/ble_ll_conn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c
index 8721f1e..342d0f8 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -2524,7 +2524,7 @@ ble_ll_conn_is_peer_adv(uint8_t addr_type, uint8_t *adva, int index)
     /* Fall-through intentional */
     case BLE_HCI_CONN_PEER_ADDR_PUBLIC:
     case BLE_HCI_CONN_PEER_ADDR_RANDOM:
-        if (addr_type == connsm->peer_addr_type) {
+        if (ble_ll_addr_is_id(adva, addr_type)) {
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)
                 /* Peer uses its identity address. Let's verify privacy mode.
                  *