BLE: return an error when application tries to turn down encryption.

pull/6932/head
Vincent Coubard 2018-04-20 15:47:17 +01:00
parent 6a90232b6b
commit b0d5ba33bb
1 changed files with 2 additions and 3 deletions

View File

@ -392,9 +392,8 @@ ble_error_t GenericSecurityManager::setLinkEncryption(
/* ignore if the link is already at required state*/
} else if (encryption == link_encryption_t::NOT_ENCRYPTED) {
/* ignore if we are requesting an open link on an already encrypted link */
// Fail as it is not permitted to turn down encryption
return BLE_ERROR_OPERATION_NOT_PERMITTED;
} else if (encryption == link_encryption_t::ENCRYPTED) {
/* only change if we're not already encrypted with mitm */