diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2015-02-27 12:24:06 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2015-02-27 21:41:21 +0100 |
commit | b48e72a939678c6fca9373c1c5d37bfa7ec66dc0 (patch) | |
tree | 076151c89c0b0972c073e086bc1ba217ecef957f /android/gatt.c | |
parent | d117048fdbfe85ec5bfb9c5af2caf5429d50d28f (diff) | |
download | bluez-b48e72a939678c6fca9373c1c5d37bfa7ec66dc0.tar.gz |
android/gatt: Fix check if CSRK is authenticated
Diffstat (limited to 'android/gatt.c')
-rw-r--r-- | android/gatt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/android/gatt.c b/android/gatt.c index 03a92d198..0703e65a9 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -4691,9 +4691,15 @@ static uint8_t check_device_permissions(struct gatt_device *device, if (!(permissions & GATT_PERM_WRITE_SIGNED)) return ATT_ECODE_WRITE_NOT_PERM; - if ((permissions & GATT_PERM_WRITE_SIGNED_MITM) && - sec_level < BT_SECURITY_HIGH) + if (permissions & GATT_PERM_WRITE_SIGNED_MITM) { + bool auth; + + if (bt_get_csrk(&device->bdaddr, true, NULL, NULL, + &auth) && auth) + break; + return ATT_ECODE_AUTHENTICATION; + } break; case ATT_OP_READ_BY_TYPE_REQ: case ATT_OP_READ_REQ: |