Skip to content

Fix missing as_entry method in KVStoreSecurityDb #14684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions connectivity/FEATURE_BLE/source/generic/KVStoreSecurityDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void KVStoreSecurityDb::set_entry_local_ltk(
SecurityEntryKeys_t* current_entry = read_in_entry_local_keys(db_handle);
current_entry->ltk = ltk;

tr_info("Write DB entry %d: local ltk %s", get_index(db_handle), to_string(ltk));
tr_info("Write DB entry %d: local ltk %s", get_index(entry), to_string(ltk));
db_write_entry(current_entry, DB_ENTRY_LOCAL_KEYS, get_index(entry));
}

Expand All @@ -177,7 +177,7 @@ void KVStoreSecurityDb::set_entry_local_ediv_rand(
current_entry->ediv = ediv;
current_entry->rand = rand;

tr_info("Write DB entry %d: local ediv %s rand %s", get_index(db_handle), to_string(ediv), to_string(rand));
tr_info("Write DB entry %d: local ediv %s rand %s", get_index(entry), to_string(ediv), to_string(rand));
db_write_entry(current_entry, DB_ENTRY_LOCAL_KEYS, get_index(entry));
}

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

tr_info("Write DB entry %d: peer ltk %s", get_index(db_handle), to_string(ltk));
tr_info("Write DB entry %d: peer ltk %s", get_index(entry), to_string(ltk));
db_write_entry(current_entry, DB_ENTRY_PEER_KEYS, get_index(entry));
}

Expand All @@ -219,7 +219,7 @@ void KVStoreSecurityDb::set_entry_peer_ediv_rand(
current_entry->ediv = ediv;
current_entry->rand = rand;

tr_info("Write DB entry %d: peer ediv %s rand %s", get_index(db_handle), to_string(ediv), to_string(rand));
tr_info("Write DB entry %d: peer ediv %s rand %s", get_index(entry), to_string(ediv), to_string(rand));
db_write_entry(current_entry, DB_ENTRY_PEER_KEYS, get_index(entry));
}

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

tr_info("Write DB entry %d: peer irk %s", get_index(db_handle), to_string(irk));
tr_info("Write DB entry %d: peer irk %s", get_index(entry), to_string(irk));
db_write_entry(current_entry, DB_ENTRY_PEER_IDENTITY, get_index(entry));
}

Expand All @@ -257,7 +257,7 @@ void KVStoreSecurityDb::set_entry_peer_bdaddr(
current_entry->identity_address = peer_address;
current_entry->identity_address_is_public = address_is_public;

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

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

tr_info("Write DB entry %d: peer csrk %s", get_index(db_handle), to_string(csrk));
tr_info("Write DB entry %d: peer csrk %s", get_index(entry), to_string(csrk));
db_write_entry(current_entry, DB_ENTRY_PEER_SIGNING, get_index(entry));
}

Expand Down
2 changes: 2 additions & 0 deletions connectivity/FEATURE_BLE/source/generic/KVStoreSecurityDb.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class KVStoreSecurityDb : public SecurityDb {
sign_count_t peer_sign_counter;
};

static entry_t *as_entry(entry_handle_t db_handle);

static constexpr uint8_t KVSTORESECURITYDB_VERSION = 1;

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