Diff between 39bc72298ecbadd4930be08db92d99f3c283567a and 6c50a037c49e4b0994af65ca1082d8a2de782c14

Changed Files

File Additions Deletions Status
emulator/bthost.c +1 -1 modified
emulator/bthost.h +1 -1 modified
emulator/smp.c +8 -8 modified

Full Patch

diff --git a/emulator/bthost.c b/emulator/bthost.c
index 7f9af43..1fae580 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -2135,7 +2135,7 @@ void bthost_request_auth(struct bthost *bthost, uint16_t handle)
 		cp.handle = cpu_to_le16(handle);
 		send_command(bthost, BT_HCI_CMD_AUTH_REQUESTED, &cp, sizeof(cp));
 	} else {
-		smp_pair(conn->smp_data, bthost->io_capability);
+		smp_pair(conn->smp_data, bthost->io_capability, bthost->auth_req);
 	}
 }
 
diff --git a/emulator/bthost.h b/emulator/bthost.h
index 49a8649..042f1cd 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -128,4 +128,4 @@ void *smp_conn_add(void *smp_data, uint16_t handle, const uint8_t *ia,
 void smp_conn_del(void *conn_data);
 void smp_data(void *conn_data, const void *data, uint16_t len);
 int smp_get_ltk(void *smp_data, uint64_t rand, uint16_t ediv, uint8_t *ltk);
-void smp_pair(void *conn_data, uint8_t io_cap);
+void smp_pair(void *conn_data, uint8_t io_cap, uint8_t auth_req);
diff --git a/emulator/smp.c b/emulator/smp.c
index 5a6c558..eea960b 100644
--- a/emulator/smp.c
+++ b/emulator/smp.c
@@ -152,17 +152,17 @@ static void pairing_rnd(struct smp_conn *conn, const void *data, uint16_t len)
 	bthost_send_cid(bthost, conn->handle, SMP_CID, rsp, sizeof(rsp));
 }
 
-void smp_pair(void *conn_data, uint8_t io_cap)
+void smp_pair(void *conn_data, uint8_t io_cap, uint8_t auth_req)
 {
 	struct smp_conn *conn = conn_data;
 	struct bthost *bthost = conn->smp->bthost;
-	const uint8_t smp_pair_req[] = {	0x01,	/* Pairing Request */
-						io_cap,	/* IO Capability */
-						0x00,	/* OOB Flag */
-						0x01,	/* Bonding - no MITM */
-						0x10,	/* Max key size */
-						0x00,	/* Init. key dist. */
-						0x01,	/* Rsp. key dist. */
+	const uint8_t smp_pair_req[] = {	0x01,     /* Pairing Request */
+						io_cap,   /* IO Capability */
+						0x00,     /* OOB Flag */
+						auth_req, /* Auth requirement */
+						0x10,     /* Max key size */
+						0x00,     /* Init. key dist. */
+						0x01,     /* Rsp. key dist. */
 					};
 
 	memcpy(conn->preq, smp_pair_req, sizeof(smp_pair_req));