Section: 6.9.3 Key handling in mobility registration update
Content: The procedure shall be invoked by the target AMF after the receiving of a Registration Request message of type mobility registration update from the UE wherein the UE and the source AMF are identified by means of a temporary identifier 5G-GUTI. The protocol steps for the source AMF and target AMF performing context transfer are as follows: a) The target AMF sends a message to the source AMF, this message contains the 5G-GUTI, the Access Type and the received Registration Request message. b) The source AMF searches the data of the UE in the database and checks the integrity protection on the Registration Request message. The source AMF uses the 5G NAS security context corresponding to the Access Type to perform the integrity check. i) If the UE is found and the integrity check succeeds, when the source AMF does not change KAMF according to its local policy, the source AMF shall send a response back that: - shall include the SUPI, and - may include any current 5G security context it holds. ii) If the UE is found and the integrity check succeeds, when the source AMF changes KAMF according to its local policy, the source AMF shall send a response back that: - shall include the SUPI, - keyAmfHDerivationInd, and - may include a new 5G security context it derives from the current one it holds. The source AMF subsequently deletes the 5G security context which it holds. If the UE cannot be identified or the integrity check fails, then the source AMF shall send a response indicating that the temporary identifier 5G-GUTI cannot be retrieved. c) If the target AMF receives a response with a SUPI, it creates an entry and stores the 5G security context that may have beenreceived . If the target AMF receives a response indicating that the UE could not be identified, it shall initiate the subscription identification procedure described in clause 6.12.4 of the present document. NOTE: Void. NOTE 1: The source AMF does not have KSEAF because it is deleted after KAMF derivation as per clause 6.2.2.1 and therefore the context transfer from the source AMF to the target AMF does not contain KSEAF. At mobility registration update, the source AMF shall use local policy to determine whether to perform horizontal KAMF derivation. If the source AMF determines not to perform horizontal KAMF derivation, the source AMF shall transfer current security context to the target AMF. If the source AMF determines to perform horizontal KAMF derivation, the source AMF shall derive a new key KAMF from the currently active KAMF and the uplink NAS COUNT value in the received Registration Request message. The ngKSI for the newly derived KAMF key is defined such as the value field and the type field are taken from the ngKSI of the current KAMF. The source AMF shall transfer the new KAMF, the new ngKSI, the UE security capability, the keyAmfHDerivationInd to the target AMF. The key derivation of the new KAMF is specified in Annex A.13. If the source AMF has derived a new key KAMF, the source AMF shall not transfer the old KAMF to the target AMF and the source AMF shall in this case also delete any stored non-current 5G security context, and not transfer any non-current 5G security context to the target AMF. When the target AMF receives the new KAMF together with the keyAmfHDerivationInd, then the target AMF shall decide whether to use the KAMF directly according to its local policy after receiving the response from the source AMF. If the target AMF, according to its local policy, decides to not use the KAMF received from the source AMF, it can perform a re-authentication procedure to the UE to establish a new NAS security context. If the target AMF decides to use the key KAMF received from source AMF (i.e., no re-authentication), it shall send the K_AMF_change_flag set to 1 to the UE in the NAS SMC including replayed UE security capabilities, the selected NAS algorithms and the ngKSI for identifying the new KAMF from which the UE shall derive a new KAMF to establish a new NAS security context between the UE and target AMF. The target AMF shall reset the NAS COUNTs to zero and derive new NAS keys (KNASint and KNASenc) from the new KAMF using the selected NAS algorithm identifiers as input. The target AMF shall integrity protect the NAS Security Mode Command message with the new KNASint key. If the UE receives the K_AMF_change_flag set to 1 in the NAS Security Mode Command message, then the UE shall derive a new key KAMF from the current active KAMF identified by the received ngKSI in the NAS Security Mode Command message using the uplink NAS COUNT valuethat was sent in the Registration Request message. The UE shall assign the received ngKSI in the NAS Security Mode Command message to the ngKSI of the new derived KAMF. The UE shall derive new NAS keys (KNASint and KNASenc) from the new KAMF and integrity check the NAS Security Mode Command message using the new KNASint key. The UE shall then derive a new initial KgNB from the new KAMF as specified in Annex A.9. The UE shall associate the derived new initial KgNB with a new NCC value equal to zero and reset the NAS COUNTs to zero. After the ongoing mobility registration procedure is successfully completed, the ME shall replace the currently stored KAMF and ngKSI values on both USIM and ME with the new KAMF and the associated ngKSI.