[bt][sm] Add Phase 1 class of pairing

Phase 1 is the first class to exist in an active pairing state machine.
As an initiator, it is responsible for building and sending the Pairing
Request. As a responder, it is responsible for parsing the peer's
Pairing Request and sending a Pairing Response. As initiator or
responder, it resolves the Pairing Request/Response into a higher-level
set of pairing features.

Bug: 46278
Test: Run with `fx run-test bluetooth-tests -t bt-host-unittests -- \
                --gtest_filter="SMP_Phase1*" `
      New Phase 1 tests have added:
      FeatureExchangeBothSupportSCFeaturesHaveSC,
      FeatureExchangeLocalSCRemoteNoSCFeaturesNoSc,
      FeatureExchangeResponderBothSupportSCFeaturesHaveSC,
      FeatureExchangeResponderLocalSCRemoteNoSCFeaturesNoSC,
      Phase1ResponderRejectsPairingRequest

      The rest have been translated from sm/bearer_unittest.cc:
      FeatureExchangeStartDefaultParams,
      FeatureExchangeStartCustomParams,
      FeatureExchangeInitiatorWithIdentityInfo,
      FeatureExchangePairingFailed,
      FeatureExchangeLocalRejectsUnsupportedInitiatorKeys,
      FeatureExchangeLocalRejectsUnsupportedResponderKeys,
      FeatureExchangeFailureAuthenticationRequirements,
      FeatureExchangePairingResponse[Legacy]JustWorks,
      FeatureExchangePairingResponse[Legacy]MITM,
      FeatureExchangeEncryptionKeySize,
      FeatureExchangeResponderErrorMaster (with a different ErrorCode),
      FeatureExchangeResponderMalformedRequest->FeatureExchange\
						MalformedRequest,
      FeatureExchangeLocalResponderRespectsInitiator,
      FeatureExchangeResponderDistributesIdKey,
      FeatureExchangeResponderRespectsInitiatorForIdKey,
      FeatureExchangeResponderFailedAuthenticationRequirements,
      FeatureExchangeResponderJustWorks,
      FeatureExchangeResponderSendsOnlyRequestedKeys,
      FeatureExchangeResponderMITM,
      UnsupportedCommandDuringPairing, OnSecurityRequestWhilePairing,
      FeatureExchangeInitiatorReqBondResNoBond,
      FeatureExchangeInitiatorReqNoBondResBond,
      FeatureExchangeResponderReqBondResNoBond,
      FeatureExchangeResponderReqNoBondResNoBond,
      FeatureExchangeResponderReqNoBondWithKeys

      The list of tests from sm/bearer_unittest.cc not translated to
      phase_1_unittest.cc:
      PacketsWhileIdle (tested in IdlePhase), FeatureExchangeErrorSlave
      (tested by death tests), FeatureExchangeTimeout (now in Manager),
      Abort (now ActivePhase), FeatureExchangeResponderTimerRestarted
      (in Manager), StopTimer (in Manager), Confirm/Random value
      related tests (now in Phase 2), Identity/Identity Address related
      tests (now in Phase 3), OnSecurityRequest... (now in IdlePhase)

Change-Id: I4f4414de57b1324797f5a821f10421440ef43354
10 files changed
tree: abd06d3c76ced19a51d1164091a422fdce0f719b
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .dir-locals.el
  17. .gitattributes
  18. .gitignore
  19. .gn
  20. .style.yapf
  21. AUTHORS
  22. BUILD.gn
  23. CODE_OF_CONDUCT.md
  24. CONTRIBUTING.md
  25. LICENSE
  26. OWNERS
  27. PATENTS
  28. README.md
  29. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.