Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca7a290a authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Packets improvements for SMP

Add HCI packets definitions necessary for LE Pairing implementation.
Loosen the definitions of SMP packets, for easier bit handling.

Test: none
Bug: 139138713
Change-Id: I29bc30f651d72b6dfd827857b57b624d209c55a1
parent 02ead5b4
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2177,11 +2177,15 @@ packet LeRandComplete : CommandComplete (command_op_code = LE_RAND) {
}

packet LeStartEncryption : LeSecurityCommand (op_code = LE_START_ENCRYPTION) {
  _payload_,  // placeholder (unimplemented)
  connection_handle: 16,
  rand: 8[8],
  ediv: 16,
  ltk: 8[16],
}

packet LeLongTermKeyRequestReply : LeSecurityCommand (op_code = LE_LONG_TERM_KEY_REQUEST_REPLY) {
  _payload_,  // placeholder (unimplemented)
  connection_handle: 16,
  long_term_key: 8[16],
}

packet LeLongTermKeyRequestNegativeReply : LeSecurityCommand (op_code = LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY) {
+5 −24
Original line number Diff line number Diff line
@@ -42,33 +42,14 @@ enum BondingFlags : 2 {
  BONDING = 1,
}

group AuthReq {
  bonding_flags : BondingFlags,
  mitm : 1, // Man-in-the-middle protection required
  sc : 1, // Secure Connections
  keypress : 1,  // Only used in Passkey Entry
  ct2 : 1, // Support for the h7 function.
  _reserved_ : 2,
}

group PairingInfo {
  io_capability : IoCapability,
  oob_data_flag : OobDataFlag,
  AuthReq,
  auth_req: 8,
  maximum_encryption_key_size : 5, // 7 - 16
  _reserved_ : 3,
  // InitiatorKeyDistribution
  initiator_enc_key : 1,
  initiator_id_key : 1,
  initiator_sign_key : 1,
  initiator_link_key : 1,
  _reserved_ : 4,
  // ResponderKeyDistribution
  responder_enc_key : 1,
  responder_id_key : 1,
  responder_sign_key : 1,
  responder_link_key : 1,
  _reserved_ : 4,
  initiator_key_distribution : 8,
  responder_key_distribution : 8,
}

packet PairingRequest : Command (code = PAIRING_REQUEST) {
@@ -114,7 +95,7 @@ packet EncryptionInformation : Command (code = ENCRYPTION_INFORMATION) {

packet MasterIdentification : Command (code = MASTER_IDENTIFICATION) {
  ediv : 16,
  rand : 64,
  rand : 8[8],
}

packet IdentityInformation : Command (code = IDENTITY_INFORMATION) {
@@ -136,7 +117,7 @@ packet SigningInformation : Command (code = SIGNING_INFORMATION) {
}

packet SecurityRequest : Command (code = SECURITY_REQUEST) {
  AuthReq,
  auth_req: 8,
}

packet PairingPublicKey : Command (code = PAIRING_PUBLIC_KEY) {