Skip to contentSkip to conversation

gatt: remove superfluous extended properties

PATCH Applied Dagan Martinez 3 participants 4 messages Sep 26, 2021 – Sep 27, 2021 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

cover gatt: remove superfluous extended properties

As discussed on Slack, the BlueZ source contains superfluous non-standard extended properties with no effect other than the creation of unnecessary CEPDs with bits set in the "reserved" field. These extended properties are set when a characteristic has a secure-*, encrypt-*, or encrypt-authenticated-* flag set.

According to section 3.3.3.1 of the Bluetooth core spec 5.3, the only valid extended properties are "reliable write", and "writable auxiliaries."

This patch removes all other extended properties.

Dagan Martinez (1):
gatt: remove superfluous extended properties

 src/gatt-database.c    | 6 ------
 src/shared/att-types.h | 8 --------
 2 files changed, 14 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 gatt: remove superfluous extended properties

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.

---
 src/gatt-database.c    | 6 ------
 src/shared/att-types.h | 8 --------
 2 files changed, 14 deletions(-)
src/gatt-database.c +0 -6
index 99c95f2d6..1f7ce5f02 100644
@@ -1656,27 +1656,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;
src/shared/att-types.h +0 -8
index 3adc05d9e..a08b24155 100644
@@ -151,14 +151,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
Signature · 1 line
2.31.1
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=553055

---Test result---

Test Summary:

CheckPatch                    PASS      0.45 seconds
GitLint                       PASS      0.29 seconds
Prep - Setup ELL              PASS      50.88 seconds
Build - Prep                  PASS      0.24 seconds
Build - Configure             PASS      9.15 seconds
Build - Make                  PASS      219.00 seconds
Make Check                    PASS      9.85 seconds
Make Distcheck                PASS      256.92 seconds
Build w/ext ELL - Configure   PASS      8.96 seconds
Build w/ext ELL - Make        PASS      207.23 seconds

---
Regards,
Linux Bluetooth

maintainer Applied
#3 lore raw

Hi Dagan,

Quoted 25 lines · On Sun, Sep 26, 2021 at 11:00 AM <[email protected]> wrote:

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=553055

---Test result---

Test Summary:

CheckPatch                    PASS      0.45 seconds
GitLint                       PASS      0.29 seconds
Prep - Setup ELL              PASS      50.88 seconds
Build - Prep                  PASS      0.24 seconds
Build - Configure             PASS      9.15 seconds
Build - Make                  PASS      219.00 seconds
Make Check                    PASS      9.85 seconds
Make Distcheck                PASS      256.92 seconds
Build w/ext ELL - Configure   PASS      8.96 seconds
Build w/ext ELL - Make        PASS      207.23 seconds
Quoted 3 lines

---
Regards,
Linux Bluetooth

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz