Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a417192
Work towards improving pairing security requirements
XavierBernhardt-Philips Jun 2, 2025
645ebe1
Better enum naming for ConnectionMode and ManInTheMiddleMode
MiquelJayson-Philips Jun 6, 2025
f470d63
Renamed notRequired to Disabled
MiquelJayson-Philips Jun 6, 2025
f3e8678
Rename values in SecureConnectionMode enum
MiquelJayson-Philips Jun 13, 2025
3adc019
Refactoring SecureConnectionMode and MITMMODE into 2 functions
XavierBernhardt-Philips Jun 16, 2025
5afb95c
refactoring
XavierBernhardt-Philips Jun 18, 2025
1e16bc3
Merge branch 'main' into feature/pairing-security-requirements
XavierBernhardt-Philips Jun 18, 2025
1459c1d
fixed compile error
XavierBernhardt-Philips Jun 18, 2025
4199635
Removed bracket
MiquelJayson-Philips Jun 19, 2025
6cad9a7
Merge commit 'c20c83ea909ca2e1a7ef8a07bb5cfe91144bf3a7'
XavierBernhardt-Philips Jul 2, 2025
ef79d2e
Refactored Pair to Bond in Gap.proto
XavierBernhardt-Philips Jul 9, 2025
b085ee8
Merge branch 'main' into feature/rename_pair_to_bond
XavierBernhardt-Philips Jul 10, 2025
76a781c
revert changes to gap
MiquelJayson-Philips Jul 14, 2025
18f12a1
Merge branch 'main' into feature/156620_revert_gap_sc
MiquelJayson-Philips Jul 16, 2025
d6edad6
cleanup
MiquelJayson-Philips Jul 17, 2025
eb79daa
cleanup
MiquelJayson-Philips Jul 17, 2025
f411646
Merge branch 'main' into feature/rename_pair_to_bond
XavierBernhardt-Philips Jul 22, 2025
d61c173
Merge branch 'feature/156620_revert_gap_sc' into feature/rename_pair_…
XavierBernhardt-Philips Jul 23, 2025
b9a9c0e
Renamed to PairAndBond
XavierBernhardt-Philips Jul 23, 2025
bb61551
merge
XavierBernhardt-Philips Jul 23, 2025
ae8eace
Merge remote-tracking branch 'origin/feature/rename_pair_to_bond' int…
XavierBernhardt-Philips Jul 23, 2025
ebeec25
pr comments
MiquelJayson-Philips Jul 24, 2025
b8aba5c
Merge branch 'feature/156620_revert_gap_sc' into feature/rename_pair_…
XavierBernhardt-Philips Jul 24, 2025
f1dd75b
Added some void trace functions
XavierBernhardt-Philips Jul 24, 2025
3b83653
Renamed to PairAndBond
XavierBernhardt-Philips Jul 29, 2025
11d8f8b
Moving logging functions away from root class
XavierBernhardt-Philips Jul 29, 2025
1c13145
Update services/ble/Gap.hpp
XavierBernhardt-Philips Jul 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions services/ble/Gap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ namespace services
});
}

void GapPairingDecorator::Pair()
void GapPairingDecorator::PairAndBond()
{
GapPairingObserver::Subject().Pair();
GapPairingObserver::Subject().PairAndBond();
}

void GapPairingDecorator::AllowPairing(bool allow)
Expand Down
8 changes: 4 additions & 4 deletions services/ble/Gap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ namespace services
level4,
};

virtual void Pair() = 0;
// 1. If there is a pre-existing bond, then the connection will be encrypted.
// 2. If there is no pre-existing bond, then pairing, encrypting, and bonding (storing the keys) will take place.
virtual void PairAndBond() = 0;

virtual void AllowPairing(bool allow) = 0;

virtual void SetSecurityMode(SecurityMode mode, SecurityLevel level) = 0;
virtual void SetIoCapabilities(IoCapabilities caps) = 0;

virtual void AuthenticateWithPasskey(uint32_t passkey) = 0;
virtual void NumericComparisonConfirm(bool accept) = 0;
};
Expand All @@ -152,7 +152,7 @@ namespace services
void PairingFailed(PairingErrorType error) override;

// Implementation of GapPairing
void Pair() override;
void PairAndBond() override;
void AllowPairing(bool allow) override;
void SetSecurityMode(SecurityMode mode, SecurityLevel level) override;
void SetIoCapabilities(IoCapabilities caps) override;
Expand Down
12 changes: 9 additions & 3 deletions services/ble/Gap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,22 @@ service GapCentral
// Allowed states: connected
rpc Disconnect(Nothing) returns (Nothing) { option (method_id) = 5; }

// Allowed states: connected
rpc Pair(Nothing) returns (Nothing) { option (method_id) = 6; }
// Allowed states: connected
// 1. If there is a pre-existing bond, then the connection will be encrypted.
// 2. If there is no pre-existing bond, then pairing, encrypting, and bonding (storing the keys) will take place.
rpc PairAndBond(Nothing) returns (Nothing) { option (method_id) = 6; }

rpc SetSecurityMode(SecurityModeAndLevel) returns (Nothing) { option (method_id) = 7; }
rpc SetIoCapabilities(IoCapabilities) returns (Nothing) { option (method_id) = 8; }
rpc AuthenticateWithPasskey(UInt32Value) returns (Nothing) { option (method_id) = 9; }
rpc NumericComparisonConfirm(BoolValue) returns (Nothing) { option (method_id) = 10; }
rpc RemoveAllBonds(Nothing) returns (Nothing) { option (method_id) = 11; }
rpc SetDeviceDiscoveryFilter(DeviceDiscoveryFilter) returns (Nothing) { option (method_id) = 12; }
rpc ResolvePrivateAddress(Address) returns (Nothing) { option (method_id) = 13; }

// This will only succeed if Address is a private resolvable address, and if the device is bonded
rpc ResolvePrivateAddress(Address) returns (Nothing) { option (method_id) = 13; }

// This will work with both public and random addresses
rpc IsDeviceBonded(PeerNodeParameters) returns (Nothing) { option (method_id) = 14; }
}

Expand Down
4 changes: 2 additions & 2 deletions services/ble/test/TestGapPairing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ namespace services

TEST_F(GapPairingDecoratorTest, forward_all_calls_to_subject)
{
EXPECT_CALL(gapPairing, Pair());
decorator.Pair();
EXPECT_CALL(gapPairing, PairAndBond());
decorator.PairAndBond();

EXPECT_CALL(gapPairing, AllowPairing(::testing::IsTrue()));
decorator.AllowPairing(true);
Expand Down
2 changes: 1 addition & 1 deletion services/ble/test_doubles/GapPairingMock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace services
: public GapPairing
{
public:
MOCK_METHOD(void, Pair, ());
MOCK_METHOD(void, PairAndBond, ());
MOCK_METHOD(void, AllowPairing, (bool allow));
MOCK_METHOD(void, SetSecurityMode, (SecurityMode mode, SecurityLevel level));
MOCK_METHOD(void, SetIoCapabilities, (IoCapabilities caps));
Expand Down
Loading