File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
features/FEATURE_BLE/source/generic Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -853,16 +853,23 @@ void GenericSecurityManager::on_slave_security_request(
853
853
return ;
854
854
}
855
855
856
- if (authentication.get_secure_connections ()
857
- && _default_authentication.get_secure_connections ()
858
- && !cb->secure_connections_paired ) {
859
- requestPairing (connection);
856
+ bool pairing_required = false ;
857
+
858
+ if (authentication.get_secure_connections () && !cb->secure_connections_paired
859
+ && _default_authentication.get_secure_connections ()) {
860
+ pairing_required = true ;
860
861
}
861
862
862
- if (authentication.get_mitm ()
863
- && !cb-> ltk_mitm_protected ) {
863
+ if (authentication.get_mitm () && !cb-> ltk_mitm_protected ) {
864
+ pairing_required = true ;
864
865
cb->mitm_requested = true ;
866
+ }
867
+
868
+ if (pairing_required) {
865
869
requestPairing (connection);
870
+ } else if (!cb->encryption_requested ) {
871
+ /* this will refresh keys if encryption is already present */
872
+ enable_encryption (connection);
866
873
}
867
874
}
868
875
You can’t perform that action at this time.
0 commit comments