Security context obtaining method and apparatus, and communications system

CA3141367CActive Publication Date: 2026-10-06HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CA3141367
Authority / Receiving Office
CA · CA
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-05-31
Filing Date
2020-05-11
Publication Date
2026-10-06
Estimated Expiration
2040-05-11

AI Technical Summary

Technical Problem

In a 5G communication scenario, there is a challenge in obtaining the security context of user equipment when handed over from a 4G communications system to a 5G communications system, particularly in ensuring the integrity protection of registration request messages between access and mobility management functions (AMFs) to facilitate successful handover.

Method used

The method involves a first AMF sending a registration request message to a second AMF, where the message is integrity protected using a native security context, allowing the second AMF to validate the integrity of the request, and subsequently sending the security context of the user equipment to the first AMF, ensuring secure handover by using integrity protection and key derivation techniques.

Benefits of technology

This approach enhances the possibility of successful security context acquisition by the first AMF from the second AMF, ensuring secure and reliable handover operations in 5G communications systems.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

Embodiments of this application provide a security context obtaining method. After user equipment UE is handed over from a 4G communications system to a 5G communications system, a first AMF providing an access and mobility management service for the UE in the 5G system may obtain a security context of the UE from a second AMF in the 5G communications system according to the method. The method includes: The UE sends a first registration request message to the first AMF, where the first registration request message carries a second request message. The first AMF sends the second request message to the second AMF, where the second request message is integrity protected using a native security context between the UE and the second AMF. After successfully validating integrity of the second request message, the second AMF returns the security context of the UE to the first AMF. This method can improve a possibility that the first AMF successfully obtains the security context of the UE from the second AMF.
Need to check novelty before this filing date? Find Prior Art

Description

<DP=1>²CA 03141367 2021-11-19²METHOD AND APPARATUS FOR ACQUIRING SECURITY²CONTEXT, AND COMMUNICATION SYSTEM²moon This application claims priority to Chinese Patent Application No. ²201910470895.8,²filed with the Chinese Patent Office on May 31, 2019 and entitled "SECURITY ²CONTEXT² OBTAINING METHOD AND APPARATUS, AND COMMUNICATIONS SYSTEM", which is²incorporated herein by reference in its entirety.²TECHNICAL FIELD²

[0002] The present invention relates to the communications field, and ²more specifically, to a ²security context obtaining method and apparatus, and a communications system.² BACKGROUND²

[0003] In a 5th generation (5th generation, 5G) communication scenario, ²because of ²movement of user equipment, a network device serving the user equipment ²changes. In a possible ²handover scenario, the user equipment is handed over from a 4th generation ²(4th generation, 4G) ²communications system to a 5G communications system. In this handover ²scenario, the user²equipment is handed over from a 4G access network device to a 5G access ²network device, and²from a 4G core network device to a 5G core network device. The handover ²between the core ²network devices includes handover between core network elements that provide a ²mobility ²management service for the user equipment, in other words, handover from a ²mobility ²management entity (mobility management entity, MME) in the 4G communications ²system to an²access and mobility management function (access and mobility management ²function, AMF) in²the 5G communications system.²

[0004] In an existing scenario in which the user equipment is handed over ²from the 4G ²communications system to the 5G communications system, in addition to an AMF ²(a first AMF) ²selected by an MME, the 5G communications system further includes an AMF (a ²second AMF)²that stores a security context of the user equipment. In this case, how the ²first AMF obtains the²1²Date Recue / Date Received 2021-11-19²<DP=2>²CA 03141367 2021-11-19²security context of the user equipment from the second AMF becomes an urgent ²problem to be ²resolved.²SUMMARY²

[0005] This application provides a security context obtaining method and ²apparatus, and a²communications system. A second registration request message sent by a first ²AMF to a second²AMF is integrity protected based on a native security context between user ²equipment and the ²second AMF, so that the second AMF can validate integrity of the second ²registration request ²message based on the native security context between the user equipment and ²the second AMF, to ²improve a possibility that the second AMF successfully validates the second ²registration request².. message. If the validation is successful, the first AMF can successfully ²obtain a security context²of the user equipment from the second AMF.²

[0006] According to a first aspect, a security context obtaining method ²is provided. The ²method includes: A first access and mobility management function AMF receives ²a first ²registration request message sent by user equipment, where the first ²registration request message².. carries a second registration request message, the second registration ²request message is integrity²protected using a first security context, the first security context is a ²native security context ²between the user equipment and a second AMF, and the first AMF is an AMF ²providing an access ²and mobility management service for the user equipment after the user ²equipment is handed over ²from a 4G communications system to a 5G communications system. The first AMF ²sends the²second registration request message to the second AMF. The second AMF ²validates integrity of²the second registration request message. If the second AMF successfully ²validates the integrity of ²the second registration request message, the second AMF sends a security ²context of the user ²equipment to the first AMF.²

[0007] According to the security context obtaining method provided in ²this embodiment of²this application, when the user equipment is handed over from the 4G ²communications system to²the 5G communications system, the security context of the user equipment is ²stored by the user ²equipment and the second AMF before the handover. After the user equipment is ²handed over from ²the 4G communications system to the 5G communications system, the first AMF ²provides the ²access and mobility management service for the user equipment. The first AMF ²needs to obtain²2²Date Recue / Date Received 2021-11-19²<DP=3>²CA 03141367 2021-11-19²the security context of the user equipment from the second AMF. Specifically, ²after receiving a ²handover command, the user equipment may perform integrity protection on a ²fourth registration ²request message based on the natively stored security context between the user ²equipment and the ²second AMF, generate the second registration request message, add the second ²registration request².. message to the first registration request message, and send the first ²registration request message to²the first AMF. In this way, the first AMF may forward the second registration ²request message to ²the second AMF, and the second AMF may validate the integrity of the second ²registration request ²message. After successfully validating the integrity of the second ²registration request message, the ²second AMF may return the security context of the user equipment to the first ²AMF. This can²improve a possibility that the first AMF successfully obtains the security ²context of the user²equipment from the second AMF.²

[0008] With reference to the first aspect, in some implementations of the ²first aspect, the ²security context of the user equipment includes: the first security context, ²or a second security ²context obtained based on the first security context.²

[0009] According to the security context obtaining method provided in this ²embodiment of²this application, the security context of the user equipment may be the native ²security context ²between the user equipment and the second AMF. Alternatively, when the second ²AMF performs ²key derivation and generates a new key, the security context of the user ²equipment may be the ²second security context generated through key derivation based on the first ²security context.²

[0010] With reference to the first aspect, in some implementations of the ²first aspect, that the²first AMF sends the second registration request message to the second AMF ²includes: The first ²AMF sends a user equipment context transfer service invoking request to the ²second AMF, where ²the user equipment context transfer service invoking request carries the ²second registration request ²message.²

[0011] According to the security context obtaining method provided in this ²embodiment of²this application, the second registration request message sent by the first ²AMF to the second AMF ²may be carried in the user equipment context transfer service invoking request ²sent by the first ²AMF to the second AMF.²

[0012] With reference to the first aspect, in some implementations of the ²first aspect, that the²second AMF sends the security context of the user equipment to the first AMF ²includes: The²second AMF sends a first response message to the first AMF, where the first ²response message²3²Date Recue / Date Received 2021-11-19²<DP=4>²CA 03141367 2021-11-19²carries the security context of the user equipment.²

[0013] According to the security context obtaining method provided in ²this embodiment of ²this application, when returning the security context of the user equipment to ²the first AMF, the ²second AMF may send the first response message carrying the security context ²of the user² equipment to the first AMF.²

[0014] With reference to the first aspect, in some implementations of the ²first aspect, the ²method further includes: When the first AMF receives a message indicating that ²the second AMF ²fails to validate the integrity of the second registration request message, ²the first AMF continues ²to use a mapped security context, or initiates initial authentication to the ²user equipment.²

[0015] According to the security context obtaining method provided in this ²embodiment of²this application, when the first AMF fails to obtain the security context of ²the user equipment from ²the second AMF, the first AMF may continue to use the mapped security context ²generated through ²negotiation with the user equipment; or the first AMF may initiate initial ²authentication to the user ²equipment to generate a security context between the first AMF and the user ²equipment.²

[0016] With reference to the first aspect, in some implementations of the ²first aspect, the²mapped security context is obtained based on a security context between a ²mobility management ²entity MME and the user equipment, and the MME is a network element in the 4G ²communications ²system.²

[0017] In the security context obtaining method provided in this ²embodiment of this²application, the mapped security context is a security context generated by ²the user equipment and²the first AMF separately through derivation based on the security context ²between the user ²equipment and the MME.²

[0018] With reference to the first aspect, in some implementations of the ²first aspect, that the ²second AMF validates the integrity of the second registration request message ²includes: The²second AMF validates the integrity of the second registration request message ²based on the native²security context between the second AMF and the user equipment.²

[0019] According to a second aspect, a security context obtaining method ²is provided. The ²method includes: A second access and mobility management function AMF receives ²a second ²registration request message sent by a first AMF, where the second ²registration request message is²integrity protected using a first security context, the first security context ²is a native security²context between user equipment and the second AMF, and the first AMF is an AMF ²providing an²4²Date Recue / Date Received 2021-11-19²<DP=5>²CA 03141367 2021-11-19²access and mobility management service for the user equipment after the user ²equipment is handed ²over from a 4G communications system to a 5G communications system. The second ²AMF ²validates integrity of the second registration request message. If the second ²AMF successfully ²validates the integrity of the second registration request message, the second ²AMF sends a security² context of the user equipment to the first AMF.²

[0020] According to the security context obtaining method provided in ²this embodiment of ²this application, when the user equipment is handed over from the 4G ²communications system to ²the 5G communications system, the security context of the user equipment is ²stored by the user ²equipment and the second AMF before the handover. After the user equipment is ²handed over from²the 4G communications system to the 5G communications system, the first AMF ²provides the²access and mobility management service for the user equipment. The first AMF ²needs to obtain ²the security context of the user equipment from the second AMF. Specifically, ²after receiving a ²handover command, the user equipment may perform integrity protection on a ²fourth registration ²request message based on the natively stored security context between the user ²equipment and the²second AMF, and then generate the second registration request message. The UE ²adds the second²registration request message to a first registration request message sent to ²the first AMF. In this ²way, the first AMF may forward the second registration request message to the ²second AMF, and ²the second AMF may validate the integrity of the second registration request ²message. After ²successfully validating the integrity of the second registration request ²message, the second AMF²sends the security context of the user equipment to the first AMF. This can ²improve a possibility²that the first AMF successfully obtains the security context of the user ²equipment from the second ²AMF.²

[0021] With reference to the second aspect, in some implementations of ²the second aspect, the ²security context of the user equipment includes: the first security context, ²or a second security² context generated through key derivation based on the first security context.²

[0022] According to the security context obtaining method provided in ²this embodiment of ²this application, the security context of the user equipment may be the native ²security context ²between the user equipment and the second AMF. Alternatively, when the second ²AMF performs ²key derivation and generates a new key, the security context of the user ²equipment may be the²second security context generated through key derivation based on the first ²security context.²

[0023] With reference to the second aspect, in some implementations of ²the second aspect, that²5²Date Recue / Date Received 2021-11-19²<DP=6>²CA 03141367 2021-11-19²the second AMF receives the second registration request message sent by the ²first AMF includes: ²The second AMF receives a user equipment context transfer service invoking ²request sent by the ²first AMF, where the user equipment context transfer service invoking request ²carries the second ²registration request message.²

[0024] According to the security context obtaining method provided in this ²embodiment of²this application, the second registration request message sent by the first ²AMF to the second AMF ²may be carried in the user equipment context transfer service invoking request ²sent by the first ²AMF to the second AMF.²

[0025] With reference to the second aspect, in some implementations of ²the second aspect, that²the second AMF sends the security context of the user equipment to the first ²AMF includes: The²second AMF sends a first response message to the first AMF, where the first ²response message ²carries the security context of the user equipment.²

[0026] According to the security context obtaining method provided in ²this embodiment of ²this application, when returning the security context of the user equipment to ²the first AMF, the²second AMF may send the first response message carrying the security context ²of the user²equipment to the first AMF.²

[0027] With reference to the second aspect, in some implementations of ²the second aspect, that ²the second AMF validates the integrity of the second registration request ²message includes: The ²second AMF validates the integrity of the second registration request message ²based on the first² security context.²

[0028] According to a third aspect, a security context obtaining method ²is provided. The ²method includes: User equipment determines a second registration request ²message, and performs ²integrity protection on the second registration request message, where the ²second registration ²request message is integrity protected using a first security context, and the ²first security context²is a native security context between the user equipment and a second access ²and mobility²management function AMF. The user equipment sends a first registration request ²message to a first ²access and mobility management function AMF, where the first registration ²request message ²carries the second registration request message, and the first AMF is an AMF ²providing an access ²and mobility management service for the user equipment after the user ²equipment is handed over²from a 4G communications system to a 5G communications system.²

[0029] According to the security context obtaining method provided in ²this embodiment of²6²Date Recue / Date Received 2021-11-19²<DP=7>²CA 03141367 2021-11-19²this application, when the user equipment is handed over from the 4G ²communications system to ²the 5G communications system, a security context of the user equipment is ²stored by the user ²equipment and the second AMF before the handover. After the user equipment is ²handed over from ²the 4G communications system to the 5G communications system, the first AMF ²provides the²access and mobility management service for the user equipment. The first AMF ²needs to obtain²the security context of the user equipment from the second AMF. Specifically, ²after receiving a ²handover command, the user equipment may perform integrity protection on a ²fourth registration ²request message based on the natively stored security context between the user ²equipment and the ²second AMF, and then generate the second registration request message. The UE ²adds the second²registration request message to the first registration request message sent to ²the first AMF. In this²way, the first AMF may forward the second registration request message to the ²second AMF, and ²the second AMF may validate integrity of the second registration request ²message. After ²successfully validating the integrity of the second registration request ²message, the second AMF ²may return the security context of the user equipment to the first AMF. This ²can improve a².. possibility that the first AMF successfully obtains the security context of ²the user equipment from²the second AMF.²

[0030] With reference to the third aspect, in some implementations of the ²third aspect, the ²method further includes: if a non-access stratum security mode command NAS SMC ²message sent ²by the first AMF is received, validating integrity of the NAS SMC; and if the ²validation is²successful, sending a non-access stratum security mode complete message to the ²first AMF.²

[0031] According to the security context obtaining method provided in ²this embodiment of ²this application, if the user equipment receives the NAS SMC message sent by ²the first AMF, and ²the user equipment successfully validates the NAS SMC message, the user ²equipment sends the ²non-access stratum security mode complete message to the first AMF.²

