refactor: set device properties only if all checks are good#327
refactor: set device properties only if all checks are good#327IvoGruber wants to merge 2 commits intoBluetooth-Devices:mainfrom
Conversation
|
Wouldn’t we need some device info in HA before we enter the encryption key? Not entirely sure if this is needed in HA. |
Will check the tests first. Maybe that gives me some hints. But probably will not happen the next days. |
|
Sure, no problem. You did more than enough last week :-) much appreciated. |
Tests fail, because they expect the call to "supported" returns true. "supported" checks if a device type is set int the base class. I currently would argue that a device that sends corrupted data should not be supported and override that method accordingly, but I am not sure. Should investigate the integration code in HA first. We anyway still need to support devices that send encrypted data but encryption failed cause bind key is not set. So you are true on that. |
|
I close this for now, needs more investigation on how things work in HA first and will have a later try on this when that device properties stuff in refactored. |
This is for discussion first. In encrypted mode you do not want to set any properties prior checking that every check is good to prevent attackers from doing stuff here.
That is why I moved down setting some of them based on meta data, not payload. But this breaks some tests. If you agree I would investigate why tests are failing and continue on fixing them.