mme: Add code to derive NAS token from NAS ul_count
NAS Token is derived from kasme and NAS ul_count as specified in 3GPP TS
33.401 A.9, and its LSB 16 bits passed to the network when mapping the GUTI to
RAI+PTMSI+PTIMSI_SIG.
Take the chance to move guti2rai_ptmsi() up to before the place it is
used.
Change-Id: I5e6003a2fe3e74cc93cfe4a288e6c114aa288d0b
diff --git a/mme/LTE_CryptoFunctionDefs.cc b/mme/LTE_CryptoFunctionDefs.cc
index da2d521..7f82224 100644
--- a/mme/LTE_CryptoFunctionDefs.cc
+++ b/mme/LTE_CryptoFunctionDefs.cc
@@ -184,6 +184,14 @@
return OCTETSTRING(sizeof(kenb), kenb);
}
+OCTETSTRING f__kdf__nas__token(const OCTETSTRING &kasme, const INTEGER &ul_count)
+{
+ TTCN_Buffer ttcn_buf_kasme(kasme);
+ uint8_t nas_token[32];
+
+ mme_kdf_nas_token(ttcn_buf_kasme.get_data(), (int)ul_count, nas_token);
+ return OCTETSTRING(sizeof(nas_token), nas_token);
+}
} // namespace