1. 13 2月, 2014 5 次提交
    • M
      Bluetooth: Add debugfs quirk for forcing Secure Connections support · 5afeac14
      Marcel Holtmann 提交于
      The Bluetooth 4.1 specification with Secure Connections support has
      just been released and controllers with this feature are still in
      an early stage.
      
      A handful of controllers have already support for it, but they do
      not always identify this feature correctly. This debugfs entry
      allows to tell the kernel that the controller can be treated as
      it would fully support Secure Connections.
      
      Using debugfs to force Secure Connections support of course does
      not make this feature magically appear in all controllers. This
      is a debug functionality for early adopters. Once the majority
      of controllers matures this quirk will be removed.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      5afeac14
    • M
      Bluetooth: Add support for local OOB data with Secure Connections · 4d2d2796
      Marcel Holtmann 提交于
      For Secure Connections support and the usage of out-of-band pairing,
      it is needed to read the P-256 hash and randomizer or P-192 hash and
      randomizer. This change will read P-192 data when Secure Connections
      is disabled and P-192 and P-256 data when it is enabled.
      
      The difference is between using HCI Read Local OOB Data and using the
      new HCI Read Local OOB Extended Data command. The first one has been
      introduced with Bluetooth 2.1 and returns only the P-192 data.
      
      < HCI Command: Read Local OOB Data (0x03|0x0057) plen 0
      > HCI Event: Command Complete (0x0e) plen 36
            Read Local OOB Data (0x03|0x0057) ncmd 1
              Status: Success (0x00)
              Hash C from P-192: 975a59baa1c4eee391477cb410b23e6d
              Randomizer R with P-192: 9ee63b7dec411d3b467c5ae446df7f7d
      
      The second command has been introduced with Bluetooth 4.1 and will
      return P-192 and P-256 data.
      
      < HCI Command: Read Local OOB Extended Data (0x03|0x007d) plen 0
      > HCI Event: Command Complete (0x0e) plen 68
            Read Local OOB Extended Data (0x03|0x007d) ncmd 1
              Status: Success (0x00)
              Hash C from P-192: 6489731804b156fa6355efb8124a1389
              Randomizer R with P-192: 4781d5352fb215b2958222b3937b6026
              Hash C from P-256: 69ef8a928b9d07fc149e630e74ecb991
              Randomizer R with P-256: 4781d5352fb215b2958222b3937b6026
      
      The change for the management interface is transparent and no change
      is required for existing userspace. The Secure Connections feature
      needs to be manually enabled. When it is disabled, then userspace
      only gets the P-192 returned and with Secure Connections enabled,
      userspace gets P-192 and P-256 in an extended structure.
      
      It is also acceptable to just ignore the P-256 data since it is not
      required to support them. The pairing with out-of-band credentials
      will still succeed. However then of course no Secure Connection will
      b established.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      4d2d2796
    • M
      Bluetooth: Limit acceptable link key types to only supported ones · 8e991132
      Marcel Holtmann 提交于
      The link keys that are loaded by userspace during controller setup
      should be limited to actual valid and supported types. With the
      support for Secure Connections, it is limited to types 0x00 - 0x08
      at the moment. Reject any other link key types.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      8e991132
    • M
      Bluetooth: Add management command for enabling Secure Connections · eac83dc6
      Marcel Holtmann 提交于
      The support for Secure Connections need to be explicitly enabled by
      userspace. This is required since only userspace that can handle the
      new link key types should enable support for Secure Connections.
      
      This command handling is similar to how Secure Simple Pairing enabling
      is done. It also tracks the case when Secure Connections support is
      enabled via raw HCI commands. This makes sure that the host features
      page is updated as well.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      eac83dc6
    • M
      Bluetooth: Add flags and setting for Secure Connections support · e98d2ce2
      Marcel Holtmann 提交于
      The MGMT_SETTING_SECURE_CONN setting is used to track the support and
      status for Secure Connections from the management interface. For HCI
      based tracking HCI_SC_ENABLED flag is used.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      e98d2ce2
  2. 04 12月, 2013 3 次提交
    • A
      Bluetooth: Add an extra check in mgmt_device_disconnected() · 57eb776f
      Andre Guedes 提交于
      This patch adds an extra check in mgmt_device_disconnected() so we only
      send the "Device Disconnected" event if it is ACL_LINK or LE_LINK link
      type.
      Signed-off-by: NAndre Guedes <andre.guedes@openbossa.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      57eb776f
    • A
      Bluetooth: Check address in mgmt_disconnect_failed() · 3655bba8
      Andre Guedes 提交于
      Check the address and address type in mgmt_disconnect_failed() otherwise
      we may wrongly fail the MGMT_OP_DISCONNECT command.
      Signed-off-by: NAndre Guedes <andre.guedes@openbossa.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      3655bba8
    • M
      Bluetooth: Fix limited discoverable mode for Zeevo modules · 33337dcb
      Marcel Holtmann 提交于
      There is an old Panasonic module with a Zeevo chip in there that is
      not really operating according to Bluetooth core specification when
      it comes to setting the IAC LAP for limited discoverable mode.
      
      For reference, this is the vendor information about this module:
      
        < HCI Command: Read Local Version Information (0x04|0x0001) plen 0
        > HCI Event: Command Complete (0x0e) plen 12
              Read Local Version Information (0x04|0x0001) ncmd 1
                Status: Success (0x00)
                HCI version: Bluetooth 1.2 (0x02) - Revision 196 (0x00c4)
                LMP version: Bluetooth 1.2 (0x02) - Subversion 61 (0x003d)
                Manufacturer: Zeevo, Inc. (18)
      
      The module reports only the support for one IAC at a time. And that
      is totally acceptable according to the Bluetooth core specification
      since the minimum supported IAC is only one.
      
        < HCI Command: Read Number of Supported IAC (0x03|0x0038) plen 0
        > HCI Event: Command Complete (0x0e) plen 5
              Read Number of Supported IAC (0x03|0x0038) ncmd 1
                Status: Success (0x00)
                Number of IAC: 1
      
      The problem arises when trying to program two IAC into the module
      on a controller that only supports one.
      
        < HCI Command: Write Current IAC LAP (0x03|0x003a) plen 7
                Number of IAC: 2
                Access code: 0x9e8b00 (Limited Inquiry)
                Access code: 0x9e8b33 (General Inquiry)
        > HCI Event: Command Status (0x0f) plen 4
              Write Current IAC LAP (0x03|0x003a) ncmd 1
                Status: Unknown HCI Command (0x01)
      
      While this looks strange, but according to the Bluetooth core
      specification it is a legal operation. The controller has to
      ignore the other values and only program as many as it supports.
      
        This command shall clear any existing IACs and stores Num_Current_IAC
        and the IAC_LAPs in to the controller. If Num_Current_IAC is greater
        than Num_Support_IAC then only the first Num_Support_IAC shall be
        stored in the controller, and a Command Complete event with error
        code Success (0x00) shall be generated.
      
      This specific controller has a bug here and just returns an error. So
      in case the number of supported IAC is less than two and the limited
      discoverable mode is requested, now only the LIAC is written to
      the controller.
      
        < HCI Command: Write Current IAC LAP (0x03|0x003a) plen 4
                Number of IAC: 1
                Access code: 0x9e8b00 (Limited Inquiry)
        > HCI Event: Command Complete (0x0e) plen 4
              Write Current IAC LAP (0x03|0x003a) ncmd 1
                Status: Success (0x00)
      
      All other controllers that only support one IAC seem to handle this
      perfectly fine, but this fix will only write the LIAC for these
      controllers as well.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      33337dcb
  3. 21 10月, 2013 10 次提交
  4. 19 10月, 2013 1 次提交
  5. 16 10月, 2013 19 次提交
  6. 15 10月, 2013 2 次提交