@@ -1550,7 +1550,6 @@ static bit_t processJoinAccept (void) {
1550
1550
}
1551
1551
1552
1552
LMIC_SecureElement_Error_t seErr ;
1553
- LMIC_SecureElement_Aes128Key_t AppSKey , NwkSKey ;
1554
1553
1555
1554
seErr = LMIC_SecureElement_Default_decodeJoinAccept (
1556
1555
LMIC .frame , dlen ,
@@ -1560,12 +1559,6 @@ static bit_t processJoinAccept (void) {
1560
1559
1561
1560
if (seErr != LMIC_SecureElement_Error_OK )
1562
1561
return processJoinAccept_badframe ();
1563
-
1564
- LMIC_SecureElement_getAppSKey (& AppSKey , LMIC_SecureElement_KeySelector_Unicast );
1565
- LMIC_SecureElement_getNwkSKey (& NwkSKey , LMIC_SecureElement_KeySelector_Unicast );
1566
-
1567
- memcpy (LMIC .artKey , AppSKey .bytes , sizeof (LMIC .artKey ));
1568
- memcpy (LMIC .nwkKey , NwkSKey .bytes , sizeof (LMIC .nwkKey ));
1569
1562
1570
1563
u4_t addr = os_rlsbf4 (LMIC .frame + OFF_JA_DEVADDR );
1571
1564
LMIC .devaddr = addr ;
@@ -3010,10 +3003,14 @@ u4_t LMIC_setSeqnoUp(u4_t seq_no) {
3010
3003
3011
3004
// \brief return the current session keys returned from join.
3012
3005
void LMIC_getSessionKeys (u4_t * netid , devaddr_t * devaddr , xref2u1_t nwkKey , xref2u1_t artKey ) {
3006
+ LMIC_SecureElement_Aes128Key_t AppSKey , NwkSKey ;
3013
3007
* netid = LMIC .netid ;
3014
3008
* devaddr = LMIC .devaddr ;
3015
- memcpy (artKey , LMIC .artKey , sizeof (LMIC .artKey ));
3016
- memcpy (nwkKey , LMIC .nwkKey , sizeof (LMIC .nwkKey ));
3009
+
3010
+ LMIC_SecureElement_getAppSKey (& AppSKey , LMIC_SecureElement_KeySelector_Unicast );
3011
+ LMIC_SecureElement_getNwkSKey (& NwkSKey , LMIC_SecureElement_KeySelector_Unicast );
3012
+ memcpy (artKey , AppSKey .bytes , sizeof (AppSKey .bytes ));
3013
+ memcpy (nwkKey , NwkSKey .bytes , sizeof (NwkSKey .bytes ));
3017
3014
}
3018
3015
3019
3016
// \brief post an asynchronous request for the network time.
0 commit comments