Skip to content

Commit ddb0a94

Browse files
committed
Issue #809 - Exclude FoptsEcnrypt call for addresses other than UNICAST.
1 parent 83aaf7c commit ddb0a94

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/mac/LoRaMacCrypto.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,12 +1573,15 @@ LoRaMacCryptoStatus_t LoRaMacCryptoUnsecureMessage( AddressIdentifier_t addrID,
15731573
#if( USE_LRWAN_1_1_X_CRYPTO == 1 )
15741574
if( CryptoCtx.NvmCtx->LrWanVersion.Fields.Minor == 1 )
15751575
{
1576-
// Decrypt FOpts
1577-
retval = FOptsEncrypt( macMsg->FHDR.FCtrl.Bits.FOptsLen, address, DOWNLINK, fCntID, fCntDown, macMsg->FHDR.FOpts );
1578-
if( retval != LORAMAC_CRYPTO_SUCCESS )
1576+
if( addrID == UNICAST_DEV_ADDR )
15791577
{
1580-
return retval;
1581-
}
1578+
// Decrypt FOpts
1579+
retval = FOptsEncrypt( macMsg->FHDR.FCtrl.Bits.FOptsLen, address, DOWNLINK, fCntID, fCntDown, macMsg->FHDR.FOpts );
1580+
if( retval != LORAMAC_CRYPTO_SUCCESS )
1581+
{
1582+
return retval;
1583+
}
1584+
}
15821585
}
15831586
#endif
15841587

0 commit comments

Comments
 (0)