Skip to content

Commit ded1403

Browse files
security manager overview doc fixes
1 parent 371f183 commit ded1403

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

features/FEATURE_BLE/ble/SecurityManager.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* Overview
2828
*
29-
* Security Manager is used to provide link security through encryption, signing, and authentication
29+
* Security Manager is used to provide link security through encryption, signing and authentication
3030
* which are made possible by pairing and optionally bonding. Pairing is the process of establishing
3131
* and/or exchanging keys used for the current connection. Bonding means saving this information so that
3232
* it can later be used after reconnecting without having to pair again. This saves time and power.
@@ -37,7 +37,7 @@
3737
*
3838
* The important settings in the init() function are the MITM requirement and IO capabilities. Man in the
3939
* Middle (MITM) protection prevents an attack where one device can impersonate another device by
40-
* pairing with both devices at the same time. This protection is achieved sharing some information
40+
* pairing with both devices at the same time. This protection is achieved by sharing some information
4141
* between the devices through some independent channel. The IO capabilities of both devices dictate
4242
* what algorithm is used. For details @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part H - 2.3.5.1.
4343
* You can change the IO capabilities after initialisation with setIoCapability(). This will take effect
@@ -50,9 +50,9 @@
5050
* and provided to the Security Manager. Use setOOBDataUsage() to indicate you want to use it. The same call also
5151
* allows you to set whether or not the communication channel you are using to transmit the OOB data is
5252
* itself secure against MITM protection - this will set the level of the link security achieved using pairing
53-
* using this data.
53+
* that uses this data.
5454
*
55-
* The most secure pairing is provided by Secure Connections which relies on public key cryptography.
55+
* The most secure pairing is provided by Secure Connections which relies on Elliptical Curve Cryptography.
5656
* Support for Secure Connections is dependent on both the stack and controller on both sides supporting
5757
* it. If either side doesn't support it Legacy Pairing will be used. This is an older standard of pairing.
5858
* If higher security is required legacy pairing can be disabled by calling allowLegacyPairing(false);
@@ -62,20 +62,24 @@
6262
* First thing you need to do is to initialise the manager by calling init() with your chosen settings.
6363
*
6464
* The SecurityManager communicates with your application through events. These will trigger calls in
65-
* the EventHandler you must provide by calling the setSecurityManagerEventHandler() function.
65+
* the EventHandler which you must provide by calling the setSecurityManagerEventHandler() function.
6666
*
6767
* The most important process is pairing. This may be triggered manually by calling requestPairing() or
68-
* may be called as a result of the application requiring encryption or encryption through
69-
* requestAuthentication() or setLinkEncryption().
68+
* may be called as a result of the application requiring encryption by calling setLinkEncryption() or
69+
* as a result of the application requiring MITM protection through requestAuthentication().
7070
*
7171
* All these can be implicitly called by using setLinkSecurity() to conveniently set the required
7272
* security for the link. The SecurityManager will trigger all the process required to achieve the set
73-
* security level.
73+
* security level. Security level can only be escalated. Asking the Security Manager for a lower
74+
* security level than the existing one will not fail but will result in a event informing the
75+
* application through linkEncryptionResult() of the current level (which remains unchanged).
7476
*
7577
* Depending on the IO capabilities and OOB usage settings different pairing algorithms will be chosen.
76-
* They will produce appropriate events which must be handled by your EventHandler.
78+
* They will produce appropriate events which must be handled by your EventHandler. If your event handler
79+
* doesn't support all the calls you must not set IO capabilities or set OOB usage in such a way that would
80+
* trigger them or else the pairing will fail (usually by timing out).
7781
*
78-
* The simplest example would be a pairing of a device with no IO capabilities and no OOB data available.
82+
* The simplest example is a pairing of a device with no IO capabilities and no OOB data available.
7983
* With such limited pairing capabilities the "just works" method will be employed. This does not provide
8084
* any MITM protection. The pairing (triggered implicitly or called explicitly) will result in an event
8185
* being generated on the peer calling pairingRequest(). The event handler must make a decision (either in
@@ -132,7 +136,7 @@
132136
* |<- passkeyRequest() <--------------| |----------------> passkeyDisplay() ->|
133137
* | | | | | |
134138
*
135-
* user reads the passkey on Device 2 and inputs it in Device 1
139+
* user reads the passkey on Device 2 and inputs it on Device 1
136140
*
137141
* | | | | | |
138142
* |-------------------------->passkeyEntered() | | |

0 commit comments

Comments
 (0)