Jan-Marcel Dietrich
07f9997a49
Add maximum encryption key size to PairingDelegate
...
So far the maxmium encryption key size has been hardcoded to 16 bytes in
'send_pairing_request_command()' and 'send_pairing_response_comman()'. By
making this configurable via the PairingDelegate, one can test how devices
respond to smaller encryption key sizes. Default remains 16 bytes.
2024-11-28 14:15:51 +01:00
Gilles Boccon-Gibod
9d3d5495ce
only use __bytes__ when not argument is needed.
2024-11-23 15:56:14 -08:00
Gilles Boccon-Gibod
b2864dac2d
fix #580
2024-11-02 10:29:40 -07:00
zxzxwu
4394a36332
Merge pull request #526 from Gopi-SB/oob
...
DH Key compute check modification for OOB Pairing
2024-08-29 16:56:45 +08:00
Gopi Sakshihally Bhuthaiah
0c9fd64434
DH Key compute check modification for OOB Pairing
2024-08-29 08:46:53 +00:00
Gopi Sakshihally Bhuthaiah
c44c89cc6e
DH Key compute check modification for OOB Pairing
2024-08-13 02:10:41 +00:00
Josh Wu
c6b3deb8df
Fix CTKD failure introduced by Host RPA generation
2024-08-12 15:13:40 +08:00
Gopi Sakshihally Bhuthaiah
414f2f3efb
DH Key compute check modification for OOB Pairing
2024-08-12 07:00:51 +00:00
Gopi Sakshihally Bhuthaiah
ed00d44ae1
DH Key compute check modification for OOB Pairing
2024-08-09 17:30:19 +00:00
Gopi Sakshihally Bhuthaiah
b164524380
DH Key compute check modification for OOB Pairing
2024-08-08 10:31:26 +00:00
Gopi Sakshihally Bhuthaiah
29e4a843df
DH Key compute check modification for OOB Pairing
2024-08-08 08:48:58 +00:00
Gopi Sakshihally Bhuthaiah
619b32d36e
DH Key compute check modification for OOB Pairing
2024-08-08 07:53:05 +00:00
Gilles Boccon-Gibod
312fc8db36
support controller-generated rpa
2024-08-05 08:59:05 -07:00
Gilles Boccon-Gibod
615691ec81
add basic RPA support
2024-08-01 15:37:11 -07:00
Josh Wu
f8a2d4f0e0
Reorganize exceptions
...
* Add BaseBumbleException as a "real" root error
* Add several core error classes and properly replace builtin errors
with them
* Add several error classes for specific modules (transport, device)
2024-06-11 16:13:08 +08:00
Gilles Boccon-Gibod
58d4ab913a
update black formatter to version 24
2024-04-01 14:44:46 -07:00
Josh Wu
c40824e51c
Support non-directed address generation offload
2024-01-26 16:02:40 +08:00
Josh Wu
acd9d994c3
Save link_key in CTKD over BR/EDR
...
Since keystore.update() overwrites all existing keys, the existing link
key will be wiped out. To avoid this, SMP also need to keep the key.
2024-01-17 19:30:02 +08:00
Josh Wu
10a3833893
Remove # type: ignore[call-arg] in HCI_Command builders
2023-12-02 19:18:54 +08:00
Josh Wu
80d34a226d
Slightly refactor and fix CTKD
...
It seems sample input data provided in the spec is big-endian (just
like other AES-CMAC-based functions), but all keys are in little-endian(
HCI standard), so they need to be reverse before and after applying
AES-CMAC.
2023-11-26 16:55:10 +08:00
Gilles Boccon-Gibod
4ae612090b
wip
2023-11-06 13:19:13 -08:00
Josh Wu
2491b686fa
Handle SMP_Security_Request
2023-09-20 23:13:08 +02:00
Gilles Boccon-Gibod
640b9cd53a
refactor pyiodide support and add examples
2023-08-15 13:36:58 -07:00
Josh Wu
6399c5fb04
Auto add device to resolving list after pairing
2023-08-03 20:51:00 +08:00
Josh Wu
cbbada4748
SMP: Delegate distributed address type
2023-08-01 08:38:03 -07:00
Josh Wu
dbf878dc3f
SMP: Remove PairingMethod.__str__
2023-07-27 08:00:36 -07:00
Josh Wu
f6c0bd88d7
SMP: Do not send phase 2 commands in CTKD
2023-07-27 08:00:36 -07:00
Josh Wu
8440b7fbf1
SMP: Refactor pairing method as enum
2023-07-27 08:00:36 -07:00
Lucas Abel
a84df469cd
pairing: handle user errors from all delegate calls
2023-07-12 11:03:21 -07:00
Gilles Boccon-Gibod
6826f68478
fix linter warnings
2023-05-05 16:16:55 -07:00
Gilles Boccon-Gibod
3de35193bc
rebase
2023-05-05 16:09:01 -07:00
uael
5d4f811a65
smp: add simple Session proxy
...
This allow modifying the SMP behavior at runtime for testing purpose.
2023-05-04 04:33:50 +00:00
uael
3c81b248a3
smp: add type hints
2023-05-04 04:33:50 +00:00
Gilles Boccon-Gibod
3442358dea
refactor PairingDelegate
2023-04-18 15:04:53 -07:00
Gilles Boccon-Gibod
bf3e05ef91
Merge pull request #174 from google/gbg/pairing-fix
...
fix role state for classic connections
2023-04-11 20:32:29 -07:00
Gilles Boccon-Gibod
859aea5a99
fix role state for classic connections
2023-04-07 10:24:26 -07:00
Josh Wu
85496aaff5
SMP: Determine initiator by direction instead of role
...
Though in the spec this is not allowed, but in some ambiguous cases such
as SMP over BR/EDR or we want to test how remote devices handle invalid
pairing requests, we still need to allow this behavior, with some logs
to let users know it's invalid.
2023-04-08 00:02:48 +08:00
Lucas Abel
044597de66
Merge pull request #161 from google/uael/smp-get-number-type-hint
...
smp: fix `PairingDelegate.get_number` return type
2023-03-28 11:48:09 -07:00
Hui Peng
423a5a95d8
add get_string API in PairingDelegate
2023-03-27 17:02:12 -07:00
Lucas Abel
8e881fdb18
smp: fix PairingDelegate.get_number return type
...
This function can return `None` to indicate a negative reply,
update the type hint accordingly.
2023-03-27 22:51:23 +00:00
uael
d21da78aa3
overall: host a minimal copy of ainsicolors
2023-02-23 20:53:06 +00:00
Gilles Boccon-Gibod
fbc7cf02a3
Merge pull request #129 from google/gbg/smp-improvements
...
improve smp compatibility with other OS flows
2023-02-14 19:10:51 -08:00
Gilles Boccon-Gibod
2d44de611f
make pylint happy
2023-02-14 16:04:20 -08:00
uael
6645ad47ee
smp: add a small type hint
2023-02-14 21:04:39 +00:00
Gilles Boccon-Gibod
e6fc63b2d8
improve smp compatibility with other OS flows
2023-02-13 10:53:00 -08:00
uael
b731f6f556
overall: add types hints to the small subset used by avatar
2023-02-02 19:37:55 +00:00
Gilles Boccon-Gibod
99758e4b7d
add basic support for mypy type checking
2023-01-20 00:20:50 -08:00
Gilles Boccon-Gibod
c2959dadb4
formatting and linting automation
...
Squashed commits:
[cd479ba] formatting and linting automation
[7fbfabb] formatting and linting automation
[c4f9505] fix after rebase
[f506ad4] rename job
[441d517] update doc (+7 squashed commits)
[2e1b416] fix invoke and github action
[6ae5bb4] doc for git blame
[44b5461] add GitHub action
[b07474f] add docs
[4cd9a6f] more linter fixes
[db71901] wip
[540dc88] wip
2022-12-15 23:07:17 -08:00
Abel Lucas
287df94090
host: spawn each asynchronous task with the right aliveness
2022-12-15 17:02:21 +00:00
Gilles Boccon-Gibod
135df0dcc0
format with Black
2022-12-10 09:40:12 -08:00