Skip to content

Commit 11901f1

Browse files
author
Cruz Monrreal
authored
Merge pull request #6800 from kivaisan/fix_loracrypto_asserts
Lora: Fix LoRaMacCrypto asserts
2 parents ceeedfd + 5384cd6 commit 11901f1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

features/lorawan/lorastack/mac/LoRaMacCrypto.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ int LoRaMacCrypto::compute_skeys_for_join_frame(const uint8_t *key, uint32_t key
265265

266266
LoRaMacCrypto::LoRaMacCrypto()
267267
{
268-
MBED_ASSERT("[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
268+
MBED_ASSERT(0 && "[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
269269
}
270270

271271
// If mbedTLS is not configured properly, these dummies will ensure that
@@ -275,7 +275,7 @@ LoRaMacCrypto::LoRaMacCrypto()
275275
int LoRaMacCrypto::compute_mic(const uint8_t *, uint16_t , const uint8_t *, uint32_t, uint32_t,
276276
uint8_t dir, uint32_t, uint32_t *)
277277
{
278-
MBED_ASSERT("[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
278+
MBED_ASSERT(0 && "[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
279279

280280
// Never actually reaches here
281281
return LORAWAN_STATUS_CRYPTO_FAIL;
@@ -284,7 +284,7 @@ int LoRaMacCrypto::compute_mic(const uint8_t *, uint16_t , const uint8_t *, uint
284284
int LoRaMacCrypto::encrypt_payload(const uint8_t *, uint16_t , const uint8_t *, uint32_t, uint32_t,
285285
uint8_t , uint32_t , uint8_t *)
286286
{
287-
MBED_ASSERT("[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
287+
MBED_ASSERT(0 && "[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
288288

289289
// Never actually reaches here
290290
return LORAWAN_STATUS_CRYPTO_FAIL;
@@ -293,23 +293,23 @@ int LoRaMacCrypto::encrypt_payload(const uint8_t *, uint16_t , const uint8_t *,
293293
int LoRaMacCrypto::decrypt_payload(const uint8_t *, uint16_t , const uint8_t *, uint32_t, uint32_t,
294294
uint8_t , uint32_t , uint8_t *)
295295
{
296-
MBED_ASSERT("[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
296+
MBED_ASSERT(0 && "[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
297297

298298
// Never actually reaches here
299299
return LORAWAN_STATUS_CRYPTO_FAIL;
300300
}
301301

302302
int LoRaMacCrypto::compute_join_frame_mic(const uint8_t *, uint16_t , const uint8_t *, uint32_t, uint32_t *)
303303
{
304-
MBED_ASSERT("[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
304+
MBED_ASSERT(0 && "[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
305305

306306
// Never actually reaches here
307307
return LORAWAN_STATUS_CRYPTO_FAIL;
308308
}
309309

310310
int LoRaMacCrypto::decrypt_join_frame(const uint8_t *, uint16_t , const uint8_t *, uint32_t, uint8_t *)
311311
{
312-
MBED_ASSERT("[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
312+
MBED_ASSERT(0 && "[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
313313

314314
// Never actually reaches here
315315
return LORAWAN_STATUS_CRYPTO_FAIL;
@@ -318,7 +318,7 @@ int LoRaMacCrypto::decrypt_join_frame(const uint8_t *, uint16_t , const uint8_t
318318
int LoRaMacCrypto::compute_skeys_for_join_frame(const uint8_t *, uint32_t, const uint8_t *, uint16_t ,
319319
uint8_t *, uint8_t *)
320320
{
321-
MBED_ASSERT("[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
321+
MBED_ASSERT(0 && "[LoRaCrypto] Must enable AES, CMAC & CIPHER from mbedTLS");
322322

323323
// Never actually reaches here
324324
return LORAWAN_STATUS_CRYPTO_FAIL;

0 commit comments

Comments
 (0)