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/01/24 21:14:37 UTC

[mynewt-nimble] branch master updated: nimble/host: Restore key size for LTK

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


The following commit(s) were added to refs/heads/master by this push:
     new e3b9d73  nimble/host: Restore key size for LTK
e3b9d73 is described below

commit e3b9d73db0c9d2c8efd47d0d5eaea9c6673752e7
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Wed Jan 23 17:58:13 2019 -0800

    nimble/host: Restore key size for LTK
    
    When LTK is restored successfully we also need to update key size for
    proc with proper value as otherwise we default to 0 which means that
    e.g. any characteristic which requires proper key size for read/write
    cannot be accessed.
---
 nimble/host/src/ble_sm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c
index d0d464d..1744832 100644
--- a/nimble/host/src/ble_sm.c
+++ b/nimble/host/src/ble_sm.c
@@ -1306,6 +1306,7 @@ ble_sm_ltk_restore_exec(struct ble_sm_proc *proc, struct ble_sm_result *res,
             proc->conn_handle, value_sec->ltk);
 
         if (res->app_status == 0) {
+            proc->key_size = value_sec->key_size;
             if (value_sec->authenticated) {
                 proc->flags |= BLE_SM_PROC_F_AUTHENTICATED;
             }