diff --git a/doc/manual/docs/picts/le_security_flow_control.txt b/doc/manual/docs/picts/le_security_flow_control.txt index 505db6753..6f7e2b2e4 100644 --- a/doc/manual/docs/picts/le_security_flow_control.txt +++ b/doc/manual/docs/picts/le_security_flow_control.txt @@ -1,30 +1,181 @@ @startuml -title Mandatory Authentication +title Reactive Authentication in Central Role +start +: App on A connects to B; +: App on A triggers GATT Client request; +: GATT Client request sent; +if (GATT Server returns an ATT_ERROR_INSUFFICIENT_X error?) then (yes) + if (ENABLE_GATT_CLIENT_PAIRING defined?) then (yes) + if (LTK available?) then (yes) + : SM_EVENT_REENCRYPTION_STARTED; + : start encryption; + if (re-encrypted) then (yes) + : SM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request re-sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_REENCRYPTION_COMPLETE(error); + : delete bonding information; + endif + endif + : SM_EVENT_PAIRING_STARTED; + : start pairing; + if (pairing success?) then (yes) + : SM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request re-sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_PAIRING_COMPLETE(error); + #FD5B41 : App receives a GATT Client error; + stop + endif + else (no) + #FD5B41: ATT_QUERY_COMPLETE(ATT_ERROR_INSUFFICIENT_X); + stop + note left + App can trigger pairing and + repeat the GATT Client request + end note + endif +else (no) + #23DB2B : App receives GATT Response; + stop +endif +@enduml + + + +@startuml +title Reactive Authentication in Peripheral Role +start +: App on B connects to A; +: App on A triggers GATT Client request; +: GATT Client request sent; +if (GATT Server returns an ATT_ERROR_INSUFFICIENT_X error?) then (yes) + if (ENABLE_GATT_CLIENT_PAIRING define?) then (yes) + if (LTK available?) then (yes) + : SM_EVENT_REENCRYPTION_STARTED; + : SM on A sends SECURITY REQUEST; + : SM on B should encrypt connection if LTK available; + if (re-encrypted) then (yes) + : SM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request re-sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_REENCRYPTION_COMPLETE(error); + : delete bonding information; + endif + endif + : SM_EVENT_PAIRING_STARTED; + : SM on A sends SECURITY REQUEST; + : SM on B should perform pairing sequence; + if (pairing success?) then (yes) + : SM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request re-sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_PAIRING_COMPLETE(error); + #FD5B41 : App receives a GATT Client error; + stop + endif + else (no) + #FD5B41: ATT_QUERY_COMPLETE(ATT_ERROR_INSUFFICIENT_X); + stop + note left + App can trigger pairing and + repeat the GATT Client request + end note + endif +else (no) + #23DB2B : App receives GATT Response; + stop +endif +@enduml + + + +@startuml +title Mandatory Authentication in Central Role start : App calls gatt_client_set_required_security_level (level > 0); -: A connects to B; -: App triggers GATT Client request on A; - -if (LTK available) then (yes) +: App on A connects to B; +: App on A triggers GATT Client request; +: GATT Client request sent; +if (LTK available?) then (yes) + : SM_EVENT_REENCRYPTION_STARTED; : start encryption; if (re-encrypted) then (yes) + : SM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS); : GATT Client request sent; #23DB2B : App receives GATT Response; stop else (no) + : SM_EVENT_REENCRYPTION_COMPLETE(error); #FD5B41: App receives GATT_QUERY_COMPLETE event with ATT_ERROR_BONDING_INFORMATION_MISSING; stop endif - else (no) - : start pairing; - - if (paired) then (yes) + : SM_EVENT_PAIRING_STARTED; + : start pairing; + if (pairing success?) then (yes) + : SM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS); : GATT Client request sent; #23DB2B : App receives GATT Response; stop else (no) + : SM_EVENT_PAIRING_COMPLETE(error); + if (level >= 3) then (yes) + #FD5B41: App receives GATT_QUERY_COMPLETE event + with ATT_ERROR_INSUFFICIENT_AUTHENTICATION; + stop + else (no) + #FD5B41: App receives GATT_QUERY_COMPLETE event + with ATT_ERROR_INSUFFICIENT_ENCRYPTION; + stop + endif + endif +@enduml + + + +@startuml +title Mandatory Authentication in Peripheral Role +start +: App calls gatt_client_set_required_security_level (level > 0); +: App on B connects to A; +: App on A triggers GATT Client request; +: GATT Client request sent; +if (LTK available?) then (yes) + : SM_EVENT_REENCRYPTION_STARTED; + : SM on A sends SECURITY REQUEST; + : SM on B should encrypt connection if LTK available; + if (re-encrypted) then (yes) + : SM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_REENCRYPTION_COMPLETE(error); + #FD5B41: App receives GATT_QUERY_COMPLETE event + with ATT_ERROR_BONDING_INFORMATION_MISSING; + stop + endif +else (no) + : SM_EVENT_PAIRING_STARTED; + : SM on A sends SECURITY REQUEST; + : SM on B should perform pairing sequence; + if (pairing success?) then (yes) + : SM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_PAIRING_COMPLETE(error); if (level >= 3) then (yes) #FD5B41: App receives GATT_QUERY_COMPLETE event with ATT_ERROR_INSUFFICIENT_AUTHENTICATION; @@ -39,72 +190,107 @@ else (no) @startuml -title Proactive Authentication with LTK +title Proactive Authentication in Central Role start : A connects to B; : App triggers GATT Client request on A; -if (role) then (Central) -: start encryption; -else (Peripheral) -: send security request; -endif -if (re-encrypted) then (yes) - : GATT Client request sent; - #23DB2B : App receives GATT Response; - stop -else (no) - #FD5B41: App receives GATT_QUERY_COMPLETE event +if (LTK available?) then (no) + : GATT Client request sent; + if (GATT Server returns an ATT_ERROR_INSUFFICIENT_X error?) then (no) + #23DB2B : App receives GATT Response; + stop + else (yes) + if (ENABLE_GATT_CLIENT_PAIRING defined?) then (no) + #FD5B41: App receives GATT_QUERY_COMPLETE event + with ATT_ERROR_INSUFFICIENT_X; + stop + else (yes) + : SM_EVENT_PAIRING_STARTED; + : start pairing; + if (pairing success?) then (yes) + : SM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request re-sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_PAIRING_COMPLETE(error); + #FD5B41: App receives GATT_QUERY_COMPLETE event + with ATT_ERROR_INSUFFICIENT_X; + stop + endif + endif + endif +else (yes) + : SM_EVENT_REENCRYPTION_STARTED; + : start encryption; + if (re-encrypted) then (yes) + : SM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_REENCRYPTION_COMPLETE(error); + #FD5B41: App receives GATT_QUERY_COMPLETE event with ATT_ERROR_BONDING_INFORMATION_MISSING; - stop - note right - App can delete bonding - information and repeat - the GATT Client request - end note + stop + note right + App can delete bonding + information and repeat + the GATT Client request + end note + endif endif @enduml @startuml -title Reactive Authentication +title Proactive Authentication in Peripheral Role start : A connects to B; : App triggers GATT Client request on A; -: GATT Client request sent; - -if (GATT Server returns an ATT_ERROR_INSUFFICIENT_X error) then (yes) - if (ENABLE_GATT_CLIENT_PAIRING) then (yes) - if (LTK available) then (yes) - : start encryption; - if (re-encrypted) then (yes) - : GATT Client request sent; - #23DB2B : App receives GATT Response; - stop - else (no) - : delete bonding information; - endif - - endif - - : start pairing; - if (paired) then (yes) - : GATT Client request sent; - #23DB2B : App receives GATT Response; - stop - else (no) - #FD5B41 : App receives a GATT Client error; - stop - endif - else (no) - #FD5B41: App receives GATT_QUERY_COMPLETE event - with ATT_ERROR_INSUFFICIENT_X; +if (LTK available?) then (no) + : GATT Client request sent; + if (GATT Server returns an ATT_ERROR_INSUFFICIENT_X error?) then (no) + #23DB2B : App receives GATT Response; stop - note left - App can trigger pairing and - repeat the GATT Client request + else (yes) + if (ENABLE_GATT_CLIENT_PAIRING defined?) then (no) + #FD5B41: App receives GATT_QUERY_COMPLETE event + with ATT_ERROR_INSUFFICIENT_X; + stop + else (yes) + : SM_EVENT_PAIRING_STARTED; + : start pairing; + if (pairing success?) then (yes) + : SM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request re-sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_PAIRING_COMPLETE(error); + #FD5B41: App receives GATT_QUERY_COMPLETE event + with ATT_ERROR_INSUFFICIENT_X; + stop + endif + endif + endif +else (yes) + : SM_EVENT_REENCRYPTION_STARTED; + : start encryption; + if (re-encrypted) then (yes) + : SM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS); + : GATT Client request sent; + #23DB2B : App receives GATT Response; + stop + else (no) + : SM_EVENT_REENCRYPTION_COMPLETE(error); + #FD5B41: App receives GATT_QUERY_COMPLETE event + with ATT_ERROR_BONDING_INFORMATION_MISSING; + stop + note right + App can delete bonding + information and repeat + the GATT Client request end note endif -else (no) - #23DB2B : App receives GATT Response; - stop endif @enduml diff --git a/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication.svg b/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication.svg deleted file mode 100644 index 0aadddae3..000000000 --- a/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication.svg +++ /dev/null @@ -1,48 +0,0 @@ -Mandatory AuthenticationApp calls gatt_client_set_required_security_level (level > 0)A connects to BApp triggers GATT Client request on ALTK availableyesnostart encryptionre-encryptedyesnoGATT Client request sentApp receives GATT ResponseApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_BONDING_INFORMATION_MISSINGstart pairingpairedyesnoGATT Client request sentApp receives GATT Responselevel >= 3yesnoApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_AUTHENTICATIONApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_ENCRYPTION; \ No newline at end of file diff --git a/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication_central.svg b/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication_central.svg new file mode 100644 index 000000000..e6600d0b0 --- /dev/null +++ b/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication_central.svg @@ -0,0 +1,52 @@ +Mandatory Authentication in Central RoleApp calls gatt_client_set_required_security_level (level > 0)App on A connects to BApp on A triggers GATT Client requestGATT Client request sentLTK available?yesnoSM_EVENT_REENCRYPTION_STARTEDstart encryptionre-encryptedyesnoSM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request sentApp receives GATT ResponseSM_EVENT_REENCRYPTION_COMPLETE(error)App receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_BONDING_INFORMATION_MISSINGSM_EVENT_PAIRING_STARTEDstart pairingpairing success?yesnoSM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request sentApp receives GATT ResponseSM_EVENT_PAIRING_COMPLETE(error)level >= 3yesnoApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_AUTHENTICATIONApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_ENCRYPTION; \ No newline at end of file diff --git a/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication_peripheral.svg b/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication_peripheral.svg new file mode 100644 index 000000000..12425b92a --- /dev/null +++ b/doc/manual/docs/picts/le_security_flow_control_mandatory_authentication_peripheral.svg @@ -0,0 +1,54 @@ +Mandatory Authentication in Peripheral RoleApp calls gatt_client_set_required_security_level (level > 0)App on B connects to AApp on A triggers GATT Client requestGATT Client request sentLTK available?yesnoSM_EVENT_REENCRYPTION_STARTEDSM on A sends SECURITY REQUESTSM on B should encrypt connection if LTK availablere-encryptedyesnoSM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request sentApp receives GATT ResponseSM_EVENT_REENCRYPTION_COMPLETE(error)App receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_BONDING_INFORMATION_MISSINGSM_EVENT_PAIRING_STARTEDSM on A sends SECURITY REQUESTSM on B should perform pairing sequencepairing success?yesnoSM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request sentApp receives GATT ResponseSM_EVENT_PAIRING_COMPLETE(error)level >= 3yesnoApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_AUTHENTICATIONApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_ENCRYPTION; \ No newline at end of file diff --git a/doc/manual/docs/picts/le_security_flow_control_proactive_authentication.svg b/doc/manual/docs/picts/le_security_flow_control_proactive_authentication.svg deleted file mode 100644 index 9c120e008..000000000 --- a/doc/manual/docs/picts/le_security_flow_control_proactive_authentication.svg +++ /dev/null @@ -1,35 +0,0 @@ -Proactive Authentication with LTKA connects to BApp triggers GATT Client request on AroleCentralPeripheralstart encryptionsend security requestre-encryptedyesnoGATT Client request sentApp receives GATT ResponseApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_BONDING_INFORMATION_MISSINGApp can delete bondinginformation and repeatthe GATT Client request \ No newline at end of file diff --git a/doc/manual/docs/picts/le_security_flow_control_proactive_authentication_central.svg b/doc/manual/docs/picts/le_security_flow_control_proactive_authentication_central.svg new file mode 100644 index 000000000..1abd21eba --- /dev/null +++ b/doc/manual/docs/picts/le_security_flow_control_proactive_authentication_central.svg @@ -0,0 +1,62 @@ +Proactive Authentication in Central RoleA connects to BApp on A triggers GATT Client requestLTK available?noyesGATT Client request sentGATT Server returns an ATT_ERROR_INSUFFICIENT_X error?noyesApp receives GATT ResponseENABLE_GATT_CLIENT_PAIRING defined?noyesApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_XSM_EVENT_PAIRING_STARTEDstart pairingpairing success?yesnoSM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request re-sentApp receives GATT ResponseSM_EVENT_PAIRING_COMPLETE(error)App receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_XSM_EVENT_REENCRYPTION_STARTEDstart encryptionre-encryptedyesnoSM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request sentApp receives GATT ResponseSM_EVENT_REENCRYPTION_COMPLETE(error)App receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_BONDING_INFORMATION_MISSINGApp can delete bondinginformation and repeatthe GATT Client request \ No newline at end of file diff --git a/doc/manual/docs/picts/le_security_flow_control_proactive_authentication_peripheral.svg b/doc/manual/docs/picts/le_security_flow_control_proactive_authentication_peripheral.svg new file mode 100644 index 000000000..735221143 --- /dev/null +++ b/doc/manual/docs/picts/le_security_flow_control_proactive_authentication_peripheral.svg @@ -0,0 +1,64 @@ +Proactive Authentication in Peripheral RoleApp on B connects to AApp on A triggers GATT Client requestLTK available?noyesGATT Client request sentGATT Server returns an ATT_ERROR_INSUFFICIENT_X error?noyesApp receives GATT ResponseENABLE_GATT_CLIENT_PAIRING defined?noyesApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_XSM_EVENT_PAIRING_STARTEDSM on A sends SECURITY REQUESTSM on B should perform pairing sequencepairing success?yesnoSM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request re-sentApp receives GATT ResponseSM_EVENT_PAIRING_COMPLETE(error)App receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_XSM_EVENT_REENCRYPTION_STARTEDSM on A sends SECURITY REQUESTSM on B should encrypt connection if LTK availablere-encryptedyesnoSM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request sentApp receives GATT ResponseSM_EVENT_REENCRYPTION_COMPLETE(error)App receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_BONDING_INFORMATION_MISSINGApp can delete bondinginformation and repeatthe GATT Client request \ No newline at end of file diff --git a/doc/manual/docs/picts/le_security_flow_control_reactive_authentication.svg b/doc/manual/docs/picts/le_security_flow_control_reactive_authentication.svg deleted file mode 100644 index 7713379ef..000000000 --- a/doc/manual/docs/picts/le_security_flow_control_reactive_authentication.svg +++ /dev/null @@ -1,55 +0,0 @@ -Reactive AuthenticationA connects to BApp triggers GATT Client request on AGATT Client request sentGATT Server returns an ATT_ERROR_INSUFFICIENT_X erroryesnoENABLE_GATT_CLIENT_PAIRINGyesnostart encryptionre-encryptedyesnoGATT Client request sentApp receives GATT Responsedelete bonding informationyesLTK availablestart pairingpairedyesnoGATT Client request sentApp receives GATT ResponseApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_XApp receives GATT_QUERY_COMPLETE eventwith ATT_ERROR_INSUFFICIENT_XApp can trigger pairing andrepeat the GATT Client requestApp receives GATT Response \ No newline at end of file diff --git a/doc/manual/docs/picts/le_security_flow_control_reactive_authentication_central.svg b/doc/manual/docs/picts/le_security_flow_control_reactive_authentication_central.svg new file mode 100644 index 000000000..e70ea6cad --- /dev/null +++ b/doc/manual/docs/picts/le_security_flow_control_reactive_authentication_central.svg @@ -0,0 +1,57 @@ +Reactive Authentication in Central RoleApp on A connects to BApp on A triggers GATT Client requestGATT Client request sentGATT Server returns an ATT_ERROR_INSUFFICIENT_X error?yesnoENABLE_GATT_CLIENT_PAIRING defined?yesnoSM_EVENT_REENCRYPTION_STARTEDstart encryptionre-encryptedyesnoSM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request re-sentApp receives GATT ResponseSM_EVENT_REENCRYPTION_COMPLETE(error)delete bonding informationyesLTK available?SM_EVENT_PAIRING_STARTEDstart pairingpairing success?yesnoSM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request re-sentApp receives GATT ResponseSM_EVENT_PAIRING_COMPLETE(error)App receives a GATT Client errorATT_QUERY_COMPLETE(ATT_ERROR_INSUFFICIENT_X)App can trigger pairing andrepeat the GATT Client requestApp receives GATT Response \ No newline at end of file diff --git a/doc/manual/docs/picts/le_security_flow_control_reactive_authentication_peripheral.svg b/doc/manual/docs/picts/le_security_flow_control_reactive_authentication_peripheral.svg new file mode 100644 index 000000000..0e2ce1bc7 --- /dev/null +++ b/doc/manual/docs/picts/le_security_flow_control_reactive_authentication_peripheral.svg @@ -0,0 +1,58 @@ +Reactive Authentication in Peripheral RoleApp on B connects to AApp on A triggers GATT Client requestGATT Client request sentGATT Server returns an ATT_ERROR_INSUFFICIENT_X error?yesnoENABLE_GATT_CLIENT_PAIRING define?yesnoSM_EVENT_REENCRYPTION_STARTEDSM on A sends SECURITY REQUESTSM on B should encrypt connection if LTK availablere-encryptedyesnoSM_EVENT_REENCRYPTION_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request re-sentApp receives GATT ResponseSM_EVENT_REENCRYPTION_COMPLETE(error)delete bonding informationyesLTK available?SM_EVENT_PAIRING_STARTEDSM on A sends SECURITY REQUESTSM on B should perform pairing sequencepairing success?yesnoSM_EVENT_PAIRING_COMPLETE(ERROR_CODE_SUCCESS)GATT Client request re-sentApp receives GATT ResponseSM_EVENT_PAIRING_COMPLETE(error)App receives a GATT Client errorATT_QUERY_COMPLETE(ATT_ERROR_INSUFFICIENT_X)App can trigger pairing andrepeat the GATT Client requestApp receives GATT Response \ No newline at end of file