mirror of https://github.com/ARMmbed/mbed-os.git
readability
parent
533f6a464a
commit
1208dc7c34
|
@ -346,6 +346,7 @@ public:
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
return BLE_ERROR_INVALID_PARAM;
|
return BLE_ERROR_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->encryption_requested) {
|
if (entry->encryption_requested) {
|
||||||
return BLE_ERROR_OPERATION_NOT_PERMITTED;
|
return BLE_ERROR_OPERATION_NOT_PERMITTED;
|
||||||
}
|
}
|
||||||
|
@ -384,6 +385,7 @@ public:
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
return BLE_ERROR_INVALID_PARAM;
|
return BLE_ERROR_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entry->signing_key && enabled) {
|
if (!entry->signing_key && enabled) {
|
||||||
KeyDistribution distribution = key_distribution;
|
KeyDistribution distribution = key_distribution;
|
||||||
distribution.set_signing(enabled);
|
distribution.set_signing(enabled);
|
||||||
|
@ -395,6 +397,7 @@ public:
|
||||||
distribution
|
distribution
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return BLE_ERROR_NONE;
|
return BLE_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,6 +552,7 @@ public:
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
return BLE_ERROR_INVALID_PARAM;
|
return BLE_ERROR_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->signing_key && (entry->mitm || !authenticated)) {
|
if (entry->signing_key && (entry->mitm || !authenticated)) {
|
||||||
/* we have a key that is either authenticated or we don't care if it is
|
/* we have a key that is either authenticated or we don't care if it is
|
||||||
* so retrieve it from the db now */
|
* so retrieve it from the db now */
|
||||||
|
@ -557,6 +561,7 @@ public:
|
||||||
connection
|
connection
|
||||||
);
|
);
|
||||||
return BLE_ERROR_NONE;
|
return BLE_ERROR_NONE;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* we don't have the right key so we need to get it first
|
/* we don't have the right key so we need to get it first
|
||||||
* keys exchange will create the signingKey event */
|
* keys exchange will create the signingKey event */
|
||||||
|
@ -637,13 +642,13 @@ public:
|
||||||
bool OOBProvidesMITM = true
|
bool OOBProvidesMITM = true
|
||||||
) {
|
) {
|
||||||
SecurityEntry_t *entry = db.get_entry(connection);
|
SecurityEntry_t *entry = db.get_entry(connection);
|
||||||
if (entry) {
|
if (!entry) {
|
||||||
|
return BLE_ERROR_INVALID_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
entry->oob = useOOB;
|
entry->oob = useOOB;
|
||||||
entry->oob_mitm_protection = OOBProvidesMITM;
|
entry->oob_mitm_protection = OOBProvidesMITM;
|
||||||
return BLE_ERROR_NONE;
|
return BLE_ERROR_NONE;
|
||||||
} else {
|
|
||||||
return BLE_ERROR_INVALID_PARAM;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ble_error_t confirmationEntered(
|
virtual ble_error_t confirmationEntered(
|
||||||
|
|
Loading…
Reference in New Issue