Skip to content

Commit

Permalink
Merge pull request #26 from duncandrennan/sec_levels
Browse files Browse the repository at this point in the history
Document security levels correctly
  • Loading branch information
rojer authored Feb 28, 2022
2 parents ff23d1f + bbb10a3 commit d35e545
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ settings:
"max_paired_devices": 10, // Allow pairing with up to this many devices; -1 - no limit
"gatts": {
"min_sec_level": 0, // Minimum security level for all attributes of all services.
// 0 - no auth required, 1 - encryption reqd, 2 - encryption + MITM reqd
// 0 - no auth required, 1 - auth reqd, 2 - auth + encryption reqd, 3 - auth + encryption + MITM reqd
"require_pairing": false // Require taht device is paired before accessing services
}
}
Expand All @@ -29,4 +29,4 @@ settings:
Default settings allow for unrestricted access: anyone can pair with a device and access the services.
A better idea is to set `bt.gatts.require_pairing` to true, `bt.allow_pairing` to false and only enable it for a limited time via `mgos_bt_gap_set_pairing_enable` when user performs some action, e.g. presses a button.
Raising `bt.gatts.min_sec_level` to at least 1 is also advisable.
_Note_: At present, level 2 (MITM protection) is not usable as it requires device to have at least output capability during pairing, and there's no API for displaying the pairing code yet.
_Note_: At present, level 3 (MITM protection) is not usable as it requires device to have at least output capability during pairing, and there's no API for displaying the pairing code yet.
2 changes: 1 addition & 1 deletion mos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ config_schema:
- ["bt.random_address", "b", false, {title: "Use random BT address"}]
- ["bt.gatt_mtu", "i", 500, {title: "Local MTU setting, used when negotiating with clients"}]
- ["bt.gatts", "o", {title: "GATTS settings"}]
- ["bt.gatts.min_sec_level", "i", 0, {title: "0 - no auth required, 1 - encryption reqd, 2 - encryption + MITM reqd"}]
- ["bt.gatts.min_sec_level", "i", 0, {title: "0 - no auth required, 1 - auth reqd, 2 - auth + encryption reqd, 3 - auth + encryption + MITM reqd"}]

conds:
- when: mos.platform == "esp32"
Expand Down

0 comments on commit d35e545

Please sign in to comment.