Skip to content

Commit e8ffe8f

Browse files
committed
Pull-request #948 - Fixed DevNonce variable type from uint8_t to uint16_t
1 parent f04ee92 commit e8ffe8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mac/LoRaMacCrypto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ LoRaMacCryptoStatus_t LoRaMacCryptoHandleJoinAccept( JoinReqIdentifier_t joinReq
12351235
LoRaMacCryptoStatus_t retval = LORAMAC_CRYPTO_ERROR;
12361236
uint8_t decJoinAccept[LORAMAC_JOIN_ACCEPT_FRAME_MAX_SIZE] = { 0 };
12371237
uint8_t versionMinor = 0;
1238-
uint8_t* nonce = ( uint8_t* )&CryptoCtx.NvmCtx->DevNonce;
1238+
uint16_t* nonce = &CryptoCtx.NvmCtx->DevNonce;
12391239

12401240
// Nonce selection depending on JoinReqType
12411241
// JOIN_REQ : CryptoCtx.NvmCtx->DevNonce
@@ -1261,7 +1261,7 @@ LoRaMacCryptoStatus_t LoRaMacCryptoHandleJoinAccept( JoinReqIdentifier_t joinReq
12611261
}
12621262
#endif
12631263

1264-
if( SecureElementProcessJoinAccept( joinReqType, joinEUI, ( int16_t )*nonce, macMsg->Buffer,
1264+
if( SecureElementProcessJoinAccept( joinReqType, joinEUI, *nonce, macMsg->Buffer,
12651265
macMsg->BufSize, decJoinAccept,
12661266
&versionMinor ) != SECURE_ELEMENT_SUCCESS )
12671267
{

0 commit comments

Comments
 (0)