forked from zmkfirmware/zmk
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ble): Add security related tests.
* Add security related tests to verify behavior when trying to read a GATT characteristic from our peripheral with and without client auto security request/retry.
- Loading branch information
1 parent
345720f
commit 55e3ae9
Showing
13 changed files
with
149 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
app/tests/ble/security/read-hid-after-connect-with-auto-sec/centrals.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./ble_test_central.exe -d=2 -skip_set_security_on_connect -read_hid_report_on_connect -skip_discovery_on_connect |
1 change: 1 addition & 0 deletions
1
app/tests/ble/security/read-hid-after-connect-with-auto-sec/events.patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
s/^d_02: @[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9][0-9][0-9][0-9] .{19}//p |
Empty file.
24 changes: 24 additions & 0 deletions
24
app/tests/ble/security/read-hid-after-connect-with-auto-sec/nrf52_bsim.keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/bt.h> | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
|
||
&kscan { | ||
events = | ||
<ZMK_MOCK_PRESS(0,0,10000) | ||
ZMK_MOCK_RELEASE(0,0,2000) | ||
ZMK_MOCK_PRESS(0,1,100) | ||
ZMK_MOCK_RELEASE(0,1,1000)>; | ||
}; | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&kp A &kp B | ||
&bt BT_SEL 0 &bt BT_SEL 1>; | ||
}; | ||
}; | ||
}; |
13 changes: 13 additions & 0 deletions
13
app/tests/ble/security/read-hid-after-connect-with-auto-sec/snapshot.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<wrn> bt_id: No static addresses stored in controller | ||
<dbg> ble_central: _posix_zephyr_main: [Bluetooth initialized] | ||
<dbg> ble_central: start_scan: [Scanning successfully started] | ||
<dbg> ble_central: device_found: [DEVICE]: ED:3B:20:15:18:12 (random), AD evt type 0, AD data len 15, RSSI -59 | ||
<dbg> ble_central: eir_found: [AD]: 9 data_len 0 | ||
<dbg> ble_central: eir_found: [AD]: 25 data_len 2 | ||
<dbg> ble_central: eir_found: [AD]: 1 data_len 1 | ||
<dbg> ble_central: eir_found: [AD]: 2 data_len 4 | ||
<dbg> ble_central: connected: [Connected]: ED:3B:20:15:18:12 (random) | ||
<dbg> ble_central: pairing_complete: Pairing complete | ||
<dbg> ble_central: read_cb: Read err: 0, length 8 | ||
<dbg> ble_central: read_cb: Read err: 0, length 12 | ||
<dbg> ble_central: read_cb: Read err: 10, length 0 |
1 change: 1 addition & 0 deletions
1
app/tests/ble/security/read-hid-after-connect-without-auto-sec/centrals.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./ble_test_no_auto_sec_central.exe -d=2 -skip_set_security_on_connect -read_hid_report_on_connect -skip_discovery_on_connect |
1 change: 1 addition & 0 deletions
1
app/tests/ble/security/read-hid-after-connect-without-auto-sec/events.patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
s/^d_02: @[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9][0-9][0-9][0-9] .{19}//p |
Empty file.
24 changes: 24 additions & 0 deletions
24
app/tests/ble/security/read-hid-after-connect-without-auto-sec/nrf52_bsim.keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/bt.h> | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
|
||
&kscan { | ||
events = | ||
<ZMK_MOCK_PRESS(0,0,10000) | ||
ZMK_MOCK_RELEASE(0,0,2000) | ||
ZMK_MOCK_PRESS(0,1,100) | ||
ZMK_MOCK_RELEASE(0,1,1000)>; | ||
}; | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&kp A &kp B | ||
&bt BT_SEL 0 &bt BT_SEL 1>; | ||
}; | ||
}; | ||
}; |
10 changes: 10 additions & 0 deletions
10
app/tests/ble/security/read-hid-after-connect-without-auto-sec/snapshot.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<wrn> bt_id: No static addresses stored in controller | ||
<dbg> ble_central: _posix_zephyr_main: [Bluetooth initialized] | ||
<dbg> ble_central: start_scan: [Scanning successfully started] | ||
<dbg> ble_central: device_found: [DEVICE]: ED:3B:20:15:18:12 (random), AD evt type 0, AD data len 15, RSSI -59 | ||
<dbg> ble_central: eir_found: [AD]: 9 data_len 0 | ||
<dbg> ble_central: eir_found: [AD]: 25 data_len 2 | ||
<dbg> ble_central: eir_found: [AD]: 1 data_len 1 | ||
<dbg> ble_central: eir_found: [AD]: 2 data_len 4 | ||
<dbg> ble_central: connected: [Connected]: ED:3B:20:15:18:12 (random) | ||
<dbg> ble_central: read_cb: Read err: 15, length 0 |