Commit e28656ca authored by aligungr's avatar aligungr

Security mode command procedure improvement

parent 2944a009
...@@ -81,7 +81,6 @@ std::pair<OctetString, OctetString> CalculateCkPrimeIkPrime(const OctetString &c ...@@ -81,7 +81,6 @@ std::pair<OctetString, OctetString> CalculateCkPrimeIkPrime(const OctetString &c
s[1] = sqnXorAk.copy(); s[1] = sqnXorAk.copy();
auto res = crypto::CalculateKdfKey(key, 0x20, s, 2); auto res = crypto::CalculateKdfKey(key, 0x20, s, 2);
;
std::pair<OctetString, OctetString> ckIk; std::pair<OctetString, OctetString> ckIk;
ckIk.first = res.subCopy(0, ck.length()); ckIk.first = res.subCopy(0, ck.length());
...@@ -139,4 +138,13 @@ OctetString CalculateResStar(const OctetString &key, const std::string &snn, con ...@@ -139,4 +138,13 @@ OctetString CalculateResStar(const OctetString &key, const std::string &snn, con
return output.subCopy(output.length() - 16); return output.subCopy(output.length() - 16);
} }
OctetString DeriveAmfPrimeInMobility(bool isUplink, const NasCount &count, const OctetString &kAmf)
{
OctetString params[2];
params[0] = OctetString::FromOctet(isUplink ? 0x00 : 0x01);
params[1] = OctetString::FromOctet4(count.toOctet4());
return crypto::CalculateKdfKey(kAmf, 0x72, params, 2);
}
} // namespace nr::ue::keys } // namespace nr::ue::keys
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment