Diff between d117048fdbfe85ec5bfb9c5af2caf5429d50d28f and b48e72a939678c6fca9373c1c5d37bfa7ec66dc0

Changed Files

File Additions Deletions Status
android/gatt.c +8 -2 modified

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index 03a92d1..0703e65 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: