Section: 6.9.4.4 AS key re-keying
Content: The KgNB/KeNB re-keying procedure is initiated by the AMF. It may be used under the following conditions: - after a successful AKA run with the UE as part of activating a partial native 5G security context; or - as part of synchronizing the NAS and the AS security contexts as a part of handover procedure, if a handover is occuring; or - as part of re-activating a non-current full native 5G security context after handover from E-UTRAN according to clause 8.4; or - to create a new KgNB from the current KAMF. NOTE 1: To perform a key change on-the-fly of the entire key hierarchy, the AMF has to change the 5G NAS security context before changing the 5G AS security context. In order to be able to re-key the KgNB, the AMF requires a fresh uplink NAS COUNT from a successful NAS SMC procedure with the UE. In the case of creating a new KgNB from the current KAMF a NAS SMC procedure shall be run first to provide this fresh uplink NAS COUNT. This NAS SMC procedure does not have to change other parameters in the current EPS NAS security context. The AMF derives the new KgNB using the key derivation function as specified in Annex A.9 using the KAMF and the uplink NAS COUNT used in the most recent NAS Security Mode Complete message. The derived new KgNB is sent to the gNB/ng-eNB in an NGAP UE CONTEXT MODIFICATION REQUEST message triggering the gNB/ng-eNB to perform the AS key re-keying. The gNB/ng-eNB runs the key change on-the-fly procedure with the UE. During this procedure the gNB/ng-eNB shall indicate to the UE that a key change on-the-fly is taking place. The procedure used is based on an intra-cell handover, and hence the same KgNB derivation steps shall be taken as in a normal handover procedure. The gNB/ng-eNB shall indicate to the UE to change the current KgNB in intra-cell handover during this procedure. Network-side handling of AS key re-keying that occur as a part of Xn and N2 handovers are described is defined in clauses 6.9.2.3.2 and 6.9.2.3.3 of the present document. When the UE receives an indication that the procedure is a key change on-the-fly procedure, the UE shall derive a temporary KgNB by applying the key derivation function as specified in Annex A.9 using the KAMF from the current 5G NAS security context and the uplink NAS COUNT in the most recent NAS Security Mode Complete message. UE-side handling of AS key re-keying that occur as a part of Xn and N2 handovers is described in clause 6.9.2.3.4 of the present document. From this temporary KgNB the UE shall derive the KNG-RAN* as normal (see Annex A.11/A.12). The gNB/ng-eNB shall take the KgNB it received from the AMF, which is equal to the temporary KgNB, as basis for its KNG-RAN* derivations. From this step onwards, the key derivations continue as in a normal handover. If the AS level re-keying fails, then the AMF shall complete another NAS security mode procedure before initiating a new AS level re-keying. This ensures that a fresh KgNB is used. The NH parameter shall be handled according to the following rules: - The UE, AMF, and gNB/ng-eNB shall delete any old NH upon completion of the context modification. - The UE and AMF shall use the KAMF from the currently active 5G NAS security context for the computation of the fresh NH. The computation of NH parameter value sent in the Namf_Communication_CreateUEContext Request, NGAP HANDOVER REQUEST, and NGAP PATH SWITCH REQUEST ACKNOWLEDGE messages shall be done according to clauses 6.9.2.3.2 and 6.9.2.3.3.