@@ -657,7 +657,7 @@ static LoRaMacCryptoStatus_t DeriveSessionKey10x( KeyIdentifier_t keyID, uint8_t
657657 memcpy1 ( compBase + 4 , netID , 3 );
658658 memcpy1 ( compBase + 7 , devNonce , 2 );
659659
660- if ( SecureElementDeriveAndStoreKey ( CryptoCtx . NvmCtx -> LrWanVersion , compBase , NWK_KEY , keyID ) != SECURE_ELEMENT_SUCCESS )
660+ if ( SecureElementDeriveAndStoreKey ( compBase , NWK_KEY , keyID ) != SECURE_ELEMENT_SUCCESS )
661661 {
662662 return LORAMAC_CRYPTO_ERROR_SECURE_ELEMENT_FUNC ;
663663 }
@@ -708,7 +708,7 @@ static LoRaMacCryptoStatus_t DeriveSessionKey11x( KeyIdentifier_t keyID, uint8_t
708708 memcpyr ( compBase + 4 , joinEUI , 8 );
709709 memcpy1 ( compBase + 12 , devNonce , 2 );
710710
711- if ( SecureElementDeriveAndStoreKey ( CryptoCtx . NvmCtx -> LrWanVersion , compBase , rootKeyId , keyID ) != SECURE_ELEMENT_SUCCESS )
711+ if ( SecureElementDeriveAndStoreKey ( compBase , rootKeyId , keyID ) != SECURE_ELEMENT_SUCCESS )
712712 {
713713 return LORAMAC_CRYPTO_ERROR_SECURE_ELEMENT_FUNC ;
714714 }
@@ -746,7 +746,7 @@ static LoRaMacCryptoStatus_t DeriveLifeTimeSessionKey( KeyIdentifier_t keyID, ui
746746
747747 memcpyr ( compBase + 1 , devEUI , 8 );
748748
749- if ( SecureElementDeriveAndStoreKey ( CryptoCtx . NvmCtx -> LrWanVersion , compBase , NWK_KEY , keyID ) != SECURE_ELEMENT_SUCCESS )
749+ if ( SecureElementDeriveAndStoreKey ( compBase , NWK_KEY , keyID ) != SECURE_ELEMENT_SUCCESS )
750750 {
751751 return LORAMAC_CRYPTO_ERROR_SECURE_ELEMENT_FUNC ;
752752 }
@@ -1589,7 +1589,7 @@ LoRaMacCryptoStatus_t LoRaMacCryptoDeriveMcRootKey( KeyIdentifier_t keyID )
15891589 {
15901590 compBase [0 ] = 0x20 ;
15911591 }
1592- if ( SecureElementDeriveAndStoreKey ( CryptoCtx . NvmCtx -> LrWanVersion , compBase , keyID , MC_ROOT_KEY ) != SECURE_ELEMENT_SUCCESS )
1592+ if ( SecureElementDeriveAndStoreKey ( compBase , keyID , MC_ROOT_KEY ) != SECURE_ELEMENT_SUCCESS )
15931593 {
15941594 return LORAMAC_CRYPTO_ERROR_SECURE_ELEMENT_FUNC ;
15951595 }
@@ -1606,7 +1606,7 @@ LoRaMacCryptoStatus_t LoRaMacCryptoDeriveMcKEKey( KeyIdentifier_t keyID )
16061606 }
16071607 uint8_t compBase [16 ] = { 0 };
16081608
1609- if ( SecureElementDeriveAndStoreKey ( CryptoCtx . NvmCtx -> LrWanVersion , compBase , keyID , MC_KE_KEY ) != SECURE_ELEMENT_SUCCESS )
1609+ if ( SecureElementDeriveAndStoreKey ( compBase , keyID , MC_KE_KEY ) != SECURE_ELEMENT_SUCCESS )
16101610 {
16111611 return LORAMAC_CRYPTO_ERROR_SECURE_ELEMENT_FUNC ;
16121612 }
@@ -1649,12 +1649,12 @@ LoRaMacCryptoStatus_t LoRaMacCryptoDeriveMcSessionKeyPair( AddressIdentifier_t a
16491649 compBaseNwkS [3 ] = ( mcAddr >> 16 ) & 0xFF ;
16501650 compBaseNwkS [4 ] = ( mcAddr >> 24 ) & 0xFF ;
16511651
1652- if ( SecureElementDeriveAndStoreKey ( CryptoCtx . NvmCtx -> LrWanVersion , compBaseAppS , curItem -> RootKey , curItem -> AppSkey ) != SECURE_ELEMENT_SUCCESS )
1652+ if ( SecureElementDeriveAndStoreKey ( compBaseAppS , curItem -> RootKey , curItem -> AppSkey ) != SECURE_ELEMENT_SUCCESS )
16531653 {
16541654 return LORAMAC_CRYPTO_ERROR_SECURE_ELEMENT_FUNC ;
16551655 }
16561656
1657- if ( SecureElementDeriveAndStoreKey ( CryptoCtx . NvmCtx -> LrWanVersion , compBaseNwkS , curItem -> RootKey , curItem -> NwkSkey ) != SECURE_ELEMENT_SUCCESS )
1657+ if ( SecureElementDeriveAndStoreKey ( compBaseNwkS , curItem -> RootKey , curItem -> NwkSkey ) != SECURE_ELEMENT_SUCCESS )
16581658 {
16591659 return LORAMAC_CRYPTO_ERROR_SECURE_ELEMENT_FUNC ;
16601660 }
0 commit comments