gatt: remove superfluous extended properties
authorDagan Martinez <martinez.dagan@gmail.com>
Sun, 26 Sep 2021 17:00:39 +0000 (13:00 -0400)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:37 +0000 (19:08 +0530)
BlueZ contained superfluous properties that not only did nothing of
value, but needlessly created CEP descriptors for any characteristic
with a secure/encrypted/authenticated flag applied to it.

This actually deviated from the spec(Bluetooth core 5.3, 3.3.3.1) by
setting the reserved bits in the CEPD.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/gatt-database.c
src/shared/att-types.h

index 45ceba14cb0f91f2a0ca6ee8a167ab4355211904..87474ff877ea89eebfb14afc6d0d0d21e1d019f2 100644 (file)
@@ -2060,27 +2060,21 @@ static bool parse_chrc_flags(DBusMessageIter *array, uint8_t *props,
                        *ext_props |= BT_GATT_CHRC_EXT_PROP_WRITABLE_AUX;
                } else if (!strcmp("encrypt-read", flag)) {
                        *props |= BT_GATT_CHRC_PROP_READ;
-                       *ext_props |= BT_GATT_CHRC_EXT_PROP_ENC_READ;
                        *perm |= BT_ATT_PERM_READ | BT_ATT_PERM_READ_ENCRYPT;
                } else if (!strcmp("encrypt-write", flag)) {
                        *props |= BT_GATT_CHRC_PROP_WRITE;
-                       *ext_props |= BT_GATT_CHRC_EXT_PROP_ENC_WRITE;
                        *perm |= BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_ENCRYPT;
                } else if (!strcmp("encrypt-authenticated-read", flag)) {
                        *props |= BT_GATT_CHRC_PROP_READ;
-                       *ext_props |= BT_GATT_CHRC_EXT_PROP_AUTH_READ;
                        *perm |= BT_ATT_PERM_READ | BT_ATT_PERM_READ_AUTHEN;
                } else if (!strcmp("encrypt-authenticated-write", flag)) {
                        *props |= BT_GATT_CHRC_PROP_WRITE;
-                       *ext_props |= BT_GATT_CHRC_EXT_PROP_AUTH_WRITE;
                        *perm |= BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_AUTHEN;
                } else if (!strcmp("secure-read", flag)) {
                        *props |= BT_GATT_CHRC_PROP_READ;
-                       *ext_props |= BT_GATT_CHRC_EXT_PROP_AUTH_READ;
                        *perm |= BT_ATT_PERM_READ | BT_ATT_PERM_READ_SECURE;
                } else if (!strcmp("secure-write", flag)) {
                        *props |= BT_GATT_CHRC_PROP_WRITE;
-                       *ext_props |= BT_GATT_CHRC_EXT_PROP_AUTH_WRITE;
                        *perm |= BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_SECURE;
                } else if (!strcmp("authorize", flag)) {
                        *req_prep_authorization = true;
index ce5d927603289a06a5e7facb90739c8ff1c7ea1c..7701506e4f0c01d2fa4097e0d48c73995de794ee 100755 (executable)
@@ -162,14 +162,6 @@ struct bt_att_pdu_error_rsp {
 /* GATT Characteristic Extended Properties Bitfield values */
 #define BT_GATT_CHRC_EXT_PROP_RELIABLE_WRITE           0x01
 #define BT_GATT_CHRC_EXT_PROP_WRITABLE_AUX             0x02
-#define BT_GATT_CHRC_EXT_PROP_ENC_READ                 0x04
-#define BT_GATT_CHRC_EXT_PROP_ENC_WRITE                        0x08
-#define BT_GATT_CHRC_EXT_PROP_ENC      (BT_GATT_CHRC_EXT_PROP_ENC_READ | \
-                                       BT_GATT_CHRC_EXT_PROP_ENC_WRITE)
-#define BT_GATT_CHRC_EXT_PROP_AUTH_READ                        0x10
-#define BT_GATT_CHRC_EXT_PROP_AUTH_WRITE               0x20
-#define BT_GATT_CHRC_EXT_PROP_AUTH     (BT_GATT_CHRC_EXT_PROP_AUTH_READ | \
-                                       BT_GATT_CHRC_EXT_PROP_AUTH_WRITE)
 
 /* GATT Characteristic Client Features Bitfield values */
 #define BT_GATT_CHRC_CLI_FEAT_ROBUST_CACHING           0x01