[0032] According to a fourth aspect, a security context obtaining method is ²provided. The²method includes: A first access and mobility management function AMF receives ²a first ²registration request message sent by user equipment, where the first ²registration request message ²carries a second registration request message, the second registration request ²message is integrity ²protected using a first security context, the first security context is a ²native security context²between the user equipment and a second AMF, and the first AMF is an AMF ²providing an access²and mobility management service for the user equipment after the user ²equipment is handed over²7²Date Recue / Date Received 2021-11-19²<DP=8>²CA 03141367 2021-11-19²from a 4G communications system to a 5G communications system. The first AMF ²sends the ²second registration request message to the second AMF. If the second AMF ²successfully validates ²integrity of the second registration request message, the first AMF receives a ²security context of ²the user equipment that is sent by the second AMF.²

[0033] According to the security context obtaining method provided in this ²embodiment of²this application, when the user equipment is handed over from the 4G ²communications system to ²the 5G communications system, the security context of the user equipment is ²stored by the user ²equipment and the second AMF before the handover. After the user equipment is ²handed over from ²the 4G communications system to the 5G communications system, the first AMF ²provides the²access and mobility management service for the user equipment. The first AMF ²needs to obtain²the security context of the user equipment from the second AMF. Specifically, ²after receiving a ²handover command, the user equipment may perform integrity protection on a ²fourth registration ²request message based on the natively stored security context between the user ²equipment and the ²second AMF, and then generate the second registration request message. The UE ²adds the second²registration request message to the first registration request message sent to ²the first AMF. In this²way, the first AMF may forward the second registration request message to the ²second AMF, and ²the second AMF may validate the integrity of the second registration request ²message. After ²successfully validating the integrity of the second registration request ²message, the second AMF ²may return the security context of the user equipment to the first AMF. This ²can improve a²possibility that the first AMF successfully obtains the security context of ²the user equipment from²the second AMF.²

[0034] With reference to the fourth aspect, in some implementations of ²the fourth aspect, the ²security context of the user equipment includes: the first security context, ²or a second security ²context generated through key derivation based on the first security context.²

[0035] According to the security context obtaining method provided in this ²embodiment of²this application, the security context of the user equipment may be the native ²security context ²between the user equipment and the second AMF. Alternatively, when the second ²AMF performs ²key derivation and generates a new key, the security context of the user ²equipment may be the ²second security context generated through key derivation based on the first ²security context.²

[0036] With reference to the fourth aspect, in some implementations of the ²fourth aspect, that²the first AMF sends the second registration request message to the second AMF ²includes: The first²8²Date Recue / Date Received 2021-11-19²<DP=9>²CA 03141367 2021-11-19²AMF sends a user equipment context transfer service invoking request to the ²second AMF, where ²the user equipment context transfer service invoking request carries the ²second registration request ²message.²

[0037] According to the security context obtaining method provided in ²this embodiment of²this application, the second registration request message sent by the first ²AMF to the second AMF²may be carried in the user equipment context transfer service invoking request ²sent by the first ²AMF to the second AMF.²

[0038] With reference to the fourth aspect, in some implementations of ²the fourth aspect, that ²the first AMF receives the security context of the user equipment that is sent ²by the second AMF²includes: The first AMF receives a first response message sent by the second ²AMF, where the first²response message carries the security context of the user equipment.²

[0039] According to the security context obtaining method provided in ²this embodiment of ²this application, when returning the security context of the user equipment to ²the first AMF, the ²second AMF may send the first response message carrying the security context ²of the user² equipment to the first AMF.²

[0040] With reference to the fourth aspect, in some implementations of ²the fourth aspect, the ²method further includes: When the first AMF receives a message indicating that ²the second AMF ²fails to validate the integrity of the second registration request message, ²the first AMF continues ²to use a mapped security context, or initiates initial authentication to the ²user equipment.²

[0041] According to the security context obtaining method provided in this ²embodiment of²this application, when the first AMF fails to obtain the security context of ²the user equipment from ²the second AMF, the first AMF may continue to use the mapped security context ²generated through ²negotiation with the user equipment; or the first AMF may initiate initial ²authentication to the user ²equipment to generate a security context between the first AMF and the user ²equipment.²

[0042] With reference to the fourth aspect, in some implementations of the ²fourth aspect, the²mapped security context is obtained based on a security context between a ²mobility management ²entity MME and the user equipment, and the MME is a network element in the 4G ²communications ²system.²

[0043] In the security context obtaining method provided in this ²embodiment of this²application, the mapped security context is a security context generated by ²the user equipment and²the first AMF separately through derivation based on the security context ²between the user²9²Date Recue / Date Received 2021-11-19²<DP=10>²CA 03141367 2021-11-19²equipment and the MME.²

[0044] According to a fifth aspect, a security context obtaining method ²is provided. The ²method includes: A first access and mobility management function AMF sends a ²user equipment ²context transfer service invoking request to a second AMF, where the user ²equipment context²transfer service invoking request is used to obtain a security context of user ²equipment, the user²equipment context transfer service invoking request carries indication ²information, the indication ²information is used to indicate that the user equipment is validated, and the ²first AMF is an AMF ²providing an access and mobility management service for the user equipment ²after the user ²equipment is handed over from a 4G communications system to a 5G ²communications system.²The first AMF receives a second response message sent by the second AMF, where ²the second²response message carries the security context of the user equipment.²

[0045] According to the security context obtaining method provided in ²this embodiment of ²this application, the user equipment context transfer service invoking request ²sent by the first AMF ²to the second AMF carries the indication information indicating that the UE is ²validated. This can²avoid that the second AMF fails to verify the UE and does not send the ²security context of the UE²to the first AMF, and improve a possibility that the first AMF successfully ²obtains the security ²context of the user equipment from the second AMF.²

[0046] With reference to the fifth aspect, in some implementations of the ²fifth aspect, that the ²indication information is used to indicate that the user equipment is ²validated includes: The²indication information is used to indicate that integrity of a registration ²request message is²successfully validated, where the registration request message is received by ²the first AMF from ²the user equipment.²

[0047] According to the security context obtaining method provided in ²this embodiment of ²this application, the indication information, sent by the first AMF to the ²second AMF, indicating²that the UE is validated may be used by the first AMF to notify the second AMF ²that the integrity²of the registration request message sent by the UE is successfully validated. ²This provides a ²flexible optional solution for indicating that the UE is validated.²

[0048] With reference to the fifth aspect, in some implementations of the ²fifth aspect, before ²the first AMF sends the user equipment context transfer service invoking ²request to the second²AMF, the method further includes: The first AMF successfully validates ²integrity protection for²the registration request message, where the registration request message is ²received by the first² Date Recue / Date Received 2021-11-19²<DP=11>²CA 03141367 2021-11-19²AMF from the user equipment; and / or the first AMF determines that the ²registration request ²message is a registration request message sent by the user equipment after the ²user equipment is ²handed over from the 4G communications system to the 5G communications system.²

[0049] According to the security context obtaining method provided in ²this embodiment of²this application, the first AMF determines, based on a result indicating that ²the registration request²message is successfully validated and / or based on that the received ²registration request message is ²the registration request message sent by the user equipment after the user ²equipment is handed ²over from the 4G communications system to the 5G communications system, that ²the user ²equipment context transfer service invoking request may be sent to the second ²AMF.²

[0050] With reference to the fifth aspect, in some implementations of the ²fifth aspect, the user²equipment context transfer service invoking request carries an identity of the ²user equipment.²

[0051] According to the security context obtaining method provided in ²this embodiment of ²this application, to enable the second AMF to learn that the first AMF needs ²to obtain a security ²context of user equipment, the first AMF adds an identity of the user ²equipment to the context² transfer service invoking request.²

[0052] With reference to the fifth aspect, in some implementations of the ²fifth aspect, the user ²equipment context transfer service invoking request carries an uplink non-²access stratum count ²UL NAS COUNT of the user equipment.²

[0053] According to the security context obtaining method provided in ²this embodiment of²this application, to enable the second AMF to learn of the UL NAS COUNT, the ²first AMF may²add the UL NAS COUNT to the context transfer service invoking request.²

[0054] With reference to the fifth aspect, in some implementations of the ²fifth aspect, that the ²user equipment context transfer service invoking request carries the UL NAS ²COUNT includes: ²The user equipment context transfer service invoking request carries a ²plaintext registration²request message, where the plaintext registration request message includes the ²UL NAS COUNT,²and the registration request message is received by the first AMF from the ²user equipment.²

[0055] According to the security context obtaining method provided in ²this embodiment of ²this application, that the user equipment context transfer service invoking ²request carries the UL ²NAS COUNT may be implemented by carrying the plaintext registration request ²message in the²user equipment context transfer service invoking request, where the plaintext ²registration request²message includes the UL NAS COUNT. This provides a flexible optional solution ²for the first²11²Date Recue / Date Received 2021-11-19²<DP=12>²CA 03141367 2021-11-19²AMF to send the UL NAS COUNT to the second AMF.²

[0056] According to a sixth aspect, a security context obtaining method ²is provided. The ²method includes: A second access and mobility management function AMF receives ²a user ²equipment context transfer service invoking request sent by a first AMF, where ²the user equipment²context transfer service invoking request is used to obtain a security context ²of user equipment,²the user equipment context transfer service invoking request carries ²indication information, the ²indication information is used to indicate that the user equipment is ²validated, and the first AMF ²is an AMF providing an access and mobility management service for the user ²equipment after the ²user equipment is handed over from a 4G communications system to a 5G ²communications system.²The second AMF sends a second response message to the first AMF, where the ²second response²message carries the security context of the user equipment.²

[0057] According to the security context obtaining method provided in ²this embodiment of ²this application, the user equipment context transfer service invoking request ²sent by the first AMF ²and received by the second AMF carries the indication information indicating ²that the UE is²validated. Based on the indication information, the second AMF does not need ²to verify the UE.²This can avoid that the second AMF fails to verify the UE and does not send ²the security context ²of the UE to the first AMF, and improve a possibility that the first AMF ²successfully obtains the ²security context of the user equipment from the second AMF.²

[0058] With reference to the sixth aspect, in some implementations of the ²sixth aspect, that the²indication information is used to indicate that the user equipment is ²validated includes: The²indication information is used to indicate that integrity of a registration ²request message is ²successfully validated, where the registration request message is received by ²the first AMF from ²the user equipment.²

[0059] According to the security context obtaining method provided in ²this embodiment of²this application, the indication information, sent by the first AMF and ²received by the second AMF,²indicating that the UE is validated may be used by the first AMF to notify the ²second AMF that ²the integrity of the registration request message sent by the UE is ²successfully validated. This ²provides a flexible optional solution for indicating that the UE is validated.²

[0060] With reference to the sixth aspect, in some implementations of the ²sixth aspect, the user²equipment context transfer service invoking request carries an identity of the ²user equipment.²

[0061] According to the security context obtaining method provided in ²this embodiment of²12²Date Recue / Date Received 2021-11-19²<DP=13>²CA 03141367 2021-11-19²this application, based on the identity of the user equipment that is carried ²in the context transfer ²service invoking request, the second AMF may determine that the first AMF ²needs to obtain the ²security context of the user equipment.²

[0062] With reference to the sixth aspect, in some implementations of the ²sixth aspect, the user²equipment context transfer service invoking request carries an uplink non-²access stratum count²UL NAS COUNT of the user equipment.²

[0063] According to the security context obtaining method provided in ²this embodiment of ²this application, the second AMF may learn of the UL NAS COUNT based on the UL ²NAS ²COUNT carried in the context transfer service invoking request.²

[0064] With reference to the sixth aspect, in some implementations of the ²sixth aspect, that the²user equipment context transfer service invoking request carries the UL NAS ²COUNT includes: ²The user equipment context transfer service invoking request carries a ²plaintext registration ²request message, where the plaintext registration request message includes the ²UL NAS COUNT, ²and the registration request message is received by the first AMF from the ²user equipment.²

[0065] According to the security context obtaining method provided in this ²embodiment of²this application, that the user equipment context transfer service invoking ²request carries the UL ²NAS COUNT may be implemented by carrying the plaintext registration request ²message in the ²user equipment context transfer service invoking request, where the plaintext ²registration request ²message includes the UL NAS COUNT. This provides a flexible optional solution ²for the first² AMF to send the UL NAS COUNT to the second AMF.²

[0066] With reference to the sixth aspect, in some implementations of the ²sixth aspect, the ²method further includes: The second AMF performs key derivation based on the ²ULNAS COUNT.²

[0067] According to the security context obtaining method provided in ²this embodiment of ²this application, the second AMF may perform key derivation based on the ²received UL NAS ² COUNT.²

[0068] According to a seventh aspect, a communications system is ²provided. The ²communications system includes the first AMF and the second AMF that may be ²configured to ²perform operations performed by the first AMF and the second AMF in any one of ²the first aspect ²or the possible implementations of the first aspect. Specifically, the ²communications apparatus²may include a corresponding component (means) configured to perform the steps ²or functions²described in any one of the first aspect or the possible implementations of ²the first aspect, and the²13²Date Recue / Date Received 2021-11-19²<DP=14>²CA 03141367 2021-11-19²component may be the first AMF and the second AMF in the first aspect, or ²chips or functional ²modules inside the first AMF and the second AMF in the first aspect. The steps ²or functions may ²be implemented by software, hardware, or a combination of hardware and ²software.²

[0069] According to an eighth aspect, a security context obtaining ²apparatus is provided. The²apparatus may be configured to perform an operation performed by the first AMF ²in any one of²the fifth aspect, the fourth aspect, the possible implementations of the fifth ²aspect, or the possible ²implementations of the fourth aspect. Specifically, the security context ²obtaining apparatus may ²include a corresponding component (means) configured to perform the steps or ²functions described ²in any one of the fifth aspect, the fourth aspect, the possible ²implementations of the first aspect, or²the possible implementations of the fourth aspect, and the component may be ²the first AMF in the²fourth and fifth aspects, or a chip or a functional module inside the first ²AMF in the fourth and ²fifth aspects. The steps or functions may be implemented by software, ²hardware, or a combination ²of hardware and software.²

[0070] According to a ninth aspect, a security context obtaining ²apparatus is provided. The²apparatus may be configured to perform an operation performed by the second ²AMF in any one of²the second aspect, the sixth aspect, the possible implementations of the ²second aspect, or the ²possible implementations of the sixth aspect. Specifically, the security ²context obtaining apparatus ²may include a corresponding component (means) configured to perform the steps ²or functions ²described in any one of the second aspect, the sixth aspect, the possible ²implementations of the²second aspect, or the possible implementations of the sixth aspect, and the ²component may be the²second AMF in the second and sixth aspects, or a chip or a functional module ²in the second AMF ²in the second and sixth aspects. The steps or functions may be implemented by ²software, hardware, ²or a combination of hardware and software.²

[0071] According to a tenth aspect, a security context obtaining ²apparatus is provided. The²apparatus may be configured to perform an operation performed by the user ²equipment in the third²aspect. Specifically, the security context obtaining apparatus may include a ²corresponding ²component (means) configured to perform the steps or functions described in ²the third aspect, and ²the component may be the user equipment in the third aspect, or a chip or a ²functional module in ²the user equipment in the third aspect. The steps or functions may be ²implemented by software,² hardware, or a combination of hardware and software.²

[0072] According to an eleventh aspect, a communications device is ²provided, including a²14²Date Recue / Date Received 2021-11-19²<DP=15>²CA 03141367 2021-11-19²processor, a transceiver, and a memory. The memory is configured to store a ²computer program. ²The transceiver is configured to perform sending and receiving steps in the ²security context ²obtaining apparatus method in any possible implementation in the first to the ²fifth aspects. The ²processor is configured to invoke the computer program from the memory and run ²the computer²program, to enable the communications device to perform the security context ²obtaining apparatus²method in any possible implementation in the first to the sixth aspects.²

[0073] Optionally, there are one or more processors and one or more ²memories.²

[0074] Optionally, the memory may be integrated with the processor, or ²the memory and the ²processor may be separately disposed.²

[0075] Optionally, the transceiver includes a transmitter (transmitter) and ²a receiver (receiver).²

[0076] According to a twelfth aspect, a system is provided. The system ²includes the security ²context obtaining apparatuses provided in the eighth aspect and the ninth ²aspect.²

[0077] According to a thirteenth aspect, a computer program product is ²provided. The ²computer program product includes a computer program (which may also be ²referred to as code²or an instruction). When the computer program is run, a computer is enabled to ²perform the method²in any possible implementation in the first to the sixth aspects.²

[0078] According to a fourteenth aspect, a computer-readable medium is ²provided. The ²computer-readable medium stores a computer program (which may also be referred ²to as code or ²an instruction). When the computer program is run on a computer, the computer ²is enabled to²perform the method in any possible implementation in the first to the sixth ²aspects.²

[0079] According to a fifteenth aspect, a chip system is provided, ²including a memory and a ²processor. The memory is configured to store a computer program. The processor ²is configured to ²invoke the computer program from the memory and run the computer program, so ²that a ²communications device on which the chip system is installed performs the ²method in any possible² implementation in the first to the sixth aspects.²BRIEF DESCRIPTION OF DRAWINGS²

[0080] FIG. 1 is a network architecture applicable to embodiments of ²this application;²

[0081] FIG. 2 is a schematic flowchart of handover between ²communications systems;²

[0082] FIG. 3 is a schematic diagram of a security context obtaining ²method according to an² Date Recue / Date Received 2021-11-19²<DP=16>²CA 03141367 2021-11-19²embodiment of this application;²

[0083] FIG. 4 is a schematic diagram of another security context ²obtaining method according ²to an embodiment of this application;²

[0084] FIG. 5 is a schematic diagram of a security context obtaining ²apparatus 50 according² to an embodiment of this application;²

[0085] FIG. 6 is a schematic structural diagram of user equipment 60 ²according to an ²embodiment of this application;²

[0086] FIG. 7 is a schematic diagram of a security context obtaining ²apparatus 70 according ²to an embodiment of this application;²

[0087] FIG. 8 is a schematic structural diagram of a first AMF 80 according ²to an embodiment²of this application;²

[0088] FIG. 9 is a schematic diagram of a security context obtaining ²apparatus 90 according ²to an embodiment of this application; and²

[0089] FIG. 10 is a schematic structural diagram of a second AMF 100 ²according to an²embodiment of this application.²DESCRIPTION OF EMBODIMENTS²

[0090] The following describes technical solutions of this application ²with reference to ²accompanying drawings.²

[0091] The technical solutions of the embodiments of this application may ²be applied to²various communications systems, such as a global system for mobile ²communications (global ²system for mobile communications, GSM), a code division multiple access (code ²division multiple ²access, CDMA) system, a wideband code division multiple access (wideband code ²division ²multiple access, WCDMA) system, a general packet radio service (general packet ²radio service, ²GPRS) system, a long term evolution (long term evolution, LTE) system, an LTE ²frequency²division duplex (frequency division duplex, FDD) system, an LTE time division ²duplex (time²division duplex, TDD) system, a universal mobile telecommunications system ²(universal mobile ²telecommunication system, UMTS), a worldwide interoperability for microwave ²access ²(worldwide interoperability for microwave access, WiMAX) communications ²system, a future 5th ²generation (5th generation, 5G) system, or a new radio (new radio, NR) system.²16²Date Recue / Date Received 2021-11-19²<DP=17>²CA 03141367 2021-11-19²

[0092] FIG. 1 is a network architecture applicable to the embodiments of ²this application. As²shown in FIG. 1, the following separately describes components in the network ²architecture.²

[0093] 1. User equipment (user equipment, UE) 110 may include various ²handheld devices, ²vehicle-mounted devices, wearable devices, and computing devices that have a ²wireless²communication function, or other processing devices connected to a wireless ²modem, and various²forms of terminals, mobile stations (mobile station, MS), terminals ²(terminal), soft clients, and the ²like. For example, the user equipment 110 may be a water meter, an electricity ²meter, or a sensor.²

[0094] 2. A (radio) access network (radio access network, (R)AN) element ²120 is configured ²to provide a network access function for authorized user equipments in a ²specific area, and can use²transmission tunnels with different quality based on levels, service ²requirements, and the like of²the user equipments.²

[0095] The (R)AN element can manage radio resources and provide an access ²service for user ²equipment, to forward a control signal and user equipment data between the ²user equipment and a ²core network. The (R)AN element may also be understood as a base station in a ²conventional² network.²

[0096] 3. A user plane network element 130 is used for packet routing and ²forwarding, quality ²of service (quality of service, QoS) processing of user plane data, and the ²like.²

[0097] In a 5G communications system, the user plane network element may ²be a user plane ²function (user plane function, UPF) network element. In a future ²communications system, the user²plane network element may still be a UPF network element, or may have another ²name. This is²not limited in this application.²

[0098] 4. A data network element 140 is configured to provide a network ²for data transmission.²

[0099] In the 5G communications system, the data network element may be a ²data network ²(data network, DN) element. In the future communications system, the data ²network element may²still be a DN element, or may have another name. This is not limited in this ²application.²

[0100] 5. An access and mobility management network element 150 is mainly ²configured to ²perform mobility management, access management, and the like. The access and ²mobility ²management network element 150 may be configured to implement functions, for ²example, lawful ²interception and access authorization / authentication, other than session ²management in functions²of a mobility management entity (mobility management entity, MME).²

[0101] In the 5G communications system, the access and mobility ²management network²17²Date Recue / Date Received 2021-11-19²<DP=18>²CA 03141367 2021-11-19²element may be an access and mobility management function (access and mobility ²management ²function, AMF). In the future communications system, the access and mobility ²management device ²may still be an AMF, or may have another name. This is not limited in this ²application.²

[0102] 6. A session management network element 160 is mainly configured ²to manage a²session, assign and manage an internet protocol (internet protocol, IP) ²address of user equipment,²select an endpoint that can manage a user plane function interface and a ²policy control and charging ²function interface, notify downlink data, and the like.²

[0103] In the 5G communications system, the session management network ²element may be a ²session management function (session management function, SMF) network ²element. In the future²communications system, the session management network element may still be an ²SMF network²element, or may have another name. This is not limited in this application.²

[0104] 7. A policy control network element 170 is configured to guide a ²unified policy ²framework of network behavior, and provide policy rule information for a ²control plane function ²network element (such as the AMF or the SMF network element), and the like.²

[0105] In a 4G communications system, the policy control network element ²may be a policy²and charging rules function (policy and charging rules function, PCRF) network ²element. In the ²5G communications system, the policy control network element may be a policy ²control function ²(policy control function, PCF) network element. In the future communications ²system, the policy ²control network element may still be a PCF network element, or may have ²another name. This is² not limited in this application.²

[0106] 8. An authentication server 180 is configured to authenticate a ²service, generate a key ²to implement two-way authentication for user equipment, and support a unified ²authentication ²framework.²

[0107] In the 5G communications system, the authentication server may be ²an authentication²server function (authentication server function, AUSF) network element. In the ²future²communications system, the authentication server function network element may ²still be an AUSF ²network element, or may have another name. This is not limited in this ²application.²

[0108] 9. A data management network element 190 is configured to process ²a user equipment²identity, perform access authentication, registration, and mobility ²management, and the like.²

[0109] In the 5G communications system, the data management network element ²may be a²unified data management (unified data management, UDM) network element. In the ²4G²18²Date Recue / Date Received 2021-11-19²<DP=19>²CA 03141367 2021-11-19²communications system, the data management network element may be a home ²subscriber server ²(home subscriber server, HSS) network element. In the future communications ²system, the unified ²data management may still be a UDM network element, or may have another name. ²This is not ²limited in this application.²

[0110] 10. An application network element 1100 is configured to perform ²application-affected²data routing, access a network exposure function network element, interact ²with a policy ²framework to perform policy control, and the like.²

[0111] In the 5G communications system, the application network element ²may be an ²application function (application function, AF) network element. In the future ²communications²system, the application network element may still be an AF network element, or ²may have another²name. This is not limited in this application.²

[0112] 11. A network storage network element is configured to maintain ²real-time information ²of all network function services in a network.²

[0113] In the 5G communications system, the network storage network ²element may be a²network repository function (network repository function, NRF) network ²element. In the future²communications system, the network storage network element may still be an NRF ²network ²element, or may have another name. This is not limited in this application.²

[0114] It may be understood that the foregoing network elements or ²functions may be network ²elements in a hardware device, software functions running on dedicated ²hardware, or virtualized²functions instantiated on a platform (for example, a cloud platform). For ease ²of description, this²application is described below by using an example in which the access and ²mobility management ²device is the AMF, the data management network element is the UDM network ²element, the ²session management network element is the SMF network element, and the user ²plane network ²element is the UPF network element.²

[0115] For ease of description, in the embodiments of this application, a ²session establishment²method is described by using an example in which an apparatus is an AMF entity ²or a UDM entity. ²For an implementation method in which the apparatus is a chip in an AMF entity ²or a chip in a ²UDM entity, refer to specific descriptions about the session establishment ²method in which the ²apparatus is the AMF entity or the UDM entity. Details are not repeated.²

[0116] In the network architecture shown in FIG. 1, the user equipment is ²connected to the²AMF through an Ni interface, the (R)AN is connected to the AMF through an N2 ²interface, and²19²Date Recue / Date Received 2021-11-19²<DP=20>²CA 03141367 2021-11-19²the (R)AN is connected to the UPF through an N3 interface. UPFs are connected ²to each other ²through an N9 interface, and the UPF is interconnected to a DN through an N6 ²interface. The SMF ²controls the UPF through an N4 interface. The AMF is connected to the SMF ²through an N11 ²interface. The AMF obtains subscription data of the user equipment from a UDM ²unit through an²N8 interface. The SMF obtains the subscription data of the user equipment from ²the UDM unit²through an N10 interface.²

[0117] It should be understood that the foregoing network architecture ²applied to the ²embodiments of this application is merely an example, and a network ²architecture applicable to ²the embodiments of this application is not limited thereto. Any network ²architecture that can²implement functions of the foregoing network elements is applicable to the ²embodiments of this²application.²

[0118] For example, in some network architectures, network function ²network elements and ²entities such as the AMF, the SMF network element, the PCF network element, a ²BSF network ²element, and the UDM network element are all referred to as network function ²(network function,²NF) network elements. Alternatively, in some other network architectures, a ²set of network²elements such as the AMF, the SMF network element, the PCF network element, a ²BSF network ²element, and the UDM network element may be referred to as a control plane ²function network ²element.²

[0119] The user equipment in the embodiments of this application may be ²an access terminal,².. a subscriber unit, a subscriber station, a mobile station, a mobile ²console, a relay station, a remote²station, a remote terminal, a mobile device, a user terminal (user terminal), ²terminal equipment ²(terminal equipment), a terminal (terminal), a wireless communications device, ²a user agent, a user ²apparatus, or the like. The user equipment may alternatively be a cellular ²phone, a cordless phone, ²a session initiation protocol (session initiation protocol, SIP) phone, a ²wireless local loop (wireless²local loop, WLL) station, a personal digital assistant (personal digital ²assistant, PDA), a handheld²device having a wireless communication function, a computing device, another ²processing device ²connected to a wireless modem, a vehicle-mounted device, a wearable device, ²user equipment in ²a future 5G network, user equipment in a future evolved public land mobile ²network (public land ²mobile network, PLMN), or the like. This is not limited in the embodiments of ²this application.²

[0120] A network device in the embodiments of this application may be any ²device that has a²wireless transceiver function and that is configured to communicate with the ²user equipment. The² Date Recue / Date Received 2021-11-19²<DP=21>²CA 03141367 2021-11-19²device includes but is not limited to an evolved NodeB (evolved Node B, eNB), ²a radio network ²controller (radio network controller, RNC), a NodeB (Node B, NB), a base ²station controller (base ²station controller, BSC), a base transceiver station (base transceiver ²station, BTS), a home base ²station (for example, a home evolved NodeB, or a home Node B, HNB), a baseband ²unit (baseBand².. unit, BBU), an access point (access point, AP) in a wireless fidelity ²(wireless fidelity, WIFI) system,²a wireless relay node, a wireless backhaul node, a transmission point ²(transmission point, TP), a ²transmission and reception point (transmission and reception point, TRP), or ²the like. Alternatively, ²the device may be a gNB or a transmission point (TRP or TP) in a 5G system ²such as an NR system, ²may be one antenna panel or a group (including a plurality of antenna panels) ²of antenna panels of²a base station in a 5G system, or may be a network node, such as a baseband ²unit (BBU) or a²distributed unit (distributed unit, DU), that constitutes a gNB or a ²transmission point.²

[0121] In some deployments, the gNB may include a centralized unit ²(centralized unit, CU) ²and the DU. The gNB may further include an active antenna unit (active antenna ²unit, AAU). The ²CU implements some functions of the gNB, and the DU implements some functions ²of the gNB.²For example, the CU is responsible for processing a non-real-time protocol and ²service, and²implements functions of a radio resource control (radio resource control, RRC) ²layer and a packet ²data convergence protocol (packet data convergence protocol, PDCP) layer. The ²DU is responsible ²for processing a physical layer protocol and a real-time service, and ²implements functions of a ²radio link control (radio link control, RLC) layer, a media access control ²(media access control,²MAC) layer, and a physical (physical, PHY) layer. The AAU implements some ²physical layer²processing functions, radio frequency processing, and a function related to an ²active antenna. ²Information at the RRC layer is eventually converted into information at the ²PHY layer, or is ²converted from information at the PHY layer. Therefore, in this architecture, ²higher layer signaling ²such as RRC layer signaling may also be considered as being sent by the DU or ²sent by the DU²and the AAU. It may be understood that the network device may be a device ²including one or more²of a CU node, a DU node, and an AAU node. In addition, the CU may be a network ²device in an ²access network (radio access network, RAN), or may be a network device in a ²core network (core ²network, CN). This is not limited in this application.²

[0122] In the embodiments of this application, the user equipment or the ²network device²includes a hardware layer, an operating system layer running above the ²hardware layer, and an²application layer running above the operating system layer. The hardware layer ²includes hardware²21²Date Recue / Date Received 2021-11-19²<DP=22>²CA 03141367 2021-11-19²such as a central processing unit (central processing unit, CPU), a memory ²management unit ²(memory management unit, MMU), and a memory (also referred to as a main ²memory). The ²operating system may be any one or more types of computer operating systems ²that implement ²service processing by using a process (process), for example, a Linux ²operating system, a Unix²operating system, an Android operating system, an iOS operating system, or a ²Windows operating²system. The application layer includes applications such as a browser, an ²address book, word ²processing software, and instant communications software. In addition, a ²specific structure of an ²entity for performing a method provided in the embodiments of this application ²is not particularly ²limited in the embodiments of this application, provided that a program ²recording code of the²method provided in the embodiments of this application can be run to perform ²communication²according to the method provided in the embodiments of this application. For ²example, the entity ²for performing the method provided in the embodiments of this application may ²be the user ²equipment or the network device, or may be a functional module capable of ²invoking and ²executing the program in the user equipment or the network device.²

[0123] In addition, aspects or features of this application may be ²implemented as a method, an²apparatus or a product that uses standard programming and / or engineering ²technologies. The term ²"product" used in this application covers a computer program that can be ²accessed from any ²computer-readable component, carrier or medium. For example, the computer-²readable medium ²may include but is not limited to: a magnetic storage component (for example, ²a hard disk, a floppy²disk or a magnetic tape), an optical disc (for example, a compact disc ²(compact disc, CD) or a²digital versatile disc (digital versatile disc, DVD)), a smart card, and a ²flash memory component ²(for example, an erasable programmable read-only memory (erasable programmable ²read-only ²memory, EPROM), a card, a stick, or a key drive). In addition, various storage ²media described in ²this specification may indicate one or more devices and / or other machine-²readable media that are²configured to store information. The term "machine-readable storage media" may ²include but is²not limited to a radio channel, and various other media that can store, ²contain, and / or carry an ²instruction and / or data.²

[0124] The embodiments of this application mainly relate to the mobility ²management entity ²MME when the network architecture shown in FIG. 1 is a 4G network ²architecture, and the access²and mobility management function AMF and the UE when the network architecture ²shown in FIG.²1 is a 5G network architecture. For the AMF, this application relates to a ²first AMF and a second²22²Date Recue / Date Received 2021-11-19²<DP=23>²CA 03141367 2021-11-19²AMF. Specifically, the first AMF in this application is an AMF that is ²selected, from the 5G ²communications system in a process in which the user equipment is handed over ²from the 4G ²communications system to the 5G communications system, for the UE by an MME in ²the 4G ²communications system to provide a core network service for the UE. The second ²AMF in this²application is an AMF, other than the first AMF in the 5G communications ²system in the process²in which the user equipment is handed over from the 4G communications system ²to the 5G ²communications system, that stores a security context of the UE.²

[0125] It should be understood that "first" and "second" in this ²application are merely used for ²differentiation, and should not be construed as any limitation on this ²application. For example, the²first AMF and the second AMF are merely used to differentiate between ²different AMFs.²

[0126] To facilitate understanding of a security context obtaining method ²provided in the ²embodiments of this application, the following briefly describes, with ²reference to FIG. 2, a ²process in which user equipment is handed over from a 4G communications system ²to a 5G ²communications system. FIG. 2 is a schematic flowchart of handover between ²communications²systems. The schematic flowchart includes the UE, an MME, a first AMF, and a ²second AMF.²

[0127] The handover between the communications systems includes the ²following steps.²

[0128] S210: The MME sends a forward relocation request (forward ²relocation request) ²message to the first AMF.²

[0129] Specifically, the MME in the 4G communications system learns that ²the user equipment²is handed over from the 4G communications system to the 5G communications ²system, and needs²to select, for the UE, the first AMF from the 5G communications system to ²continue to provide an ²access and mobility management service for the UE. When the UE accesses the 4G ²²communications system, the UE and the MME obtain a same key KASME. When the UE ²is handed ²over from the 4G communications system to the 5G communications system, the ²MME selects the²first AMF and sends the KASME and a next hop parameter (next hop parameter, ²NH) to the first²AMF. In other words, the forward relocation request message carries parameters ²such as the KASME ²and the NH.²

[0130] In this embodiment of this application, how the MME learns of ²handover between ²systems is not limited. For details, refer to specifications for a procedure ²of handover from the 4G²communications system to the 5G communications system in an existing protocol. ²For example, a²base station in the 4G communications system may send a handover request to ²the MME, so that²23²Date Recue / Date Received 2021-11-19²<DP=24>²CA 03141367 2021-11-19²the MME learns that the user equipment needs to be handed over from the 4G ²communications ²system to the 5G communications system.²

[0131] In addition, in this embodiment of this application, how the MME ²selects the first AMF ²is not limited. For details, refer to specifications in the existing protocol. ²For example, the MME²stores at least one AMF configured by an operator. When the MME learns that ²the user equipment²needs to be handed over from the 4G communications system to the 5G ²communications system, ²the MME selects the first AMF from the at least one AMF.²

[0132] S220: The first AMF determines a mapped (mapped) security context.²

[0133] Specifically, the first AMF derives the mapped security context ²based on the parameters,²such as the KASME and the NH, carried in the received relocation request ²message. The mapped²security context is included in a mapped context of the UE. It should be ²understood that the mapped ²context in this application is a security context of the UE that is derived by ²the first AMF and the ²UE separately based on a context generated through negotiation between the UE ²and the MME in ²the 4G communications system. For how to derive the security context of the UE ²based on the 4G²context, refer to specifications in the existing protocol, and this process is ²not limited in this²application. The mapped security context is obtained by the first AMF and the ²UE separately based ²on a security context between the MME and the user equipment. In addition, in ²this application, ²the context negotiated between the UE and the MME in the 4G communications ²system includes ²the security context between the UE and the MME, and may also be referred to ²as a 4G context of²the UE for differentiation. Likewise, in this application, before the UE is ²handed over from the 4G²communications system to the 5G communications system, the security context of ²the UE that is ²stored in the UE and the second AMF is a context negotiated between the UE and ²the second AMF ²in the 5G communications system, includes a security context between the UE ²and the AMF, and ²may also be referred to as a 5G context of the UE for differentiation.²

[0134] For ease of description, in the following, the security context ²obtained by the first AMF²and the UE separately through derivation based on the security context between ²the MME and the ²user equipment is referred to as the mapped security context, and the security ²context between the ²second AMF and the UE is referred to as a native (native) security context.²

[0135] It should be further understood that this embodiment of this ²application mainly relates²to sending the security context of the UE by the second AMF to the first AMF. ²The security context²of the UE is a part of a context of the UE, and may be transferred along with ²the context of the UE.²24²Date Recue / Date Received 2021-11-19²<DP=25>²CA 03141367 2021-11-19²Therefore, for ease of description, in this embodiment of this application, ²sending the security ²context of the UE by the second AMF to the first AMF may be described as ²sending the context of ²the UE or sending the security context of the UE. This is merely used for ease ²of description, and ²does not constitute any limitation on the protection scope of the embodiments ²of this application.²

[0136] That the first AMF derives the mapped security context of the UE ²based on the²parameters, such as the KASME and the NH, carried in the received relocation ²request message ²includes that the first AMF derives a key KANui based on the KASME and the NH.²

[0137] For example, after receiving the KASME and the NH, the first AMF ²may calculate the ²key KAMF1 by using a preset derivation formula. The derivation formula is: ²KAMM = HMAC ¨ SHA²¨256 (Key, FC1113011L0), where FC = 0x76, PO =NH value, LO = length of the NH ²value (i.e. 0x00²0x20), and KEY = KASME. The first AMF calculates an integrity protection key ²KNAstnti and a ²confidentiality protection key KNAsenci based on the key KAMF1 and a security ²algorithm negotiated ²with the UE, where KAmm, KNAsinti, and KNAsenci are included in the security ²context of the UE. ²KAN4F1, KNAStntl, and KNASencl are derived based on KASME and the NH, and ²KASME and the NH are²the security context between the UE and the MME. Therefore, KAMF1, KNAStritl, ²and KNAsenci are²referred to as the mapped security context of the UE.²

[0138] S230: The first AMF sends a forward relocation response (forward ²relocation response) ²message to the MME.²

[0139] Specifically, after determining the mapped security context, the ²first AMF sends the²forward relocation response message to the MME. The forward relocation ²response message is²used to notify the MME that the first AMF may be used as an AMF providing the ²access and ²mobility management service for the UE in the 5G communications system when ²the UE is handed ²over from the 4G communications system to the 5G communications system.²

[0140] S240: The MME sends a handover command (handover command) message ²to the UE.²

[0141] After receiving the forward reallocation response message sent by ²the first AMF, the²MME learns that the first AMF can provide the access and mobility management ²service for the ²UE. In this case, the MME sends the handover command message to the UE, so ²that the UE learns ²that the UE can be handed over from the 4G communications system to the 5G ²communications ²system.²

[0142] S250: The UE determines the mapped security context.²

[0143] After receiving the handover command message, the UE calculates, ²by using the preset² Date Recue / Date Received 2021-11-19²<DP=26>²CA 03141367 2021-11-19²derivation formula, the key KAMF1 based on the key KASME and the NH that are ²stored in the UE. ²For a specific derivation process, refer to the foregoing S220, and details ²are not described herein ²again.²

[0144] After S250, the UE and the first AMF obtain the same key KAMF1, ²and the key KAMF1² may be subsequently used to derive another key.²

[0145] For example, the UE and the first AMF obtain the same key KAN / Fi. ²Then, based on ²KANui and a non-access stratum (non-access stratum, NAS) integrity protection ²algorithm and a ²confidentiality protection algorithm that are negotiated between the UE and ²the first AMF, the UE ²and the first AMF generate the integrity protection key KNAsma and the ²confidentiality protection²key KNASenel that are used to protect a NAS message (for example, a ²registration request message).²Specifically, KNAStntl and KNASenel are calculated as follows:²

[0146] KNAs,nti = HMAC ¨ SHA¨ 256 (KEY, S), where S = ²FC11130111L0111P1111L11, FC = 0x69, ²P01 = algorithm type distinguisher (algorithm type distinguisher), LO1 = ²length of the algorithm ²type distinguisher (length of algorithm type distinguisher) (i.e. 0x00 Ox01), ²P11 = algorithm²identity (algorithm identity), Lli = length of the algorithm identity (length ²of algorithm identity)²(i.e. 0x00 Ox01), and KEY = KAMF1-²

[0147] KNAsenci = HMAC ¨ SHA ¨ 256 (KEY, S), where S = ²FC1113011L011P111L1, FC = 0x69, ²PO = algorithm type distinguisher, LO = length of algorithm type distinguisher ²(i.e. 0x00 Ox01), P1²= algorithm identity, Li = length of algorithm identity (i.e. 0x00 Ox01), and ²KEY = KAMF1-²

[0148] The algorithm type distinguisher and the algorithm identity for ²calculating KNAStntl are²different from those for calculating KNAsenci.²

[0149] After the handover is completed, the UE initiates mobility ²registration, in other words, ²performs S260. The UE sends the registration request (registration request) ²message to the first ²AMF, and the UE performs security protection on the registration request ²message by using the²mapped security context generated through derivation based on the foregoing ²generated KAN / Fi.²The security protection includes encryption protection and / or integrity ²protection.²

[0150] It should be understood that a message sent by the UE to a core ²network device may ²be forwarded by an access network device. Because a function of an access ²device is not limited ²in this embodiment of this application, the access network device may forward ²a message between²the UE and the first AMF. For brevity, in this application, forwarding the ²message between the UE²and the first AMF is described as that the UE sends the registration request ²message to the first²26²Date Recue / Date Received 2021-11-19²<DP=27>²CA 03141367 2021-11-19²AMF and the MME sends a message to the UE. The registration request message ²sent by the UE ²further includes a globally unique temporary user equipment identity (globally ²unique temporary ²user equipment identity, GUTI) in the mapped context, and the GUTI is used by ²the access network ²device to determine to forward the registration request message to the first ²AMF. Because the²GUTI is included in the mapped context, the GUTI may be referred to as a ²mapped GUTI.²

[0151] Optionally, when the UE sends the registration request message to ²the first AMF, the ²UE stores a security context of the UE that is between the UE and another AMF ²(the second AMF) ²and a 5G globally unique temporary user equipment identity (5th generation ²globally unique ²temporary user equipment identity, 5G-GUTI) of the user equipment. Therefore, ²the UE adds the² 5G-GUTI to the registration request message.²

[0152] It should be understood that this embodiment of this application ²mainly relates to a ²process in which the first AMF successfully obtains the security context of ²the UE from the second ²AMF. Therefore, in this application, the following case is mainly considered: ²When the UE sends ²the registration request message to the first AMF, the UE stores the security ²context the UE that is²negotiated between the UE and the second AMF as well as the 5G-GUTI.²

[0153] It should be further understood that a reason why the security ²context and the 5G-GUTI ²of the UE are stored by the UE and the second AMF is not limited in this ²embodiment of this ²application, and may be specified in the existing protocol. For example, ²before the UE is handed ²over from the 4G communications system to the 5G communications system, the UE ²is handed²over from the 5G network communications system to the 4G communications ²system. ²Alternatively, UE supporting dual connectivity accesses the 5G communications ²system through ²a non-3GPP connection, and accesses the 4G communications system through a ²3GPP connection ²at the same time. In this way, the UE in connected mode is handed over from ²the 4G ²communications system to the 5G communications system.²

[0154] It should be understood that when the security context of the UE ²that is between the²second AMF and the UE exists on the second AMF, the first AMF needs to obtain ²the security ²context of the UE from the second AMF. Specifically, that the first AMF ²obtains the security ²context of the UE from the second AMF is determined based on the 5G-GUTI ²carried in the ²registration request message received from the UE. The 5G-GUTI is configured ²by the second²AMF for the UE and may be used to identify the UE and the second AMF. As ²specified in a²protocol, when a security context of UE exists in the 5G communications ²system, the security²27²Date Recue / Date Received 2021-11-19²<DP=28>²CA 03141367 2021-11-19²context of the UE instead of a mapped security context determined through ²negotiation between ²the first AMF and the UE is preferentially used, because the mapped security ²context is obtained ²through mapping based on a security context of the UE that is between the UE ²and the MME in ²the 4G communications system. In other words, the procedure shown in FIG. 2 ²further includes²S270 in which the first AMF initiates a user equipment context transfer ²service invoking request²(Namf Communication UEContextTransfer).²

[0155] Specifically, the first AMF receives the registration request ²message sent by the UE, ²and initiates the user equipment context transfer service invoking request to ²the second AMF based ²on the 5G-GUTI carried in the registration request message. The user equipment ²context transfer² service invoking request carries the registration request message.²

[0156] It should be understood that the registration request message is ²security protected based ²on the mapped security context between the UE and the first AMF, and the ²second AMF determines, ²based on a result of validating the registration request message, whether to ²return the security ²context of the UE to the first AMF. In other words, S290 is performed. The ²second AMF validates²the registration request message.²

[0157] In a possible implementation, the second AMF fails to validate ²the registration request ²message. In this case, the second AMF does not return the security context of ²the UE to the first ²AMF. Consequently, the first AMF fails to obtain the security context of the ²UE from the second ²AMF, and the first AMF cannot preferentially use the security context of the ²UE. This does not²comply with the protocol.²

[0158] In another possible implementation, the second AMF successfully ²validates integrity ²of the registration request message. In this case, the second AMF returns the ²security context of ²the UE to the first AMF, and performs S291 in which the second AMF sends the ²security context ²of the UE to the first AMF. Optionally, that the second AMF sends the security ²context of the UE²to the first AMF may be described as that the second AMF sends the context of ²the UE to the first²AMF. The context of the UE includes the security context of the UE that is ²determined through ²negotiation between the second AMF and the UE, and the security context of the ²UE includes a ²key KAmr2, a non-access stratum count (non-access stratum count, NAS COUNT), ²and the like.²

[0159] Optionally, before transferring the security context of the UE, ²the second AMF may²perform key derivation on the key KAmF2 according to a local policy. If the ²second AMF has²performed key derivation on KAMF2, the second AMF sends, to the first AMF, a ²key KAMF2' obtained²28²Date Recue / Date Received 2021-11-19²<DP=29>²CA 03141367 2021-11-19²after derivation and derivation indication information that is used to ²indicate that the second AMF ²has performed key derivation on KAMF2-²

[0160] In a possible implementation, the key derivation in this ²application may be horizontal ²key derivation.²

[0161] For example, a manner of performing horizontal key derivation on ²KAMY2 to generate²KAMF2' is as follows:²KAmr2'=HMAC¨SHA-256 (Key, S);²FC = Ox72;²PO = Ox01;² LO = length of PO (i.e. 0x00 Ox01);²P1 = uplink NAS COUNT;²Li = length of P1 (i.e. 0x00 0x04); ²KEY = KA1F2;²S=FC1113011L011P111L1.²

[0162] In another possible implementation, the key derivation in this ²application may be a key²derivation manner agreed on between different network elements. For example, ²the first AMF and ²the second AMF agree on a preset key derivation manner. Provided that the ²security context of the ²UE that is sent by the second AMF to the first AMF includes the derivation ²indication information, ²the first AMF can determine that a key in the received security context of the ²UE is obtained by²the second AMF by performing key derivation in the preset key derivation ²manner.²

[0163] Similarly, after receiving the derivation indication information, ²the first AMF also ²sends the derivation indication information to the UE, to indicate the UE to ²perform key derivation ²on the key KAMY2 to obtain the key KAMF2', so that the UE and a network side ²agree on the key. It ²should be understood that the UE receives a key identifier indicating the key ²KAMF2, and therefore²can determine to perform key derivation on the key KAmr2 instead of KAmr. The ²key identifier is²not improved in this application. Therefore, the key identifier is not ²described in detail herein.²

[0164] It can be learned, from the process of handing over the user ²equipment from the 4G ²communications system to the 5G communications system in FIG. 2, that when the ²second AMF ²fails to verify the UE, the first AMF cannot obtain the security context of ²the UE from the second²AMF. To avoid failing to obtain the security context of the UE, an embodiment ²of this application²provides a security context obtaining method. When the first AMF obtains the ²security context of²29²Date Recue / Date Received 2021-11-19²<DP=30>²CA 03141367 2021-11-19²the UE from the second AMF, the security context carries indication ²information. The indication ²information indicates that the UE has been successfully verified. Based on the ²indication ²information, the second AMF does not need to verify the UE, but directly ²returns the security ²context of the UE. This can avoid a possibility of failing to obtain the ²security context of the UE.²

[0165] It should be understood that verifying the UE in this application ²means validating the²integrity of the registration request message sent by the UE, for example, ²decrypting the ²registration request message and / or validating the integrity of the ²registration request message. ²Because a premise that the integrity of the registration request message is ²successfully validated ²is that the registration request message is successfully decrypted, in this ²embodiment of this²application, that the UE is successfully verified is described as that the ²integrity of the registration²request message is successfully validated.²

[0166] With reference to FIG. 3, the following describes in detail a ²security context obtaining ²method provided in an embodiment of this application. FIG. 3 is a schematic ²diagram of a security ²context obtaining method according to an embodiment of this application. The ²schematic diagram² includes UE, an MME, a first AMF, and a second AMF.²

[0167] The security context obtaining method includes the following ²steps.²

[0168] S310: The first AMF sends a second request message to the second ²AMF.²

[0169] The second request message is used to request to obtain a security ²context of the UE. ²The second request message carries indication information, and the indication ²information is used²to indicate that the UE is validated.²

[0170] Optionally, the indication information may be referred to as a ²reason value (value).²

[0171] Specifically, that the first AMF determines that the UE is ²validated is mainly ²determining whether a registration request message received from the UE ²satisfies a preset ²condition. It should be understood that, before the first AMF sends the second ²request message to²the second AMF, a method procedure shown in FIG. 3 further includes S311 to ²S316.²

[0172] S311: The MME sends a forward relocation request message to the ²first AMF. This step ²is similar to S210 in FIG. 2, and details are not described herein again.²

[0173] S312: The first AMF determines a mapped security context. This ²step is similar to S220 ²in FIG. 2, and details are not described herein again.²

[0174] S313: The first AMF sends a forward relocation response message to ²the MME. This²step is similar to S230 in FIG. 2, and details are not described herein again.² Date Recue / Date Received 2021-11-19²<DP=31>²CA 03141367 2021-11-19²

[0175] S314: The MME sends a handover command message to the UE. This ²step is similar ²to S240 in FIG. 2, and details are not described herein again.²

[0176] S315: The UE determines the mapped security context. This step is ²similar to S250 in ²FIG. 2, and details are not described herein again.²

[0177] S316: The UE sends the registration request message to the first ²AMF. This step is²similar to S260 in FIG. 2, and details are not described herein again.²

[0178] Further, that the first AMF determines that the registration ²request message satisfies the²preset condition includes:²the first AMF successfully validates integrity protection for the registration ²request² message; or²the first AMF determines that the registration request message is a ²registration request ²message sent by the UE after the UE is handed over from a 4G communications ²system to a 5G ²communications system. For example, before receiving the registration request ²message sent by ²the UE, the first AMF receives the forward relocation request message sent by ²the MME. Therefore,².. the first AMF can learn that the currently received registration request ²message is the registration²request message received from the UE in a handover procedure.²

[0179] Specifically, that the first AMF successfully validates integrity ²protection for the ²registration request message may also be referred to as that the first AMF ²successfully verifies the ²UE. In other words, the method procedure shown in FIG. 3 further includes S317 ²in which the first² AMF verifies the UE.²

[0180] In a possible implementation, the second request message is a ²user equipment context ²transfer service invoking request (Namf Communication UEContextTransfer) ²initiated by the ²first AMF shown in FIG. 2. Different from the user equipment context transfer ²service invoking ²request shown in FIG. 2, the user equipment context transfer service invoking ²request in this²embodiment of this application includes a newly added information element ²(information element,²IE), namely, the indication information.²

[0181] In another possible implementation, the second request message is ²another possible ²second request message that is sent by the first AMF to the second AMF and ²that is used to obtain ²the security context of the UE.²

[0182] It should be understood that a specific form of the second request ²message is not limited²in this application. The indication information may be added to existing ²signaling between the first²31²Date Recue / Date Received 2021-11-19²<DP=32>²CA 03141367 2021-11-19²AMF and the second AMF, or may be added to signaling newly added between the ²first AMF and ²the second AMF.²

[0183] In another possible implementation, in this embodiment of this ²application, it is limited ²only that the first AMF needs to send the indication information to the second ²AMF before sending²the user equipment context transfer service invoking request to the second ²AMF. In other words,²the first AMF may directly send the indication information to the second AMF, ²without adding the ²indication information to the second request message. This possible ²implementation is not shown ²in FIG. 3.²

[0184] It should be further understood that how the indication ²information specifically²indicates that the UE is validated is not limited in this application. In a ²possible implementation,²the indication information may be a 5G-GUTI of the UE. In this case, the 5G-²GUTI may be used ²to identify the UE and indicate that the UE is validated. In this ²implementation, a new indication ²function is added to an existing IE, and the second AMF may be notified, in a ²predefined manner, ²that the 5G-GUTI has the new function. In another possible implementation, the ²indication²information may be at least one newly added bit, and a value of the bit is set ²to 1, to indicate that²the UE is validated. The foregoing possible implementations are merely ²examples for description, ²and do not constitute any limitation on the protection scope of this ²application.²

[0185] In a possible implementation, the indication information ²explicitly indicates that the ²UE is validated. Alternatively, in another possible implementation, the ²indication information²implicitly indicates that the UE is validated. For example, the indication ²information indicates that²integrity of the registration request message received by the first AMF from ²the UE is successfully ²validated.²

[0186] Further, to enable the second AMF to determine that the first AMF ²needs to obtain the ²security context of the UE, the second request message further needs to carry ²an identity of the ² UE.²

[0187] In a possible implementation, the identity of the UE may be the ²foregoing 5G-GUTI.²

[0188] In another possible implementation, the identity of the UE may be ²a subscriber ²permanent identity (subscriber permanent identity, SUPI).²

[0189] It should be understood that, if the first AMF determines, after ²receiving the 5G-GUTI²of the UE from the UE, that the security context of the UE needs to be ²obtained from the second²AMF, the first AMF may choose to continue to add the 5G-GUTI of the UE, the ²SUPI of the UE,²32²Date Recue / Date Received 2021-11-19²<DP=33>²CA 03141367 2021-11-19²or both the 5G-GUTI and the SUPI of the UE to the second request message.²

[0190] Optionally, to enable the second AMF to obtain an uplink non-²access stratum count ²(uplink non-access stratum count, UL NAS COUNT) of the UE, in a possible ²implementation, the ²second request message carries a plaintext registration request message, where ²the plaintext²registration request message includes the UL NAS COUNT; or in a possible ²implementation, the²second request message carries the UL NAS COUNT.²

[0191] Further, after receiving the second request message sent by the ²first AMF, the second ²AMF learns, based on the indication information, that the UE is validated. In ²this case, the second ²AMF does not need to verify the UE, in other words, performs S320 in which the ²second AMF² determines that the UE does not need to be verified.²

[0192] S330: The second AMF sends a second response message to the first ²AMF.²

[0193] The second response message carries the security context of the ²UE.²

[0194] In this embodiment of this application, the second AMF does not ²need to verify the UE. ²After receiving the second request message sent by the first AMF, the second ²AMF directly returns²the security context of the UE to the first AMF. This avoids a case in which ²the first AMF fails to²obtain the security context of the UE because the second AMF fails to verify ²the UE.²

[0195] Optionally, when the second request message carries the plaintext ²registration request ²message, or the second request message carries the UL NAS COUNT, the second ²AMF can obtain ²the UL NAS COUNT. For example, because the plaintext registration request ²message is a²registration request message on which no security protection is performed, the ²second AMF does²not need to validate the plaintext registration request message, and may ²directly obtain the UL ²NAS COUNT from the plaintext registration request message.²

[0196] Further, the second AMF can perform key derivation on a first key ²in the security ²context of the UE based on the UL NAS COUNT. In this case, a key in the ²security context of the²UE that is returned by the second AMF to the first AMF is a second key ²obtained by performing²key derivation on the first key.²

[0197] Specifically, when the key in the security context of the UE that ²is sent by the second ²AMF to the first AMF is the second key, the second AMF further needs to send ²key derivation ²indication information to the first AMF, to indicate that the second key is a ²key obtained through² key derivation.²

[0198] It should be understood that a procedure after the first AMF ²obtains the security context²33²Date Recue / Date Received 2021-11-19²<DP=34>²CA 03141367 2021-11-19²of the UE is similar to a procedure after the first AMF obtains the security ²context of the UE in an ²existing procedure of handing over the UE from the 4G communications system to ²the 5G ²communications system. For details, refer to the existing procedure. Details ²are not described ²herein again.²

[0199] In the security context obtaining method shown in FIG. 3, the second ²request message²sent by the first AMF to the second AMF carries the indication information, ²and the indication ²information is used to indicate that the UE is validated. Therefore, the ²second AMF can determine, ²based on the indication information, that the UE is validated, and does not ²need to verify the UE. ²After receiving the second request message carrying the indication ²information, the second AMF²directly returns the security context of the UE to the first AMF. This avoids ²the case in which the²first AMF fails to obtain the security context of the UE because the second ²AMF fails to verify the ²UE. This application further provides another security context obtaining ²method in which the ²second AMF verifies the UE. However, the method can improve a possibility that ²the second AMF ²successfully verifies the UE, thereby improving a possibility that the first ²AMF successfully² obtains the security context of the user equipment from the second AMF.²

[0200] The following describes the security context obtaining method in ²detail with reference ²to FIG. 4. FIG. 4 is a schematic diagram of another security context obtaining ²method according ²to an embodiment of this application. The schematic diagram includes UE, an ²MME, a first AMF, ²and a second AMF.²

[0201] The security context obtaining method includes the following steps.²

[0202] S410: The UE determines a first registration request message.²

[0203] The first registration request message carries a second ²registration request message. ²The second registration request message is integrity protected using a first ²security context, and ²the first security context is a native (native) security context between the ²UE and the second AMF.²

[0204] Specifically, that the UE determines the first registration request ²message is mainly²determining the second registration request message. The second registration ²request message is a ²message obtained after the UE performs integrity protection on a fourth ²registration request ²message by using the native security context. The fourth registration request ²message includes a ²GUTI, key identifier (ngKSI) information, and an UL NAS COUNT that are in a ²context of the²UE that is between the UE and the second AMF. For ease of differentiation, the ²GUTI may be²referred to as a native GUTI, and the key identifier may be referred to as a ²native key identifier.²34²Date Recue / Date Received 2021-11-19²<DP=35>²CA 03141367 2021-11-19²

[0205] Optionally, the fourth registration request message may have the ²following several ²possible cases:²

[0206] Case 1:²

[0207] The fourth registration request message is a message generated by ²the UE based on the²native GUTI, the native key identifier, and the UL NAS COUNT. In Case 1, the ²fourth registration²request message may also be referred to as a fourth message or may have ²another possible name. ²A name of the message is not limited in this embodiment of this application.²

[0208] It should be understood that the fourth registration request ²message generated by the ²UE based on the context of the UE that is between the UE and the second AMF ²may alternatively²be in another form. For example, in addition to the native GUTI, the native ²key identifier, and the²UL NAS COUNT, the fourth registration request message generated by the UE ²further includes ²another information element (information element, IE).²

[0209] In Case 1, that the UE performs integrity protection on the ²fourth registration request ²message based on the first security context includes: The UE performs ²integrity protection on the²fourth registration request message based on the first security context, and ²generates a first MAC.²Therefore, carrying the second registration request message in the first ²registration request ²message may also be understood as carrying the first MAC and the fourth ²registration request ²message in the first registration request message.²

[0210] Further, in Case 1, that the UE determines the first registration ²request message² includes the following steps:²

[0211] Step 1:²

[0212] The UE constructs the fourth registration request message.²

[0213] Step 2:²

[0214] The UE performs integrity protection on the fourth registration ²request message based²on the security context between the UE and the second AMF, and generates the ²first MAC.²

[0215] Step 3:²

[0216] The UE performs integrity protection on a third registration ²request message and the ²second registration request message (RR2) based on a mapped security context ²between the UE ²and the first AMF, and generates a fifth MAC. The third registration request ²message is the²registration request message sent by the UE to the first AMF in the method ²procedure S260 shown²in FIG. 2. Specifically, the third registration request message includes a ²GUTI and key identifier² Date Recue / Date Received 2021-11-19²<DP=36>²CA 03141367 2021-11-19²information that are in the mapped context between the UE and the first AMF. ²For ease of ²differentiation, the GUTI may be referred to as a mapped GUTI, and the key ²identifier may be ²referred to as a mapped key identifier.²

[0217] In this case, the first registration request message includes the ²fourth registration²request message (RR4), the third registration request message (RR3), the fifth ²MAC (MACS), and²the first MAC (MAC1). MAC1 is a MAC value obtained by performing integrity ²protection on ²RR4 by using the native security context. MACS is a MAC value obtained by ²performing integrity ²protection on RR3 and RR2 by using the mapped security context (or MACS is a ²MAC value ²obtained by performing integrity protection on RR3, RR4, and MAC1 by using the ²mapped²security context). It may also be understood that the first registration ²request message is a message²on which integrity protection is performed sequentially based on the native ²security context and ²the mapped security context.²

[0218] Case 2:²

[0219] The fourth registration request message is a registration request ²message obtained after²the UE performs integrity protection on a third registration request message ²based on a mapped²security context.²

[0220] In Case 2, that the UE performs integrity protection on the fourth ²registration request ²message based on the first security context includes: The UE performs ²integrity protection on the ²fourth registration request message based on the first security context, and ²generates a first MAC.².. Therefore, carrying the second registration request message in the first ²registration request²message may also be understood as carrying the first MAC and the fourth ²registration request ²message in the first registration request message.²

[0221] Further, in Case 2, that the UE determines the first registration ²request message ²includes the following steps:²

[0222] Step 1:²

[0223] The UE performs integrity protection on the third registration ²request message based ²on the mapped security context between the UE and the first AMF, and generates ²a third MAC.²

[0224] Step 2:²

[0225] The UE performs, based on the native security context between the ²UE and the second²AMF, integrity protection on the third registration request message on which ²integrity protection²is performed based on the mapped security context in the step 1, and generates ²the first MAC.²36²Date Recue / Date Received 2021-11-19²<DP=37>²CA 03141367 2021-11-19²

[0226] In this case, the first registration request message includes the ²third registration request ²message (RR3), the third MAC (MAC3), and the first MAC (MAC1). MAC3 is a MAC ²value ²obtained by performing integrity protection on RR3 by using the mapped ²security context. MAC1 ²is a MAC value obtained by performing integrity protection on RR3 and MAC3 by ²using the native²security context. It may also be understood that the first registration ²request message is a message²on which integrity protection is performed sequentially based on the mapped ²security context and ²the native security context.²

[0227] Case 3:²

[0228] The fourth registration request message is a third registration ²request message. The²third registration request message is the registration request message sent by ²the UE to the first²AMF in the method procedure S260 shown in FIG. 2.²

[0229] In Case 2, that the UE performs integrity protection on the fourth ²registration request ²message based on the first security context includes: The UE performs ²integrity protection on the ²fourth registration request message based on the first security context, and ²generates a first MAC.²Therefore, carrying the second registration request message in the first ²registration request²message may also be understood as carrying the first MAC and the fourth ²registration request ²message in the first registration request message.²

[0230] Further, in Case 3, that the UE determines the first registration ²request message ²includes the following steps:²

[0231] Step 1:²

[0232] The UE performs integrity protection on the third registration ²request message based ²on the native security context between the UE and the second AMF, and ²generates the first MAC.²

[0233] Step 2:²

[0234] The UE performs, based on a mapped security context between the UE ²and the first²AMF, integrity protection on the third registration request message on which ²integrity protection²is performed based on the native security context in the step 1, and generates ²a fourth MAC.²

[0235] In this case, the first registration request message includes the ²third registration request ²message (RR3), the first MAC (MAC1), and the fourth MAC (MAC4). MAC1 is a MAC ²value ²obtained by performing integrity protection on RR3 by using the native ²security context. MAC4²is a MAC value obtained by performing integrity protection on RR3 and MAC1 by ²using the²mapped security context. It may also be understood that the first registration ²request message is a²37²Date Recue / Date Received 2021-11-19²<DP=38>²CA 03141367 2021-11-19²message on which integrity protection is performed sequentially based on the ²native security ²context and the mapped security context.²

[0236] It should be understood that, in Case 1, the first AMF can ²determine, based on both the ²mapped GUITI and the native GUTI that are carried in the first registration ²request message sent²by the UE, to send the second registration request message that is integrity ²protected by using the²native security context to the second AMF.²

[0237] It should be further understood that the foregoing Case 1 to Case ²3 are merely examples ²to describe possible cases of the second registration request message and how ²the UE determines ²the first registration request message. Another undescribed possible form of ²the second registration²request also falls within the protection scope of this application. For ²example, the fourth²registration request message is another possible message constructed by the UE ²based on a native ²context.²

[0238] S420: The UE sends the first registration request message to the ²first AMF.²

[0239] Specifically, the UE sends the first registration request message ²determined in S410 to² the first AMF.²

[0240] It should be understood that the first registration request ²message sent by the UE to the ²first AMF may be forwarded by an access network device. A function of the ²access network device ²is not limited in this application. Therefore, that the first registration ²request message sent by the ²UE to the first AMF may be forwarded by the access network device is directly ²described as that²the UE sends the first registration request message to the first AMF.²

[0241] It should be further understood that, before the UE sends the ²first registration request ²message to the first AMF, the UE needs to determine the mapped security ²context. Therefore, ²before the UE sends the first registration request message to the first AMF, a ²method procedure ²shown in FIG. 4 further includes S411 to S414.²

[0242] S411: The MME sends a forward relocation request message to the ²first AMF. This step²is similar to S210 in FIG. 2, and details are not described herein again.²

[0243] S412: The first AMF determines the mapped security context. This ²step is similar to ²S220 in FIG. 2, and details are not described herein again.²

[0244] S413: The first AMF sends a forward relocation response message to ²the MME. This²step is similar to S230 in FIG. 2, and details are not described herein again.²

[0245] S414: The MME sends a handover command message to the UE. This ²step is similar²38²Date Recue / Date Received 2021-11-19²<DP=39>²CA 03141367 2021-11-19²to S240 in FIG. 2, and details are not described herein again.²

[0246] Specifically, after receiving the handover command message, the ²UE derives the ²mapped security context. Further, the UE performs security protection on the ²first registration ²request message by using the native security context and the mapped security ²context.²

[0247] S430: The first AMF verifies the UE.²

[0248] Specifically, that the first AMF determines that the UE is ²validated is mainly ²determining whether the first registration request message received from the ²UE satisfies a preset ²condition. That the first AMF determines that the first registration request ²message satisfies the ²preset condition includes:²the first AMF successfully validates integrity protection for the first ²registration request²message based on the mapped security context; or²the first AMF determines that the first registration request message is a ²registration ²request message sent by the UE after the UE is handed over from a 4G ²communications system to ²a 5G communications system. For example, before receiving the first ²registration request message²sent by the UE, the first AMF receives the forward relocation request message ²sent by the MME.²Therefore, the first AMF can learn that the currently received first ²registration request message is ²the registration request message received from the UE in a handover procedure.²

[0249] After verifying that the UE is validated, the first AMF sends the ²second registration ²request message to the second AMF, where the second registration request ²message is used by the²second AMF to verify the UE. In other words, the method procedure shown in ²FIG. 4 further²includes S440 in which the first AMF sends the second request message to the ²second AMF.²

[0250] Optionally, the second registration request message is carried in ²a first request message, ²and is sent by the first AMF to the second AMF.²

[0251] In a possible implementation, the first request message is a user ²equipment context²transfer service invoking request (Namf Communication UEContextTransfer) ²initiated by the ²first AMF shown in FIG. 2. Different from the user equipment context transfer ²service invoking ²request shown in FIG. 2, the user equipment context transfer service invoking ²request in this ²embodiment of this application includes a newly added information element, ²namely, the first ²MAC.²

[0252] In another possible implementation, the first request message is ²another possible first²request message that is sent by the first AMF to the second AMF and that is ²used to obtain a²39²Date Recue / Date Received 2021-11-19²<DP=40>²CA 03141367 2021-11-19²security context of the UE.²

[0253] It should be understood that a specific form of the first request ²message is not limited ²in this application. The first MAC may be added to existing signaling between ²the first AMF and ²the second AMF, or may be added to signaling newly added between the first AMF ²and the second ² AMF.²

[0254] Further, to enable the second AMF to determine that the first AMF ²needs to obtain the ²security context of the UE, the first request message further carries an ²identity of the UE. ²Specifically, the identity of the UE is included in the second registration ²request message sent by ²the first AMF to the second AMF.²

[0255] In a possible implementation, the identity of the UE may be the ²mapped GUTI.²

[0256] In a possible implementation, the identity of the UE may be the ²native GUTI.²

[0257] In another possible implementation, the identity of the UE may be ²an SUPI.²

[0258] It should be understood that, if the first AMF determines, after ²receiving the mapped ²GUTI of the UE from the UE, that the security context of the UE needs to be ²obtained from the²second AMF, the first AMF may choose to continue to add the mapped GUTI of the ²UE, the SUPI ²of the UE, or both the mapped GUTI and the SUPI of the UE to the first request ²message.²

[0259] It should be further understood that, when the first registration ²request message ²received by the first AMF is the first registration request message shown in ²Case 1 in S410, the ²first registration request message carries the second registration request ²message, and the second²registration request message includes the native GUTI. In this case, the first ²AMF may choose to ²add the native GUTI of the UE to the first request message.²

[0260] Further, the second registration request message further includes ²the UL NAS COUNT ²of the UE, so that the second AMF can obtain the UL NAS COUNT of the UE.²

[0261] Further, after receiving the first request message sent by the ²first AMF, the second AMF²determines, based on an integrity validation result of the second registration ²request message, ²whether the UE is validated. To be specific, the second AMF performs S450, in ²other words, ²validates integrity of the second registration request message.²

[0262] The second AMF validates the integrity of the second registration ²request message ²based on the security context between the second AMF and the user equipment. ²For example, the²second AMF generates a second MAC based on a natively stored security context, ²and compares ²the first MAC with the second MAC. When the first MAC is equal to the second ²MAC, the second² Date Recue / Date Received 2021-11-19²<DP=41>²CA 03141367 2021-11-19²AMF successfully verifies the UE, and determines that the UE is validated. In ²this case, the second ²AMF sends the security context of the UE to the first AMF.²

[0263] It should be understood that the first MAC is a MAC generated by ²the UE based on the ²security context of the UE that is negotiated between the UE and the second ²AMF, and the second²MAC is a MAC generated by the second AMF based on the security context of the ²UE that is²negotiated between the UE and the second AMF. Therefore, there is a high ²probability that the first ²MAC is equal to the second MAC. In this case, the second AMF can successfully ²verify the UE, ²and returns the security context of the UE to the first AMF, unless the second ²AMF fails to verify ²the UE due to a low-probability event such as a transmission error. Compared ²with the method²procedure shown in FIG. 2, the security context obtaining method shown in FIG. ²4 improves a²possibility that the first AMF successfully obtains the security context of ²the user equipment from ²the second AMF.²

[0264] After successfully validating the integrity of the second ²registration request message, ²the second AMF performs S460, in other words, sends the security context of ²the user UE to the² first AMF.²

[0265] Optionally, the security context of the UE is carried in a first ²response message.²

[0266] Further, if the security context of the UE is included in the ²context of the UE, the second ²AMF may send the context of the UE to the first AMF.²

[0267] Optionally, the second AMF can perform key derivation on a first ²key in the security²context of the UE based on the UL NAS COUNT. In this case, a key in the ²security context of the²UE that is returned by the second AMF to the first AMF is a second key ²obtained by performing ²key derivation on the first key. In this embodiment of this application, the ²security context of the ²UE that includes the second key generated through key derivation may be ²referred to as a second ²security context. In other words, the security context of the UE that is sent ²by the second AMF to²the first AMF may not undergo key derivation, may be the security context of ²the UE that is²between the second AMF and the UE and that is natively stored in the second ²AMF, or may be the ²second security context when the second AMF performs, according to a local ²policy, key derivation ²on a key in the natively stored security context of the UE that is between the ²second AMF and the ²UE, to generate a derived key.²

[0268] Specifically, when the key in the security context of the UE that is ²sent by the second²AMF to the first AMF is the second key, the second AMF further needs to send ²key derivation²41²Date Recue / Date Received 2021-11-19²<DP=42>²CA 03141367 2021-11-19²indication information to the first AMF, to indicate that the second key is a ²key obtained through ²key derivation.²

[0269] It should be understood that a procedure after the first AMF ²obtains the security context ²of the UE is similar to a procedure after the first AMF obtains the security ²context of the UE in an²existing procedure of handing over the UE from the 4G communications system to ²the 5G²communications system. For details, refer to the existing procedure. Details ²are not described ²herein again.²

[0270] For example, the UE and the first AMF subsequently negotiate to ²use the native security ²context. Specifically, the first AMF sends a non-access stratum security mode ²command (non-²access layer secure mode command, NAS SMC) message to the UE, and the UE ²validates integrity²of the NAS SMC message. After the UE successfully validates the NAS SMC, the ²UE sends a ²non-access stratum security mode complete (non-access layer security mode ²complete) message ²to the first AMF.²

[0271] In a possible implementation, when the second AMF fails to ²validate the integrity of²the second registration request message, the second AMF sends failure ²indication information to²the first AMF, to notify the first AMF that the second AMF fails to validate ²the integrity of the ²second registration request message.²

[0272] Further, after the first AMF receives the failure indication ²information indicating that ²the second AMF fails to validate the integrity of the second registration ²request message, the first²AMF determines, according to a local policy, that the first AMF may continue ²to use the mapped²security context, or the first AMF determines to initiate initial ²authentication to the UE according ²to a local policy, and generates a new security context between the first AMF ²and the UE.²

[0273] It should be understood that sequence numbers of the foregoing ²processes do not mean ²execution sequences in the foregoing method embodiments. The execution ²sequences of the²processes should be determined based on functions and internal logic of the ²processes, and should²not be construed as any limitation on the implementation processes of the ²embodiments of this ²application.²

[0274] The security context obtaining methods in the embodiments of this ²application are ²described above in detail with reference to FIG. 3 and FIG. 4. The following ²describes in detail²security context obtaining apparatuses in the embodiments of this application ²with reference to²FIG. 5 to FIG. 10.²42²Date Recue / Date Received 2021-11-19²<DP=43>²CA 03141367 2021-11-19²

[0275] FIG. 5 is a schematic diagram of a security context obtaining ²apparatus 50 according ²to this application. As shown in FIG. 5, the apparatus 50 includes a sending ²unit 510, a processing ²unit 520, and a receiving unit 530.²

[0276] The sending unit 510 is configured to send a first registration ²request message to a first ² AMF.²

[0277] The processing unit 520 is configured to determine the first ²registration request ²message.²

[0278] The receiving unit 530 is configured to receive a handover command ²message sent by ²an MME.²

[0279] The apparatus 50 completely corresponds to the user equipment in the ²method²embodiments. The apparatus 50 may be the user equipment in the method ²embodiments, or a chip ²or a functional module inside the user equipment in the method embodiments. ²The corresponding ²units of the apparatus 50 are configured to perform corresponding steps ²performed by the user ²equipment in the method embodiments shown in FIG. 3 and FIG. 4.²

[0280] The sending unit 510 of the apparatus 50 performs a sending step ²performed by the²user equipment in the method embodiments. For example, the sending unit 510 ²performs the step ²S316 of sending the registration request message to the first AMF in FIG. 3 ²and the step S420 of ²sending the first registration request message to the first AMF in FIG. 4.²

[0281] The processing unit 520 performs a step implemented or processed ²inside the user²equipment in the method embodiments. For example, the processing unit 520 ²performs the step ²S315 of determining the mapped security context in FIG. 3 and the step S410 of ²determining the ²first registration request message in FIG. 4.²

[0282] The receiving unit 530 performs a receiving step performed by the ²user equipment in ²the method embodiments. For example, the receiving unit 530 performs the step ²S314 of receiving²the handover command message sent by the MME in FIG. 3 and the step S414 of ²receiving the ²handover command message sent by the MME in FIG. 4.²

[0283] The sending unit 510 and the receiving unit 530 shown in the ²apparatus 50 may ²constitute a transceiver unit that has both receiving and sending functions. ²The processing unit 520 ²may be a processor. The sending unit 510 may be a transmitter, and the ²receiving unit 530 may be²a receiver. The receiver and the transmitter may be integrated to constitute a ²transceiver.²

[0284] FIG. 6 is a schematic structural diagram of user equipment 60 ²applicable to an²43²Date Recue / Date Received 2021-11-19²<DP=44>²CA 03141367 2021-11-19²embodiment of this application. The user equipment 60 may be applied to the ²system shown in ²FIG. 1. For ease of description, FIG. 6 shows only main components of the user ²equipment. As ²shown in FIG. 6, the user equipment 60 includes a processor (corresponding to ²the processing unit ²520 in FIG. 5), a memory, a control circuit, an antenna, and an input / output ²apparatus²(corresponding to the sending unit 510 and the receiving unit 530 in FIG. 5). ²The processor is²configured to control the antenna and the input / output apparatus to send and ²receive a signal. The ²memory is configured to store a computer program. The processor is configured ²to invoke the ²computer program from the memory and run the computer program, to perform a ²corresponding ²procedure and / or operation performed by the user equipment in the security ²context obtaining² methods provided in this application. Details are not described herein again.²

[0285] A person skilled in the art may understand that, for ease of ²description, FIG. 6 shows ²only one memory and only one processor. Actual user equipment may have a ²plurality of ²processors and a plurality of memories. The memory may also be referred to as ²a storage medium, ²a storage device, or the like. This is not limited in this embodiment of this ²application.²

[0286] FIG. 7 is a schematic diagram of a security context obtaining ²apparatus 70 according²to this application. As shown in FIG. 7, the apparatus 70 includes a receiving ²unit 710, a processing ²unit 720, and a sending unit 730.²

[0287] The receiving unit 710 is configured to receive a first ²registration request message sent ²by user equipment, where the first registration request message carries a ²second registration²request message, the second registration request message is integrity ²protected using a first security²context, the first security context is a native security context between the ²user equipment and a ²second AMF, and the first AMF is an AMF providing an access and mobility ²management service ²for the user equipment after the user equipment is handed over from a 4G ²communications system ²to a 5G communications system.²

[0288] The processing unit 720 is configured to determine a mapped security ²context.²

[0289] The sending unit 730 is configured to send the second registration ²request message to ²the second AMY.²

[0290] The apparatus 70 completely corresponds to the first AMF in the ²method embodiments. ²The apparatus 70 may be the first AMF in the method embodiments, or a chip or ²a functional²module inside the first AMF in the method embodiments. The corresponding units ²of the apparatus²70 are configured to perform corresponding steps performed by the first AMF in ²the method²44²Date Recue / Date Received 2021-11-19²<DP=45>²CA 03141367 2021-11-19²embodiments shown in FIG. 3 and FIG. 4.²

[0291] The receiving unit 710 of the apparatus 70 performs a receiving ²step performed by the ²first AMF in the method embodiments. For example, the receiving unit 710 ²performs the step S311 ²of receiving the forward relocation request message sent by the MME in FIG. 3, ²the step S411 of².. receiving the forward relocation request message sent by the MME in FIG. 4, ²the step S316 of²receiving the registration request message sent by the UE in FIG. 3, the step ²S420 of receiving the ²first registration request message sent by the UE in FIG. 3, the step S330 of ²receiving the second ²response message sent by the second AMF in FIG. 3, and the step S460 of ²receiving the security ²context of the UE that is sent by the second AMF in FIG. 4.²

[0292] The processing unit 720 performs a step implemented or processed ²inside the first AMF²in the method embodiments. For example, the processing unit 720 performs the ²step S312 of ²determining the mapped security context in FIG. 3, the step S412 of ²determining the mapped ²security context in FIG. 4, the step S317 of verifying the UE in FIG. 3, and ²the step S430 of ²verifying the UE in FIG. 4.²

[0293] The sending unit 730 performs a sending step performed by the first ²AMF in the method²embodiments. For example, the sending unit 730 performs the step S313 of ²sending the forward ²relocation response message to the MME in FIG. 3, the step S413 of sending the ²forward relocation ²response message to the MME in FIG. 4, the step S310 of sending the second ²request message to ²the second AMF in FIG. 3, and the step S440 of sending the second registration ²request message² to the second AMF in FIG. 4.²

[0294] The receiving unit 710 and the sending unit 730 may constitute a ²transceiver unit that ²has both receiving and sending functions. The processing unit 720 may be a ²processor. The sending ²unit 730 may be a transmitter. The receiving unit 710 may be a receiver. The ²receiver and the ²transmitter may be integrated to constitute a transceiver.²

[0295] As shown in FIG. 8, an embodiment of this application further ²provides a first AMF²80. The first AMF 80 includes a processor 810, a memory 820, and a transceiver ²830. The memory ²820 stores an instruction or a program, and the processor 830 is configured to ²execute the ²instruction or the program stored in the memory 820. When the instruction or ²the program stored ²in the memory 820 is executed, the transceiver 830 is configured to perform ²operations performed²by the receiving unit 710 and the sending unit 730 in the apparatus 70 shown ²in FIG. 7.²

[0296] FIG. 9 is a schematic diagram of a security context obtaining ²apparatus 90 according² Date Recue / Date Received 2021-11-19²<DP=46>²CA 03141367 2021-11-19²to this application. As shown in FIG. 9, the apparatus 90 includes a receiving ²unit 910, a processing ²unit 920, and a sending unit 930.²

[0297] The receiving unit 910 is configured to receive a second ²registration request message ²sent by a first AMF, where the second registration request message is ²integrity protected using a²first security context, and the first security context is a native security ²context between the user²equipment and a second AMF.²

[0298] The processing unit 920 is configured to validate integrity of the ²second registration ²request message.²

[0299] The sending unit 930 is configured to: when the processing unit ²920 successfully²validates the integrity of the second registration request message, send a ²security context of the²user equipment to the first AMF.²

[0300] The apparatus 90 completely corresponds to the second AMF in the ²method ²embodiments. The apparatus 90 may be the second AMF in the method embodiments, ²or a chip or ²a functional module inside the second AMF in the method embodiments. The ²corresponding units²of the apparatus 80 are configured to perform corresponding steps performed by ²the second AMF²in the method embodiments shown in FIG. 3 and FIG. 4.²

[0301] The receiving unit 910 of the apparatus 90 performs a receiving ²step performed by the ²second AMF in the method embodiments. For example, the receiving unit 910 ²performs the step ²S310 of receiving the second request message sent by the first AMF in FIG. 3 ²and the step S440²of receiving the second registration request message sent by the first AMF in ²FIG. 4.²

[0302] The processing unit 920 performs a step implemented or processed ²inside the second ²AMF in the method embodiments. For example, the processing unit 920 performs ²the step S320 ²of determining that the UE does not need to be verified in FIG. 3 and the step ²S450 of validating ²the integrity of the second registration request message in FIG. 4.²

[0303] The sending unit 930 performs a sending step performed by the second ²AMF in the²method embodiments. For example, the sending unit 930 performs the step S330 ²of sending the ²second response message to the first AMF in FIG. 3 and the step S460 of ²sending the security ²context of the UE to the first AMF in FIG. 4.²

[0304] The receiving unit 910 and the sending unit 930 may constitute a ²transceiver unit that²has both receiving and sending functions. The processing unit 920 may be a ²processor. The sending²unit 930 may be a transmitter, and the receiving unit 910 may be a receiver. ²The receiver and the²46²Date Recue / Date Received 2021-11-19²<DP=47>²CA 03141367 2021-11-19²transmitter may be integrated to constitute a transceiver.²

[0305] As shown in FIG. 10, an embodiment of this application further ²provides a second AMF ²100. The second AMF 100 includes a processor 1010, a memory 1020, and a ²transceiver 1030. ²The memory 1020 stores an instruction or a program, and the processor 1030 is ²configured to²execute the instruction or the program stored in the memory 1020. When the ²instruction or the²program stored in the memory 1020 is executed, the transceiver 1030 is ²configured to perform ²operations performed by the receiving unit 910 and the sending unit 930 in the ²apparatus 90 shown ²in FIG. 9.²

[0306] An embodiment of this application further provides a computer-²readable storage²medium. The computer-readable storage medium stores an instruction. When the ²instruction is run²on a computer, the computer is enabled to perform steps performed by the first ²AMF in the methods ²shown in FIG. 3 and FIG. 4.²10307] An embodiment of this application further provides a computer-²readable storage ²medium. The computer-readable storage medium stores an instruction. When the ²instruction is run².. on a computer, the computer is enabled to perform steps performed by the ²second AMF in the²methods shown in FIG. 3 and FIG. 4.²

[0308] An embodiment of this application further provides a computer ²program product that ²includes an instruction. When the computer program product runs on a computer, ²the computer is ²enabled to perform steps performed by the first AMF in the methods shown in ²FIG. 3 and FIG. 4.²

[0309] An embodiment of this application further provides a computer ²program product that²includes an instruction. When the computer program product runs on a computer, ²the computer is ²enabled to perform steps performed by the second AMF in the methods shown in ²FIG. 3 and FIG. ²4.²

[0310] An embodiment of this application further provides a chip, ²including a processor. The².. processor is configured to read a computer program stored in a memory and ²run the computer²program, to perform a corresponding operation and / or procedure performed by ²the second AMF ²in the security context obtaining methods provided in this application. ²Optionally, the chip further ²includes the memory. The memory is connected to the processor through a ²circuit or a cable. The ²processor is configured to read the computer program from the memory and ²execute the computer²program. Optionally, the chip further includes a communications interface. The ²processor is²connected to the communications interface. The communications interface is ²configured to receive²47²Date Recue / Date Received 2021-11-19²<DP=48>²CA 03141367 2021-11-19²data and / or information that needs to be processed. The processor obtains the ²data and / or ²information from the communications interface, and processes the data and / or ²information. The ²communications interface may be an input / output interface.²

[0311] This application further provides a chip, including a processor. ²The processor is²configured to invoke a computer program stored in a memory and run the ²computer program, to²perform a corresponding operation and / or procedure performed by the first AMF ²in the security ²context obtaining methods provided in this application. Optionally, the chip ²further includes the ²memory. The memory is connected to the processor through a circuit or a cable. ²The processor is ²configured to read the computer program from the memory and execute the ²computer program.²Optionally, the chip further includes a communications interface. The ²processor is connected to²the communications interface. The communications interface is configured to ²receive data and / or ²information that needs to be processed. The processor obtains the data and / or ²information from ²the communications interface, and processes the data and / or information. The ²communications ²interface may be an input / output interface.²

[0312] A person of ordinary skill in the art may be aware that, in ²combination with the²examples described in the embodiments disclosed in this specification, units ²and algorithm steps ²may be implemented by electronic hardware or a combination of computer ²software and electronic ²hardware. Whether the functions are performed by hardware or software depends ²on particular ²applications and design constraints of the technical solutions. A person ²skilled in the art may use²different methods to implement the described functions for each particular ²application, but it²should not be considered that the implementation goes beyond the scope of this ²application.²

[0313] It may be clearly understood by a person skilled in the art that, ²for the purpose of ²convenient and brief description, for detailed working processes of the ²foregoing system, apparatus, ²and unit, refer to corresponding processes in the foregoing method ²embodiments, and details are² not described herein again.²

[0314] In the several embodiments provided in this application, it should ²be understood that ²the disclosed system, apparatus, and method may be implemented in other ²manners. For example, ²the described apparatus embodiment is merely an example. For example, division ²into the units is ²merely logical function division and may be other division in actual ²implementation. For example,²a plurality of units or components may be combined or integrated into another ²system, or some²features may be ignored or not performed. In addition, the displayed or ²discussed mutual couplings²48²Date Recue / Date Received 2021-11-19²<DP=49>²CA 03141367 2021-11-19²or direct couplings or communication connections may be implemented by using ²some interfaces. ²The indirect couplings or communication connections between the apparatuses or ²units may be ²implemented in electrical, mechanical, or other forms.²

[0315] The units described as separate parts may or may not be physically ²separate, and parts²displayed as units may or may not be physical units, may be located in one ²position, or may be²distributed on a plurality of network units. Some or all of the units may be ²selected based on actual ²requirements to achieve the objectives of the solutions of the embodiments.²

[0316] In addition, functional units in the embodiments of this ²application may be integrated ²into one processing unit, or each of the units may exist alone physically, or ²two or more units are² integrated into one unit.²

[0317] When the functions are implemented in a form of a software ²functional unit and sold ²or used as an independent product, the functions may be stored in a computer-²readable storage ²medium. Based on such an understanding, the technical solutions of this ²application essentially, or ²the part contributing to the prior art, or some of the technical solutions may ²be implemented in a²form of a software product. The software product is stored in a storage ²medium, and includes²several instructions for instructing a computer device (which may be a ²personal computer, a server, ²a network device, or the like) to perform all or some of the steps of the ²methods described in the ²embodiments of this application. The foregoing storage medium includes: any ²medium that can ²store program code, such as a USB flash drive, a removable hard disk, a read-²only memory (Read-²Only Memory, ROM), a random access memory ((R)ANdom Access Memory, RAM), a ²magnetic²disk, or an optical disc.²

[0318] In addition, the term "and / or" in this application describes only ²an association ²relationship for describing associated objects and represents that three ²relationships may exist. For ²example, A and / or B may represent the following three cases: Only A exists, ²both A and B exist,²and only B exists. In addition, the character "I" in this specification ²generally indicates an "or"²relationship between the associated objects. The term "at least one" in this ²application may ²represent "one" and "two or more". For example, at least one of A, B, and C ²may represent: Only ²A exists, only B exists, only C exists, both A and B exist, and both A and C ²exist, C and B exist, ²and A, B, and C exist.²

[0319] The foregoing descriptions are merely specific implementations of ²this application, but²are not intended to limit the protection scope of this application. Any ²variation or replacement²49²Date Recue / Date Received 2021-11-19²<DP=50>²CA 03141367 2021-11-19²readily figured out by a person skilled in the art within the technical scope ²disclosed in this ²application shall fall within the protection scope of this application. ²Therefore, the protection scope ²of this application shall be subject to the protection scope of the claims.² Date Recue / Date Received 2021-11-19²

Claims

<DP=1>²CA 03141367 2021-11-19²CLAIMS²What is claimed is:²1. A security context obtaining method, comprising:²receiving, by a first access and mobility management function AMF, a first ²registration ²request message sent by user equipment, wherein the first registration request ²message carries a ²second registration request message, wherein²the second registration request message is integrity protected using a first ²security context, ²the first security context is a native security context between the user ²equipment and a second ²AMF, and the first AMF is an AMF providing an access and mobility management ²service for the ²user equipment after the user equipment is handed over from a 4G ²communications system to a ²5G communications system;²sending, by the first AMF, the second registration request message to the ²second AMF; ²validating, by the second AMF, integrity of the second registration request ²message; and²if the second AMF successfully validates the integrity of the second ²registration request ²message, sending, by the second AMF, a security context of the user equipment ²to the first AMF.²2. The method according to claim 1, wherein the security context of the user ²equipment ²comprises:²the first security context, or a second security context obtained based on the ²first security ²context.²3. The method according to claim 1 or 2, wherein the sending, by the first ²AMF, the second ²registration request message to the second AMF comprises:²sending, by the first AMF, a user equipment context transfer service invoking ²request to the ²second AMF, wherein the user equipment context transfer service invoking ²request carries the ²second registration request message.²4. The method according to any one of claims 1 to 3, wherein the sending, by ²the second AMF, ²a security context of the user equipment to the first AMF comprises:²51²Date Recue / Date Received 2021-11-19²<DP=2>²CA 03141367 2021-11-19²sending, by the second AMF, a first response message to the first AMF, wherein ²the first ²response message carries the security context of the user equipment.²5. The method according to any one of claims 1 to 4, wherein the method ²further comprises:²when the first AMF receives a message indicating that the second AMF fails to ²validate the ²integrity of the second registration request message, continuing, by the first ²AMF, to use a mapped ²security context, or initiating initial authentication to the user equipment.²6. The method according to claim 5, wherein the mapped security context is ²obtained based ²on a security context between a mobility management entity MME and the user ²equipment, and ²the MME is a network element in the 4G communications system.²7. The method according to any one of claims 1 to 6, wherein the validating, ²by the second ²AMF, integrity of the second registration request message comprises:²validating, by the second AMF, the integrity of the second registration ²request message based ²on the first security context.²8. A security context obtaining method, comprising:²determining, by user equipment, a second registration request message, wherein ²the second ²registration request message is integrity protected using a first security ²context, and the first ²security context is a native security context between the user equipment and a ²second access and ²mobility management function AMF; and²sending, by the user equipment, a first registration request message to a ²first AMF, wherein ²the first registration request message carries the second registration request ²message, wherein²the first AMF is an AMF providing an access and mobility management service ²for the user ²equipment after the user equipment is handed over from a 4G communications ²system to a 5G ²communications system.²9. The method according to claim 8, wherein the method further comprises:²if a non-access stratum security mode command NAS SMC message sent by the ²first AMF is²received, validating integrity of the NAS SMC; and²52²Date Recue / Date Received 2021-11-19²<DP=3>²CA 03141367 2021-11-19²if the validation is successful, sending a non-access stratum security mode ²complete message ²to the first AMF.²10. A communications system, wherein the communications system comprises a ²first access ²and mobility management function AMF and a first AMF, wherein²the first AMF is configured to receive a first registration request message ²sent by user ²equipment, wherein the first registration request message carries a second ²registration request ²message, the second registration request message is integrity protected using ²a first security ²context, the first security context is a native security context between the ²user equipment and the ²second AMF, and the first AMF is an AMF providing an access and mobility ²management service ²for the user equipment after the user equipment is handed over from a 4G ²communications system ²to a 5G communications system;²the first AMF is further configured to send the second registration request ²message to the ²second AMF;²the second AMF is configured to validate integrity of the second registration ²request message; ²and²the second AMF is further configured to: if the integrity of the second ²registration request ²message is successfully validated, send a security context of the user ²equipment to the first AMF.²11. The communications system according to claim 10, wherein the security ²context of the ²user equipment comprises:²the first security context, or a second security context obtained based on the ²first security ²context.²12. The communications system according to claim 10 or 11, wherein²the first AMF is specifically configured to send a user equipment context ²transfer service ²invoking request to the second AMF, wherein the user equipment context ²transfer service invoking ²request carries the second registration request message.²13. The communications system according to any one of claims 10 to 12, wherein ²²the second AMF is specifically configured to send a first response message to ²the first AMF,²53²Date Recue / Date Received 2021-11-19²<DP=4>²CA 03141367 2021-11-19²wherein the first response message carries the security context of the user ²equipment.²14. The communications system according to any one of claims 10 to 13, wherein²the first AMF is further configured to: when a message indicating that the ²second AMF fails ²to validate the integrity of the second registration request message is ²received, continue to use a ²mapped security context, or initiate initial authentication to the user ²equipment.²15. The communications system according to claim 14, wherein the mapped ²security context ²is obtained based on a security context between a mobility management entity ²MME and the user ²equipment, and the MME is a network element in the 4G communications system.²16. The communications system according to any one of claims 10 to 15, wherein²the second AMF is specifically configured to validate the integrity of the ²second registration²request message based on the first security context.²17. A security context obtaining apparatus, comprising:²a processing unit, configured to determine a second registration request ²message, wherein the ²second registration request message is integrity protected using a first ²security context, and the ²first security context is a native security context between the user equipment ²and a second access ²and mobility management function AMF; and²a sending unit, configured to send a first registration request message to a ²first AMF, wherein ²the first registration request message carries the second registration request ²message, and the first ²AMF is an AMF providing an access and mobility management service for the user ²equipment ²after the user equipment is handed over from a 4G communications system to a ²5G ²communications system.²18. The apparatus according to claim 17, wherein the apparatus further ²comprises a receiving ²unit;²the processing unit is configured to: if the receiving unit receives a non-²access stratum ²security mode command NAS SMC message sent by the first AMF, validate ²integrity of the NAS ²SMC; and²54²Date Recue / Date Received 2021-11-19²<DP=5>²CA 03141367 2021-11-19²the sending unit is further configured to: if the validation is successful, ²send a non-access ²stratum security mode complete message to the first AMF.²19. A computer-readable storage medium, wherein the computer-readable medium ²stores a ²computer program, and when the computer program is run on a computer, the ²computer is enabled ²to perform the method according to any one of claims 1 to 9.²20. A security context obtaining method, wherein the method comprises:²receiving, by a first access and mobility management function AMF, a first ²registration²request message sent by user equipment UE;²validating, by the first AMF, integrity protection for the first registration ²request message;²if the first AMF successfully validates integrity protection for the first ²registration request²message, sending, by the first AMF, a second request message to a second AMF;²receiving, by the second AMF, the second request message; and²if the second request message carries indication information and the ²indication information²is used to indicate that the UE is validated, sending, by the second AMF, a ²security context of the²UE to the first AMF.²21. The method according to claim 20, wherein the method further comprises:²sending, by a mobility management network element MME, a forward relocation ²request ²message to the first AMF, wherein the forward relocation request message ²comprises a security ²context between the UE and the MME;²determining, by the first AMF, a mapped security context based on the security ²context ²between the user equipment and the MME; and²the validating, by the first AMF, integrity protection for the first ²registration request message ²comprises:²validating, by the first AMF, integrity protection for the first registration ²request message by ²using the mapped security context.²22. The method according to claim 20 or 21, wherein the first registration ²request message ²further comprises an identity 5G-GUTI of the user equipment.² Date Recue / Date Received 2021-11-19²<DP=6>²CA 03141367 2021-11-19²23. The method according to claim 22, wherein the indication information is ²the 5G-GUTI.²24. The method according to any one of claims 20 to 22, wherein the indication ²information ²is a reason value.²25. A security context obtaining system, wherein the system comprises a first ²access and ²mobility management function AMF and a second AMF;²the first AMF is configured to: receive a first registration request message ²sent by user ²equipment UE; validate integrity protection for the first registration request ²message; and if ²successfully validating integrity protection for the first registration ²request message, send a second ²request message to the second AMF; and²the second AMF is configured to: receive the second request message; and if ²the second ²request message carries indication information and the indication information ²is used to indicate ²that the UE is validated, send a security context of the UE to the first AMF.²26. The system according to claim 25, wherein the system further comprises a ²mobility ²management network element MME;²the MME is configured to send a forward relocation request message to the ²first AMF, ²wherein the forward relocation request message comprises a security context ²between the UE and ²the MME; and²the first AMF is further configured to determine a mapped security context ²based on the ²security context between the user equipment and the MME; wherein²the validating integrity protection for the first registration request message ²comprises:²validating integrity protection for the first registration request message by ²using the mapped ²security context.²27. The system according to claim 25 or 26, wherein the first registration ²request message ²further comprises an identity 5G-GUTI of the user equipment.²28. The system according to claim 27, wherein the indication information is ²the 5G-GUTI.²56²Date Recue / Date Received 2021-11-19²<DP=7>²CA 03141367 2021-11-19²29. The system according to any one of claims 25 to 27, wherein the indication ²information ²is a reason value.²30. A security context obtaining method, wherein the method comprises:²receiving, by a first access and mobility management function AMF, a first ²registration ²request message sent by user equipment UE;²validating, by the first AMF, integrity protection for the first registration ²request message; ²and²if the first AMF successfully validates integrity protection for the first ²registration request ²message, sending, by the first AMF, a second request message to a second AMF, ²wherein the ²second request message carries indication information and the indication ²information is used to ²indicate that the UE is validated.²31. The method according to claim 30, wherein the method further comprises:²receiving, by the first AMF, a forward relocation request message sent by a ²mobility ²management network element MME, wherein the forward relocation request message ²comprises ²a security context between the user equipment and the MME;²determining, by the first AMF, a mapped security context based on the security ²context ²between the UE and the MME; and²the validating, by the first AMF, integrity protection for the first ²registration request message ²comprises:²validating, by the first AMF, integrity protection for the first registration ²request message by ²using the mapped security context.²32. The method according to claim 30 or 31, wherein the first registration ²request message ²further comprises an identity 5G-GUTI of the user equipment.²33. The method according to claim 32, wherein the indication information is ²the 5G-GUTI.²34. The method according to any one of claims 30 to 32, wherein the indication ²information²57²Date Recue / Date Received 2021-11-19²<DP=8>²CA 03141367 2021-11-19²is a reason value.²35. A security context obtaining method, wherein the method comprises:²receiving, by a second access and mobility management function AMF, a request ²message ²sent by a first AMF; and²if the request message carries indication information and the indication ²information is used ²to indicate that user equipment UE is validated, sending, by the second AMF, a ²security context of ²the UE to the first AMF.²36. The method according to claim 35, wherein before the sending, by the ²second AMF, a²security context of the UE to the first AMF, the method further comprises:²skipping, by the second AMF, authentication on the UE.²37. The method according to claim 35 or 36, wherein the indication information ²is the 5G-²GUTI.²38. The method according to claim 35 to 36, wherein the indication information ²is a reason ²value.²39. A communications apparatus, wherein the apparatus comprises a processor, a ²memory, ²and a transceiver; the memory stores an instruction, and the processor is ²coupled to the transceiver; ²and when the instruction stored in the memory is executed, the processor ²performs the following ²operations:²receiving a first registration request message sent by user equipment UE;²validating integrity protection for the first registration request message; ²and²if successfully validating integrity protection for the first registration ²request message, ²sending a second request message to a second AMF, wherein the second request ²message carries ²indication information and the indication information is used to indicate that ²the UE is validated.²40. The communications apparatus according to claim 39, wherein the processor ²further ²performs the following operations:²58²Date Recue / Date Received 2021-11-19²<DP=9>²CA 03141367 2021-11-19²receiving a forward relocation request message sent by a mobility management ²network ²element MME, wherein the forward relocation request message comprises a ²security context ²between the user equipment and the MME;²determining a mapped security context based on the security context between ²the UE and the ²MME; and²the validating integrity protection for the first registration request message ²comprises: ²validating integrity protection for the first registration request message by ²using the mapped ²security context.²41. The communications apparatus according to claim 39 or 40, wherein the ²first registration ²request message further comprises an identity 5G-GUTI of the user equipment.²42. The communications apparatus according to claim 41, wherein the indication ²information ²is the 5G-GUTI.²43. The communications apparatus according to any one of claims 39 to 41, ²wherein the ²indication information is a reason value.²44. A communications apparatus, wherein the apparatus comprises a processor, a ²memory, ²and a transceiver; the memory stores an instruction, and the processor is ²coupled to the transceiver; ²and when the instruction stored in the memory is executed, the processor ²performs the following ²operations:²receiving a request message sent by a first AMF; and²if the request message carries indication information and the indication ²information is used ²to indicate that user equipment UE is validated, sending a security context of ²the UE to the first ²AMF.²45. The communications apparatus according to claim 44, wherein the processor ²further²performs the following operation:²skipping authentication on the UE.²59²Date Recue / Date Received 2021-11-19²<DP=10>²CA 03141367 2021-11-19²46. The communications apparatus according to claim 44 or 45, wherein the ²indication ²information is the 5G-GUTI.²47. The communications apparatus according to claim 44 to 45, wherein the ²indication ²information is a reason value.² Date Recue / Date Received 2021-11-19²