Skip to content

Commit 062a6b6

Browse files
dhineshkumarmcciterrillmoore
authored andcommitted
implemented LMIC_SecureElement APIs to get session keys and modified data length of aes_appendMic()
1 parent 09dc5f9 commit 062a6b6

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/se/drivers/default/lmic_se_default.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,36 @@ LMIC_SecureElement_Default_setAppKey(const LMIC_SecureElement_Aes128Key_t *pAppK
142142
return LMIC_SecureElement_Error_OK;
143143
}
144144

145+
/*!
146+
147+
\copydoc LMIC_SecureElement_getNwkSKey_t
148+
149+
\par "Implementation Notes"
150+
In the default secure element, the nwkskey is stored in a static variable without obfuscation.
151+
In this function the nwkskey is passed to upper layer of LMIC.
152+
153+
*/
154+
155+
LMIC_SecureElement_Error_t
156+
LMIC_SecureElement_Default_getNwkSKey(LMIC_SecureElement_Aes128Key_t *pNwkSKey, LMIC_SecureElement_KeySelector_t iKey) {
157+
os_copyMem(pNwkSKey->bytes,s_nwkSKey.bytes, 16);
158+
}
159+
160+
/*!
161+
162+
\copydoc LMIC_SecureElement_getAppSKey_t
163+
164+
\par "Implementation Notes"
165+
In the default secure element, the appskey is stored in a static variable without obfuscation.
166+
In this function the appskey is passed to upper layer of LMIC.
167+
168+
*/
169+
170+
LMIC_SecureElement_Error_t
171+
LMIC_SecureElement_Default_getAppSKey(LMIC_SecureElement_Aes128Key_t *pAppSKey, LMIC_SecureElement_KeySelector_t iKey) {
172+
os_copyMem(pAppSKey->bytes,s_appSKey.bytes, 16);
173+
}
174+
145175
// ================================================================================
146176
// BEG AES
147177

@@ -265,7 +295,7 @@ LMIC_SecureElement_Default_encodeMessage(
265295
LMIC.seqnoUp - 1,
266296
/*up*/ 0,
267297
pCipherTextBuffer,
268-
nMessage
298+
nData
269299
);
270300
return LMIC_SecureElement_Error_OK;
271301
}

0 commit comments

Comments
 (0)