Skip to content

Commit e91ef4f

Browse files
alxelaxrlubos
authored andcommitted
[nrf fromtree] bluetooth: mesh: prevent getting wrong authentication size
Commit moves SHA256 authentication size under SHA256 macro. Signed-off-by: Aleksandr Khromykh <[email protected]> (cherry picked from commit 8b2e37f) Signed-off-by: Aleksandr Khromykh <[email protected]>
1 parent 99708cd commit e91ef4f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

subsys/bluetooth/mesh/prov.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,14 @@ static inline void bt_mesh_prov_buf_init(struct net_buf_simple *buf, uint8_t typ
164164
net_buf_simple_add_u8(buf, type);
165165
}
166166

167-
168167
static inline uint8_t bt_mesh_prov_auth_size_get(void)
169168
{
170-
return bt_mesh_prov_link.algorithm == BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM ? 16 : 32;
169+
if (IS_ENABLED(CONFIG_BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM)) {
170+
return bt_mesh_prov_link.algorithm == BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM ? 16
171+
: 32;
172+
} else {
173+
return 16;
174+
}
171175
}
172176

173177
static inline k_timeout_t bt_mesh_prov_protocol_timeout_get(void)

0 commit comments

Comments
 (0)