mirror of https://github.com/ARMmbed/mbed-os.git
BLE: return an error when application tries to turn down encryption.
parent
6a90232b6b
commit
b0d5ba33bb
|
@ -392,9 +392,8 @@ ble_error_t GenericSecurityManager::setLinkEncryption(
|
||||||
/* ignore if the link is already at required state*/
|
/* ignore if the link is already at required state*/
|
||||||
|
|
||||||
} else if (encryption == link_encryption_t::NOT_ENCRYPTED) {
|
} else if (encryption == link_encryption_t::NOT_ENCRYPTED) {
|
||||||
|
// Fail as it is not permitted to turn down encryption
|
||||||
/* ignore if we are requesting an open link on an already encrypted link */
|
return BLE_ERROR_OPERATION_NOT_PERMITTED;
|
||||||
|
|
||||||
} else if (encryption == link_encryption_t::ENCRYPTED) {
|
} else if (encryption == link_encryption_t::ENCRYPTED) {
|
||||||
|
|
||||||
/* only change if we're not already encrypted with mitm */
|
/* only change if we're not already encrypted with mitm */
|
||||||
|
|
Loading…
Reference in New Issue