[PATCH 2/9] android/gatt: Fix handling signed write command from remote

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As per spec (BT spec 4.1 Vol[3], Part F, chapter 3.4.5.4) message which
should be taken to generate signature is opcode, handle and parameters
---
 android/gatt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index 2e37a02..6638fe6 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -5007,8 +5007,9 @@ static void write_signed_cmd_request(const uint8_t *cmd, uint16_t cmd_len,
 		}
 
 		/* Generate signature and verify it */
-		if (!bt_crypto_sign_att(crypto, csrk, value, vlen, sign_cnt,
-									t)) {
+		if (!bt_crypto_sign_att(crypto, csrk, cmd,
+						cmd_len - ATT_SIGNATURE_LEN,
+						sign_cnt, t)) {
 			error("gatt: Error when generating att signature");
 			return;
 		}
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux