summaryrefslogtreecommitdiffstats
path: root/src/direct_bt
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-25 05:30:33 +0100
committerSven Göthel <[email protected]>2024-02-25 05:30:33 +0100
commit41985a975e406864229a24b7e67ec2298bf6e9b2 (patch)
tree88ff1c2a1dcd3b35cf0c3048b6fc1be1fe7cda89 /src/direct_bt
parent0660af6cb4978689c8ca40921c7d383e6a5fcb9f (diff)
Adopt to jaulib commit d658b6059d7e7513b60c5c67019b76c9cd3f809b
Diffstat (limited to 'src/direct_bt')
-rw-r--r--src/direct_bt/BTAdapter.cpp2
-rw-r--r--src/direct_bt/BTManager.cpp4
-rw-r--r--src/direct_bt/HCIHandler.cpp2
-rw-r--r--src/direct_bt/SMPCrypto.cpp12
-rw-r--r--src/direct_bt/SMPTypes.cpp2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/direct_bt/BTAdapter.cpp b/src/direct_bt/BTAdapter.cpp
index 16e9550e..e3f62f9a 100644
--- a/src/direct_bt/BTAdapter.cpp
+++ b/src/direct_bt/BTAdapter.cpp
@@ -672,7 +672,7 @@ bool BTAdapter::setPowered(const bool power_on) noexcept {
}
HCIStatusCode BTAdapter::setPrivacy(const bool enable) noexcept {
- jau::uint128_t irk;
+ jau::uint128dp_t irk;
if( enable ) {
std::unique_ptr<std::random_device> rng_hw = std::make_unique<std::random_device>();
for(int i=0; i<4; ++i) {
diff --git a/src/direct_bt/BTManager.cpp b/src/direct_bt/BTManager.cpp
index 1af91966..a04269d0 100644
--- a/src/direct_bt/BTManager.cpp
+++ b/src/direct_bt/BTManager.cpp
@@ -264,7 +264,7 @@ HCIStatusCode BTManager::initializeAdapter(AdapterInfo& adapterInfo, const uint1
setMode(dev_id, MgmtCommand::Opcode::SET_POWERED, 0, current_settings);
{
- jau::uint128_t zero_privacy_irk;
+ jau::uint128dp_t zero_privacy_irk;
zero_privacy_irk.clear();
setPrivacy(dev_id, 0x00, zero_privacy_irk, current_settings);
}
@@ -730,7 +730,7 @@ std::vector<MgmtDefaultParam> BTManager::readDefaultSysParam(const uint16_t dev_
return std::vector<MgmtDefaultParam>();
}
-HCIStatusCode BTManager::setPrivacy(const uint16_t dev_id, const uint8_t privacy, const jau::uint128_t& irk, AdapterSetting& current_settings) noexcept {
+HCIStatusCode BTManager::setPrivacy(const uint16_t dev_id, const uint8_t privacy, const jau::uint128dp_t& irk, AdapterSetting& current_settings) noexcept {
MgmtSetPrivacyCmd req(dev_id, privacy, irk);
MgmtStatus res = handleCurrentSettingsReply(sendWithReply(req), current_settings);
DBG_PRINT("BTManager::setPrivacy[%d]: %s, result %s %s", dev_id,
diff --git a/src/direct_bt/HCIHandler.cpp b/src/direct_bt/HCIHandler.cpp
index 1abb2b2d..d9498a7f 100644
--- a/src/direct_bt/HCIHandler.cpp
+++ b/src/direct_bt/HCIHandler.cpp
@@ -1508,7 +1508,7 @@ HCIStatusCode HCIHandler::disconnect(const uint16_t conn_handle, const BDAddress
}
HCIStatusCode HCIHandler::le_add_to_resolv_list(const BDAddressAndType& peerIdentityAddressAndType,
- jau::uint128_t& peer_irk, jau::uint128_t& local_irk) noexcept {
+ jau::uint128dp_t& peer_irk, jau::uint128dp_t& local_irk) noexcept {
if( !use_resolv_add() ) { return HCIStatusCode::UNKNOWN_COMMAND; }
HCIStatusCode status;
HCIStructCommand<hci_cp_le_add_to_resolv_list> req0(HCIOpcode::LE_ADD_TO_RESOLV_LIST);
diff --git a/src/direct_bt/SMPCrypto.cpp b/src/direct_bt/SMPCrypto.cpp
index 3c9839da..e4cd2d9c 100644
--- a/src/direct_bt/SMPCrypto.cpp
+++ b/src/direct_bt/SMPCrypto.cpp
@@ -164,7 +164,7 @@ static int smp_crypto_ah(const uint8_t irk[16], const uint8_t r[3], uint8_t out[
return 0;
}
-bool smp_crypto_rpa_irk_matches(const jau::uint128_t irk, const EUI48& rpa) noexcept {
+bool smp_crypto_rpa_irk_matches(const jau::uint128dp_t irk, const EUI48& rpa) noexcept {
if constexpr ( !USE_SMP_CRYPTO_IRK ) {
return false;
}
@@ -187,7 +187,7 @@ bool smp_crypto_rpa_irk_matches(const jau::uint128_t irk, const EUI48& rpa) noex
* @param out 128-bit message authentication code
* @return
*/
-static bool bt_smp_aes_cmac(const jau::uint128_t& key, const uint8_t *in, size_t len, jau::uint128_t& out)
+static bool bt_smp_aes_cmac(const jau::uint128dp_t& key, const uint8_t *in, size_t len, jau::uint128dp_t& out)
{
#if defined(USE_SMP_CRYPTO_CMAC_) && defined(USE_SMP_CRYPTO_AES128_)
struct tc_aes_key_sched_struct sched;
@@ -223,16 +223,16 @@ static bool bt_smp_aes_cmac(const jau::uint128_t& key, const uint8_t *in, size_t
* @param ltk result in littleEndian
* @return
*/
-bool smp_crypto_f5(const jau::uint256_t w, const jau::uint128_t n1, const jau::uint128_t n2,
+bool smp_crypto_f5(const jau::uint256_t w, const jau::uint128dp_t n1, const jau::uint128dp_t n2,
const BDAddressAndType& a1, const BDAddressAndType& a2,
- jau::uint128_t& mackey, jau::uint128_t& ltk) noexcept
+ jau::uint128dp_t& mackey, jau::uint128dp_t& ltk) noexcept
{
if constexpr ( !USE_SMP_CRYPTO_F5 ) {
return false;
}
/** Salt random number in MSB, see BT Core Spec */
- static const jau::uint128_t salt( { 0x6c, 0x88, 0x83, 0x91, 0xaa, 0xf5,
+ static const jau::uint128dp_t salt( { 0x6c, 0x88, 0x83, 0x91, 0xaa, 0xf5,
0xa5, 0x38, 0x60, 0x37, 0x0b, 0xdb,
0x5a, 0x60, 0x83, 0xbe } );
@@ -247,7 +247,7 @@ bool smp_crypto_f5(const jau::uint256_t w, const jau::uint128_t n1, const jau::u
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a2 */
0x01, 0x00 /* length 256 in MSB */ };
uint8_t ws[32];
- jau::uint128_t t, temp_;
+ jau::uint128dp_t t, temp_;
DBG_PRINT("w %s", jau::bytesHexString(w.data, 0, 32, true /* lsbFirst */).c_str());
DBG_PRINT("n1 %s", jau::bytesHexString(n1.data, 0, 16, true /* lsbFirst */).c_str());
diff --git a/src/direct_bt/SMPTypes.cpp b/src/direct_bt/SMPTypes.cpp
index 862d47b6..7c4fb114 100644
--- a/src/direct_bt/SMPTypes.cpp
+++ b/src/direct_bt/SMPTypes.cpp
@@ -315,7 +315,7 @@ bool SMPIdentityResolvingKey::matches(const EUI48& rpa) noexcept {
return smp_crypto_rpa_irk_matches(irk, rpa); // irk.id_address == this->addressAndType
}
-bool SMPIdentityResolvingKey::matches(const jau::uint128_t& irk, const EUI48& rpa) noexcept {
+bool SMPIdentityResolvingKey::matches(const jau::uint128dp_t& irk, const EUI48& rpa) noexcept {
return smp_crypto_rpa_irk_matches(irk, rpa);
}