* companion: fix for CMD_IMPORT_PRIVATE_KEY, to re-calc shared secrets
This commit is contained in:
@@ -661,6 +661,7 @@ void MyMesh::begin(bool has_display) {
|
|||||||
_active_ble_pin = 0;
|
_active_ble_pin = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
resetContacts();
|
||||||
_store->loadContacts(this);
|
_store->loadContacts(this);
|
||||||
addChannel("Public", PUBLIC_GROUP_PSK); // pre-configure Andy's public channel
|
addChannel("Public", PUBLIC_GROUP_PSK); // pre-configure Andy's public channel
|
||||||
_store->loadChannels(this);
|
_store->loadChannels(this);
|
||||||
@@ -1097,6 +1098,9 @@ void MyMesh::handleCmdFrame(size_t len) {
|
|||||||
if (_store->saveMainIdentity(identity)) {
|
if (_store->saveMainIdentity(identity)) {
|
||||||
self_id = identity;
|
self_id = identity;
|
||||||
writeOKFrame();
|
writeOKFrame();
|
||||||
|
// re-load contacts, to recalc shared secrets
|
||||||
|
resetContacts();
|
||||||
|
_store->loadContacts(this);
|
||||||
} else {
|
} else {
|
||||||
writeErrFrame(ERR_CODE_FILE_IO_ERROR);
|
writeErrFrame(ERR_CODE_FILE_IO_ERROR);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ protected:
|
|||||||
memset(connections, 0, sizeof(connections));
|
memset(connections, 0, sizeof(connections));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void resetContacts() { num_contacts = 0; }
|
||||||
|
|
||||||
// 'UI' concepts, for sub-classes to implement
|
// 'UI' concepts, for sub-classes to implement
|
||||||
virtual bool isAutoAddEnabled() const { return true; }
|
virtual bool isAutoAddEnabled() const { return true; }
|
||||||
virtual void onDiscoveredContact(ContactInfo& contact, bool is_new, uint8_t path_len, const uint8_t* path) = 0;
|
virtual void onDiscoveredContact(ContactInfo& contact, bool is_new, uint8_t path_len, const uint8_t* path) = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user