Skip to content

Commit 77927d0

Browse files
authored
Merge pull request #14684 from AGlass0fMilk/fix-kvstore-security-db
Fix missing `as_entry` method in KVStoreSecurityDb
2 parents 3992222 + 2578c53 commit 77927d0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

connectivity/FEATURE_BLE/source/generic/KVStoreSecurityDb.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void KVStoreSecurityDb::set_entry_local_ltk(
158158
SecurityEntryKeys_t* current_entry = read_in_entry_local_keys(db_handle);
159159
current_entry->ltk = ltk;
160160

161-
tr_info("Write DB entry %d: local ltk %s", get_index(db_handle), to_string(ltk));
161+
tr_info("Write DB entry %d: local ltk %s", get_index(entry), to_string(ltk));
162162
db_write_entry(current_entry, DB_ENTRY_LOCAL_KEYS, get_index(entry));
163163
}
164164

@@ -177,7 +177,7 @@ void KVStoreSecurityDb::set_entry_local_ediv_rand(
177177
current_entry->ediv = ediv;
178178
current_entry->rand = rand;
179179

180-
tr_info("Write DB entry %d: local ediv %s rand %s", get_index(db_handle), to_string(ediv), to_string(rand));
180+
tr_info("Write DB entry %d: local ediv %s rand %s", get_index(entry), to_string(ediv), to_string(rand));
181181
db_write_entry(current_entry, DB_ENTRY_LOCAL_KEYS, get_index(entry));
182182
}
183183

@@ -200,7 +200,7 @@ void KVStoreSecurityDb::set_entry_peer_ltk(
200200
SecurityEntryKeys_t* current_entry = read_in_entry_peer_keys(db_handle);
201201
current_entry->ltk = ltk;
202202

203-
tr_info("Write DB entry %d: peer ltk %s", get_index(db_handle), to_string(ltk));
203+
tr_info("Write DB entry %d: peer ltk %s", get_index(entry), to_string(ltk));
204204
db_write_entry(current_entry, DB_ENTRY_PEER_KEYS, get_index(entry));
205205
}
206206

@@ -219,7 +219,7 @@ void KVStoreSecurityDb::set_entry_peer_ediv_rand(
219219
current_entry->ediv = ediv;
220220
current_entry->rand = rand;
221221

222-
tr_info("Write DB entry %d: peer ediv %s rand %s", get_index(db_handle), to_string(ediv), to_string(rand));
222+
tr_info("Write DB entry %d: peer ediv %s rand %s", get_index(entry), to_string(ediv), to_string(rand));
223223
db_write_entry(current_entry, DB_ENTRY_PEER_KEYS, get_index(entry));
224224
}
225225

@@ -238,7 +238,7 @@ void KVStoreSecurityDb::set_entry_peer_irk(
238238
SecurityEntryIdentity_t* current_entry = read_in_entry_peer_identity(db_handle);
239239
current_entry->irk = irk;
240240

241-
tr_info("Write DB entry %d: peer irk %s", get_index(db_handle), to_string(irk));
241+
tr_info("Write DB entry %d: peer irk %s", get_index(entry), to_string(irk));
242242
db_write_entry(current_entry, DB_ENTRY_PEER_IDENTITY, get_index(entry));
243243
}
244244

@@ -257,7 +257,7 @@ void KVStoreSecurityDb::set_entry_peer_bdaddr(
257257
current_entry->identity_address = peer_address;
258258
current_entry->identity_address_is_public = address_is_public;
259259

260-
tr_info("Write DB entry %d: %s peer address %s", get_index(db_handle), address_is_public? "public" : "private", to_string(peer_address));
260+
tr_info("Write DB entry %d: %s peer address %s", get_index(entry), address_is_public? "public" : "private", to_string(peer_address));
261261
db_write_entry(current_entry, DB_ENTRY_PEER_IDENTITY, get_index(entry));
262262
}
263263

@@ -276,7 +276,7 @@ void KVStoreSecurityDb::set_entry_peer_csrk(
276276
SecurityEntrySigning_t* current_entry = read_in_entry_peer_signing(db_handle);
277277
current_entry->csrk = csrk;
278278

279-
tr_info("Write DB entry %d: peer csrk %s", get_index(db_handle), to_string(csrk));
279+
tr_info("Write DB entry %d: peer csrk %s", get_index(entry), to_string(csrk));
280280
db_write_entry(current_entry, DB_ENTRY_PEER_SIGNING, get_index(entry));
281281
}
282282

connectivity/FEATURE_BLE/source/generic/KVStoreSecurityDb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class KVStoreSecurityDb : public SecurityDb {
4040
sign_count_t peer_sign_counter;
4141
};
4242

43+
static entry_t *as_entry(entry_handle_t db_handle);
44+
4345
static constexpr uint8_t KVSTORESECURITYDB_VERSION = 1;
4446

4547
static constexpr size_t DB_PREFIX_SIZE = 7 + sizeof (STR(MBED_CONF_STORAGE_DEFAULT_KV)) - 1;

0 commit comments

Comments
 (0)