[go: up one dir, main page]

CN105340319B - Method and equipment for providing and acquiring security context - Google Patents

Method and equipment for providing and acquiring security context Download PDF

Info

Publication number
CN105340319B
CN105340319B CN201480035973.7A CN201480035973A CN105340319B CN 105340319 B CN105340319 B CN 105340319B CN 201480035973 A CN201480035973 A CN 201480035973A CN 105340319 B CN105340319 B CN 105340319B
Authority
CN
China
Prior art keywords
core network
network device
message
security context
nas message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201480035973.7A
Other languages
Chinese (zh)
Other versions
CN105340319A (en
Inventor
张丽佳
陈璟
许怡娴
张万强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from PCT/CN2013/086088 external-priority patent/WO2015061951A1/en
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201480035973.7A priority Critical patent/CN105340319B/en
Publication of CN105340319A publication Critical patent/CN105340319A/en
Application granted granted Critical
Publication of CN105340319B publication Critical patent/CN105340319B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了一种安全上下文的提供、获取方法及设备,用以实现特定网络下的核心网设备可以获取安全上下文。所述的提供方法包括:第一核心网设备接收来自UE的NAS消息;第一核心网设备当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息;第一核心网设备接收所述第二核心网设备发送的上下文请求,所述上下文请求中包括重路由指示、UE的标识以及密钥集标识,第一核心网设备根据所述UE的标识以及密钥集标识,查找对应的安全上下文,并将该安全上下文发送给所述第二核心网设备,其中,所述根密钥,为安全上下文中的根密钥。

Figure 201480035973

The invention discloses a method and device for providing and acquiring security context, which are used to realize that core network devices under a specific network can acquire security context. The providing method includes: the first core network device receives the NAS message from the UE; when the first core network device determines that the NAS message needs to be rerouted to the second core network device in the specific network, sending the information to the access network device. Send a rerouting command, where the rerouting command includes a NAS message and information used to determine the second core network device; the first core network device receives a context request sent by the second core network device, the context request including the rerouting indication, the UE's identity and the key set identity, the first core network device searches for the corresponding security context according to the UE's identity and the key set identity, and sends the security context to the second core network device, wherein the root key is the root key in the security context.

Figure 201480035973

Description

一种安全上下文的提供、获取方法及设备A security context providing, obtaining method and device

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种安全上下文的提供、获取方法及设备。The present invention relates to the field of communication technologies, and in particular, to a method and device for providing and acquiring a security context.

背景技术Background technique

版本(Release,R)10及R10之后的用户设备(User Equipment,UE)具有上报低接入优先级指示(Low Access Priority Indicator,LAPI)给演进型基站(evolved NodeB,eNB)的能力,这样eNB可以根据UE上报的指示为UE选择特定网络,从而防止进行特定业务的UE对普通网络带来的影响,例如大量低优先级UE接入网络带来的网络拥塞。其中,所述特定业务,例如机器类通信(Machine Type Communication,MTC)。特定网络是服务于特定业务的网络,例如机器类通信网络,专门服务于机器类通信,所有的机器类通信设备都接入到这个网络进行通信,可以防止机器类通信给普通网络带来的冲击。特定网络的网络架构与普通网络一样,只是网络实体功能上有些改变。User Equipment (UE) after Release (R) 10 and R10 has the ability to report a Low Access Priority Indicator (LAPI) to an evolved base station (evolved NodeB, eNB), so that the eNB A specific network can be selected for the UE according to the indication reported by the UE, so as to prevent the impact of the UE performing specific services on the ordinary network, such as network congestion caused by a large number of low-priority UEs accessing the network. Wherein, the specific service is, for example, machine type communication (Machine Type Communication, MTC). A specific network is a network that serves a specific business, such as a machine-type communication network, which is dedicated to machine-type communication. All machine-type communication devices are connected to this network for communication, which can prevent the impact of machine-type communication on ordinary networks. . The network architecture of a specific network is the same as that of an ordinary network, but there are some changes in the function of the network entity.

目前广泛应用的R10之前的UE并不支持此功能,为了在不改变现有UE前提下实现此功能,现有技术提出了基于网络侧的方案,使得R10之前的UE也可以选择在特定网络进行通信。具体方法参见图1,UE向网络侧发起附着请求或位置更新请求,移动性管理实体(Mobile Management Entity,MME)向归属用户服务器(Home Subscriber Server,HSS)请求签约数据,当签约数据中包含UE在特定网络通信的指示时,MME通过eNB将非接入层(NonAccess Stratum,NAS)消息转发给特定(specific)MME,其中,所述NAS消息,例如附着请求或位置更新请求,所述specific MME,即特定网络中的MME。Currently widely used pre-R10 UEs do not support this function. In order to realize this function without changing the existing UE, the prior art proposes a network-side-based solution, so that pre-R10 UEs can also choose to perform operations on a specific network. communication. The specific method is shown in Fig. 1. The UE initiates an attach request or a location update request to the network side, and the mobility management entity (Mobile Management Entity, MME) requests subscription data from the Home Subscriber Server (HSS), and when the subscription data includes the UE When a specific network communication is indicated, the MME forwards a non-access stratum (NonAccess Stratum, NAS) message to a specific (specific) MME through the eNB, wherein the NAS message, such as an attach request or a location update request, the specific MME , that is, the MME in a specific network.

在MME向HSS获取签约数据之前,UE与MME之间已经建立了安全关联,网络侧重新选择specific MME的行为对UE来说是不可知的,specific MME需要从MME处获取安全上下文,从而利用该安全上下文与UE进行安全通信。另外,如果该NAS消息被完整性保护,需要考虑specific MME如何对重路由(reroute)的NAS消息进行完整性校验。Before the MME obtains the subscription data from the HSS, the security association has been established between the UE and the MME. The behavior of the network side to reselect the specific MME is unknown to the UE. The specific MME needs to obtain the security context from the MME, so as to use the security context. The security context communicates securely with the UE. In addition, if the NAS message is integrity protected, it needs to consider how the specific MME performs the integrity check on the rerouted NAS message.

现有技术中的跟踪区域更新(Tracking Area Update,TAU)过程如下,假设UE发起TAU时,新MME(MMEn)上没有可用的安全上下文,需要向旧MME(MMEo)索要。参见图2,具体包括:The Tracking Area Update (TAU) process in the prior art is as follows. It is assumed that when the UE initiates a TAU, there is no available security context on the new MME (MMEn) and needs to ask the old MME (MMEo) for it. See Figure 2, including:

MMEn向MMEo发送安全上下文的请求消息,该请求消息中包括MMEo为UE分配的全球唯一临时标识(Globally Unique Temporary UE Identity,GUTI),即旧GUTI(GUTIo),该请求消息还包括从UE处接收的整个TAU消息;MMEn sends a security context request message to MMEo, where the request message includes the Globally Unique Temporary UE Identity (GUTI) allocated by MMEo to the UE, namely the old GUTI (GUTIo), and the request message also includes the information received from the UE. The entire TAU message of ;

MMEo根据GUTIo从数据库中检索用户数据,利用检索到的安全上下文验证TAU请求的完整性,并将认证数据(authentication data)和UE的国际移动签约用户识别码(International Mobile Subscriber Identification Number,IMSI)发送给MMEn,其中,所述认证数据中包含安全上下文,MMEn保存接收到的安全上下文。MMEo retrieves user data from the database according to GUTIo, uses the retrieved security context to verify the integrity of the TAU request, and sends the authentication data (authentication data) and the UE's International Mobile Subscriber Identification Number (IMSI) To the MMEn, wherein the authentication data includes a security context, and the MMEn stores the received security context.

综上所述,在MME重选场景下,现有技术无法解决specific MME如何获取UE的安全上下文的问题,导致specific MME不能和UE进行安全通信。To sum up, in the MME reselection scenario, the prior art cannot solve the problem of how the specific MME obtains the security context of the UE, so that the specific MME cannot perform secure communication with the UE.

发明内容SUMMARY OF THE INVENTION

本发明提供一种安全上下文的提供、获取方法及设备,用以实现特定网络下的核心网设备可以获取UE的安全上下文,从而使得特定网络下的核心网设备与UE可以进行安全通信。The present invention provides a method and device for providing, obtaining, and obtaining a security context, so as to realize that a core network device under a specific network can obtain the security context of a UE, so that the core network device under a specific network can communicate with the UE securely.

第一方面,本发明实施例提供的一种提供安全上下文的方法,包括:In a first aspect, a method for providing a security context provided by an embodiment of the present invention includes:

第一核心网设备接收用户设备UE发送的非接入层NAS消息;The first core network device receives the non-access stratum NAS message sent by the user equipment UE;

当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第一核心网设备向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息;When it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the first core network device sends a rerouting command to the access network device, where the rerouting command Describe the information of the second core network equipment;

第一核心网设备接收所述第二核心网设备发送的上下文请求,所述上下文请求中包括UE的标识以及密钥集标识,第一核心网设备根据所述UE的标识以及密钥集标识,查找对应的安全上下文,并将该安全上下文发送给所述第二核心网设备。The first core network device receives the context request sent by the second core network device, where the context request includes the identifier of the UE and the identifier of the key set, and the first core network device, according to the identifier of the UE and the identifier of the key set, Find the corresponding security context, and send the security context to the second core network device.

结合第一方面,在第一种可能的实现方式中,第一核心网设备向接入网设备发送重路由命令之前,该方法还包括:With reference to the first aspect, in a first possible implementation manner, before the first core network device sends the rerouting command to the access network device, the method further includes:

第一核心网设备对接收到的NAS消息进行重构,所述重路由命令中包含的NAS消息,为重构的NAS消息。The first core network device reconstructs the received NAS message, and the NAS message included in the rerouting command is the reconstructed NAS message.

结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,第一核心网设备对接收到的来自所述UE的NAS消息进行重构,包括:With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the first core network device reconstructs the received NAS message from the UE, including:

第一核心网设备利用当前安全上下文中的密钥集标识,替换该UE发送的NAS消息中的密钥集标识;和/或,The first core network device uses the key set identifier in the current security context to replace the key set identifier in the NAS message sent by the UE; and/or,

第一核心网设备根据当前安全上下文计算完整性保护校验值,并将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE。The first core network device calculates the integrity protection check value according to the current security context, and uses the integrity protection check value as the message authentication code MAC information element IE in the NAS message sent by the UE.

结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE,包括:With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the integrity protection check value is used as the message authentication code MAC information element IE in the NAS message sent by the UE, include:

将所述完整性保护校验值填充到所述UE发送的NAS消息中的消息认证码MAC信元IE;或Filling the integrity protection check value into the message authentication code MAC information element IE in the NAS message sent by the UE; or

将所述完整性保护校验值替换所述UE发送的NAS消息中的消息认证码MAC。Replace the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.

结合第一方面的第二种可能的实现方式,在第四种可能的实现方式中,第一核心网设备对接收到的来自所述UE的NAS消息进行重构,还包括:With reference to the second possible implementation manner of the first aspect, in a fourth possible implementation manner, the first core network device reconstructs the received NAS message from the UE, and further includes:

第一核心网设备将第一核心网设备为所述UE分配的标识替换从该UE接收到的NAS消息中的UE的标识。The first core network device replaces the identifier of the UE in the NAS message received from the UE with the identifier allocated by the first core network device to the UE.

结合第一方面,在第五种可能的实现方式中,所述密钥集标识包含在所述上下文请求中;或者,With reference to the first aspect, in a fifth possible implementation manner, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

结合第一方面,在第六种可能的实现方式中,第一核心网设备确定当前的安全上下文后,将该安全上下文发送给第二核心网设备前,该方法还包括:With reference to the first aspect, in a sixth possible implementation manner, after the first core network device determines the current security context and before sending the security context to the second core network device, the method further includes:

第一核心网设备利用当前的安全上下文验证该上下文请求中携带的NAS消息的完整性;The first core network device uses the current security context to verify the integrity of the NAS message carried in the context request;

则,所述第一核心网设备将该安全上下文发送给第二核心网设备的步骤,是当所述验证成功时执行的。Then, the step of sending the security context by the first core network device to the second core network device is performed when the verification is successful.

结合第一方面的第六种可能的实现方式,在第七种可能的实现方式中,第一核心网设备利用当前与该UE共享的安全上下文验证该上下文请求中携带的NAS消息的完整性,包括:With reference to the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner, the first core network device verifies the integrity of the NAS message carried in the context request by using the security context currently shared with the UE, include:

第一核心网设备验证该上下文请求中携带的NAS消息中的完整性保护校验值或者消息认证码MAC值;或者The first core network device verifies the integrity protection check value or the message authentication code MAC value in the NAS message carried in the context request; or

第一核心网设备验证该上下文请求中的完整性保护校验值。The first core network device verifies the integrity protection check value in the context request.

结合第一方面,在第八种可能的实现方式中,所述重路由命令中还包括:With reference to the first aspect, in an eighth possible implementation manner, the rerouting command further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

结合第一方面,在第九种可能的实现方式中,所述上下文请求中还包括:With reference to the first aspect, in a ninth possible implementation manner, the context request further includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

第二方面,本发明实施例提供的一种获取安全上下文的方法,包括:In a second aspect, a method for obtaining a security context provided by an embodiment of the present invention includes:

第二核心网设备接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;The second core network device receives a specific message sent by the access network device, where the specific message includes a non-access stratum NAS message;

第二核心网设备根据所述特定消息确定第一核心网设备,并向第一核心网设备发送上下文请求,所述上下文请求中包括UE的标识以及密钥集标识;The second core network device determines the first core network device according to the specific message, and sends a context request to the first core network device, where the context request includes the identifier of the UE and the identifier of the key set;

第二核心网设备接收第一核心网设备发送的上下文响应,并从中获取安全上下文,该安全上下文是第一核心网设备根据所述上下文请求中所述UE的标识以及密钥集标识确定的The second core network device receives the context response sent by the first core network device, and obtains a security context therefrom, where the security context is determined by the first core network device according to the UE identifier and the key set identifier in the context request

结合第二方面,在第一种可能的实现方式中,所述NAS消息中包含第一核心网设备为所述UE分配的标识,第二核心网设备根据该标识确定第一核心网设备。With reference to the second aspect, in a first possible implementation manner, the NAS message includes an identifier allocated by the first core network device to the UE, and the second core network device determines the first core network device according to the identifier.

结合第二方面,在第二种可能的实现方式中,所述特定消息中还包括第一核心网设备的标识信息,第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。With reference to the second aspect, in a second possible implementation manner, the specific message further includes identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device network equipment.

结合第二方面,在第三种可能的实现方式中,所述密钥集标识包含在所述上下文请求中;或者,With reference to the second aspect, in a third possible implementation manner, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

结合第二方面、或结合第二方面的第一种可能的实现方式、或结合第二方面的第二种可能的实现方式、结合第二方面的第三种可能的实现方式,在第四种可能的实现方式中,第二核心网设备获取的所述UE的安全上下文中,包含第一核心网设备保护NAS消息所使用的加密算法和完整性保护算法。In combination with the second aspect, or in combination with the first possible implementation manner of the second aspect, or in combination with the second possible implementation manner of the second aspect, in combination with the third possible implementation manner of the second aspect, in the fourth In a possible implementation manner, the security context of the UE acquired by the second core network device includes the encryption algorithm and the integrity protection algorithm used by the first core network device to protect the NAS message.

结合第二方面的第四种可能的实现方式,在第五种可能的实现方式中,第二核心网设备获取所述UE的安全上下文后,该方法还包括:With reference to the fourth possible implementation manner of the second aspect, in a fifth possible implementation manner, after the second core network device acquires the security context of the UE, the method further includes:

当第二核心网设备需要选择新的算法时,第二核心网设备利用新的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,其中包含新的算法的标识;其中,所述新的算法包括加密算法和/或完整性保护算法;When the second core network device needs to select a new algorithm, the second core network device uses the new algorithm to derive a new NAS key, and sends a NAS security mode command message to the UE, which contains the identifier of the new algorithm; wherein, The new algorithm includes an encryption algorithm and/or an integrity protection algorithm;

第二核心网设备接收该UE反馈的NAS安全模式完成消息。The second core network device receives the NAS security mode completion message fed back by the UE.

结合第二方面,在第六种可能的实现方式中,所述上下文请求中还包括:With reference to the second aspect, in a sixth possible implementation manner, the context request further includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

结合第二方面,在第七种可能的实现方式中,所述特定消息中还包括:With reference to the second aspect, in a seventh possible implementation manner, the specific message further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

第三方面,本发明实施例提供的一种重路由命令的接收处理方法,包括:In a third aspect, a method for receiving and processing a rerouting command provided by an embodiment of the present invention includes:

接入网设备接收第一核心网设备发送的重路由命令,其中包含非接入层NAS消息和用于确定第二核心网设备的指示信息;The access network device receives the rerouting command sent by the first core network device, which includes a non-access stratum NAS message and indication information for determining the second core network device;

接入网设备根据所述指示信息,确定所述第二核心网设备,并向所述第二核心网设备发送携带所述NAS消息的特定消息。The access network device determines the second core network device according to the indication information, and sends a specific message carrying the NAS message to the second core network device.

结合第三方面,在第一种可能的实现方式中,所述特定消息中还包括:With reference to the third aspect, in a first possible implementation manner, the specific message further includes:

重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

结合第三方面,或结合第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述特定消息中还包括:In combination with the third aspect, or in combination with the first possible implementation manner of the third aspect, in the second possible implementation manner, the specific message further includes:

第一核心网设备的标识信息,所述第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

结合第三方面,在第三种可能的实现方式中,所述NAS消息是所述第一核心网设备对接收到的UE发送的NAS消息进行重构后的NAS消息。With reference to the third aspect, in a third possible implementation manner, the NAS message is a NAS message reconstructed by the first core network device on the received NAS message sent by the UE.

结合第三方面,在第四种可能的实现方式中,所述重路由命令中还包括:With reference to the third aspect, in a fourth possible implementation manner, the rerouting command further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

结合第三方面,在第五种可能的实现方式中,所述特定消息中还包括:With reference to the third aspect, in a fifth possible implementation manner, the specific message further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

第四方面,本发明实施例提供的一种提供安全上下文的设备,包括:In a fourth aspect, a device for providing a security context provided by an embodiment of the present invention includes:

接收NAS消息单元,用于接收用户设备UE发送的非接入层NAS消息;a receiving NAS message unit, configured to receive a non-access stratum NAS message sent by the user equipment UE;

发送重路由命令单元,用于当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息;A rerouting command sending unit is configured to send a rerouting command to the access network device when it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, where the rerouting command includes the NAS message and the user interface. for determining the information of the second core network device;

安全上下文提供单元,用于接收所述第二核心网设备发送的上下文请求,所述上下文请求中包括UE的标识以及密钥集标识,根据所述UE的标识以及密钥集标识,查找对应的安全上下文,并将该安全上下文发送给所述第二核心网设备。A security context providing unit, configured to receive a context request sent by the second core network device, where the context request includes the identifier of the UE and the identifier of the key set, and searches for the corresponding identifier according to the identifier of the UE and the identifier of the key set security context, and send the security context to the second core network device.

结合第四方面,在第一种可能的实现方式中,所述发送重路由命令单元还用于:With reference to the fourth aspect, in a first possible implementation manner, the sending rerouting command unit is further configured to:

在向接入网设备发送重路由命令之前,对接收到的NAS消息进行重构,所述重路由命令中包含的NAS消息,为重构的NAS消息。Before sending the rerouting command to the access network device, the received NAS message is reconstructed, and the NAS message included in the rerouting command is the reconstructed NAS message.

结合第四方面的第一种可能的实现方式,在第二种可能的实现方式中,所述发送重路由命令单元对接收到的来自所述UE的NAS消息进行重构时,具体用于:With reference to the first possible implementation manner of the fourth aspect, in the second possible implementation manner, when the sending rerouting command unit reconstructs the received NAS message from the UE, it is specifically used for:

利用当前安全上下文中的密钥集标识,替换该UE发送的NAS消息中的密钥集标识;和/或,Use the key set identifier in the current security context to replace the key set identifier in the NAS message sent by the UE; and/or,

根据当前安全上下文计算完整性保护校验值,并将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE。Calculate the integrity protection check value according to the current security context, and use the integrity protection check value as the message authentication code MAC information element IE in the NAS message sent by the UE.

结合第四方面的第二种可能的实现方式,在第三种可能的实现方式中,所述发送重路由命令单元将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE时,具体用于:With reference to the second possible implementation manner of the fourth aspect, in a third possible implementation manner, the sending rerouting command unit uses the integrity protection check value as a message in the NAS message sent by the UE When the authentication code MAC information element is IE, it is specifically used for:

将所述完整性保护校验值填充到所述UE发送的NAS消息中的消息认证码MAC信元IE;或Filling the integrity protection check value into the message authentication code MAC information element IE in the NAS message sent by the UE; or

将所述完整性保护校验值替换所述UE发送的NAS消息中的消息认证码MAC。Replace the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.

结合第四方面的第二种可能的实现方式,在第四种可能的实现方式中,所述发送重路由命令单元,还用于:In combination with the second possible implementation manner of the fourth aspect, in the fourth possible implementation manner, the sending rerouting command unit is further used for:

将第一核心网设备为所述UE分配的标识替换从该UE接收到的NAS消息中的UE的标识。The identifier of the UE in the NAS message received from the UE is replaced by the identifier assigned to the UE by the first core network device.

结合第四方面,在第五种可能的实现方式中,所述密钥集标识包含在所述上下文请求中;或者,With reference to the fourth aspect, in a fifth possible implementation manner, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

结合第四方面,在第六种可能的实现方式中,所述安全上下文提供单元还用于:With reference to the fourth aspect, in a sixth possible implementation manner, the security context providing unit is further configured to:

在确定当前的安全上下文后,将该安全上下文发送给第二核心网设备前,利用当前的安全上下文验证该上下文请求中携带的NAS消息的完整性;After determining the current security context, before sending the security context to the second core network device, use the current security context to verify the integrity of the NAS message carried in the context request;

则,当所述验证成功时,所述安全上下文将该安全上下文发送给第二核心网设备。Then, when the verification is successful, the security context sends the security context to the second core network device.

结合第四方面的第六种可能的实现方式,在第七种可能的实现方式中,所述安全上下文提供单元利用当前与该UE共享的安全上下文验证该上下文请求中携带的NAS消息的完整性时,具体用于:With reference to the sixth possible implementation manner of the fourth aspect, in a seventh possible implementation manner, the security context providing unit verifies the integrity of the NAS message carried in the context request by using the security context currently shared with the UE , specifically for:

验证该上下文请求中携带的NAS消息中的完整性保护校验值或者消息认证码MAC值;或者Verify the integrity protection check value or message authentication code MAC value in the NAS message carried in the context request; or

验证该上下文请求中的完整性保护校验值。Verify the integrity protection check value in this context request.

结合第四方面,在第八种可能的实现方式中,所述重路由命令中还包括:With reference to the fourth aspect, in an eighth possible implementation manner, the rerouting command further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

结合第四方面,在第九种可能的实现方式中,所述上下文请求中还包括:With reference to the fourth aspect, in a ninth possible implementation manner, the context request further includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

第五方面,本发明实施例提供的一种获取安全上下文的设备,包括:In a fifth aspect, a device for acquiring a security context provided by an embodiment of the present invention includes:

特定消息接收单元,用于接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;a specific message receiving unit, configured to receive a specific message sent by an access network device, where the specific message includes a non-access stratum NAS message;

上下文请求单元,用于根据所述特定消息确定第一核心网设备,并向第一核心网设备发送上下文请求,所述上下文请求中包括UE的标识以及密钥集标识;a context request unit, configured to determine the first core network device according to the specific message, and send a context request to the first core network device, where the context request includes the identifier of the UE and the identifier of the key set;

上下文获取单元,用于接收第一核心网设备发送的上下文响应,并从中获取安全上下文,该安全上下文是第一核心网设备根据所述上下文请求中所述UE的标识以及密钥集标识确定的。a context obtaining unit, configured to receive a context response sent by the first core network device, and obtain a security context therefrom, where the security context is determined by the first core network device according to the identifier of the UE and the key set identifier in the context request .

结合第五方面,在第一种可能的实现方式中,所述NAS消息中包含第一核心网设备为所述UE分配的标识,第二核心网设备根据该标识确定第一核心网设备。With reference to the fifth aspect, in a first possible implementation manner, the NAS message includes an identifier allocated by the first core network device to the UE, and the second core network device determines the first core network device according to the identifier.

结合第五方面,在第二种可能的实现方式中,所述特定消息中还包括第一核心网设备的标识信息,第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。With reference to the fifth aspect, in a second possible implementation manner, the specific message further includes identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device network equipment.

结合第五方面,在第三种可能的实现方式中,所述密钥集标识包含在所述上下文请求中;或者,With reference to the fifth aspect, in a third possible implementation manner, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

结合第五方面、或者结合第五方面的第一种可能的实现方式、或者结合第五方面的第二种可能的实现方式、或者结合第五方面的第三种可能的实现方式,在第四种可能的实现方式中,所述安全上下文中,包含第一核心网设备保护NAS消息所使用的加密算法和完整性保护算法。In combination with the fifth aspect, or with the first possible implementation manner of the fifth aspect, or with the second possible implementation manner of the fifth aspect, or with the third possible implementation manner of the fifth aspect, in the fourth In a possible implementation manner, the security context includes an encryption algorithm and an integrity protection algorithm used by the first core network device to protect the NAS message.

结合第五方面的第四种可能的实现方式,在第五种可能的实现方式中,所述上下文获取单元获取所述UE的安全上下文后,还用于:With reference to the fourth possible implementation manner of the fifth aspect, in the fifth possible implementation manner, after the context acquisition unit acquires the security context of the UE, it is further configured to:

当需要选择新的算法时,利用新的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,其中包含新的算法的标识;其中,所述新的算法包括加密算法和/或完整性保护算法;When a new algorithm needs to be selected, use the new algorithm to derive a new NAS key, and send a NAS security mode command message to the UE, which contains the identifier of the new algorithm; wherein, the new algorithm includes an encryption algorithm and/or or integrity protection algorithms;

接收该UE反馈的NAS安全模式完成消息。Receive the NAS security mode completion message fed back by the UE.

结合第五方面,在第六种可能的实现方式中,所述上下文请求中还包括:With reference to the fifth aspect, in a sixth possible implementation manner, the context request further includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

结合第五方面,在第七种可能的实现方式中,所述特定消息中还包括:With reference to the fifth aspect, in a seventh possible implementation manner, the specific message further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

第六方面,本发明实施例提供的一种重路由命令的接收处理设备,包括:In a sixth aspect, a device for receiving and processing a rerouting command provided by an embodiment of the present invention includes:

重路由命令接收单元,用于接收第一核心网设备发送的重路由命令,其中包含非接入层NAS消息和用于确定第二核心网设备的指示信息;a rerouting command receiving unit, configured to receive a rerouting command sent by the first core network device, including a non-access stratum NAS message and indication information for determining the second core network device;

特定消息发送单元,用于根据所述指示信息,确定所述第二核心网设备,并向所述第二核心网设备发送携带所述NAS消息的特定消息。A specific message sending unit, configured to determine the second core network device according to the indication information, and send a specific message carrying the NAS message to the second core network device.

结合第六方面,在第一种可能的实现方式中,所述特定消息中还包括:With reference to the sixth aspect, in a first possible implementation manner, the specific message further includes:

重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

结合第六方面、或者结合第六方面的第一种可能的实现方式,在第二种可能的实现方式中,所述特定消息中还包括:In combination with the sixth aspect, or in combination with the first possible implementation manner of the sixth aspect, in the second possible implementation manner, the specific message further includes:

第一核心网设备的标识信息,所述第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

结合第六方面,在第三种可能的实现方式中,所述NAS消息是所述第一核心网设备对接收到的UE发送的NAS消息进行重构后的NAS消息。With reference to the sixth aspect, in a third possible implementation manner, the NAS message is a NAS message reconstructed by the first core network device on the received NAS message sent by the UE.

结合第六方面,在第四种可能的实现方式中,所述重路由命令中还包括:With reference to the sixth aspect, in a fourth possible implementation manner, the rerouting command further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

结合第六方面,在第五种可能的实现方式中,所述特定消息中还包括:With reference to the sixth aspect, in a fifth possible implementation manner, the specific message further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

第七方面,本发明实施例提供的一种提供安全上下文的设备,该设备包括处理器和收发机,其中,In a seventh aspect, an embodiment of the present invention provides a device for providing a security context, the device includes a processor and a transceiver, wherein,

收发机接收用户设备UE发送的非接入层NAS消息;The transceiver receives the non-access stratum NAS message sent by the user equipment UE;

当处理器确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,通过收发机向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息;When the processor determines that the NAS message needs to be re-routed to the second core network device in the specific network, a re-routing command is sent to the access network device through the transceiver, where the re-routing command includes the NAS message and is used to determine the Describe the information of the second core network equipment;

收发机接收所述第二核心网设备发送的上下文请求,所述上下文请求中包括UE的标识以及密钥集标识,处理器根据所述UE的标识以及密钥集标识,查找对应的安全上下文,收发机将该安全上下文发送给所述第二核心网设备。The transceiver receives the context request sent by the second core network device, where the context request includes the identifier of the UE and the identifier of the key set, and the processor searches for the corresponding security context according to the identifier of the UE and the identifier of the key set, The transceiver sends the security context to the second core network device.

结合第七方面,在第一种可能的实现方式中,收发机在向接入网设备发送重路由命令之前,处理器还用于对接收到的NAS消息进行重构,所述重路由命令中包含的NAS消息,为重构的NAS消息。With reference to the seventh aspect, in a first possible implementation manner, before the transceiver sends a rerouting command to the access network device, the processor is further configured to reconstruct the received NAS message, where the rerouting command includes The included NAS message is the reconstructed NAS message.

结合第七方面的第一种可能的实现方式,在第二种可能的实现方式中,处理器对接收到的NAS消息进行重构时,具体用于:With reference to the first possible implementation manner of the seventh aspect, in the second possible implementation manner, when the processor reconstructs the received NAS message, it is specifically used for:

利用当前安全上下文中的密钥集标识,替换该UE发送的NAS消息中的密钥集标识;和/或,Use the key set identifier in the current security context to replace the key set identifier in the NAS message sent by the UE; and/or,

根据当前安全上下文计算完整性保护校验值,并将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE。Calculate the integrity protection check value according to the current security context, and use the integrity protection check value as the message authentication code MAC information element IE in the NAS message sent by the UE.

结合第七方面的第二种可能的实现方式,在第三种可能的实现方式中,处理器将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE时,具体用于:With reference to the second possible implementation manner of the seventh aspect, in a third possible implementation manner, the processor uses the integrity protection check value as the message authentication code MAC information element in the NAS message sent by the UE IE, specifically for:

将所述完整性保护校验值填充到所述UE发送的NAS消息中的消息认证码MAC信元IE;或Filling the integrity protection check value into the message authentication code MAC information element IE in the NAS message sent by the UE; or

将所述完整性保护校验值替换所述UE发送的NAS消息中的消息认证码MAC。Replace the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.

结合第七方面的第二种可能的实现方式,在第四种可能的实现方式中,处理器对接收到的NAS消息进行重构时,还用于:With reference to the second possible implementation manner of the seventh aspect, in the fourth possible implementation manner, when the processor reconstructs the received NAS message, it is further used for:

将第一核心网设备为所述UE分配的标识替换从该UE接收到的NAS消息中的UE的标识。The identifier of the UE in the NAS message received from the UE is replaced by the identifier assigned to the UE by the first core network device.

结合第七方面,在第五种可能的实现方式中,所述密钥集标识包含在所述上下文请求中;或者,With reference to the seventh aspect, in a fifth possible implementation manner, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

结合第七方面,在第六种可能的实现方式中,处理器确定当前的安全上下文后,收发机将该安全上下文发送给第二核心网设备前,处理器还用于:With reference to the seventh aspect, in a sixth possible implementation manner, after the processor determines the current security context, and before the transceiver sends the security context to the second core network device, the processor is further configured to:

利用当前的安全上下文验证该上下文请求中携带的NAS消息的完整性;Use the current security context to verify the integrity of the NAS message carried in the context request;

则,当所述验证成功时,收发机将该安全上下文发送给第二核心网设备。Then, when the verification is successful, the transceiver sends the security context to the second core network device.

结合第七方面的第六种可能的实现方式,在第七种可能的实现方式中,处理器利用当前与该UE共享的安全上下文验证该上下文请求中携带的NAS消息的完整性时,具体用于:In conjunction with the sixth possible implementation manner of the seventh aspect, in the seventh possible implementation manner, when the processor uses the security context currently shared with the UE to verify the integrity of the NAS message carried in the context request, it specifically uses At:

验证该上下文请求中携带的NAS消息中的完整性保护校验值或者消息认证码MAC值;或者Verify the integrity protection check value or message authentication code MAC value in the NAS message carried in the context request; or

验证该上下文请求中的完整性保护校验值。Verify the integrity protection check value in this context request.

结合第七方面,在第八种可能的实现方式中,所述重路由命令中还包括:With reference to the seventh aspect, in an eighth possible implementation manner, the rerouting command further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

结合第七方面,在第九种可能的实现方式中,所述上下文请求中还包括:With reference to the seventh aspect, in a ninth possible implementation manner, the context request further includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

第八方面,本发明实施例提供的一种获取安全上下文的设备,该设备包括收发机和处理器,其中:In an eighth aspect, an embodiment of the present invention provides a device for acquiring a security context, the device includes a transceiver and a processor, wherein:

收发机接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;The transceiver receives a specific message sent by the access network device, where the specific message includes a non-access stratum NAS message;

处理器根据所述特定消息确定第一核心网设备,收发机向第一核心网设备发送上下文请求,所述上下文请求中包括UE的标识以及密钥集标识;The processor determines the first core network device according to the specific message, and the transceiver sends a context request to the first core network device, where the context request includes the identifier of the UE and the identifier of the key set;

收发机接收第一核心网设备发送的上下文响应,处理器从中获取安全上下文,该安全上下文是第一核心网设备根据所述上下文请求中所述UE的标识以及密钥集标识确定的。The transceiver receives the context response sent by the first core network device, and the processor obtains the security context therefrom, where the security context is determined by the first core network device according to the identifier of the UE and the identifier of the key set in the context request.

结合第八方面,在第一种可能的实现方式中,所述NAS消息中包含第一核心网设备为所述UE分配的标识,第二核心网设备根据该标识确定第一核心网设备。With reference to the eighth aspect, in a first possible implementation manner, the NAS message includes an identifier allocated by the first core network device to the UE, and the second core network device determines the first core network device according to the identifier.

结合第八方面,在第二种可能的实现方式中,所述特定消息中还包括第一核心网设备的标识信息,第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。With reference to the eighth aspect, in a second possible implementation manner, the specific message further includes identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device network equipment.

结合第八方面,在第三种可能的实现方式中,所述密钥集标识包含在所述上下文请求中;或者,With reference to the eighth aspect, in a third possible implementation manner, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

结合第八方面、或者结合第八方面的第一种可能的实现方式、或者结合第八方面的第二种可能的实现方式、或者结合第八方面的第三种可能的实现方式,在第四种可能的实现方式中,所述安全上下文中,包含第一核心网设备保护NAS消息所使用的加密算法和完整性保护算法。In combination with the eighth aspect, or in combination with the first possible implementation manner of the eighth aspect, or in combination with the second possible implementation manner of the eighth aspect, or in combination with the third possible implementation manner of the eighth aspect, in the fourth In a possible implementation manner, the security context includes an encryption algorithm and an integrity protection algorithm used by the first core network device to protect the NAS message.

结合第八方面的第四种可能的实现方式,在第五种可能的实现方式中,所述处理器获取所述UE的安全上下文后,还用于:当需要选择新的算法时,利用新的算法推衍新的NAS密钥,并通过收发机向UE发送NAS安全模式命令消息,其中包含新的算法的标识;其中,所述新的算法包括加密算法和/或完整性保护算法;With reference to the fourth possible implementation manner of the eighth aspect, in a fifth possible implementation manner, after acquiring the security context of the UE, the processor is further configured to: when a new algorithm needs to be selected, use the new The algorithm derives a new NAS key, and sends a NAS security mode command message to the UE through the transceiver, which contains the identifier of the new algorithm; wherein, the new algorithm includes an encryption algorithm and/or an integrity protection algorithm;

收发机接收该UE反馈的NAS安全模式完成消息。The transceiver receives the NAS security mode completion message fed back by the UE.

结合第八方面,在第六种可能的实现方式中,所述上下文请求中还包括:With reference to the eighth aspect, in a sixth possible implementation manner, the context request further includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

结合第八方面,在第七种可能的实现方式中,所述特定消息中还包括:With reference to the eighth aspect, in a seventh possible implementation manner, the specific message further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

第九方面,本发明实施例提供的一种重路由命令的接收处理设备,该设备包括收发机和处理器,其中:In a ninth aspect, an embodiment of the present invention provides a device for receiving and processing a rerouting command, the device includes a transceiver and a processor, wherein:

收发机接收第一核心网设备发送的重路由命令,其中包含非接入层NAS消息和用于确定第二核心网设备的指示信息;The transceiver receives the rerouting command sent by the first core network device, which includes a non-access stratum NAS message and indication information for determining the second core network device;

处理器根据所述指示信息,确定所述第二核心网设备,并通过收发机向所述第二核心网设备发送携带所述NAS消息的特定消息。The processor determines the second core network device according to the indication information, and sends a specific message carrying the NAS message to the second core network device through the transceiver.

结合第九方面,在第一种可能的实现方式中,所述特定消息中还包括:With reference to the ninth aspect, in a first possible implementation manner, the specific message further includes:

重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

结合第九方面,或者结合第九方面的第一种可能的实现方式,在第二种可能的实现方式中,所述特定消息中还包括:In combination with the ninth aspect, or in combination with the first possible implementation manner of the ninth aspect, in a second possible implementation manner, the specific message further includes:

第一核心网设备的标识信息,所述第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

结合第九方面,在第三种可能的实现方式中,所述NAS消息是所述第一核心网设备对接收到的UE发送的NAS消息进行重构后的NAS消息。With reference to the ninth aspect, in a third possible implementation manner, the NAS message is a NAS message after the first core network device reconstructs the received NAS message sent by the UE.

结合第九方面,在第四种可能的实现方式中,所述重路由命令中还包括:With reference to the ninth aspect, in a fourth possible implementation manner, the rerouting command further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

结合第九方面,在第五种可能的实现方式中,所述特定消息中还包括:With reference to the ninth aspect, in a fifth possible implementation manner, the specific message further includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

本发明通过第一核心网设备接收用户设备UE发送的非接入层NAS消息;当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第一核心网设备向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息;第一核心网设备接收所述第二核心网设备发送的上下文请求,所述上下文请求中包括UE的标识以及密钥集标识,第一核心网设备根据所述UE的标识以及密钥集标识,查找对应的安全上下文,并将该安全上下文发送给所述第二核心网设备。从而,使得第一核心网设备可以向特定网络中的第二核心网设备提供UE的安全上下文。The present invention receives the non-access stratum NAS message sent by the user equipment UE through the first core network device; when it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the first core network device sends the access layer to the access layer. The network device sends a rerouting command, where the rerouting command includes a NAS message and information used to determine the second core network device; the first core network device receives the context request sent by the second core network device, the The context request includes the identity of the UE and the identity of the key set, and the first core network device searches for the corresponding security context according to the identity of the UE and the identity of the key set, and sends the security context to the second core network device . Thus, the first core network device can provide the security context of the UE to the second core network device in a specific network.

本发明通过第二核心网设备接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;第二核心网设备根据所述特定消息确定第一核心网设备,并向第一核心网设备发送上下文请求,所述上下文请求中包括UE的标识以及密钥集标识;第二核心网设备接收第一核心网设备发送的上下文响应,并从中获取安全上下文,该安全上下文是第一核心网设备根据所述上下文请求中所述UE的标识以及密钥集标识确定的。从而使得特定网络中的第二核心网设备可以获取第一核心网设备提供的UE的安全上下文,使得特定网络下的核心网设备与UE可以进行安全通信。The present invention receives a specific message sent by the access network device through the second core network device, and the specific message includes a non-access stratum NAS message; the second core network device determines the first core network device according to the specific message, and reports to the first core network device. A core network device sends a context request, and the context request includes the identifier of the UE and the key set identifier; the second core network device receives the context response sent by the first core network device, and obtains a security context from it, and the security context is the first A core network device is determined according to the identifier of the UE and the identifier of the key set in the context request. Therefore, the second core network device in the specific network can obtain the security context of the UE provided by the first core network device, so that the core network device in the specific network can securely communicate with the UE.

第十方面,本发明实施例提供的一种提供安全上下文的方法,包括:In a tenth aspect, a method for providing a security context provided by an embodiment of the present invention includes:

第一核心网设备接收用户设备UE发送的非接入层NAS消息;The first core network device receives the non-access stratum NAS message sent by the user equipment UE;

当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第一核心网设备向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息。When it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the first core network device sends a rerouting command to the access network device, where the rerouting command information about the second core network device.

结合第十方面,在第一种可能的实现方式中,该方法还包括:With reference to the tenth aspect, in a first possible implementation manner, the method further includes:

第一核心网设备接收所述第二核心网设备发送的请求消息,所述请求消息中包括UE的标识,第一核心网设备根据所述UE的标识,查找对应的鉴权数据,并将该鉴权数据发送给所述第二核心网设备。The first core network device receives the request message sent by the second core network device, the request message includes the identifier of the UE, the first core network device searches for the corresponding authentication data according to the identifier of the UE, and stores the The authentication data is sent to the second core network device.

结合第十方面的第一种可能的实现方式,在第二种可能的实现方式中,在第一核心网设备将该鉴权数据发送给所述第二核心网设备之前,该方法还包括:第一核心网设备验证请求消息中的校验值;With reference to the first possible implementation manner of the tenth aspect, in a second possible implementation manner, before the first core network device sends the authentication data to the second core network device, the method further includes: The first core network device verifies the check value in the request message;

第一核心网将该鉴权数据发送给所述第二核心网设备,具体为:当验证成功时,第一核心网设备将鉴权数据发送给第二核心网设备。The first core network sends the authentication data to the second core network device, specifically: when the verification is successful, the first core network device sends the authentication data to the second core network device.

结合第十方面的第二种可能的实现方式,在第三种可能的实现方式中,所述第一核心网设备验证请求消息中的校验值,具体包括:With reference to the second possible implementation manner of the tenth aspect, in a third possible implementation manner, the first core network device verifies the check value in the request message, specifically including:

当所述请求消息中还包括密钥集标识时,第一核心网设备利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, the first core network device uses the UE identifier and the key set identifier to determine the corresponding security context, and uses the security context to calculate a check value, if If the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

第一核心网设备通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The first core network device calculates the check value by using the hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

第一核心网设备查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The first core network device searches for the locally stored check value, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

结合第十方面,在第四种可能的实现方式中,在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,该方法还包括:所述第一核心网设备通过与所述UE之间的鉴权过程,或者从第三核心网设备获取所述UE的安全上下文;With reference to the tenth aspect, in a fourth possible implementation manner, before determining that the NAS message needs to be rerouted to the second core network device in a specific network, the method further includes: the first core network device the authentication process between the UEs, or obtain the security context of the UE from a third core network device;

在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之后,第一核心网设备向接入网设备发送重路由命令之前,该方法还包括:第一核心网设备为所述UE分配标识,并确定校验值;After it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, and before the first core network device sends a rerouting command to the access network device, the method further includes: the first core network device is the The UE allocates the identity and determines the check value;

所述重路由命令中,还包括:所述第一核心网设备为所述UE分配的标识和所述校验值;The rerouting command further includes: an identifier allocated by the first core network device to the UE and the check value;

或者,所述重路由命令中,还包括:所述第一核心网设备为所述UE分配的标识、所述校验值、以及该UE的安全上下文的密钥集标识。Alternatively, the rerouting command further includes: the identifier allocated by the first core network device to the UE, the check value, and the key set identifier of the security context of the UE.

结合第十方面,在第五种可能的实现方式中,所述第一核心网确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还包括:With reference to the tenth aspect, in a fifth possible implementation manner, before the first core network determines that the NAS message needs to be rerouted to a second core network device in a specific network, the method further includes:

所述第一核心网设备向第三核心网设备发送请求消息,请求消息中包含所述NAS消息,并接收第三核心网设备回复的响应消息,其中包括所述UE的安全上下文、校验值以及用于确定所述第二核心网设备的信息;其中,所述校验值是所述第三核心网设备确定的;The first core network device sends a request message to the third core network device, the request message includes the NAS message, and receives a response message replied by the third core network device, including the security context of the UE, the check value and information for determining the second core network device; wherein the check value is determined by the third core network device;

所述第一核心网设备通过所述用于确定所述第二核心网设备的信息,确定所述NAS消息需要重路由到所述特定网络中的第二核心网设备;The first core network device determines, by using the information for determining the second core network device, that the NAS message needs to be rerouted to the second core network device in the specific network;

所述重路由命令中还包括:所述校验值,或者所述校验值和密钥集标识。The rerouting command further includes: the check value, or the check value and a key set identifier.

第十一方面,本发明实施例提供的一种获取安全上下文的方法,包括:In an eleventh aspect, a method for obtaining a security context provided by an embodiment of the present invention includes:

第二核心网设备接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;The second core network device receives a specific message sent by the access network device, where the specific message includes a non-access stratum NAS message;

第二核心网设备根据所述特定消息确定第一核心网设备,并向第一核心网设备发送请求消息,所述请求消息中包括UE的标识;The second core network device determines the first core network device according to the specific message, and sends a request message to the first core network device, where the request message includes the identifier of the UE;

第二核心网设备接收第一核心网设备发送的响应消息,并从中获取所述UE的鉴权数据,该鉴权数据中包括所述UE的安全上下文,该鉴权数据是所述第一核心网设备根据所述UE的标识确定的。The second core network device receives the response message sent by the first core network device, and obtains the authentication data of the UE therefrom, where the authentication data includes the security context of the UE, and the authentication data is the first core network device. The network device is determined according to the identifier of the UE.

结合第十一方面,如果把第二MME看作是第二核心网设备,则相应地,可以把第一MME或第三MME看作是第一核心网设备。With reference to the eleventh aspect, if the second MME is regarded as the second core network device, correspondingly, the first MME or the third MME can be regarded as the first core network device.

结合第十一方面,在第一种可能的实现方式中,所述UE的标识,为所述第一核心网设备为所述UE分配的标识;With reference to the eleventh aspect, in a first possible implementation manner, the identifier of the UE is an identifier allocated to the UE by the first core network device;

所述特定消息中还包括:校验值,或者校验值和密钥集标识;The specific message also includes: a check value, or a check value and a key set identifier;

所述请求消息中还包括:校验值,或者校验值和密钥集标识。The request message also includes: a check value, or a check value and a key set identifier.

结合第十一方面,在第二种可能的实现方式中,所述特定消息中还包括:重路由指示,所述重路由指示用于指示所述NAS消息是重路由到第二核心网设备的;With reference to the eleventh aspect, in a second possible implementation manner, the specific message further includes: a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device ;

所述请求消息中包括所述NAS消息,所述NAS消息中包括所述UE的标识,并且,所述请求消息中还包括所述重路由指示。The request message includes the NAS message, the NAS message includes the identifier of the UE, and the request message further includes the rerouting indication.

第十二方面,本发明实施例提供的一种提供安全上下文的方法,包括:In a twelfth aspect, a method for providing a security context provided by an embodiment of the present invention includes:

第三核心网设备接收第一核心网设备发送的请求消息,其中包括用户设备UE的非接入层NAS消息;The third core network device receives the request message sent by the first core network device, including the non-access stratum NAS message of the user equipment UE;

当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第三核心网设备向所述第一核心网设备发送响应消息,其中包括所述UE的安全上下文和用于确定所述第二核心网设备的信息。When it is determined that the NAS message needs to be rerouted to the second core network device in a specific network, the third core network device sends a response message to the first core network device, which includes the security context of the UE and a message for determining Information of the second core network device.

结合第十二方面,在第一种可能的实现方式中,当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,还包括:With reference to the twelfth aspect, in a first possible implementation manner, when it is determined that the NAS message needs to be rerouted to a second core network device in a specific network, the method further includes:

第三核心网设备确定该UE的校验值;The third core network device determines the check value of the UE;

所述响应消息中还包括:所述校验值,或者所述校验值和所述UE的安全上下文对应的密钥集标识。The response message further includes: the check value, or a key set identifier corresponding to the check value and the security context of the UE.

结合第十二方面的第一种可能的实现方式,在第二种可能的实现方式中,该方法还包括:With reference to the first possible implementation manner of the twelfth aspect, in the second possible implementation manner, the method further includes:

第三核心网设备接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息、校验值和密钥集标识;The third core network device receives the request message sent by the second core network device, which includes the NAS message, the check value and the key set identifier;

第三核心网设备根据所述UE的标识找到对应的鉴权数据,向所述第二核心网设备发送响应消息,其中包括该UE的鉴权数据。The third core network device finds the corresponding authentication data according to the identifier of the UE, and sends a response message to the second core network device, which includes the authentication data of the UE.

结合第十二方面的第二种可能的实现方式,在第三种可能的实现方式中,在第三核心网设备向所述第二核心网设备发送响应消息之前,该方法还包括:第三核心网设备验证所述请求消息中的校验值;With reference to the second possible implementation manner of the twelfth aspect, in a third possible implementation manner, before the third core network device sends a response message to the second core network device, the method further includes: a third The core network device verifies the check value in the request message;

第三核心网设备向所述第二核心网设备发送响应消息,具体为:当验证成功时,第三核心网设备向所述第二核心网设备发送响应消息。The third core network device sends a response message to the second core network device, specifically: when the verification is successful, the third core network device sends a response message to the second core network device.

结合第十二方面的第三种可能的实现方式,在第四种可能的实现方式中,所述第三核心网设备验证所述请求消息中的校验值,具体包括:With reference to the third possible implementation manner of the twelfth aspect, in a fourth possible implementation manner, the third core network device verifies the check value in the request message, specifically including:

当所述请求消息中还包括密钥集标识时,所述第三核心网设备利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message further includes a key set identifier, the third core network device determines a corresponding security context by using the UE's identifier and the key set identifier, and uses the security context to calculate a check value , if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

所述第三核心网设备通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The third core network device calculates the check value by using the hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

所述第三核心网设备查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The third core network device searches for the locally stored check value, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

结合第十二方面,在第五种可能的实现方式中,该方法还包括:With reference to the twelfth aspect, in a fifth possible implementation manner, the method further includes:

第三核心网设备接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息和重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的;The third core network device receives the request message sent by the second core network device, which includes the NAS message and a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device;

第三核心网设备通过所述重路由指示确定该请求消息中的NAS消息是重路由到第二核心网设备的;The third core network device determines that the NAS message in the request message is rerouted to the second core network device through the rerouting indication;

第三核心网设备根据该NAS消息中的UE的标识和密钥集标识找到对应的安全上下文,并利用该安全上下文验证该请求消息中的完整性校验码,当验证成功时,第三核心网设备根据所述UE的标识找到对应的鉴权数据,并将该鉴权数据返回给第二核心网设备。The third core network device finds the corresponding security context according to the UE's identity and key set identity in the NAS message, and uses the security context to verify the integrity check code in the request message. When the verification is successful, the third core The network device finds the corresponding authentication data according to the identifier of the UE, and returns the authentication data to the second core network device.

第十三方面,本发明实施例提供的一种提供安全上下文的设备,包括:In a thirteenth aspect, a device for providing a security context provided by an embodiment of the present invention includes:

接收NAS消息单元,用于接收用户设备UE发送的非接入层NAS消息;a receiving NAS message unit, configured to receive a non-access stratum NAS message sent by the user equipment UE;

发送重路由命令单元,用于当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息。A rerouting command sending unit is configured to send a rerouting command to the access network device when it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, where the rerouting command includes the NAS message and the user interface. for determining the information of the second core network device.

结合第十三方面,在第一种可能的实现方式中,该设备还包括:With reference to the thirteenth aspect, in a first possible implementation manner, the device further includes:

鉴权数据提供单元,用于接收所述第二核心网设备发送的请求消息,所述请求消息中包括UE的标识,根据所述UE的标识,查找对应的鉴权数据,并将该鉴权数据发送给所述第二核心网设备。An authentication data providing unit, configured to receive a request message sent by the second core network device, where the request message includes the identifier of the UE, search for the corresponding authentication data according to the identifier of the UE, and use the authentication The data is sent to the second core network device.

结合第十三方面第一种可能的实现方式,在第二种可能的实现方式中,所述鉴权数据提供单元将该鉴权数据发送给所述第二核心网设备之前,还用于验证请求消息中的校验值;With reference to the first possible implementation manner of the thirteenth aspect, in the second possible implementation manner, the authentication data providing unit is also used to verify the authentication data before sending the authentication data to the second core network device. The check value in the request message;

所述鉴权数据提供单元将该鉴权数据发送给所述第二核心网设备,具体为:当验证成功时,将鉴权数据发送给第二核心网设备。The authentication data providing unit sends the authentication data to the second core network device, specifically: when the verification is successful, sending the authentication data to the second core network device.

结合第十三方面第二种可能的实现方式,在第三种可能的实现方式中,所述鉴权数据提供单元验证请求消息中的校验值时,具体用于:In combination with the second possible implementation manner of the thirteenth aspect, in the third possible implementation manner, when the authentication data provides the check value in the unit verification request message, it is specifically used for:

当所述请求消息中还包括密钥集标识时,利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, use the UE identifier and the key set identifier to determine the corresponding security context, and use the security context to calculate a check value. If the verification value is consistent with the verification value in the request message, it is determined that the verification is successful; or,

通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The check value is calculated by a hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The locally stored check value is searched, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

结合第十三方面,在第四种可能的实现方式中,所述发送重路由命令单元在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还用于:通过与所述UE之间的鉴权过程,或者从第三核心网设备获取所述UE的安全上下文;With reference to the thirteenth aspect, in a fourth possible implementation manner, before determining that the NAS message needs to be rerouted to the second core network device in the specific network, the sending rerouting command unit is further configured to: the authentication process between the UEs, or obtain the security context of the UE from a third core network device;

在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之后,向接入网设备发送重路由命令之前,所述发送重路由命令单元还用于:为所述UE分配标识,并确定校验值;After determining that the NAS message needs to be rerouted to the second core network device in the specific network, and before sending the rerouting command to the access network device, the unit for sending the rerouting command is further configured to: assign an identifier to the UE, and determine the check value;

所述重路由命令中,还包括:所述发送重路由命令单元为所述UE分配的标识和所述校验值;The rerouting command further includes: an identifier allocated by the rerouting command unit for the UE and the check value;

或者,所述重路由命令中,还包括:所述发送重路由命令单元为所述UE分配的标识、所述校验值、以及该UE的安全上下文的密钥集标识。Or, the rerouting command further includes: the identifier allocated to the UE by the sending rerouting command unit, the check value, and the key set identifier of the security context of the UE.

结合第十三方面,在第五种可能的实现方式中,所述发送重路由命令单元确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还用于:With reference to the thirteenth aspect, in a fifth possible implementation manner, before the unit for sending a rerouting command determines that the NAS message needs to be rerouted to the second core network device in the specific network, the unit is further configured to:

向第三核心网设备发送请求消息,请求消息中包含所述NAS消息,并接收第三核心网设备回复的响应消息,其中包括所述UE的安全上下文、校验值以及用于确定所述第二核心网设备的信息;其中,所述校验值是所述第三核心网设备确定的;Send a request message to the third core network device, where the request message includes the NAS message, and receive a response message replied by the third core network device, including the security context of the UE, a check value and a Information of the second core network device; wherein, the check value is determined by the third core network device;

通过所述用于确定所述第二核心网设备的信息,确定所述NAS消息需要重路由到所述特定网络中的第二核心网设备;determining that the NAS message needs to be rerouted to the second core network device in the specific network by using the information for determining the second core network device;

所述重路由命令中还包括:所述校验值,或者所述校验值和密钥集标识。The rerouting command further includes: the check value, or the check value and a key set identifier.

第十四方面,本发明实施例提供的一种获取安全上下文的设备,包括:In a fourteenth aspect, a device for acquiring a security context provided by an embodiment of the present invention includes:

特定消息接收单元,用于接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;a specific message receiving unit, configured to receive a specific message sent by an access network device, where the specific message includes a non-access stratum NAS message;

请求单元,用于根据所述特定消息确定第一核心网设备,并向第一核心网设备发送请求消息,所述请求消息中包括UE的标识;a requesting unit, configured to determine the first core network device according to the specific message, and send a request message to the first core network device, where the request message includes the identifier of the UE;

获取单元,用于接收第一核心网设备发送的响应消息,并从中获取所述UE的鉴权数据,该鉴权数据中包括所述UE的安全上下文,该鉴权数据是所述第一核心网设备根据所述UE的标识确定的。an obtaining unit, configured to receive a response message sent by the first core network device, and obtain the authentication data of the UE therefrom, where the authentication data includes the security context of the UE, and the authentication data is the first core The network device is determined according to the identifier of the UE.

结合第十四方面,如果把第二MME看作是第二核心网设备,则相应地,可以把第一MME或第三MME看作是第一核心网设备。With reference to the fourteenth aspect, if the second MME is regarded as the second core network device, correspondingly, the first MME or the third MME can be regarded as the first core network device.

结合第十四方面,在第一种可能的实现方式中,所述UE的标识,为所述第一核心网设备为所述UE分配的标识;With reference to the fourteenth aspect, in a first possible implementation manner, the identifier of the UE is an identifier allocated to the UE by the first core network device;

所述特定消息中还包括:校验值,或者校验值和密钥集标识;The specific message also includes: a check value, or a check value and a key set identifier;

所述请求消息中还包括:校验值,或者校验值和密钥集标识。The request message also includes: a check value, or a check value and a key set identifier.

结合第十四方面,在第二种可能的实现方式中,所述特定消息中还包括:重路由指示,所述重路由指示用于指示所述NAS消息是重路由到第二核心网设备的;With reference to the fourteenth aspect, in a second possible implementation manner, the specific message further includes: a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device ;

所述请求消息中包括所述NAS消息,所述NAS消息中包括所述UE的标识,并且,所述请求消息中还包括所述重路由指示。The request message includes the NAS message, the NAS message includes the identifier of the UE, and the request message further includes the rerouting indication.

第十五方面,本发明实施例提供的一种提供安全上下文的设备,包括:A fifteenth aspect, a device for providing a security context provided by an embodiment of the present invention includes:

接收请求单元,用于接收第一核心网设备发送的请求消息,其中包括用户设备UE的非接入层NAS消息;a receiving request unit, configured to receive a request message sent by the first core network device, including a non-access stratum NAS message of the user equipment UE;

响应单元,用于当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,向所述第一核心网设备发送响应消息,其中包括所述UE的安全上下文和用于确定所述第二核心网设备的信息。a response unit, configured to send a response message to the first core network device when it is determined that the NAS message needs to be rerouted to a second core network device in a specific network, including the security context of the UE and a response message for determining Information of the second core network device.

结合第十五方面,在第一种可能的实现方式中,所述响应单元当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,还用于:With reference to the fifteenth aspect, in a first possible implementation manner, when determining that the NAS message needs to be rerouted to a second core network device in a specific network, the response unit is further configured to:

确定该UE的校验值;determine the check value of the UE;

所述响应消息中还包括:所述校验值,或者所述校验值和所述UE的安全上下文对应的密钥集标识。The response message further includes: the check value, or a key set identifier corresponding to the check value and the security context of the UE.

结合第十五方面的第一种可能的实现方式,在第二种可能的实现方式中,所述接收请求单元还用于:接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息、校验值和密钥集标识;With reference to the first possible implementation manner of the fifteenth aspect, in a second possible implementation manner, the receiving request unit is further configured to: receive a request message sent by the second core network device, including the NAS message, check value and key set identifier;

所述响应单元还用于:根据所述UE的标识找到对应的鉴权数据,向所述第二核心网设备发送响应消息,其中包括该UE的鉴权数据。The response unit is further configured to: find corresponding authentication data according to the identifier of the UE, and send a response message to the second core network device, which includes the authentication data of the UE.

结合第十五方面的第二种可能的实现方式,在第三种可能的实现方式中,所述响应单元在向所述第二核心网设备发送响应消息之前,还用于验证所述请求消息中的校验值;With reference to the second possible implementation manner of the fifteenth aspect, in a third possible implementation manner, before sending a response message to the second core network device, the response unit is further configured to verify the request message check value in ;

所述响应单元向所述第二核心网设备发送响应消息,具体为:当验证成功时,所述响应单元向所述第二核心网设备发送响应消息。The response unit sends a response message to the second core network device, specifically: when the verification is successful, the response unit sends a response message to the second core network device.

结合第十五方面的第三种可能的实现方式,在第四种可能的实现方式中,所述响应单元验证所述请求消息中的校验值时,具体用于:With reference to the third possible implementation manner of the fifteenth aspect, in a fourth possible implementation manner, when the response unit verifies the check value in the request message, it is specifically used for:

当所述请求消息中还包括密钥集标识时,利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, use the UE identifier and the key set identifier to determine the corresponding security context, and use the security context to calculate a check value. If the verification value is consistent with the verification value in the request message, it is determined that the verification is successful; or,

通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The check value is calculated by a hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The locally stored check value is searched, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

结合第十五方面,在第五种可能的实现方式中,所述接收请求单元还用于:With reference to the fifteenth aspect, in a fifth possible implementation manner, the receiving request unit is further configured to:

接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息和重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的;receiving a request message sent by the second core network device, including the NAS message and a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device;

通过所述重路由指示确定该请求消息中的NAS消息是重路由到第二核心网设备的;Determine through the rerouting indication that the NAS message in the request message is rerouted to the second core network device;

根据该NAS消息中的UE的标识和密钥集标识找到对应的安全上下文,并利用该安全上下文验证该请求消息中的完整性校验码,当验证成功时,根据所述UE的标识找到对应的鉴权数据,并将该鉴权数据返回给第二核心网设备。Find the corresponding security context according to the UE's identity and key set identity in the NAS message, and use the security context to verify the integrity check code in the request message. When the verification is successful, find the corresponding security context according to the UE's identity and returns the authentication data to the second core network device.

第十六方面,本发明实施例提供的一种提供安全上下文的设备,包括收发机和处理器,其中,In a sixteenth aspect, an embodiment of the present invention provides a device for providing a security context, including a transceiver and a processor, wherein:

收发机接收用户设备UE发送的非接入层NAS消息;The transceiver receives the non-access stratum NAS message sent by the user equipment UE;

处理器当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,通过收发机向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息。When it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the processor sends a rerouting command to the access network device through the transceiver, where the rerouting command includes the NAS message and is used to determine the information about the second core network device.

结合第十六方面,在第一种可能的实现方式中,收发机还用于接收所述第二核心网设备发送的请求消息,所述请求消息中包括UE的标识,所述处理器还用于根据所述UE的标识,查找对应的鉴权数据,并通过收发机将该鉴权数据发送给所述第二核心网设备。With reference to the sixteenth aspect, in a first possible implementation manner, the transceiver is further configured to receive a request message sent by the second core network device, where the request message includes the identifier of the UE, and the processor further uses According to the identifier of the UE, the corresponding authentication data is searched, and the authentication data is sent to the second core network device through the transceiver.

结合第十六方面的第一种可能的实现方式,在第二种可能的实现方式中,所述处理器还用于:With reference to the first possible implementation manner of the sixteenth aspect, in the second possible implementation manner, the processor is further configured to:

在所述收发机将该鉴权数据发送给所述第二核心网设备之前,验证请求消息中的校验值;当验证成功时,通过所述收发机将鉴权数据发送给第二核心网设备。Before the transceiver sends the authentication data to the second core network device, verify the check value in the request message; when the verification is successful, send the authentication data to the second core network through the transceiver equipment.

结合第十六方面的第二种可能的实现方式,在第三种可能的实现方式中,所述处理器验证请求消息中的校验值时,具体用于:With reference to the second possible implementation manner of the sixteenth aspect, in the third possible implementation manner, when the processor verifies the check value in the request message, it is specifically used for:

当所述请求消息中还包括密钥集标识时,利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, use the UE identifier and the key set identifier to determine the corresponding security context, and use the security context to calculate a check value. If the verification value is consistent with the verification value in the request message, it is determined that the verification is successful; or,

通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The check value is calculated by a hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The locally stored check value is searched, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

结合第十六方面,在第四种可能的实现方式中,所述处理器在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还用于:通过与所述UE之间的鉴权过程,或者从第三核心网设备获取所述UE的安全上下文;With reference to the sixteenth aspect, in a fourth possible implementation manner, before determining that the NAS message needs to be rerouted to the second core network device in a specific network, the processor is further configured to: The authentication process between, or obtain the security context of the UE from the third core network device;

在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之后,通过收发机向接入网设备发送重路由命令之前,所述处理器还用于:为所述UE分配标识,并确定校验值;After determining that the NAS message needs to be rerouted to the second core network device in the specific network, and before sending a rerouting command to the access network device through the transceiver, the processor is further configured to: assign an identifier to the UE, and determine the check value;

所述重路由命令中,还包括:所述处理器为所述UE分配的标识和所述校验值;The rerouting command further includes: an identifier allocated by the processor to the UE and the check value;

或者,所述重路由命令中,还包括:所述处理器为所述UE分配的标识、所述校验值、以及该UE的安全上下文的密钥集标识。Alternatively, the rerouting command further includes: the identifier allocated by the processor to the UE, the check value, and the key set identifier of the security context of the UE.

结合第十六方面,在第五种可能的实现方式中,所述处理器确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还用于:通过收发机向第三核心网设备发送请求消息,请求消息中包含所述NAS消息,并通过收发机接收第三核心网设备回复的响应消息,其中包括所述UE的安全上下文、校验值以及用于确定所述第二核心网设备的信息;其中,所述校验值是所述第三核心网设备确定的;With reference to the sixteenth aspect, in a fifth possible implementation manner, before the processor determines that the NAS message needs to be rerouted to the second core network device in the specific network, the processor is further configured to: send the third The core network device sends a request message, the request message includes the NAS message, and receives a response message replied by the third core network device through the transceiver, which includes the security context of the UE, a check value and a Information of the second core network device; wherein, the check value is determined by the third core network device;

通过所述用于确定所述第二核心网设备的信息,确定所述NAS消息需要重路由到所述特定网络中的第二核心网设备;determining that the NAS message needs to be rerouted to the second core network device in the specific network by using the information for determining the second core network device;

所述重路由命令中还包括:所述校验值,或者所述校验值和密钥集标识。The rerouting command further includes: the check value, or the check value and a key set identifier.

第十七方面,本发明实施例提供的一种获取安全上下文的设备,包括:收发机和处理器,其中,In a seventeenth aspect, an embodiment of the present invention provides a device for acquiring a security context, including: a transceiver and a processor, wherein:

收发机接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;The transceiver receives a specific message sent by the access network device, where the specific message includes a non-access stratum NAS message;

处理器根据所述特定消息确定第一核心网设备,并通过收发机向第一核心网设备发送请求消息,所述请求消息中包括UE的标识;The processor determines the first core network device according to the specific message, and sends a request message to the first core network device through the transceiver, where the request message includes the identifier of the UE;

收发机接收第一核心网设备发送的响应消息,处理器从中获取所述UE的鉴权数据,该鉴权数据中包括所述UE的安全上下文,该鉴权数据是所述第一核心网设备根据所述UE的标识确定的。The transceiver receives the response message sent by the first core network device, from which the processor obtains the authentication data of the UE, the authentication data includes the security context of the UE, and the authentication data is the first core network device It is determined according to the identity of the UE.

结合第十七方面,在第一种可能的实现方式中,所述UE的标识,为所述第一核心网设备为所述UE分配的标识;With reference to the seventeenth aspect, in a first possible implementation manner, the identifier of the UE is an identifier allocated to the UE by the first core network device;

所述特定消息中还包括:校验值,或者校验值和密钥集标识;The specific message also includes: a check value, or a check value and a key set identifier;

所述请求消息中还包括:校验值,或者校验值和密钥集标识。The request message also includes: a check value, or a check value and a key set identifier.

结合第十七方面,在第二种可能的实现方式中,所述特定消息中还包括:重路由指示,所述重路由指示用于指示所述NAS消息是重路由到第二核心网设备的;With reference to the seventeenth aspect, in a second possible implementation manner, the specific message further includes: a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device ;

所述请求消息中包括所述NAS消息,所述NAS消息中包括所述UE的标识,并且,所述请求消息中还包括所述重路由指示。The request message includes the NAS message, the NAS message includes the identifier of the UE, and the request message further includes the rerouting indication.

第十八方面,本发明实施例提供的一种提供安全上下文的设备,包括:收发机和处理器,其中,In an eighteenth aspect, an embodiment of the present invention provides a device for providing a security context, including: a transceiver and a processor, wherein:

收发机接收第一核心网设备发送的请求消息,其中包括用户设备UE的非接入层NAS消息;The transceiver receives the request message sent by the first core network device, including the non-access stratum NAS message of the user equipment UE;

处理器当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,通过收发机向所述第一核心网设备发送响应消息,其中包括所述UE的安全上下文和用于确定所述第二核心网设备的信息。When it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the processor sends a response message to the first core network device through the transceiver, which includes the security context of the UE and the information used for determining Information of the second core network device.

结合第十八方面,在第一种可能的实现方式中,处理器当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,还用于:With reference to the eighteenth aspect, in a first possible implementation manner, when the processor determines that the NAS message needs to be rerouted to the second core network device in the specific network, the processor is further configured to:

确定该UE的校验值;Determine the check value of the UE;

所述响应消息中还包括:所述校验值,或者所述校验值和所述UE的安全上下文对应的密钥集标识。The response message further includes: the check value, or a key set identifier corresponding to the check value and the security context of the UE.

结合第十八方面的第一种可能的实现方式,在第二种可能的实现方式中,所述收发机还用于接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息、校验值和密钥集标识;With reference to the first possible implementation manner of the eighteenth aspect, in a second possible implementation manner, the transceiver is further configured to receive a request message sent by the second core network device, including the NAS message , check value and key set identifier;

所述处理器根据所述UE的标识找到对应的鉴权数据,通过所述收发机向所述第二核心网设备发送响应消息,其中包括该UE的鉴权数据。The processor finds the corresponding authentication data according to the identifier of the UE, and sends a response message to the second core network device through the transceiver, which includes the authentication data of the UE.

结合第十八方面的第二种可能的实现方式,在第三种可能的实现方式中,所述处理器在通过收发机向所述第二核心网设备发送响应消息之前,还用于验证所述请求消息中的校验值;With reference to the second possible implementation manner of the eighteenth aspect, in a third possible implementation manner, before sending the response message to the second core network device through the transceiver, the processor is further configured to verify all The check value in the request message;

所述处理器通过收发机向所述第二核心网设备发送响应消息,具体为:当验证成功时,所述处理器通过收发机向所述第二核心网设备发送响应消息。The processor sends a response message to the second core network device through the transceiver, specifically: when the verification is successful, the processor sends a response message to the second core network device through the transceiver.

结合第十八方面的第三种可能的实现方式,在第四种可能的实现方式中,所述处理器验证所述请求消息中的校验值时,具体用于:With reference to the third possible implementation manner of the eighteenth aspect, in a fourth possible implementation manner, when the processor verifies the check value in the request message, it is specifically used for:

当所述请求消息中还包括密钥集标识时,利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, use the UE identifier and the key set identifier to determine the corresponding security context, and use the security context to calculate a check value. If the verification value is consistent with the verification value in the request message, it is determined that the verification is successful; or,

通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The check value is calculated by a hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The locally stored check value is searched, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

结合第十八方面,在第五种可能的实现方式中,所述收发机还用于接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息和重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的;With reference to the eighteenth aspect, in a fifth possible implementation manner, the transceiver is further configured to receive a request message sent by the second core network device, including the NAS message and a rerouting indication, the rerouting The routing indication is used to indicate that the NAS message is rerouted to the second core network device;

所述处理器还用于通过所述重路由指示确定该请求消息中的NAS消息是重路由到第二核心网设备的;根据该NAS消息中的UE的标识和密钥集标识找到对应的安全上下文,并利用该安全上下文验证该请求消息中的完整性校验码,当验证成功时,根据所述UE的标识找到对应的鉴权数据,并将该鉴权数据通过收发机返回给第二核心网设备。The processor is further configured to determine, through the rerouting indication, that the NAS message in the request message is rerouted to the second core network device; find the corresponding security device according to the UE identifier and the key set identifier in the NAS message. context, and use the security context to verify the integrity check code in the request message, when the verification is successful, find the corresponding authentication data according to the identity of the UE, and return the authentication data to the second through the transceiver core network equipment.

本发明实施例通过第一核心网设备接收用户设备UE发送的非接入层NAS消息;当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第一核心网设备向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息。从而,使得第一核心网设备当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第一核心网设备向接入网设备发送重路由命令。In this embodiment of the present invention, the non-access stratum NAS message sent by the user equipment UE is received by the first core network device; when it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the first core network device sends the The access network device sends a rerouting command, where the rerouting command includes a NAS message and information for determining the second core network device. Therefore, when the first core network device determines that the NAS message needs to be rerouted to the second core network device in a specific network, the first core network device sends a rerouting command to the access network device.

本发明实施例通过第二核心网设备接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;第二核心网设备根据所述特定消息确定第一核心网设备,并向第一核心网设备发送请求消息,所述请求消息中包括UE的标识;第二核心网设备接收第一核心网设备发送的响应消息,并从中获取所述UE的鉴权数据,该鉴权数据中包括所述UE的安全上下文,该鉴权数据是所述第一核心网设备根据所述UE的标识确定的。从而使得特定网络中的第二核心网设备可以获取第一核心网设备提供的UE的安全上下文,使得特定网络下的核心网设备与UE可以进行安全通信。In this embodiment of the present invention, a specific message sent by the access network device is received by the second core network device, where the specific message includes a non-access stratum NAS message; the second core network device determines the first core network device according to the specific message, and Sending a request message to the first core network device, where the request message includes the identifier of the UE; the second core network device receives the response message sent by the first core network device, and obtains the authentication data of the UE therefrom. The data includes the security context of the UE, and the authentication data is determined by the first core network device according to the identifier of the UE. Therefore, the second core network device in the specific network can obtain the security context of the UE provided by the first core network device, so that the core network device in the specific network can securely communicate with the UE.

本发明实施例通过第三核心网设备接收第一核心网设备发送的请求消息,其中包括用户设备UE的非接入层NAS消息;当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第三核心网设备向所述第一核心网设备发送响应消息,其中包括所述UE的安全上下文和用于确定所述第二核心网设备的信息,从而使得第三核心网设备当接收到第一核心网设备发送的请求消息时,当确定其中的NAS消息需要重路由到特定网络中的第二核心网设备时,通过向所述第一核心网设备发送响应消息将UE的安全上下文和用于确定所述第二核心网设备的信息提供给特定网络中的第二核心网设备。In this embodiment of the present invention, the request message sent by the first core network device is received by the third core network device, including the non-access stratum NAS message of the user equipment UE; when it is determined that the NAS message needs to be rerouted to the second core network device in the specific network When the core network device is used, the third core network device sends a response message to the first core network device, which includes the security context of the UE and the information used to determine the second core network device, so that the third core network device When the device receives the request message sent by the first core network device and determines that the NAS message in it needs to be rerouted to the second core network device in the specific network, it sends a response message to the first core network device to send the UE a The security context and information for determining the second core network device are provided to the second core network device in the specific network.

附图说明Description of drawings

图1为现有技术中MME重选过程示意图;1 is a schematic diagram of an MME reselection process in the prior art;

图2为现有技术中TAU过程中MMEn向MMEo索要安全上下文的过程示意图;2 is a schematic diagram of a process in which MMEn asks for a security context from MMEo in a TAU process in the prior art;

图3为本发明实施例一提供的一种安全上下文的传输处理流程示意图;FIG. 3 is a schematic flowchart of a security context transmission process according to Embodiment 1 of the present invention;

图4为本发明实施例二提供的一种安全上下文的传输处理流程示意图;FIG. 4 is a schematic flowchart of a security context transmission process according to Embodiment 2 of the present invention;

图5为本发明实施例三提供的一种安全上下文的传输处理流程示意图;FIG. 5 is a schematic flowchart of a security context transmission process provided in Embodiment 3 of the present invention;

图6为本发明实施例四提供的一种安全上下文的传输处理流程示意图;FIG. 6 is a schematic flowchart of a security context transmission process according to Embodiment 4 of the present invention;

图7为本发明实施例五提供的一种安全上下文的传输处理流程示意图;FIG. 7 is a schematic flowchart of a security context transmission process according to Embodiment 5 of the present invention;

图8为本发明实施例提供的第一种计算完整性保护校验值(Token值)的方法示意图;8 is a schematic diagram of a first method for calculating an integrity protection check value (Token value) provided by an embodiment of the present invention;

图9为本发明实施例提供的第二种计算Token值的方法示意图;9 is a schematic diagram of a second method for calculating a Token value provided by an embodiment of the present invention;

图10为本发明实施例提供的一种安全上下文的提供方法的流程示意图;10 is a schematic flowchart of a method for providing a security context according to an embodiment of the present invention;

图11为本发明实施例提供的一种安全上下文的获取方法的流程示意图;11 is a schematic flowchart of a method for acquiring a security context according to an embodiment of the present invention;

图12为本发明实施例提供的一种重路由命令的接收处理方法的流程示意图;12 is a schematic flowchart of a method for receiving and processing a rerouting command according to an embodiment of the present invention;

图13为本发明实施例提供的一种安全上下文的提供设备的结构示意图;13 is a schematic structural diagram of a device for providing a security context according to an embodiment of the present invention;

图14为本发明实施例提供的一种安全上下文的获取设备的结构示意图;14 is a schematic structural diagram of a device for acquiring a security context according to an embodiment of the present invention;

图15为本发明实施例提供的一种重路由命令的接收处理设备的结构示意图;15 is a schematic structural diagram of a device for receiving and processing a rerouting command according to an embodiment of the present invention;

图16为本发明实施例六提供的一种安全上下文的传输处理流程示意图;FIG. 16 is a schematic flowchart of a security context transmission process according to Embodiment 6 of the present invention;

图17为本发明实施例七提供的一种安全上下文的传输处理流程示意图;FIG. 17 is a schematic flowchart of a security context transmission process according to Embodiment 7 of the present invention;

图18为本发明实施例八提供的一种安全上下文的传输处理流程示意图;FIG. 18 is a schematic flowchart of a security context transmission process according to Embodiment 8 of the present invention;

图19为本发明实施例九提供的一种安全上下文的传输处理流程示意图;FIG. 19 is a schematic flowchart of a security context transmission process according to Embodiment 9 of the present invention;

图20为本发明实施例提供的另一种安全上下文的提供方法的流程示意图;20 is a schematic flowchart of another method for providing a security context provided by an embodiment of the present invention;

图21为本发明实施例提供的另一种安全上下文的获取方法的流程示意图;21 is a schematic flowchart of another method for acquiring a security context provided by an embodiment of the present invention;

图22为本发明实施例提供的第三种安全上下文的提供方法的流程示意图;22 is a schematic flowchart of a method for providing a third security context provided by an embodiment of the present invention;

图23为本发明实施例提供的另一种安全上下文的提供设备的结构示意图;23 is a schematic structural diagram of another security context providing device according to an embodiment of the present invention;

图24为本发明实施例提供的另一种安全上下文的获取设备的结构示意图;FIG. 24 is a schematic structural diagram of another security context acquisition device provided by an embodiment of the present invention;

图25为本发明实施例提供的第三种安全上下文的提供设备的结构示意图。FIG. 25 is a schematic structural diagram of a device for providing a third security context according to an embodiment of the present invention.

具体实施方式Detailed ways

本发明实施例提供了一种安全上下文的提供、获取方法及设备,用以实现特定网络下的MME可以获取UE的安全上下文,从而使得特定网络下的MME与UE可以进行安全通信。The embodiments of the present invention provide a method and device for providing and acquiring a security context, so as to realize that an MME in a specific network can acquire the security context of a UE, so that the MME in the specific network and the UE can communicate securely.

另外,本发明实施例提供的技术方案还可以对重路由(reroute)的NAS消息进行完整性校验。In addition, the technical solutions provided by the embodiments of the present invention can also perform integrity check on the rerouted NAS message.

本发明中所述的核心网设备,可以是MME,也可以是SGSN等设备。本发明中所述的接入网设备,可以是eNB,也可以是无线网络控制器(Radio Network Controller,RNC)等设备。本发明中所述的NAS消息,可以是附着请求消息,也可以是跟踪区域更新请求消息等。The core network equipment described in the present invention may be an MME or an SGSN or other equipment. The access network device described in the present invention may be an eNB, or may be a radio network controller (Radio Network Controller, RNC) and other devices. The NAS message described in the present invention may be an attach request message or a tracking area update request message or the like.

下面以核心网设备是MME,接入网设备是eNB,NAS消息是附着请求消息为例,给出本发明具体实施例的介绍。In the following, an introduction to specific embodiments of the present invention is given by taking the core network device as an MME, the access network device as an eNB, and the NAS message as an attach request message as an example.

本发明实施例一:Embodiment 1 of the present invention:

本实施例针对NAS消息没有被安全保护(包括完整性保护和机密性保护)的场景,例如UE初次附着到网络(即首次接入网络)上。具体流程如图3所示,包括步骤:This embodiment is directed to a scenario in which the NAS message is not protected by security (including integrity protection and confidentiality protection), for example, the UE attaches to the network for the first time (ie, accesses the network for the first time). The specific process is shown in Figure 3, including steps:

301.UE向第一MME初次发起附着请求(或跟踪区域更新请求);301. The UE initiates an attach request (or a tracking area update request) to the first MME for the first time;

该附着请求(或跟踪区域更新请求)中的演进型通用陆地无线接入网络(E-UTRAN)密钥集标识符(Key Set Identifier in E-UTRAN,eKSI)的所有比特位均设为1,即UE没有可用的安全上下文,该附着请求(或跟踪区域更新请求)未被安全保护。All bits of the Evolved Universal Terrestrial Radio Access Network (E-UTRAN) key set identifier (Key Set Identifier in E-UTRAN, eKSI) in the attach request (or tracking area update request) are set to 1, That is, the UE has no available security context, and the attach request (or tracking area update request) is not protected by security.

其中,所述的eKSI用于标识该UE下的不同安全上下文,具体地,eKSI是安全上下文中的密钥集标识,由于不同的安全上下文中的根密钥不同,因此可以用密钥集标识来标识安全上下文。所述根密钥为Kasme。The eKSI is used to identify different security contexts under the UE. Specifically, the eKSI is the key set identifier in the security context. Since the root keys in different security contexts are different, the key set identifier can be used. to identify the security context. The root key is Kasme.

302.UE与第一MME进行认证和密钥协商,建立UE与第一MME之间的NAS安全关联;302. The UE performs authentication and key negotiation with the first MME, and establishes a NAS security association between the UE and the first MME;

本步骤即建立了UE与第一MME之间共享的安全上下文。In this step, the shared security context between the UE and the first MME is established.

303.第一MME向HSS发起更新位置请求;303. The first MME initiates an update location request to the HSS;

304.HSS查询数据库,即查找UE的签约数据,确定UE是否为需要执行特定业务(例如MTC业务)的UE,是否需要将UE接入相应的特定网络,并返回更新位置确认,该更新位置确认消息中包含使用特定网络的信息,该信息例如包括该UE的业务类型及其接入的特定网络的类型信息等。304. The HSS queries the database, that is, searches the subscription data of the UE, determines whether the UE is a UE that needs to perform a specific service (such as an MTC service), whether the UE needs to be connected to a corresponding specific network, and returns an update location confirmation, which updates the location confirmation. The message contains information about using a specific network, for example, the information includes the service type of the UE and the type information of the specific network accessed by the UE.

305.第一MME接收到使用特定网络的信息指示后,对附着请求(或跟踪区域更新请求)进行重构(re-structure),即使用当前与UE共享的安全上下文关联的eKSI替换附着请求中的eKSI。305. After receiving the information indication of using a specific network, the first MME re-structures the attach request (or the tracking area update request), that is, replaces the attachment request with the eKSI associated with the security context currently shared with the UE. eKSI.

其中,安全上下文关联的eKSI,即该安全上下文中的密钥集标识。The eKSI associated with the security context is the key set identifier in the security context.

306.第一MME向eNB发送重路由命令,该重路由命令中包括重构的附着请求(或重构的跟踪区域更新请求),使用特定网络的信息。306. The first MME sends a rerouting command to the eNB, where the rerouting command includes a reconfigured attach request (or a reconfigured tracking area update request), using information of a specific network.

其中,该使用特定网络的信息,即用于确定第二MME的信息。Wherein, the information of using a specific network is the information used to determine the second MME.

所述第二MME,即特定网络中的MME,即背景技术中所述的specific MME。The second MME, that is, the MME in the specific network, that is, the specific MME described in the background art.

307.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的第二MME,并向第二MME发送特定消息,该特定消息中包括重构的附着请求(或重构的跟踪区域更新请求)、重路由指示以及第一MME的标识信息。307. After receiving the rerouting command, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, and sends a specific message to the second MME, where the specific message includes the reconfigured attach request (or reconfigured Tracking area update request), rerouting indication and identification information of the first MME.

其中,第一MME的标识信息可以是MME ID,也可以是GUTI等。Wherein, the identification information of the first MME may be an MME ID, or may be a GUTI or the like.

其中,eNB根据使用特定网络的信息为UE选择特定网络的第二MME,例如包括:Wherein, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, for example, including:

eNB根据预先配置的网络类型与第二MME标识的对应关系列表,通过特定网络的类型信息确定对应的特定网络的第二MME。The eNB determines the corresponding second MME of the specific network through the type information of the specific network according to the pre-configured correspondence list between the network type and the second MME identifier.

308.第二MME根据第一MME的标识信息找到第一MME,并向第一MME发起上下文请求消息,其中包含UE的IMSI、eKSI和重路由指示。308. The second MME finds the first MME according to the identification information of the first MME, and sends a context request message to the first MME, which contains the IMSI, eKSI and rerouting indication of the UE.

309.第一MME接收到上下文请求消息后,从中获取UE的IMSI、eKSI和重路由指示,第一MME根据重路由指示确定需要查找安全上下文,进而根据IMSI和eKSI找到对应的安全上下文。其中,用IMSI确定UE,用eKSI确定该UE下的安全上下文。309. After receiving the context request message, the first MME obtains the UE's IMSI, eKSI and rerouting indication from it, and the first MME determines that it needs to search for a security context according to the rerouting indication, and then finds the corresponding security context according to the IMSI and eKSI. The UE is determined by the IMSI, and the security context under the UE is determined by the eKSI.

3010.第一MME将UE当前与该第一MME共享的安全上下文通过上下文响应消息发给第二MME,该安全上下文中包含根密钥(Kasme),加密算法(用于防监听的算法)和完整性保护算法(用于防篡改的算法)。3010. The first MME sends the security context currently shared by the UE with the first MME to the second MME through a context response message, where the security context includes the root key (Kasme), the encryption algorithm (the algorithm used to prevent interception) and Integrity Protection Algorithms (algorithms for tamper resistance).

3011.如果第二MME需要重新选择与该UE通信时使用的算法,例如如果第二MME选择的算法(包括加密算法和/或完整性保护算法)安全上下文中的算法不同,则第二MME利用新选择的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含第二MME选择的新算法。其中,第二MME选择的新算法,包括加密算法和/或完整性保护算法。3011. If the second MME needs to reselect the algorithm used when communicating with the UE, for example, if the algorithm (including the encryption algorithm and/or the integrity protection algorithm) selected by the second MME is different in the security context, the second MME uses The newly selected algorithm derives a new NAS key, and sends a NAS security mode command message to the UE, which contains the new algorithm selected by the second MME. The new algorithm selected by the second MME includes an encryption algorithm and/or an integrity protection algorithm.

其中,第二MME利用新选择的算法推衍新的NAS密钥,包括:利用新选择的加密算法和/或完整性保护算法的标识(ID),以及根密钥Kasme,推衍新的NAS密钥。此为现有技术,在此不进行赘述。Wherein, the second MME derives a new NAS key by using the newly selected algorithm, including: deriving a new NAS by using the identifier (ID) of the newly selected encryption algorithm and/or the integrity protection algorithm, and the root key Kasme key. This is the prior art, and details are not described here.

3012.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。3012. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

针对该实施例,可进一步扩展以下五个方面:For this embodiment, the following five aspects can be further expanded:

第一:如果在重路由之前,第一MME向UE分配了标识,例如分配了GUTI(其中包含第一MME的标识,可以用于查找对应的第一MME),那么在305步中还需要用分配的GUTI替换附着请求(或跟踪区域更新请求)中的IMSI(或PTMSI或GUTI),这样307步中不需要携带第一MME的标识信息,308步中携带的不是IMSI而是GUTI。First: if the first MME assigns an identifier to the UE before rerouting, for example, a GUTI (which includes the identifier of the first MME, which can be used to find the corresponding first MME), then in step 305, it is also necessary to use The assigned GUTI replaces the IMSI (or PTMSI or GUTI) in the attach request (or tracking area update request), so step 307 does not need to carry the identification information of the first MME, and step 308 carries not IMSI but GUTI.

第二:308步和309步上下文请求中携带的指示是可选的,不是必须携带的指示。当上下文请求中携带重路由指示时,第一MME根据上下文请求中的重路由指示获知附着请求(或跟踪区域更新请求)是重路由到第二MME上的。Second: the indication carried in the context request in steps 308 and 309 is optional and not mandatory. When the context request carries the rerouting indication, the first MME learns that the attach request (or the tracking area update request) is rerouted to the second MME according to the rerouting indication in the context request.

第三:3011步和3012步的NAS安全模式命令过程是可选的,只有在第二MME为UE选择了新的完整性算法和/或加密算法时才发起此过程。Third: The NAS security mode command procedure of steps 3011 and 3012 is optional, and this procedure is only initiated when the second MME selects a new integrity algorithm and/or encryption algorithm for the UE.

第四:308步上下文请求中也可以携带重构的附着请求(或重构的跟踪区域更新请求),而不直接携带eKSI,第一MME根据IMSI和重构的附着请求(或重构的跟踪区域更新请求)中的eKSI获取安全上下文,第一MME不需要对重构的附着请求(或重构的跟踪区域更新请求)进行完整性验证,只需要根据重路由指示将该安全上下文发给第二MME即可。Fourth: The context request in step 308 may also carry the reconstructed attach request (or the reconstructed tracking area update request) instead of directly carrying the eKSI. The first MME uses the IMSI and the reconstructed attach request (or the reconstructed tracking). The eKSI in the area update request) obtains the security context, and the first MME does not need to perform integrity verification on the reconstructed attach request (or the reconstructed tracking area update request), and only needs to send the security context to the first MME according to the rerouting instruction. Two MME can be.

第五:305步中不对附着请求(或跟踪区域更新请求)进行重构,那么后续步骤中使用的都是UE发送的附着请求(或跟踪区域更新请求)。因此306步重路由命令中还包括第一MME当前与UE共享的安全上下文所关联的eKSI。步骤307特定消息中还包括所述eKSI。308步上下文请求中还可以携带附着请求(或跟踪区域更新请求)。Fifth: in step 305, the attachment request (or the tracking area update request) is not reconstructed, then all the following steps use the attachment request (or the tracking area update request) sent by the UE. Therefore, the rerouting command in step 306 also includes the eKSI associated with the security context currently shared by the first MME with the UE. In step 307, the eKSI is also included in the specific message. The context request in step 308 may also carry an attach request (or a tracking area update request).

本发明实施例二:Embodiment 2 of the present invention:

本实施例针对NAS消息没有被安全保护的场景,例如UE初次附着到网络上。本实施例增加了对附着请求(或跟踪区域更新请求)的完整性保护,提高了安全性。具体流程如图4所示,包括:This embodiment is directed to the scenario where the NAS message is not protected by security, for example, the UE attaches to the network for the first time. This embodiment increases the integrity protection for the attach request (or the tracking area update request), and improves the security. The specific process is shown in Figure 4, including:

401.UE向第一MME初次发起附着请求(或跟踪区域更新请求)。;401. The UE initiates an attach request (or a tracking area update request) to the first MME for the first time. ;

其中的消息认证码(Message Authentication Code,MAC)信元(InformationElement,IE)为空,即未被完整性保护。The Message Authentication Code (MAC) information element (InformationElement, IE) is empty, that is, it is not integrity protected.

402.UE与网络侧进行认证和密钥协商,建立UE与第一MME之间的NAS安全关联;402. The UE performs authentication and key negotiation with the network side, and establishes a NAS security association between the UE and the first MME;

本步骤即建立了UE与第一MME之间共享的安全上下文。In this step, the shared security context between the UE and the first MME is established.

403.第一MME向HSS发起更新位置请求;403. The first MME initiates an update location request to the HSS;

404.HSS查询数据库,即查找UE的签约数据,看UE是否为需要执行特定业务(例如MTC业务)的UE,是否需要将UE接入相应的特定网络,并返回更新位置确认,该更新位置确认消息中包含使用特定网络的信息,该信息例如包括该UE的业务类型及其接入的特定网络的类型信息等。404. The HSS queries the database, that is, searches the subscription data of the UE to see if the UE is a UE that needs to perform a specific service (such as an MTC service), whether the UE needs to be connected to a corresponding specific network, and returns an update location confirmation, which updates the location confirmation. The message contains information about using a specific network, for example, the information includes the service type of the UE and the type information of the specific network accessed by the UE.

405.第一MME接收到使用特定网络的信息指示后,对原来接收到的附着请求消息(或跟踪区域更新请求)进行重构,即第一MME基于当前与UE共享的安全上下文计算令牌(Token)值,并将该Token值填充到附着请求消息的MAC IE,使用与当前安全上下文关联的eKSI替换附着请求中的eKSI.405. After receiving the information indication of using a specific network, the first MME reconstructs the originally received attach request message (or tracking area update request), that is, the first MME calculates the token based on the security context currently shared with the UE (or the tracking area update request). Token) value, and fill the Token value into the MAC IE of the attach request message, and replace the eKSI in the attach request with the eKSI associated with the current security context.

其中,所述Token值,即完整性保护校验值。Wherein, the Token value is the integrity protection check value.

406.第一MME向eNB发送重路由命令,该命令中包括重构的附着请求(或重构的跟踪区域更新请求),使用特定网络的信息。406. The first MME sends a rerouting command to the eNB, where the command includes a reconfigured attach request (or a reconfigured tracking area update request), using information about a specific network.

其中,该使用特定网络的信息,即用于确定第二MME的信息。Wherein, the information of using a specific network is the information used to determine the second MME.

所述第二MME,即特定网络中的MME,即背景技术中所述的specific MME。The second MME, that is, the MME in the specific network, that is, the specific MME described in the background art.

407.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的第二MME,并向第二MME发送特定消息,该特定消息中包括重构的附着请求(或重构的跟踪区域更新请求)、重路由指示以及第一MME的标识信息。407. After receiving the rerouting command, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, and sends a specific message to the second MME, where the specific message includes the reconfigured attach request (or reconfigured Tracking area update request), rerouting indication and identification information of the first MME.

其中,第一MME的标识信息可以是MME ID,也可以是GUTI等。Wherein, the identification information of the first MME may be an MME ID, or may be a GUTI or the like.

其中,eNB根据使用特定网络的信息为UE选择特定网络的第二MME,例如包括:Wherein, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, for example, including:

eNB根据预先配置的网络类型与第二MME标识的对应关系列表,通过特定网络的类型信息确定对应的特定网络的第二MME。The eNB determines the corresponding second MME of the specific network through the type information of the specific network according to the pre-configured correspondence list between the network type and the second MME identifier.

408.第二MME根据第一MME的标识信息找到第一MME,并向第一MME发起上下文请求消息,其中包含UE的IMSI、重构的附着请求和重路由指示。408. The second MME finds the first MME according to the identification information of the first MME, and sends a context request message to the first MME, which includes the IMSI of the UE, the reconfigured attach request and the rerouting indication.

409.第一MME根据IMSI和eKSI找到对应的安全上下文,并利用该安全上下文验证附着请求中的Token值。409. The first MME finds the corresponding security context according to the IMSI and eKSI, and uses the security context to verify the Token value in the attach request.

其中,第一MME利用该安全上下文验证附着请求中的Token值,即第一MME将利用该安全上下文计算得到Token值,与附着请求中的Token值进行比较,一致则验证成功。The first MME uses the security context to verify the Token value in the attach request, that is, the first MME will use the security context to calculate and obtain the Token value, and compare it with the Token value in the attach request. If they are consistent, the verification is successful.

4010.如果验证成功,那么第一MME将UE当前与该第一MME共享的安全上下文通过上下文响应消息发给第二MME,该安全上下文中包含根密钥(Kasme),加密算法(用于防监听的算法)和完整性保护算法(用于防篡改的算法)。4010. If the verification is successful, then the first MME sends the security context that the UE currently shares with the first MME to the second MME through a context response message, where the security context contains the root key (Kasme), the encryption algorithm (used to prevent Algorithms for snooping) and integrity protection algorithms (algorithms for tamper resistance).

4011.如果第二MME需要重新选择与该UE通信时使用的算法,例如如果第二MME选择的算法(包括加密算法和/或完整性保护算法)安全上下文中的算法不同,则第二MME利用新选择的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含第二MME选择的新算法。其中,第二MME选择的新算法,包括加密算法和/或完整性保护算法。4011. If the second MME needs to reselect the algorithm used when communicating with the UE, for example, if the algorithm (including the encryption algorithm and/or the integrity protection algorithm) selected by the second MME is different in the security context, the second MME uses The newly selected algorithm derives a new NAS key, and sends a NAS security mode command message to the UE, which contains the new algorithm selected by the second MME. The new algorithm selected by the second MME includes an encryption algorithm and/or an integrity protection algorithm.

其中,第二MME利用新选择的算法推衍新的NAS密钥,包括:利用新选择的加密算法和/或完整性保护算法的标识(ID),以及根密钥Kasme,推衍新的NAS密钥。此为现有技术,在此不进行赘述。Wherein, the second MME derives a new NAS key by using the newly selected algorithm, including: deriving a new NAS by using the identifier (ID) of the newly selected encryption algorithm and/or the integrity protection algorithm, and the root key Kasme key. This is the prior art, and details are not described here.

4012.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。4012. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

针对该实施例,可进一步扩展以下四个方面:For this embodiment, the following four aspects can be further expanded:

第一:如果在重路由之前,第一MME向UE分配了标识,例如分配了GUTI(其中包含第一MME的标识,可以用于查找对应的第一MME),那么在405步中还需要用分配的GUTI替换附着请求(或跟踪区域更新请求)中的IMSI(或P-TMSI或GUTI),这样407步中不需要携带第一MME的标识信息,408步中携带的不是IMSI而是GUTI。First: If the first MME assigns an identifier to the UE before rerouting, for example, a GUTI (which includes the identifier of the first MME, which can be used to find the corresponding first MME), then in step 405, it is also necessary to use The assigned GUTI replaces the IMSI (or P-TMSI or GUTI) in the attach request (or tracking area update request), so step 407 does not need to carry the identification information of the first MME, and step 408 carries not IMSI but GUTI.

第二:408步和409步上下文请求中携带的重路由指示是可选的,不是必须携带的指示。当上下文请求中携带重路由指示时,第一MME根据上下文请求中的重路由指示获知附着请求(或跟踪区域更新请求)是重路由到第二MME上的,第一MME接收该附着请求(或跟踪区域更新请求)并验证Token值。Second: the rerouting indication carried in the context request in steps 408 and 409 is optional and not mandatory. When the context request carries the rerouting indication, the first MME learns, according to the rerouting indication in the context request, that the attach request (or the tracking area update request) is rerouted to the second MME, and the first MME receives the attach request (or the tracking area update request). Track area update requests) and verify the Token value.

第三:4011步和4012步的NAS安全模式命令过程是可选的,只有在第二MME为UE选择了新的完整性算法和/或加密算法时才发起此过程。Third: The NAS security mode command procedure of steps 4011 and 4012 is optional, and this procedure is only initiated when the second MME selects a new integrity algorithm and/or encryption algorithm for the UE.

第四:405步中不对附着请求(或跟踪区域更新请求)进行重构,只计算Token值,那么后续步骤中使用的都是UE发送的附着请求(或跟踪区域更新请求)。因此,406步重路由命令中还包括第一MME当前与UE共享的安全上下文所关联的eKSI和计算出的Token值。步骤407特定消息中还包括所述eKSI和计算出的Token值。步骤408上下文请求中还包括Token值。步骤409第一MME需要对安全上下文中的Token值进行验证。Fourth: In step 405, the attach request (or the tracking area update request) is not reconstructed, and only the Token value is calculated, then all the following steps use the attach request (or the tracking area update request) sent by the UE. Therefore, the rerouting command in step 406 also includes the eKSI associated with the security context currently shared by the first MME with the UE and the calculated Token value. Step 407 The specific message also includes the eKSI and the calculated Token value. In step 408, the context request also includes the Token value. Step 409: The first MME needs to verify the Token value in the security context.

本发明实施例三:Embodiment three of the present invention:

本实施例针对NAS消息被安全保护并且第一MME上不存在可用安全上下文的场景,例如UE发起附着请求或跟踪区域更新请求时,具体流程如图5所示,包括步骤:This embodiment is aimed at a scenario where the NAS message is secured and there is no available security context on the first MME. For example, when the UE initiates an attach request or a tracking area update request, the specific process is shown in Figure 5, including steps:

501.UE向第一MME发起附着请求(或跟踪区域更新请求),该附着请求(或跟踪区域更新请求)被完整性保护;501. The UE initiates an attach request (or a tracking area update request) to the first MME, and the attach request (or a tracking area update request) is integrity-protected;

502.第一MME上不存在可用的安全上下文,第一MME利用附着请求(或跟踪区域更新请求)中的GUTIo查找第三MME,从而向第三MME发起上下文请求;502. There is no available security context on the first MME, and the first MME uses the GUTIo in the attach request (or the tracking area update request) to search for the third MME, thereby initiating a context request to the third MME;

其中,所述GUTIo即旧的GUTI,也就是第三MME为UE分配的GUTI。The GUTIo is the old GUTI, that is, the GUTI allocated to the UE by the third MME.

503.第三MME验证接收到的附着请求(或跟踪区域更新请求)的完整性。503. The third MME verifies the integrity of the received attach request (or tracking area update request).

504.如果验证成功,第三MME向第一MME发送上下文响应,其中包含安全上下文。504. If the verification is successful, the third MME sends a context response to the first MME, which contains the security context.

505.第一MME向HSS发起更新位置请求;505. The first MME initiates an update location request to the HSS;

506.HSS查询数据库,即查找UE的签约数据,看UE是否为需要执行特定业务(例如MTC业务)的UE,是否需要将UE接入相应的特定网络,并返回更新位置确认,该更新位置确认消息中包含使用特定网络的信息,该信息例如包括该UE的业务类型及其接入的特定网络的类型信息等。506. The HSS queries the database, that is, searches the subscription data of the UE to see if the UE is a UE that needs to perform a specific service (such as an MTC service), whether the UE needs to be connected to a corresponding specific network, and returns an update location confirmation, which updates the location confirmation. The message contains information about using a specific network, for example, the information includes the service type of the UE and the type information of the specific network accessed by the UE.

507.第一MME接收到使用特定网络的信息指示后,对原来接收到的附着请求(或跟踪区域更新请求)消息进行重构,即如果第一MME已经为UE分配了GUTI,第一MME将附着请求(或跟踪区域更新请求)消息中的GUTIo替换为第一MME为UE分配的GUTI;如果第一MME没有为UE分配GUTI,则第一MME将附着请求(或跟踪区域更新请求)消息中的GUTIo替换为IMSI。第一MME基于当前与UE共享的安全上下文计算Token值,并将该Token值替换附着请求(或跟踪区域更新请求)消息的MAC IE;507. After the first MME receives the information indication of using a specific network, it reconstructs the originally received Attach Request (or Tracking Area Update Request) message, that is, if the first MME has allocated a GUTI to the UE, the first MME will The GUTIo in the Attach Request (or Tracking Area Update Request) message is replaced with the GUTI allocated by the first MME for the UE; if the first MME does not allocate a GUTI for the UE, the first MME will add the GUTI in the Attach Request (or Tracking Area Update Request) message to the UE. GUTIo is replaced by IMSI. The first MME calculates the Token value based on the security context currently shared with the UE, and replaces the Token value with the MAC IE of the Attach Request (or Tracking Area Update Request) message;

508.第一MME向eNB发送重路由命令,该命令中包括重构的附着请求(或重构的跟踪区域更新请求)以及使用特定网络的信息。508. The first MME sends a rerouting command to the eNB, where the command includes a reconfigured attach request (or a reconfigured tracking area update request) and information about using a specific network.

其中,该使用特定网络的信息,即用于确定第二MME的信息。Wherein, the information of using a specific network is the information used to determine the second MME.

所述第二MME,即特定网络中的MME,即背景技术中所述的specific MME。The second MME, that is, the MME in the specific network, that is, the specific MME described in the background art.

509.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的第二MME,并向第二MME发送特定消息,该特定消息中包括重构的附着请求(或重构的跟踪区域更新请求)以及重路由指示。509. After receiving the rerouting command, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, and sends a specific message to the second MME, where the specific message includes the reconfigured attach request (or reconfigured Tracking Area Update Request) and rerouting indication.

其中,eNB根据使用特定网络的信息为UE选择特定网络的第二MME,例如包括:Wherein, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, for example, including:

eNB根据预先配置的网络类型与第二MME标识的对应关系列表,通过特定网络的类型信息确定对应的特定网络的第二MME。The eNB determines the corresponding second MME of the specific network through the type information of the specific network according to the pre-configured correspondence list between the network type and the second MME identifier.

5010.第二MME根据重构的附着请求(或重构的跟踪区域更新请求)中的GUTI找到第一MME,并向第一MME发起上下文请求消息,其中包含第一MME为UE分配的GUTI、重构的附着请求(或重构的跟踪区域更新请求)和重路由指示。5010. The second MME finds the first MME according to the GUTI in the reconfigured attach request (or the reconfigured tracking area update request), and sends a context request message to the first MME, which includes the GUTI allocated by the first MME for the UE, Refactored Attach Request (or Refactored Tracking Area Update Request) and Rerouting Indication.

5011.第一MME根据重路由指示获知该重构的附着请求(或重构的跟踪区域更新请求)是重路由的,第一MME接收该重构的附着请求(或重构的跟踪区域更新请求),并根据GUTI(或IMSI)和eKSI找到对应的安全上下文,并利用该安全上下文验证附着请求(或跟踪区域更新请求)中的Token值。5011. The first MME learns according to the rerouting indication that the reconfigured attach request (or the reconfigured tracking area update request) is rerouted, and the first MME receives the reconfigured attach request (or the reconfigured tracking area update request) ), and find the corresponding security context according to GUTI (or IMSI) and eKSI, and use the security context to verify the Token value in the attach request (or tracking area update request).

其中,第一MME根据GUTI(或IMSI)和eKSI找到对应的安全上下文,包括:第一MME根据GUTI(或IMSI)确定相应的UE,并根据eKSI确定该UE下的相应的安全上下文。The first MME finds the corresponding security context according to the GUTI (or IMSI) and the eKSI, including: the first MME determines the corresponding UE according to the GUTI (or IMSI), and determines the corresponding security context under the UE according to the eKSI.

第一MME利用该安全上下文验证重构的附着请求(或重构的跟踪区域更新请求)中的Token值,即第一MME将利用该安全上下文计算得到Token值,与重构的附着请求(或重构的跟踪区域更新请求)中的Token值进行比较,一致则验证成功。The first MME uses the security context to verify the Token value in the reconstructed attach request (or the reconstructed tracking area update request), that is, the first MME will use the security context to calculate the Token value, which is different from the reconstructed attach request (or The Token value in the refactored tracking area update request) is compared, and the verification is successful if they are consistent.

5012.如果验证成功,那么第一MME将UE当前的安全上下文发给第二MME,该安全上下文中包含第根密钥(Kasme)、加密算法(用于防监听的算法)和完整性保护算法(用于防篡改的算法)。5012. If the verification is successful, the first MME sends the current security context of the UE to the second MME, where the security context includes the first root key (Kasme), encryption algorithm (algorithm for preventing interception) and integrity protection algorithm (algorithms for tamper resistance).

5013.如果第二MME需要重新选择与该UE通信时使用的算法,例如如果第二MME选择的算法(包括加密算法和/或完整性保护算法)安全上下文中的算法不同,则第二MME利用新选择的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含第二MME选择的新算法。其中,第二MME选择的新算法,包括加密算法和/或完整性保护算法。其中,第二MME利用新选择的算法推衍新的NAS密钥,包括:利用新选择的加密算法和/或完整性保护算法的标识(ID),以及根密钥Kasme,推衍新的NAS密钥。此为现有技术,在此不进行赘述。5013. If the second MME needs to reselect the algorithm used when communicating with the UE, for example, if the algorithm (including the encryption algorithm and/or the integrity protection algorithm) selected by the second MME is different in the security context, the second MME uses The newly selected algorithm derives a new NAS key, and sends a NAS security mode command message to the UE, which contains the new algorithm selected by the second MME. The new algorithm selected by the second MME includes an encryption algorithm and/or an integrity protection algorithm. Wherein, the second MME derives a new NAS key by using the newly selected algorithm, including: deriving a new NAS by using the identifier (ID) of the newly selected encryption algorithm and/or the integrity protection algorithm, and the root key Kasme key. This is the prior art, and details are not described here.

5014.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。5014. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

针对该实施例,可进一步扩展以下二个方面:For this embodiment, the following two aspects can be further expanded:

第一:如果507步中将GUTIo替换为IMSI,那么609步中需要携带第一MME的标识信息,从而第二MME可以根据第一MME的标识信息找到对应的第一MME索要安全上下文。First: if GUTIo is replaced by IMSI in step 507, then step 609 needs to carry the identification information of the first MME, so that the second MME can find the corresponding first MME and request a security context according to the identification information of the first MME.

第二:5013步和5014步NAS安全模式命令过程是可选的,只有在第二MME为UE选择了新的完整性算法和/或加密算法时才发起此过程。Second: Steps 5013 and 5014 NAS security mode command procedures are optional and are only initiated when the second MME selects a new integrity algorithm and/or encryption algorithm for the UE.

本发明实施例四:Embodiment four of the present invention:

本实施例针对NAS消息被安全保护并且第一MME上不存在可用安全上下文的场景,例如UE发起附着请求或跟踪区域更新请求时,具体流程如图6所示,包括步骤:This embodiment is aimed at the scenario where the NAS message is secured and there is no available security context on the first MME. For example, when the UE initiates an attach request or a tracking area update request, the specific process is shown in Figure 6, including steps:

601.UE向第一MME发起附着请求(或跟踪区域更新请求),该附着请求(或跟踪区域更新请求)被完整性保护;601. The UE initiates an attach request (or tracking area update request) to the first MME, and the attach request (or tracking area update request) is integrity-protected;

602.第一MME上不存在可用的安全上下文,第一MME利用附着请求(或跟踪区域更新请求)中的GUTIo查找第三MME,从而向第三MME发起上下文请求;602. There is no available security context on the first MME, and the first MME uses the GUTIo in the attach request (or the tracking area update request) to search for the third MME, thereby initiating a context request to the third MME;

其中,所述GUTIo即旧的GUTI,也就是第三MME为UE分配的GUTI。The GUTIo is the old GUTI, that is, the GUTI allocated to the UE by the third MME.

603.第三MME验证接收到的附着请求(或跟踪区域更新请求)的完整性。603. The third MME verifies the integrity of the received attach request (or tracking area update request).

604.如果验证成功,第三MME向第一MME发送上下文响应,其中包含安全上下文。604. If the verification is successful, the third MME sends a context response to the first MME, which contains the security context.

605.第一MME向HSS发起更新位置请求;605. The first MME initiates an update location request to the HSS;

606.HSS查询数据库,即查找UE的签约数据,看UE是否为需要执行特定业务(例如MTC业务)的UE,是否需要将UE接入相应的特定网络,并返回更新位置确认,该更新位置确认消息中包含使用特定网络的信息,该信息例如包括该UE的业务类型及其接入的特定网络的类型信息等。606. The HSS queries the database, that is, searches the subscription data of the UE to see whether the UE is a UE that needs to perform a specific service (such as MTC service), whether the UE needs to be connected to a corresponding specific network, and returns an update location confirmation, which updates the location confirmation. The message contains information about using a specific network, for example, the information includes the service type of the UE and the type information of the specific network accessed by the UE.

607.第一MME接收到使用特定网络的信息指示后,向eNB发送重路由命令,该命令中包括附着请求(或跟踪区域更新请求)、UE的标识以及使用特定网络的信息。607. After receiving the information indication of using the specific network, the first MME sends a rerouting command to the eNB, where the command includes an attach request (or a tracking area update request), the identity of the UE and the information of using the specific network.

其中,该使用特定网络的信息,即用于确定第二MME的信息。Wherein, the information of using a specific network is the information used to determine the second MME.

所述第二MME,即特定网络中的MME,即背景技术中所述的specific MME。The second MME, that is, the MME in the specific network, that is, the specific MME described in the background art.

其中,所述UE的标识可以是第一MME为UE分配的GUTI,也可以是IMSI。The identifier of the UE may be the GUTI allocated to the UE by the first MME, or may be the IMSI.

可选地,如果第一MME与UE之间进行了重认证,那么所述重路由命令中还可以包含eKSI。Optionally, if re-authentication is performed between the first MME and the UE, the rerouting command may further include eKSI.

609.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的第二MME,并向第二MME发送特定消息,该特定消息中包括附着请求(或跟踪区域更新请求),UE的标识以及重路由指示。609. After receiving the rerouting command, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, and sends a specific message to the second MME, where the specific message includes an attach request (or a tracking area update request), The identity of the UE and the rerouting indication.

其中,eNB根据使用特定网络的信息为UE选择特定网络的第二MME,例如包括:Wherein, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, for example, including:

eNB根据预先配置的网络类型与第二MME标识的对应关系列表,通过特定网络的类型信息确定对应的特定网络的第二MME。The eNB determines the corresponding second MME of the specific network through the type information of the specific network according to the pre-configured correspondence list between the network type and the second MME identifier.

其中,所述UE的标识可以是第一MME为UE分配的GUTI,也可以是IMSI。The identifier of the UE may be the GUTI allocated to the UE by the first MME, or may be the IMSI.

可选地,当UE的标识是IMSI时,所述特定消息中还可以包含第一MME的标识信息,从而第二MME可以根据第一MME的标识信息找到对应的第一MME。Optionally, when the identifier of the UE is an IMSI, the specific message may further include the identifier information of the first MME, so that the second MME can find the corresponding first MME according to the identifier information of the first MME.

可选地,如果第一MME与UE之间进行了重认证,那么所述特定消息中还可以包含eKSI。Optionally, if re-authentication is performed between the first MME and the UE, the specific message may further include eKSI.

6010.第二MME根据特定消息中的GUTI或第一MME的标识信息找到第一MME,并向第一MME发起上下文请求消息,其中包含UE的标识、附着请求(或跟踪区域更新请求)和重路由指示。6010. The second MME finds the first MME according to the GUTI in the specific message or the identity information of the first MME, and sends a context request message to the first MME, which includes the UE's identity, an attach request (or a tracking area update request), and a retry. routing instructions.

其中,所述UE的标识可以是第一MME为UE分配的GUTI,也可以是IMSI。The identifier of the UE may be the GUTI allocated to the UE by the first MME, or may be the IMSI.

可选地,如果第一MME与UE之间进行了重认证,那么所述特定消息中还可以包含eKSI。Optionally, if re-authentication is performed between the first MME and the UE, the specific message may further include eKSI.

6011.第一MME根据重路由指示获知该附着请求(或跟踪区域更新请求)是重路由的,第一MME接收该附着请求(或跟踪区域更新请求),并根据GUTI(或IMSI)和eKSI找到对应的安全上下文,并利用该安全上下文验证附着请求(或跟踪区域更新请求)。6011. The first MME learns that the attach request (or tracking area update request) is rerouted according to the rerouting indication, and the first MME receives the attach request (or tracking area update request), and finds out according to GUTI (or IMSI) and eKSI. The corresponding security context is used, and the attach request (or the tracking area update request) is verified with the security context.

其中,第一MME根据GUTI(或IMSI)和eKSI找到对应的安全上下文,包括:第一MME根据GUTI(或IMSI)确定相应的UE,并根据eKSI确定该UE下的相应的安全上下文。The first MME finds the corresponding security context according to the GUTI (or IMSI) and the eKSI, including: the first MME determines the corresponding UE according to the GUTI (or IMSI), and determines the corresponding security context under the UE according to the eKSI.

第一MME利用该安全上下文验证附着请求(或跟踪区域更新请求)中,即第一MME将利用该安全上下文计算得到MAC值,与附着请求(或跟踪区域更新请求)中的MAC值进行比较,一致则验证成功。The first MME uses the security context to verify the attachment request (or the tracking area update request), that is, the first MME will use the security context to calculate and obtain the MAC value, and compare it with the MAC value in the attach request (or the tracking area update request), If they are consistent, the verification is successful.

6012.如果验证成功,那么第一MME将UE当前的安全上下文发给第二MME,该安全上下文中包含第根密钥(Kasme)、加密算法(用于防监听的算法)和完整性保护算法(用于防篡改的算法)。6012. If the verification is successful, the first MME sends the current security context of the UE to the second MME, where the security context includes the first root key (Kasme), the encryption algorithm (the algorithm used for anti-eavesdropping) and the integrity protection algorithm (algorithms for tamper resistance).

6013.如果第二MME需要重新选择与该UE通信时使用的算法,例如如果第二MME选择的算法(包括加密算法和/或完整性保护算法)安全上下文中的算法不同,则第二MME利用新选择的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含第二MME选择的新算法。其中,第二MME选择的新算法,包括加密算法和/或完整性保护算法。其中,第二MME利用新选择的算法推衍新的NAS密钥,包括:利用新选择的加密算法和/或完整性保护算法的标识(ID),以及根密钥Kasme,推衍新的NAS密钥。此为现有技术,在此不进行赘述。6013. If the second MME needs to reselect the algorithm used when communicating with the UE, for example, if the algorithm (including the encryption algorithm and/or the integrity protection algorithm) selected by the second MME is different in the security context, the second MME uses The newly selected algorithm derives a new NAS key, and sends a NAS security mode command message to the UE, which contains the new algorithm selected by the second MME. The new algorithm selected by the second MME includes an encryption algorithm and/or an integrity protection algorithm. Wherein, the second MME derives a new NAS key by using the newly selected algorithm, including: deriving a new NAS by using the identifier (ID) of the newly selected encryption algorithm and/or the integrity protection algorithm, and the root key Kasme key. This is the prior art, and details are not described here.

6014.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。6014. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

针对该实施例,可进一步扩展以下一个方面:For this embodiment, one of the following aspects can be further expanded:

第一:6013步和6014步NAS安全模式命令过程是可选的,只有在第二MME为UE选择了新的完整性算法和/或加密算法时才发起此过程。First: The NAS security mode command procedure of steps 6013 and 6014 is optional and is only initiated when the second MME has selected a new integrity algorithm and/or encryption algorithm for the UE.

本发明实施例五:Embodiment 5 of the present invention:

本实施例针对NAS消息被安全保护并且第一MME上不存在可用安全上下文的场景,例如UE发起附着请求或跟踪区域更新请求时,具体流程如图7所示,包括步骤:This embodiment is aimed at a scenario where the NAS message is secured and there is no available security context on the first MME. For example, when the UE initiates an attach request or a tracking area update request, the specific process is shown in Figure 7, including the steps:

701.UE向第一MME发起附着请求(或跟踪区域更新请求),该附着请求(或跟踪区域更新请求)被完整性保护;701. The UE initiates an attach request (or tracking area update request) to the first MME, and the attach request (or tracking area update request) is integrity-protected;

702.第一MME上不存在可用的安全上下文,第一MME利用附着请求(或跟踪区域更新请求)中的GUTIo查找第三MME,从而向第三MME发起上下文请求;702. There is no available security context on the first MME, and the first MME uses the GUTIo in the attach request (or the tracking area update request) to search for the third MME, thereby initiating a context request to the third MME;

其中,所述GUTIo即旧的GUTI,也就是第三MME为UE分配的GUTI。The GUTIo is the old GUTI, that is, the GUTI allocated to the UE by the third MME.

703.第三MME验证接收到的附着请求(或跟踪区域更新请求)的完整性。703. The third MME verifies the integrity of the received attach request (or tracking area update request).

704.如果验证成功,第三MME向第一MME发送上下文响应,其中包含安全上下文和使用特定网络的信息。704. If the verification is successful, the third MME sends a context response to the first MME, which contains the security context and information on using a specific network.

705.第一MME接收到使用特定网络的信息指示后,向eNB发送重路由命令,该命令中包括附着请求(或跟踪区域更新请求)以及使用特定网络的信息。705. After receiving the information indication of using the specific network, the first MME sends a rerouting command to the eNB, where the command includes the attach request (or the tracking area update request) and the information of using the specific network.

其中,该使用特定网络的信息,即用于确定第二MME的信息。Wherein, the information of using a specific network is the information used to determine the second MME.

所述第二MME,即特定网络中的MME,即背景技术中所述的specific MME。The second MME, that is, the MME in the specific network, that is, the specific MME described in the background art.

706.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的第二MME,并向第二MME发送特定消息,该特定消息中包括附着请求(或跟踪区域更新请求)以及重路由指示。706. After receiving the rerouting command, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, and sends a specific message to the second MME, the specific message includes an attach request (or a tracking area update request) and Rerouting indication.

其中,eNB根据使用特定网络的信息为UE选择特定网络的第二MME,例如包括:Wherein, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, for example, including:

eNB根据预先配置的网络类型与第二MME标识的对应关系列表,通过特定网络的类型信息确定对应的特定网络的第二MME。The eNB determines the corresponding second MME of the specific network through the type information of the specific network according to the pre-configured correspondence list between the network type and the second MME identifier.

707.第二MME根据附着请求(或跟踪区域更新请求)中的GUTI找到第三MME,并向第三MME发起上下文请求消息,其中包含GUTI、附着请求(或跟踪区域更新请求)和重路由指示。707. The second MME finds the third MME according to the GUTI in the attach request (or the tracking area update request), and sends a context request message to the third MME, which includes the GUTI, the attach request (or the tracking area update request) and the rerouting indication .

708.第三MME根据重路由指示获知该附着请求(或跟踪区域更新请求)是重路由的,第三MME接收该附着请求(或跟踪区域更新请求),并根据GUTI和eKSI找到对应的安全上下文,并利用该安全上下文验证附着请求(或跟踪区域更新请求)。708. The third MME learns that the attach request (or the tracking area update request) is rerouted according to the rerouting indication, and the third MME receives the attach request (or the tracking area update request) and finds the corresponding security context according to the GUTI and eKSI , and verify the attach request (or tracking area update request) with the security context.

其中,第三MME根据GUTI和eKSI找到对应的安全上下文,包括:第三MME根据GUTI确定相应的UE,并根据eKSI确定该UE下的相应的安全上下文。The third MME finds the corresponding security context according to the GUTI and the eKSI, including: the third MME determines the corresponding UE according to the GUTI, and determines the corresponding security context under the UE according to the eKSI.

第三MME利用该安全上下文验证附着请求(或跟踪区域更新请求)中,即第三MME将利用该安全上下文计算得到MAC值,与附着请求(或跟踪区域更新请求)中的MAC值进行比较,一致则验证成功。The third MME uses the security context to verify the attachment request (or the tracking area update request), that is, the third MME will use the security context to calculate the MAC value, and compare it with the MAC value in the attach request (or the tracking area update request), If they are consistent, the verification is successful.

709.如果验证成功,那么第三MME将UE当前的安全上下文发给第二MME,该安全上下文中包含第根密钥(Kasme)、加密算法(用于防监听的算法)和完整性保护算法(用于防篡改的算法)。709. If the verification is successful, the third MME sends the current security context of the UE to the second MME, where the security context includes the first root key (Kasme), the encryption algorithm (the algorithm used to prevent interception) and the integrity protection algorithm (algorithms for tamper resistance).

7010.如果第二MME需要重新选择与该UE通信时使用的算法,例如如果第二MME选择的算法(包括加密算法和/或完整性保护算法)安全上下文中的算法不同,则第二MME利用新选择的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含第二MME选择的新算法。其中,第二MME选择的新算法,包括加密算法和/或完整性保护算法。其中,第二MME利用新选择的算法推衍新的NAS密钥,包括:利用新选择的加密算法和/或完整性保护算法的标识(ID),以及根密钥Kasme,推衍新的NAS密钥。此为现有技术,在此不进行赘述。7010. If the second MME needs to reselect the algorithm used when communicating with the UE, for example, if the algorithm (including the encryption algorithm and/or the integrity protection algorithm) selected by the second MME is different in the security context, the second MME uses The newly selected algorithm derives a new NAS key, and sends a NAS security mode command message to the UE, which contains the new algorithm selected by the second MME. The new algorithm selected by the second MME includes an encryption algorithm and/or an integrity protection algorithm. Wherein, the second MME derives a new NAS key by using the newly selected algorithm, including: deriving a new NAS by using the identifier (ID) of the newly selected encryption algorithm and/or the integrity protection algorithm, and the root key Kasme key. This is the prior art, and details are not described here.

7011.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。7011. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

本实施例中,如果把第二MME看作是第二核心网设备,则相应地,可以把第三MME看作是第一核心网设备。In this embodiment, if the second MME is regarded as the second core network device, correspondingly, the third MME can be regarded as the first core network device.

针对该实施例,可进一步扩展以下一个方面:For this embodiment, one of the following aspects can be further expanded:

第一:7010步和7011步NAS安全模式命令过程是可选的,只有在第二MME为UE选择了新的完整性算法和/或加密算法时才发起此过程。First: Steps 7010 and 7011 The NAS security mode command procedure is optional and is only initiated when the second MME selects a new integrity algorithm and/or encryption algorithm for the UE.

以下结合附图介绍一下本实施例提供的Token的计算方法。The following describes the calculation method of the Token provided by this embodiment with reference to the accompanying drawings.

方法一:method one:

参见图8,采用KEY、MESSAGE、COUNT、BEARER标识、DIRECTION值,通过EIA算法计算得到Token值。Referring to Figure 8, using KEY, MESSAGE, COUNT, BEARER identification, and DIRECTION values, the Token value is calculated by the EIA algorithm.

其中,计数(COUNT)值为NAS消息的计数值,具体采用UE与第一MME共享的计数值;Wherein, the count (COUNT) value is the count value of the NAS message, and specifically adopts the count value shared by the UE and the first MME;

消息(MESSAGE)为NAS消息;The message (MESSAGE) is a NAS message;

EIA为完整性算法;EIA is the integrity algorithm;

密钥(KEY)设置为KNASint;The key (KEY) is set to KNASint;

承载(BEARER)标识所有比特位设置为默认值,例如1;Bearer (BEARER) identifies that all bits are set to default values, such as 1;

方向(DIRECTION)值比特位设置为默认值,例如1;The DIRECTION value bit is set to the default value, such as 1;

方法二:Method Two:

参见图9,只采用NAS消息和NAS消息的计数值以及NAS层完整性密钥,用哈希函数计算得到Token值。Referring to FIG. 9, only the NAS message and the count value of the NAS message and the NAS layer integrity key are used, and the Token value is obtained by calculating the hash function.

综上所述,在第一核心网设备侧,参见图10,本发明实施例提供的一种获取安全上下文的方法,包括步骤:To sum up, on the side of the first core network device, referring to FIG. 10 , a method for obtaining a security context provided by an embodiment of the present invention includes the steps:

901、第一核心网设备接收用户设备UE发送的非接入层NAS消息;901. A first core network device receives a non-access stratum NAS message sent by a user equipment UE;

902、当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第一核心网设备向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息;902. When it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the first core network device sends a rerouting command to the access network device, where the rerouting command includes the NAS message and a command for determining the information of the second core network device;

903、第一核心网设备接收所述第二核心网设备发送的上下文请求,所述上下文请求中包括UE的标识以及密钥集标识,第一核心网设备根据所述UE的标识以及密钥集标识,查找对应的安全上下文,并将该安全上下文发送给所述第二核心网设备。903. The first core network device receives the context request sent by the second core network device, where the context request includes the identifier of the UE and the identifier of the key set, and the first core network device receives the identifier of the UE and the identifier of the key set according to the identifier of the UE and the identifier of the key set. identification, look up the corresponding security context, and send the security context to the second core network device.

较佳地,第一核心网设备向接入网设备发送重路由命令之前,该方法还包括:Preferably, before the first core network device sends the rerouting command to the access network device, the method further includes:

第一核心网设备对接收到的NAS消息进行重构,所述重路由命令中包含的NAS消息,为重构的NAS消息。The first core network device reconstructs the received NAS message, and the NAS message included in the rerouting command is the reconstructed NAS message.

较佳地,第一核心网设备对接收到的来自所述UE的NAS消息进行重构,包括:Preferably, the first core network device reconstructs the received NAS message from the UE, including:

第一核心网设备利用当前安全上下文中的密钥集标识,替换该UE发送的NAS消息中的密钥集标识;和/或,The first core network device uses the key set identifier in the current security context to replace the key set identifier in the NAS message sent by the UE; and/or,

第一核心网设备根据当前安全上下文计算完整性保护校验值,并将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE。The first core network device calculates the integrity protection check value according to the current security context, and uses the integrity protection check value as the message authentication code MAC information element IE in the NAS message sent by the UE.

较佳地,将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE,包括:Preferably, the integrity protection check value is used as the message authentication code MAC information element IE in the NAS message sent by the UE, including:

将所述完整性保护校验值填充到所述UE发送的NAS消息中的消息认证码MAC信元IE;或Filling the integrity protection check value into the message authentication code MAC information element IE in the NAS message sent by the UE; or

将所述完整性保护校验值替换所述UE发送的NAS消息中的消息认证码MAC。Replace the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.

较佳地,第一核心网设备对接收到的来自所述UE的NAS消息进行重构,还包括:Preferably, the first core network device reconstructs the received NAS message from the UE, further comprising:

第一核心网设备将第一核心网设备为所述UE分配的标识替换从该UE接收到的NAS消息中的UE的标识。The first core network device replaces the identifier of the UE in the NAS message received from the UE with the identifier allocated by the first core network device to the UE.

较佳地,所述密钥集标识包含在所述上下文请求中;或者,Preferably, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

较佳地,第一核心网设备确定当前的安全上下文后,将该安全上下文发送给第二核心网设备前,该方法还包括:Preferably, after the first core network device determines the current security context, and before sending the security context to the second core network device, the method further includes:

第一核心网设备利用当前的安全上下文验证该上下文请求中携带的NAS消息的完整性;The first core network device uses the current security context to verify the integrity of the NAS message carried in the context request;

则,所述第一核心网设备将该安全上下文发送给第二核心网设备的步骤,是当所述验证成功时执行的。Then, the step of sending the security context by the first core network device to the second core network device is performed when the verification is successful.

较佳地,第一核心网设备利用当前与该UE共享的安全上下文验证该上下文请求中携带的NAS消息的完整性,包括:Preferably, the first core network device uses the security context currently shared with the UE to verify the integrity of the NAS message carried in the context request, including:

第一核心网设备验证该上下文请求中携带的NAS消息中的完整性保护校验值或者消息认证码MAC值;或者The first core network device verifies the integrity protection check value or the message authentication code MAC value in the NAS message carried in the context request; or

第一核心网设备验证该上下文请求中的完整性保护校验值The first core network device verifies the integrity protection check value in the context request

较佳地,所述重路由命令中还包括:Preferably, the rerouting command also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

较佳地,所述上下文请求中还包括:Preferably, the context request also includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

相应地,参见图11,在第二核心网设备侧,本发明实施例提供的一种获取安全上下文的方法,包括:Correspondingly, referring to FIG. 11 , on the device side of the second core network, a method for acquiring a security context provided by an embodiment of the present invention includes:

101、第二核心网设备接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;101. The second core network device receives a specific message sent by the access network device, where the specific message includes a non-access stratum NAS message;

102、第二核心网设备根据所述特定消息确定第一核心网设备,并向第一核心网设备发送上下文请求,所述上下文请求中包括UE的标识以及密钥集标识;102. The second core network device determines the first core network device according to the specific message, and sends a context request to the first core network device, where the context request includes the identifier of the UE and the key set identifier;

103、第二核心网设备接收第一核心网设备发送的上下文响应,并从中获取安全上下文,该安全上下文是第一核心网设备根据所述上下文请求中所述UE的标识以及密钥集标识确定的。103. The second core network device receives the context response sent by the first core network device, and obtains a security context therefrom, where the security context is determined by the first core network device according to the identifier of the UE and the key set identifier in the context request. of.

较佳地,所述NAS消息中包含第一核心网设备为所述UE分配的标识,第二核心网设备根据该标识确定第一核心网设备。Preferably, the NAS message includes an identifier allocated to the UE by the first core network device, and the second core network device determines the first core network device according to the identifier.

较佳地,所述特定消息中还包括第一核心网设备的标识信息,第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Preferably, the specific message further includes identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

较佳地,所述密钥集标识包含在所述上下文请求中;或者,Preferably, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

较佳地,第二核心网设备获取的所述UE的安全上下文中,包含第一核心网设备保护NAS消息所使用的加密算法和完整性保护算法。Preferably, the security context of the UE acquired by the second core network device includes the encryption algorithm and the integrity protection algorithm used by the first core network device to protect the NAS message.

较佳地,第二核心网设备获取所述UE的安全上下文后,该方法还包括:Preferably, after the second core network device acquires the security context of the UE, the method further includes:

当第二核心网设备需要选择新的算法时,第二核心网设备利用新的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,其中包含新的算法的标识;其中,所述新的算法包括加密算法和/或完整性保护算法;When the second core network device needs to select a new algorithm, the second core network device uses the new algorithm to derive a new NAS key, and sends a NAS security mode command message to the UE, which contains the identifier of the new algorithm; wherein, The new algorithm includes an encryption algorithm and/or an integrity protection algorithm;

第二核心网设备接收该UE反馈的NAS安全模式完成消息。The second core network device receives the NAS security mode completion message fed back by the UE.

较佳地,所述上下文请求中还包括:Preferably, the context request also includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

相应地,在接入网设备侧,参见图12,本发明实施例提供的一种重路由命令的接收处理方法,包括:Correspondingly, on the access network device side, referring to FIG. 12 , a method for receiving and processing a rerouting command provided by an embodiment of the present invention includes:

111、接入网设备接收第一核心网设备发送的重路由命令,其中包含非接入层NAS消息和用于确定第二核心网设备的指示信息;111. The access network device receives a rerouting command sent by the first core network device, which includes a non-access stratum NAS message and indication information for determining the second core network device;

112、接入网设备根据所述指示信息,确定所述第二核心网设备,并向所述第二核心网设备发送携带所述NAS消息的特定消息。112. The access network device determines the second core network device according to the indication information, and sends a specific message carrying the NAS message to the second core network device.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

第一核心网设备的标识信息,所述第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

较佳地,所述NAS消息是所述第一核心网设备对接收到的UE发送的NAS消息进行重构后的NAS消息。Preferably, the NAS message is a NAS message reconstructed by the first core network device on the received NAS message sent by the UE.

较佳地,所述重路由命令中还包括:Preferably, the rerouting command also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

参见图13,本发明实施例提供的一种提供安全上下文的设备,包括:Referring to FIG. 13, a device for providing a security context provided by an embodiment of the present invention includes:

接收NAS消息单元131,用于接收用户设备UE发送的非接入层NAS消息;a receiving NAS message unit 131, configured to receive a non-access stratum NAS message sent by the user equipment UE;

发送重路由命令单元132,用于当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息;The sending rerouting command unit 132 is configured to send a rerouting command to the access network device when it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, where the rerouting command includes the NAS message and the second core network device. information for determining the second core network device;

安全上下文提供单元133,用于接收所述第二核心网设备发送的上下文请求,所述上下文请求中包括UE的标识以及密钥集标识,根据所述UE的标识以及密钥集标识,查找对应的安全上下文,并将该安全上下文发送给所述第二核心网设备。The security context providing unit 133 is configured to receive a context request sent by the second core network device, where the context request includes the identifier of the UE and the identifier of the key set, and searches for the corresponding identifier according to the identifier of the UE and the identifier of the key set. and send the security context to the second core network device.

较佳地,所述发送重路由命令单元还用于:Preferably, the sending rerouting command unit is also used for:

在向接入网设备发送重路由命令之前,对接收到的NAS消息进行重构,所述重路由命令中包含的NAS消息,为重构的NAS消息。Before sending the rerouting command to the access network device, the received NAS message is reconstructed, and the NAS message included in the rerouting command is the reconstructed NAS message.

较佳地,所述发送重路由命令单元对接收到的来自所述UE的NAS消息进行重构时,具体用于:Preferably, when the rerouting command sending unit reconstructs the received NAS message from the UE, it is specifically used for:

利用当前安全上下文中的密钥集标识,替换该UE发送的NAS消息中的密钥集标识;和/或,Use the key set identifier in the current security context to replace the key set identifier in the NAS message sent by the UE; and/or,

根据当前安全上下文计算完整性保护校验值,并将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE。Calculate the integrity protection check value according to the current security context, and use the integrity protection check value as the message authentication code MAC information element IE in the NAS message sent by the UE.

较佳地,所述发送重路由命令单元将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE时,具体用于:Preferably, when the sending rerouting command unit uses the integrity protection check value as the message authentication code MAC information element IE in the NAS message sent by the UE, it is specifically used for:

将所述完整性保护校验值填充到所述UE发送的NAS消息中的消息认证码MAC信元IE;或Filling the integrity protection check value into the message authentication code MAC information element IE in the NAS message sent by the UE; or

将所述完整性保护校验值替换所述UE发送的NAS消息中的消息认证码MAC。Replace the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.

较佳地,所述发送重路由命令单元,还用于:Preferably, the sending rerouting command unit is also used for:

将第一核心网设备为所述UE分配的标识替换从该UE接收到的NAS消息中的UE的标识。The identifier of the UE in the NAS message received from the UE is replaced by the identifier assigned to the UE by the first core network device.

较佳地,所述密钥集标识包含在所述上下文请求中;或者,Preferably, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

较佳地,所述安全上下文提供单元还用于:Preferably, the security context providing unit is also used for:

在确定当前的安全上下文后,将该安全上下文发送给第二核心网设备前,利用当前的安全上下文验证该上下文请求中携带的NAS消息的完整性;After determining the current security context, before sending the security context to the second core network device, use the current security context to verify the integrity of the NAS message carried in the context request;

则,当所述验证成功时,所述安全上下文将该安全上下文发送给第二核心网设备。Then, when the verification is successful, the security context sends the security context to the second core network device.

较佳地,所述安全上下文提供单元利用当前与该UE共享的安全上下文验证该上下文请求中携带的NAS消息的完整性时,具体用于:Preferably, when the security context providing unit uses the security context currently shared with the UE to verify the integrity of the NAS message carried in the context request, it is specifically used for:

验证该上下文请求中携带的NAS消息中的完整性保护校验值或者消息认证码MAC值;或者Verify the integrity protection check value or message authentication code MAC value in the NAS message carried in the context request; or

验证该上下文请求中的完整性保护校验值。Verify the integrity protection check value in this context request.

较佳地,所述重路由命令中还包括:Preferably, the rerouting command also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

较佳地,所述上下文请求中还包括:Preferably, the context request also includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

图13所示的设备可以是核心网设备,例如MME。The device shown in FIG. 13 may be a core network device, such as an MME.

参见图14,本发明实施例提供的一种获取安全上下文的设备,包括:Referring to FIG. 14 , a device for acquiring a security context provided by an embodiment of the present invention includes:

特定消息接收单元141,用于接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;a specific message receiving unit 141, configured to receive a specific message sent by an access network device, where the specific message includes a non-access stratum NAS message;

上下文请求单元142,用于根据所述特定消息确定第一核心网设备,并向第一核心网设备发送上下文请求,所述上下文请求中包括UE的标识以及密钥集标识;a context requesting unit 142, configured to determine the first core network device according to the specific message, and send a context request to the first core network device, where the context request includes the identifier of the UE and the identifier of the key set;

上下文获取单元143,用于接收第一核心网设备发送的上下文响应,并从中获取安全上下文,该安全上下文是第一核心网设备根据所述上下文请求中所述UE的标识以及密钥集标识确定的。A context obtaining unit 143, configured to receive a context response sent by the first core network device, and obtain a security context therefrom, where the security context is determined by the first core network device according to the identifier of the UE and the key set identifier in the context request of.

较佳地,所述NAS消息中包含第一核心网设备为所述UE分配的标识,第二核心网设备根据该标识确定第一核心网设备。Preferably, the NAS message includes an identifier allocated to the UE by the first core network device, and the second core network device determines the first core network device according to the identifier.

较佳地,所述特定消息中还包括第一核心网设备的标识信息,第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Preferably, the specific message further includes identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

较佳地,所述密钥集标识包含在所述上下文请求中;或者,Preferably, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

较佳地,所述安全上下文中,包含第一核心网设备保护NAS消息所使用的加密算法和完整性保护算法。Preferably, the security context includes an encryption algorithm and an integrity protection algorithm used by the first core network device to protect the NAS message.

较佳地,所述上下文获取单元获取所述UE的安全上下文后,还用于:Preferably, after the context obtaining unit obtains the security context of the UE, it is further used to:

当需要选择新的算法时,利用新的算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,其中包含新的算法的标识;其中,所述新的算法包括加密算法和/或完整性保护算法;When a new algorithm needs to be selected, use the new algorithm to derive a new NAS key, and send a NAS security mode command message to the UE, which contains the identifier of the new algorithm; wherein, the new algorithm includes an encryption algorithm and/or or integrity protection algorithms;

接收该UE反馈的NAS安全模式完成消息。Receive the NAS security mode completion message fed back by the UE.

较佳地,所述上下文请求中还包括:Preferably, the context request also includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

图14所示的设备可以是核心网设备,该设备可以和图13所示的核心网设备为同一核心网设备,例如MME。The device shown in FIG. 14 may be a core network device, and the device may be the same core network device as the core network device shown in FIG. 13 , such as an MME.

参见图15,本发明实施例提供的一种重路由命令的接收处理设备,包括:Referring to FIG. 15 , a device for receiving and processing a rerouting command provided by an embodiment of the present invention includes:

重路由命令接收单元151,用于接收第一核心网设备发送的重路由命令,其中包含非接入层NAS消息和用于确定第二核心网设备的指示信息;a rerouting command receiving unit 151, configured to receive a rerouting command sent by the first core network device, which includes a non-access stratum NAS message and indication information for determining the second core network device;

特定消息发送单元152,用于根据所述指示信息,确定所述第二核心网设备,并向所述第二核心网设备发送携带所述NAS消息的特定消息。The specific message sending unit 152 is configured to determine the second core network device according to the indication information, and send a specific message carrying the NAS message to the second core network device.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

第一核心网设备的标识信息,所述第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

较佳地,所述NAS消息是所述第一核心网设备对接收到的UE发送的NAS消息进行重构后的NAS消息。Preferably, the NAS message is a NAS message reconstructed by the first core network device on the received NAS message sent by the UE.

较佳地,所述重路由命令中还包括:Preferably, the rerouting command also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

图15所示的设备,可以是接入网设备,例如eNB。The device shown in FIG. 15 may be an access network device, such as an eNB.

本发明实施例提供的一种提供安全上下文的设备,该设备包括处理器和收发机,其中,An embodiment of the present invention provides a device for providing a security context, the device includes a processor and a transceiver, wherein:

收发机接收用户设备UE发送的非接入层NAS消息;The transceiver receives the non-access stratum NAS message sent by the user equipment UE;

当处理器确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,通过收发机向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息;When the processor determines that the NAS message needs to be re-routed to the second core network device in the specific network, a re-routing command is sent to the access network device through the transceiver, where the re-routing command includes the NAS message and is used to determine the Describe the information of the second core network equipment;

收发机接收所述第二核心网设备发送的上下文请求,所述上下文请求中包括UE的标识以及密钥集标识,处理器根据所述UE的标识以及密钥集标识,查找对应的安全上下文,收发机将该安全上下文发送给所述第二核心网设备。The transceiver receives the context request sent by the second core network device, the context request includes the identifier of the UE and the identifier of the key set, and the processor searches for the corresponding security context according to the identifier of the UE and the identifier of the key set, The transceiver sends the security context to the second core network device.

较佳地,收发机在向接入网设备发送重路由命令之前,处理器还用于对接收到的NAS消息进行重构,所述重路由命令中包含的NAS消息,为重构的NAS消息。Preferably, before the transceiver sends the rerouting command to the access network device, the processor is further configured to reconstruct the received NAS message, and the NAS message included in the rerouting command is the reconstructed NAS message. .

较佳地,处理器对接收到的NAS消息进行重构时,具体用于:Preferably, when the processor reconstructs the received NAS message, it is specifically used for:

利用当前安全上下文中的密钥集标识,替换该UE发送的NAS消息中的密钥集标识;和/或,Use the key set identifier in the current security context to replace the key set identifier in the NAS message sent by the UE; and/or,

根据当前安全上下文计算完整性保护校验值,并将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE。Calculate the integrity protection check value according to the current security context, and use the integrity protection check value as the message authentication code MAC information element IE in the NAS message sent by the UE.

较佳地,处理器将所述完整性保护校验值作为所述UE发送的NAS消息中的消息认证码MAC信元IE时,具体用于:Preferably, when the processor uses the integrity protection check value as the message authentication code MAC information element IE in the NAS message sent by the UE, it is specifically used for:

将所述完整性保护校验值填充到所述UE发送的NAS消息中的消息认证码MAC信元IE;或Filling the integrity protection check value into the message authentication code MAC information element IE in the NAS message sent by the UE; or

将所述完整性保护校验值替换所述UE发送的NAS消息中的消息认证码MAC。Replace the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.

较佳地,处理器对接收到的NAS消息进行重构时,还用于:Preferably, when the processor reconstructs the received NAS message, it is further used for:

将第一核心网设备为所述UE分配的标识替换从该UE接收到的NAS消息中的UE的标识。The identifier of the UE in the NAS message received from the UE is replaced by the identifier assigned to the UE by the first core network device.

较佳地,所述密钥集标识包含在所述上下文请求中;或者,Preferably, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

较佳地,处理器确定当前的安全上下文后,收发机将该安全上下文发送给第二核心网设备前,处理器还用于:Preferably, after the processor determines the current security context, and before the transceiver sends the security context to the second core network device, the processor is further configured to:

利用当前的安全上下文验证该上下文请求中携带的NAS消息的完整性;Use the current security context to verify the integrity of the NAS message carried in the context request;

则,当所述验证成功时,收发机将该安全上下文发送给第二核心网设备。Then, when the verification is successful, the transceiver sends the security context to the second core network device.

较佳地,处理器利用当前与该UE共享的安全上下文验证该上下文请求中携带的NAS消息的完整性时,具体用于:Preferably, when the processor uses the security context currently shared with the UE to verify the integrity of the NAS message carried in the context request, it is specifically used for:

验证该上下文请求中携带的NAS消息中的完整性保护校验值或者消息认证码MAC值;或者Verify the integrity protection check value or message authentication code MAC value in the NAS message carried in the context request; or

验证该上下文请求中的完整性保护校验值。Verify the integrity protection check value in this context request.

较佳地,所述重路由命令中还包括:Preferably, the rerouting command also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

较佳地,所述上下文请求中还包括:Preferably, the context request also includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

本发明实施例提供的一种获取安全上下文的设备,该设备包括收发机和处理器,其中:An embodiment of the present invention provides a device for acquiring a security context, the device includes a transceiver and a processor, wherein:

收发机接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;The transceiver receives a specific message sent by the access network device, where the specific message includes a non-access stratum NAS message;

处理器根据所述特定消息确定第一核心网设备,收发机向第一核心网设备发送上下文请求,所述上下文请求中包括UE的标识以及密钥集标识;The processor determines the first core network device according to the specific message, and the transceiver sends a context request to the first core network device, where the context request includes the identifier of the UE and the identifier of the key set;

收发机接收第一核心网设备发送的上下文响应,处理器从中获取安全上下文,该安全上下文是第一核心网设备根据所述上下文请求中所述UE的标识以及密钥集标识确定的。The transceiver receives the context response sent by the first core network device, and the processor obtains the security context therefrom, where the security context is determined by the first core network device according to the identifier of the UE and the identifier of the key set in the context request.

较佳地,所述NAS消息中包含第一核心网设备为所述UE分配的标识,第二核心网设备根据该标识确定第一核心网设备。Preferably, the NAS message includes an identifier allocated to the UE by the first core network device, and the second core network device determines the first core network device according to the identifier.

较佳地,所述特定消息中还包括第一核心网设备的标识信息,第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Preferably, the specific message further includes identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

较佳地,所述密钥集标识包含在所述上下文请求中;或者,Preferably, the key set identifier is included in the context request; or,

所述密钥集标识包含在NAS消息中,该NAS消息包含在所述上下文请求。The key set identifier is included in the NAS message, which is included in the context request.

较佳地,所述安全上下文中,包含第一核心网设备保护NAS消息所使用的加密算法和完整性保护算法。Preferably, the security context includes an encryption algorithm and an integrity protection algorithm used by the first core network device to protect the NAS message.

较佳地,所述处理器获取所述UE的安全上下文后,还用于:当需要选择新的算法时,利用新的算法推衍新的NAS密钥,并通过收发机向UE发送NAS安全模式命令消息,其中包含新的算法的标识;其中,所述新的算法包括加密算法和/或完整性保护算法;Preferably, after acquiring the security context of the UE, the processor is further configured to: when a new algorithm needs to be selected, use the new algorithm to derive a new NAS key, and send the NAS security key to the UE through the transceiver. The mode command message, which contains the identification of the new algorithm; wherein, the new algorithm includes an encryption algorithm and/or an integrity protection algorithm;

收发机接收该UE反馈的NAS安全模式完成消息。The transceiver receives the NAS security mode completion message fed back by the UE.

较佳地,所述上下文请求中还包括:Preferably, the context request also includes:

重路由指示和/或完整性保护校验值,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication and/or an integrity protection check value, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

本发明实施例提供的一种重路由命令的接收处理设备,该设备包括收发机和处理器,其中:An embodiment of the present invention provides a device for receiving and processing a rerouting command. The device includes a transceiver and a processor, wherein:

收发机接收第一核心网设备发送的重路由命令,其中包含非接入层NAS消息和用于确定第二核心网设备的指示信息;The transceiver receives a rerouting command sent by the first core network device, which includes a non-access stratum NAS message and indication information for determining the second core network device;

处理器根据所述指示信息,确定所述第二核心网设备,并通过收发机向所述第二核心网设备发送携带所述NAS消息的特定消息。The processor determines the second core network device according to the indication information, and sends a specific message carrying the NAS message to the second core network device through the transceiver.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的。A rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

第一核心网设备的标识信息,所述第二核心网设备根据该第一核心网设备的标识信息确定第一核心网设备。Identification information of the first core network device, and the second core network device determines the first core network device according to the identification information of the first core network device.

较佳地,所述NAS消息是所述第一核心网设备对接收到的UE发送的NAS消息进行重构后的NAS消息。Preferably, the NAS message is a NAS message reconstructed by the first core network device on the received NAS message sent by the UE.

较佳地,所述重路由命令中还包括:Preferably, the rerouting command also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

较佳地,所述特定消息中还包括:Preferably, the specific message also includes:

密钥集标识和/或完整性保护校验值和/或UE的标识。The key set identity and/or the integrity protection check value and/or the identity of the UE.

由此可见,本发明实施例通过对NAS消息进行重构,使得重路由到特定网络的NAS消息可以被完整性校验,也使得特定网络的核心网设备可以获得安全上下文,从而与UE进行安全通信。It can be seen that, by reconstructing the NAS message in the embodiment of the present invention, the NAS message re-routed to the specific network can be integrity checked, and the core network device of the specific network can obtain the security context, so as to conduct security with the UE. communication.

本发明实施例六:Embodiment 6 of the present invention:

本发明实施例六针对在NAS消息重路由之前,UE和MME上执行了鉴权流程,共享了新的安全上下文的场景,具体流程如图16所示,包括步骤:Embodiment 6 of the present invention is directed to the scenario in which the authentication process is performed on the UE and the MME before the NAS message is rerouted, and a new security context is shared. The specific process is shown in Figure 16, including the steps:

S161.UE向第一MME(新的MME)发起附着请求或位置更新请求;S161. The UE initiates an attach request or a location update request to the first MME (new MME);

S162.当网络侧找不到UE对应的安全上下文或者向第三MME(旧的MME)获取上下文过程中完整性验证失败,UE与网络侧进行鉴权和密钥协商,建立UE与第一MME之间的NAS安全;S162. When the network side cannot find the security context corresponding to the UE or the integrity verification fails in the process of obtaining the context from the third MME (the old MME), the UE and the network side perform authentication and key negotiation to establish the relationship between the UE and the first MME. NAS security between;

S163.第一MME向HSS发起更新位置请求;S163. The first MME initiates an update location request to the HSS;

S164.HSS查询数据库,并返回更新位置确认,该确认消息中包含使用特定网络的信息。S164. The HSS queries the database, and returns an update location confirmation, the confirmation message contains information about using a specific network.

S165.第一MME接收到使用特定网络的信息后,为UE分配新的GUTI值(也可以不是新的GUTI),并利用鉴权生成的新的安全上下文计算Token值.S165. After receiving the information about using a specific network, the first MME allocates a new GUTI value (or not a new GUTI) to the UE, and uses the new security context generated by authentication to calculate the Token value.

S166.第一MME向eNB发送重路由命令,该重路由命令中包括附着请求或位置更新请求、GUTI、eKSI、Token值和使用特定网络的信息,eKSI是鉴权后生成的新的安全上下文的密钥集标识。S166. The first MME sends a rerouting command to the eNB, where the rerouting command includes an attach request or a location update request, GUTI, eKSI, Token value and information about using a specific network, and the eKSI is a new security context generated after authentication Keyset ID.

S167.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的MME,即第二MME,并向第二MME发送消息,该消息中包括附着请求/位置更新请求、GUTI、eKSI和Token值。S167. After receiving the rerouting command, the eNB selects the MME of the specific network, that is, the second MME, for the UE according to the information of using the specific network, and sends a message to the second MME, which includes the attach request/location update request, GUTI, eKSI and Token values.

S168.第二MME根据GUTI找到第一MME,并向第一MME发起请求消息,该请求消息可以是身份请求消息/上下文请求消息或者包含身份请求消息/上下文请求消息,该请求消息中包含附着请求/位置更新请求、GUTI、eKSI和Token值。S168. The second MME finds the first MME according to the GUTI, and sends a request message to the first MME. The request message can be an identity request message/context request message or includes an identity request message/context request message, and the request message includes an attach request /Location update request, GUTI, eKSI and Token values.

S169.第一MME接收到请求消息后,根据GUTI和eKSI找到对应的安全上下文并利用该安全上下文验证请求消息中的Token值,具体验证方法是,第一MME根据安全上下文计算出Token值,然后和请求消息中Token值比较,如果一致,则认为验证成功。如果验证成功,第一MME根据GUTI找到对应的鉴权数据。S169. After the first MME receives the request message, it finds the corresponding security context according to the GUTI and eKSI and uses the security context to verify the Token value in the request message. The specific verification method is that the first MME calculates the Token value according to the security context, and then Compared with the Token value in the request message, if they are consistent, the verification is considered successful. If the verification is successful, the first MME finds the corresponding authentication data according to the GUTI.

S1610.第一MME将UE相关的鉴权数据发给第二MME,该鉴权数据包含鉴权向量和安全上下文。S1610. The first MME sends UE-related authentication data to the second MME, where the authentication data includes an authentication vector and a security context.

S1611.如果第二MME的算法优先级列表与第一MME的算法优先级不同,那么第二MME可以重新为UE选择新的算法,根据新算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含选择的新完整性算法标识和新加密算法标识。S1611. If the algorithm priority list of the second MME is different from the algorithm priority of the first MME, the second MME can re-select a new algorithm for the UE, derive a new NAS key according to the new algorithm, and send the NAS key to the UE The security mode command message contains the selected new integrity algorithm ID and new encryption algorithm ID.

S1612.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。S1612. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

针对该实施例,可进一步扩展以下六个方面:For this embodiment, the following six aspects can be further expanded:

第一:第S165步中第一MME分配GUTI并计算Token值后,还可以重构附着请求/位置更新请求,包括用分配的GUTI替换附着请求/位置更新请求中的IMSI/GUTI,用鉴权后生成的新的安全上下文的eKSI替换附着请求/位置更新请求中的eKSI,用计算的Token替换/填充附着请求/位置更新请求中的MAC值。这样第S166步中不需要携带GUTI,eKSI和Token值,第S167步中不需要携带GUTI,eKSI和Token值,第S168步中不需要携带GUTI,eKSI和Token值,而是携带重构的附着请求/位置更新请求。First: after the first MME allocates the GUTI and calculates the Token value in step S165, it can also reconstruct the attach request/location update request, including replacing the IMSI/GUTI in the attach request/location update request with the allocated GUTI, and using the authentication The eKSI of the new security context generated later replaces the eKSI in the attach request/location update request, and replaces/fills the MAC value in the attach request/location update request with the calculated Token. In this way, GUTI, eKSI and Token values do not need to be carried in step S166, GUTI, eKSI and Token values do not need to be carried in step S167, and GUTI, eKSI and Token values do not need to be carried in step S168, but the reconstructed attachment is carried request/location update request.

或者,第S165步中第一MME分配GUTI并计算Token值后,还可以重构附着请求/位置更新请求,包括用计算的Token替换/填充附着请求/位置更新请求中的MAC值。这样第S166步中不需要携带Token值,第S167步中不需要携带Token值,第S168步中不需要携带Token值,而是携带重构的附着请求/位置更新请求。Alternatively, after the first MME allocates the GUTI and calculates the Token value in step S165, it can also reconstruct the attach request/location update request, including replacing/filling the MAC value in the attach request/location update request with the calculated Token. In this way, the Token value does not need to be carried in step S166, the Token value does not need to be carried in step S167, and the Token value does not need to be carried in step S168, but the reconstructed attach request/location update request is carried.

第二:可选的,第S166、S167、S168步中可以不携带eKSI。Second: Optionally, the eKSI may not be carried in steps S166, S167, and S168.

第三:可选的,Token值可以是根据安全上下文计算的完整性校验码MAC(NASCOUNT值可以算是全0或者是一个预先设定的值),也可以是通过哈希函数Hash计算出的校验值(输入参数可以是消息,或者消息和NAS层完整性密钥,或者消息、NAS层完整性密钥和NAS COUNT值),或者是第一MME为UE分配的签名。上述消息可以是附着请求/位置更新请求,或附着请求/位置更新请求和GUTI,或附着请求/位置更新请求,GUTI和eKSI。第一MME通过哈希函数Hash计算出Token,然后和身份请求/上下文请求消息中Token值比较,如果一致,则认为验证成功;或者,第一MME将身份请求/上下文请求消息中Token值和计算的/分配的/保存的Token(签名或随机数)比较,如果一致,则认为验证成功。第一MME可以识别身份请求/上下文请求中的附着请求/位置更新请求是重路由的(根据Token和GUTI,或者根据Token、eKSI和GUTI识别),那么第一MME可以接受附着请求/位置更新请求中的序列号,并使用全0的NAS COUNT值或者预先设定的NAS COUNT值来验证该消息的完整性,在验证通过后不将请求/位置更新请求中的序列号赋值给本地保存的NAS COUNT,保持本地的NAS COUNT值不变。Third: Optionally, the Token value can be the integrity check code MAC calculated according to the security context (the NASCOUNT value can be regarded as all 0s or a preset value), or it can be calculated by the hash function Hash The check value (the input parameter can be the message, or the message and the NAS layer integrity key, or the message, the NAS layer integrity key and the NAS COUNT value), or the signature assigned to the UE by the first MME. The above message may be Attach Request/Location Update Request, or Attach Request/Location Update Request and GUTI, or Attach Request/Location Update Request, GUTI and eKSI. The first MME calculates the Token through the hash function Hash, and then compares it with the Token value in the identity request/context request message. If they are consistent, the verification is considered successful; or, the first MME calculates the Token value in the identity request/context request message with the The Token (signature or random number) of the / allocated / saved is compared, and if they are consistent, the verification is considered successful. The first MME can recognize that the attach request/location update request in the identity request/context request is rerouted (according to Token and GUTI, or based on Token, eKSI and GUTI), then the first MME can accept the attach request/location update request and use the NAS COUNT value of all 0s or the preset NAS COUNT value to verify the integrity of the message, and do not assign the serial number in the request/location update request to the locally stored NAS after the verification is passed. COUNT, keep the local NAS COUNT value unchanged.

第四:第S168步中,当请求消息就是身份请求消息/上下文请求消息时,GUTI、eKSI和Token包含在身份请求/上下文请求消息内。当请求消息包含身份请求消息/上下文请求消息时,GUTI、eKSI和Token也可以在身份请求/上下文请求消息之外,和身份请求/上下文请求消息一起发送给第一MME,即第二MME向第一MMME发起请求消息,该消息最终包含身份请求/上下文请求消息,GUTI、eKSI和Token值。身份请求/上下文请求中包含附着请求/位置更新请求。Fourth: In step S168, when the request message is the identity request message/context request message, GUTI, eKSI and Token are included in the identity request/context request message. When the request message includes the identity request message/context request message, GUTI, eKSI and Token can also be sent to the first MME together with the identity request/context request message in addition to the identity request/context request message, that is, the second MME sends the message to the first MME. An MMME initiates a request message, which finally includes an identity request/context request message, GUTI, eKSI and Token values. An attach request/location update request is included in the identity request/context request.

第五:第S1611步和第S1612步NAS安全模式命令过程是可选的,只有第二MME为UE选择了新的完整性算法和加密算法时才发起此过程。Fifth: the NAS security mode command process in steps S1611 and S1612 is optional, and this process is initiated only when the second MME selects a new integrity algorithm and encryption algorithm for the UE.

第六:使用特定网络的信息用来指示该附着请求需要重路由到特定网络,使用特定网络的信息可以是核心网类型。Sixth: the information of using a specific network is used to indicate that the attach request needs to be rerouted to a specific network, and the information of using a specific network may be a core network type.

本发明实施例七:Embodiment 7 of the present invention:

本实施例针对在NAS消息重路由之前,New MME(第一MME)从old MME(第三MME)获取了安全上下文,后续specific MME(第二MME)向New MME(第一MME)索要安全上下文的场景,具体流程如图17所示,包括步骤:In this embodiment, before the NAS message is rerouted, the New MME (the first MME) obtains the security context from the old MME (the third MME), and the subsequent specific MME (the second MME) asks the New MME (the first MME) for the security context The specific process is shown in Figure 17, including steps:

S171.UE向eNB发起附着请求/位置更新请求;S171. The UE initiates an attach request/location update request to the eNB;

S172.eNB将附着请求/位置更新请求转发给第一MME;S172. The eNB forwards the attach request/location update request to the first MME;

S173.第一MME没有可用的安全上下文,第一MME向第三MME发送身份请求/上下文请求。S173. The first MME has no available security context, and the first MME sends an identity request/context request to the third MME.

S174.第三MME验证成功后,向第一MME发送身份响应消息,消息中包含安全上下文和使用特定网络的信息。S174. After the third MME successfully authenticates, it sends an identity response message to the first MME, where the message includes the security context and information about using a specific network.

S175.第一MME接收到使用特定网络的信息指示后,为UE分配新的GUTI值,并利用鉴权生成的新的安全上下文计算Token值.S175. After the first MME receives the information indication of using a specific network, it allocates a new GUTI value to the UE, and uses the new security context generated by the authentication to calculate the Token value.

S176.第一MME向eNB发送重路由命令,该命令中包括附着请求/位置更新请求,GUTI、Token值和使用特定网络的信息,eKSI是附着请求/位置更新请求消息中的密钥集标识。S176. The first MME sends a rerouting command to the eNB, the command includes an attach request/location update request, GUTI, Token value and information about using a specific network, and eKSI is the key set identifier in the attach request/location update request message.

S177.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的第二MME,并向第二MME发送消息,消息中包括附着请求/位置更新请求、GUTI和Token值。S177. After receiving the rerouting command, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, and sends a message to the second MME, the message includes the attach request/location update request, GUTI and Token value.

S178.第二MME根据GUTI找到第一MME,并向第一MME发起请求消息,该请求消息可以是身份请求消息/上下文请求消息或者包含身份请求消息/上下文请求消息,该请求消息中包含附着请求/位置更新请求、GUTI和Token值。S178. The second MME finds the first MME according to the GUTI, and sends a request message to the first MME. The request message can be an identity request message/context request message or includes an identity request message/context request message, and the request message includes an attach request /Location update request, GUTI and Token values.

S179.第一MME接收到请求消息后,根据GUTI和eKSI找到对应的安全上下文并利用该安全上下文验证请求消息中的Token值,具体验证方法是:第一MME根据安全上下文计算出Token值,然后和请求消息中Token值比较,如果一致,则认为验证成功。如果验证成功,第一MME根据GUTI找到对应的鉴权数据。S179. After the first MME receives the request message, it finds the corresponding security context according to the GUTI and eKSI, and uses the security context to verify the Token value in the request message. The specific verification method is as follows: the first MME calculates the Token value according to the security context, and then Compared with the Token value in the request message, if they are consistent, the verification is considered successful. If the verification is successful, the first MME finds the corresponding authentication data according to the GUTI.

S1710.第一MME将UE相关的鉴权数据发给第二MME,该鉴权数据包含鉴权向量和安全上下文。S1710. The first MME sends UE-related authentication data to the second MME, where the authentication data includes an authentication vector and a security context.

S1711.如果第二MME的算法优先级列表与第三MME的算法优先级不同,那么第二MME可以重新为UE选择新的算法,根据新算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含选择的新完整性算法标识和新加密算法标识。S1711. If the algorithm priority list of the second MME is different from the algorithm priority of the third MME, the second MME can re-select a new algorithm for the UE, derive a new NAS key according to the new algorithm, and send the NAS key to the UE The security mode command message contains the selected new integrity algorithm ID and new encryption algorithm ID.

S1712.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。S1712. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

针对该实施例,可进一步扩展以下六个方面:For this embodiment, the following six aspects can be further expanded:

第一:第S175步中第一MME分配GUTI并计算Token值后,还可以重构附着请求/位置更新请求,包括用分配的GUTI替换附着请求/位置更新请求中的IMSI/GUTI,用鉴权后生成的新的安全上下文的eKSI替换附着请求/位置更新请求中的eKSI,用计算的Token替换/填充附着请求/位置更新请求中的MAC值。这样第S176步中不需要携带GUTI、eKSI和Token值,第S177步中不需要携带GUTI、eKSI和Token值,第S178步中不需要携带GUTI、eKSI和Token值,而是携带重构的附着请求/位置更新请求。First: after the first MME allocates the GUTI and calculates the Token value in step S175, it can also reconstruct the attach request/location update request, including replacing the IMSI/GUTI in the attach request/location update request with the allocated GUTI, and using the authentication The eKSI of the new security context generated later replaces the eKSI in the attach request/location update request, and replaces/fills the MAC value in the attach request/location update request with the calculated Token. In this way, the GUTI, eKSI and Token values do not need to be carried in step S176, the GUTI, eKSI and Token values do not need to be carried in step S177, and the GUTI, eKSI and Token values do not need to be carried in step S178, but the reconstructed attachment is carried request/location update request.

或者,第S175步中第一MME分配GUTI并计算Token值后,还可以重构附着请求/位置更新请求,包括用计算的Token替换/填充附着请求/位置更新请求中的MAC值。这样第S176步中不需要携带Token值,第S177步中不需要携带Token值,第S178步中不需要携带Token值,而是携带重构的附着请求/位置更新请求。Alternatively, after the first MME allocates the GUTI and calculates the Token value in step S175, it can also reconstruct the attach request/location update request, including replacing/filling the MAC value in the attach request/location update request with the calculated Token. In this way, the Token value does not need to be carried in step S176, the Token value does not need to be carried in step S177, and the Token value does not need to be carried in step S178, but the reconstructed attach request/location update request is carried.

第二:可选的,第S176、S177、S178步中可以携带KSI。Second: Optionally, KSI can be carried in steps S176, S177, and S178.

第三:可选的,Token值可以是根据安全上下文计算的完整性校验码MAC(NASCOUNT值可以算是全0或者是一个预先设定的值),也可以是通过哈希函数Hash计算出的校验值(输入参数可以是消息,或者消息和NAS层完整性密钥,或者消息、NAS层完整性密钥和NAS COUNT值),或者是MME为UE分配的签名。上述消息可以是附着请求/位置更新请求,或附着请求/位置更新请求和GUTI,或附着请求/位置更新请求、GUTI和eKSI。第一MME通过哈希函数Hash计算出Token,然后和身份请求/上下文请求消息中Token值比较,如果一致,则认为验证成功;或者,第一MME将身份请求/上下文请求消息中Token值和计算的/分配的/保存的Token(签名或随机数)比较,如果一致,则认为验证成功。第一MME可以识别身份请求/上下文请求中的附着请求/位置更新请求是重路由的(根据Token或者根据Token和eKSI),那么第一MME可以接受附着请求/位置更新请求中的序列号与当前保存的NAS COUNT的序列号一样的附着请求/位置更新请求,验证通过后,第一MME保存的NASCOUNT不变并将鉴权数据返回给第二MME。Third: Optionally, the Token value can be the integrity check code MAC calculated according to the security context (the NASCOUNT value can be regarded as all 0s or a preset value), or it can be calculated by the hash function Hash Check value (the input parameter can be the message, or the message and the NAS layer integrity key, or the message, the NAS layer integrity key and the NAS COUNT value), or the signature assigned by the MME to the UE. The above message may be Attach Request/Location Update Request, or Attach Request/Location Update Request and GUTI, or Attach Request/Location Update Request, GUTI and eKSI. The first MME calculates the Token through the hash function Hash, and then compares it with the Token value in the identity request/context request message. If they are consistent, the verification is considered successful; or, the first MME calculates the Token value in the identity request/context request message with the The Token (signature or random number) of the / allocated / saved is compared, and if they are consistent, the verification is considered successful. The first MME can recognize that the attach request/location update request in the identity request/context request is rerouted (according to Token or based on Token and eKSI), then the first MME can accept the sequence number in the attach request/location update request and the current For an attach request/location update request with the same sequence number as the stored NAS COUNT, after the verification is passed, the NASCOUNT stored by the first MME remains unchanged and the authentication data is returned to the second MME.

第四:第S178步中,当请求消息就是身份请求消息/上下文请求消息时,GUTI、eKSI和Token包含在身份请求/上下文请求消息内。当请求消息包含身份请求消息/上下文请求消息时,GUTI、eKSI和Token也可以在身份请求/上下文请求消息之外,和身份请求/上下文请求消息一起发送给第一MME,即第二MME向第一MMME发起请求消息,该请求消息最终包含身份请求/上下文请求消息,GUTI、eKSI和Token值。身份请求/上下文请求中包含附着请求/位置更新请求。Fourth: in step S178, when the request message is the identity request message/context request message, GUTI, eKSI and Token are included in the identity request/context request message. When the request message includes the identity request message/context request message, GUTI, eKSI and Token can also be sent to the first MME together with the identity request/context request message in addition to the identity request/context request message, that is, the second MME sends the message to the first MME. An MMME initiates a request message, which finally includes an identity request/context request message, GUTI, eKSI and Token values. An attach request/location update request is included in the identity request/context request.

第五:第S1711步和第S1712步NAS安全模式命令过程是可选的,只有第二MME为UE选择了新的完整性算法和加密算法时才发起此过程。Fifth: the NAS security mode command process in steps S1711 and S1712 is optional, and this process is initiated only when the second MME selects a new integrity algorithm and encryption algorithm for the UE.

第六:使用特定网络的信息用来指示该附着请求需要重路由到特定网络,使用特定网络的信息可以是核心网类型。Sixth: the information of using a specific network is used to indicate that the attach request needs to be rerouted to a specific network, and the information of using a specific network may be a core network type.

本发明实施例八:Embodiment 8 of the present invention:

本实施例针对在NAS消息重路由之前,New MME(第一MME)从old MME(第三MME)获取了安全上下文,后续specific MME(第二MME)向old MME(第三MME)索要安全上下文的场景,In this embodiment, before the NAS message is rerouted, the New MME (first MME) obtains the security context from the old MME (third MME), and the subsequent specific MME (second MME) asks the old MME (third MME) for the security context scene,

具体流程如图18所示,包括步骤:The specific process is shown in Figure 18, including steps:

S181.UE向eNB发起附着请求/位置更新请求;S181. The UE initiates an attach request/location update request to the eNB;

S182.eNB将附着请求/位置更新请求转发给第一MME;S182. The eNB forwards the attach request/location update request to the first MME;

S183.第一MME没有可用的安全上下文,第一MME向第三MME发送身份请求/上下文请求。S183. The first MME has no available security context, and the first MME sends an identity request/context request to the third MME.

S184.第三MME验证成功后,如果该附着请求需要重路由到特定网络,那么第三MME为UE计算或分配一个Token。S184. After successful verification by the third MME, if the attach request needs to be rerouted to a specific network, the third MME calculates or allocates a Token to the UE.

S185.第三MME向第一MME发送身份响应消息,消息中包含安全上下文,使用特定网络的信息、eKSI和Token。上述使用特定网络的信息、eKSI和Token也可以在身份响应消息之外和身份响应消息一起发送给第一MME。S185. The third MME sends an identity response message to the first MME, where the message includes the security context and uses information of a specific network, eKSI and Token. The above-mentioned information of using a specific network, eKSI and Token may also be sent to the first MME together with the identity response message in addition to the identity response message.

S186.新MME向eNB发送重路由命令,该命令中包括附着请求/位置更新请求、eKSI、Token值和使用特定网络的信息。S186. The new MME sends a rerouting command to the eNB, where the command includes an attach request/location update request, eKSI, Token value and information about using a specific network.

S187.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的第二MME,并向第二MME发送消息,消息中包括附着请求/位置更新请求、eKSI和Token值。S187. After receiving the rerouting command, the eNB selects the second MME of the specific network for the UE according to the information of using the specific network, and sends a message to the second MME, the message includes the attach request/location update request, eKSI and Token value.

S188.第二MME根据附着请求/位置更新请求中的GUTI找到第三MME,并向第三MME发起请求消息,该请求消息可以是身份请求/上下文请求消息或者包含身份请求消息/上下文请求消息,该请求消息中包含附着请求/位置更新请求、eKSI和Token值。S188. The second MME finds the third MME according to the GUTI in the attach request/location update request, and sends a request message to the third MME, where the request message may be an identity request/context request message or include an identity request message/context request message, The request message includes the attach request/location update request, eKSI and Token value.

S189.第三MME接收到请求消息后,根据GUTI和eKSI找到对应的安全上下文并利用该安全上下文验证请求消息中的Token值,具体验证方法是,第三MME根据安全上下文计算出Token值,然后和请求消息中Token值比较,如果一致,则认为验证成功。如果验证成功,第三MME根据GUTI找到对应的鉴权数据。S189. After receiving the request message, the third MME finds the corresponding security context according to the GUTI and eKSI, and uses the security context to verify the Token value in the request message. The specific verification method is that the third MME calculates the Token value according to the security context, and then Compared with the Token value in the request message, if they are consistent, the verification is considered successful. If the verification is successful, the third MME finds the corresponding authentication data according to the GUTI.

S1810.第三MME将UE相关的鉴权数据发给第二MME,该鉴权数据包含鉴权向量和安全上下文。S1810. The third MME sends UE-related authentication data to the second MME, where the authentication data includes an authentication vector and a security context.

S1811.如果第二MME的算法优先级列表与第三MME的算法优先级不同,那么第二MME可以重新为UE选择新的算法,根据新算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含选择的新完整性算法标识和新加密算法标识。S1811. If the algorithm priority list of the second MME is different from the algorithm priority of the third MME, the second MME can re-select a new algorithm for the UE, derive a new NAS key according to the new algorithm, and send the NAS key to the UE The security mode command message contains the selected new integrity algorithm ID and new encryption algorithm ID.

S1812.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。S1812. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

针对该实施例,可进一步扩展以下五个方面:For this embodiment, the following five aspects can be further expanded:

第一:可选的,第S186、S187、S188步中不携带eKSI,第三MME使用附着请求/位置更新请求中的eKSI。First: Optionally, steps S186, S187, and S188 do not carry the eKSI, and the third MME uses the eKSI in the attach request/location update request.

第二:可选的,Token值可以是根据安全上下文计算的完整性校验码MAC(NASCOUNT值可以算是全0或者是一个预先设定的值),也可以是通过哈希函数Hash计算出的校验值(输入参数可以是消息,或者消息和NAS层完整性密钥,或者消息、NAS层完整性密钥和NAS COUNT值),或者是第一MME为UE分配的签名。上述消息可以是附着请求/位置更新请求,或附着请求/位置更新请求和GUTI,或附着请求/位置更新请求、GUTI和eKSI。第三MME通过哈希函数Hash计算出Token,然后和身份请求/上下文请求消息中Token值比较,如果一致,则认为验证成功;或者,第三MME将身份请求/上下文请求消息中Token值和计算的/分配的/保存的Token(签名或随机数)比较,如果一致,则认为验证成功。第三MME可以识别身份请求/上下文请求中的附着请求/位置更新请求是重路由的(根据Token或者根据Token和eKSI),那么第三MME可以接受附着请求/位置更新请求中的序列号与当前保存的NAS COUNT的序列号一样的附着请求/位置更新请求,验证通过后,第三MME保存的NAS COUNT不变并将鉴权数据返回给第二MME。Second: Optionally, the Token value can be the integrity check code MAC calculated according to the security context (the NASCOUNT value can be regarded as all 0s or a preset value), or it can be calculated by the hash function Hash The check value (the input parameter can be the message, or the message and the NAS layer integrity key, or the message, the NAS layer integrity key and the NAS COUNT value), or the signature assigned to the UE by the first MME. The above message may be Attach Request/Location Update Request, or Attach Request/Location Update Request and GUTI, or Attach Request/Location Update Request, GUTI and eKSI. The third MME calculates the Token through the hash function Hash, and then compares it with the Token value in the identity request/context request message. If they are consistent, the verification is considered successful; or, the third MME calculates the Token value in the identity request/context request message with the The Token (signature or random number) of the / allocated / saved is compared, and if they are consistent, the verification is considered successful. The third MME can recognize that the attach request/location update request in the identity request/context request is rerouted (according to Token or based on Token and eKSI), then the third MME can accept the sequence number in the attach request/location update request and the current For an attach request/location update request with the same serial number of the stored NAS COUNT, after the verification is passed, the NAS COUNT stored by the third MME remains unchanged and the authentication data is returned to the second MME.

第三:第S188步中,当请求消息就是身份请求消息/上下文请求消息时,eKSI和/或Token包含在身份请求/上下文请求消息内。当请求消息包含身份请求消息/上下文请求消息时,eKSI和/或Token也可以在身份请求/上下文请求消息之外,和身份请求/上下文请求消息一起发送给第一MME,即第二MME向第一MMME发起请求消息,该请求消息最终包含身份请求/上下文请求消息,eKSI和/或Token值。身份请求/上下文请求中包含附着请求/位置更新请求。Third: in step S188, when the request message is the identity request message/context request message, the eKSI and/or Token are included in the identity request/context request message. When the request message includes the identity request message/context request message, the eKSI and/or Token can also be sent to the first MME together with the identity request/context request message in addition to the identity request/context request message, that is, the second MME sends the message to the first MME. An MMME initiates a request message, and the request message finally includes an identity request/context request message, eKSI and/or Token value. An attach request/location update request is included in the identity request/context request.

第四:第S1811步和第S1812步NAS安全模式命令过程是可选的,只有第二MME为UE选择了新的完整性算法和加密算法时才发起此过程。Fourth: the NAS security mode command process in steps S1811 and S1812 is optional, and this process is initiated only when the second MME selects a new integrity algorithm and encryption algorithm for the UE.

第五:使用特定网络的信息用来指示该附着请求需要重路由到特定网络,使用特定网络的信息可以是核心网类型。Fifth: the information of using a specific network is used to indicate that the attach request needs to be rerouted to a specific network, and the information of using a specific network may be a core network type.

本实施例中,如果把第二MME看作是第二核心网设备,则相应地,可以把第三MME看作是第一核心网设备。In this embodiment, if the second MME is regarded as the second core network device, correspondingly, the third MME can be regarded as the first core network device.

本发明实施例九:Embodiment 9 of the present invention:

本实施例针对在NAS消息重路由之前,New MME(第一MME)从old MME(第三MME)获取了安全上下文,后续specific MME(第二MME)向old MME(第三MME)索要安全上下文的场景,具体流程如图19所示,包括步骤:In this embodiment, before the NAS message is rerouted, the New MME (first MME) obtains the security context from the old MME (third MME), and the subsequent specific MME (second MME) asks the old MME (third MME) for the security context The specific process is shown in Figure 19, including steps:

S191.UE向eNB发起附着请求/位置更新请求;S191. The UE initiates an attach request/location update request to the eNB;

S192.eNB将附着请求/位置更新请求转发给第一MME;S192. The eNB forwards the attach request/location update request to the first MME;

S193.第一MME没有可用的安全上下文,第一MME向第三MME发送身份请求/上下文请求。S193. The first MME has no available security context, and the first MME sends an identity request/context request to the third MME.

S194.第三MME向第一MME发送身份响应消息,消息中包含安全上下文和使用特定网络的信息。S194. The third MME sends an identity response message to the first MME, where the message includes the security context and information about using a specific network.

S195.第一MME向eNB发送重路由命令,该命令中包括附着请求/位置更新请求和使用特定网络的信息。S195. The first MME sends a rerouting command to the eNB, where the command includes an attach request/location update request and information on using a specific network.

S196.eNB接收到重路由命令后,根据使用特定网络的信息为UE选择特定网络的MME,并向第二MME发送消息,消息中包括附着请求/位置更新请求和重路由指示。S196. After receiving the rerouting command, the eNB selects the MME of the specific network for the UE according to the information of using the specific network, and sends a message to the second MME, the message includes the attach request/location update request and the rerouting indication.

S197.第二MME根据附着请求/位置更新请求中的GUTI找到第三MME,并向第三MME发起请求消息,该请求消息可以是身份请求/上下文请求消息或者包含身份请求消息/上下文请求消息,该请求消息中包含附着请求/位置更新请求和重路由指示。S197. The second MME finds the third MME according to the GUTI in the attach request/location update request, and sends a request message to the third MME, where the request message may be an identity request/context request message or include an identity request message/context request message, The request message includes an attach request/location update request and a rerouting indication.

S198.第三MME接收到请求消息后,第三MME可以识别请求消息中的附着请求/位置更新请求是重路由的(根据重路由指示),那么第三MME可以接受附着请求/位置更新请求中的序列号与当前保存的NAS COUNT的序列号一样的附着请求/位置更新请求,第三MME根据GUTI和eKSI找到对应的安全上下文并利用该安全上下文验证请求消息中的Token值,具体验证方法是,第三MME根据安全上下文计算出Token值,然后和身份请求/上下文请求消息中Token值比较,如果一致,则认为验证成功。如果验证成功,第三MME根据GUTI找到对应的鉴权数据。验证通过后,第三MME保存的NAS COUNT不变并将鉴权数据返回给第二MME。此实施例中的Token值即为消息鉴权码MAC。S198. After the third MME receives the request message, the third MME can identify that the attach request/location update request in the request message is re-routing (according to the rerouting indication), then the third MME can accept the attachment request/location update request in the The serial number of the NAS COUNT is the same as the attachment request/location update request. The third MME finds the corresponding security context according to the GUTI and eKSI and uses the security context to verify the Token value in the request message. The specific verification method is , the third MME calculates the Token value according to the security context, and then compares it with the Token value in the identity request/context request message. If they are consistent, the verification is considered successful. If the verification is successful, the third MME finds the corresponding authentication data according to the GUTI. After the verification is passed, the NAS COUNT stored by the third MME remains unchanged and the authentication data is returned to the second MME. The Token value in this embodiment is the message authentication code MAC.

S199.第三MME将UE相关的鉴权数据发给第二MME,该鉴权数据包含鉴权向量和安全上下文。S199. The third MME sends UE-related authentication data to the second MME, where the authentication data includes an authentication vector and a security context.

S1910.如果第二MME的算法优先级列表与第三MME的算法优先级不同,那么第二MME可以重新为UE选择新的算法,根据新算法推衍新的NAS密钥,并向UE发送NAS安全模式命令消息,该消息中包含选择的新完整性算法标识和新加密算法标识。S1910. If the algorithm priority list of the second MME is different from the algorithm priority of the third MME, the second MME can re-select a new algorithm for the UE, derive a new NAS key according to the new algorithm, and send the NAS key to the UE The security mode command message contains the selected new integrity algorithm ID and new encryption algorithm ID.

S1911.UE根据NAS安全模式命令中携带的完整性算法标识和加密算法标识推衍新的NAS密钥,并向第二MME发送NAS安全模式完成消息。S1911. The UE derives a new NAS key according to the integrity algorithm identifier and the encryption algorithm identifier carried in the NAS security mode command, and sends a NAS security mode completion message to the second MME.

针对该实施例,可进一步扩展以下三个方面:For this embodiment, the following three aspects can be further expanded:

第一:第S197步中,当请求消息就是身份请求消息/上下文请求消息时,重路由指示包含在身份请求/上下文请求消息内。当请求消息包含身份请求消息/上下文请求消息时,重路由指示也可以在身份请求/上下文请求消息之外,和身份请求/上下文请求消息一起发送给第一MME,即第二MME向第一MMME发起请求消息,该请求消息最终包含身份请求/上下文请求消息和重路由指示。身份请求/上下文请求中包含附着请求/位置更新请求。First: in step S197, when the request message is the identity request message/context request message, the rerouting indication is included in the identity request/context request message. When the request message contains the identity request message/context request message, the rerouting indication can also be sent to the first MME together with the identity request/context request message in addition to the identity request/context request message, that is, the second MME sends the first MMME A request message is initiated, which finally contains an identity request/context request message and a rerouting indication. An attach request/location update request is included in the identity request/context request.

第二:第S1910步和第S1911步NAS安全模式命令过程是可选的,只有第二MME为UE选择了新的完整性算法和加密算法时才发起此过程。Second: the NAS security mode command process in steps S1910 and S1911 is optional, and this process is initiated only when the second MME selects a new integrity algorithm and encryption algorithm for the UE.

第三:使用特定网络的信息用来指示该附着请求需要重路由到特定网络,使用特定网络的信息可以是核心网类型。Third: the information of using a specific network is used to indicate that the attach request needs to be rerouted to a specific network, and the information of using a specific network may be a core network type.

综上所述,在第一核心网设备侧,参见图20,本发明实施例提供的另一种提供安全上下文的方法,包括步骤:To sum up, on the side of the first core network device, referring to FIG. 20 , another method for providing a security context provided by an embodiment of the present invention includes the steps:

S2001、第一核心网设备接收用户设备UE发送的非接入层NAS消息;S2001. A first core network device receives a non-access stratum NAS message sent by a user equipment UE;

S2002、当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第一核心网设备向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息。S2002. When it is determined that the NAS message needs to be rerouted to a second core network device in a specific network, the first core network device sends a rerouting command to the access network device, where the rerouting command includes a NAS message and a Determine the information of the second core network device.

较佳地,该方法还包括:Preferably, the method further includes:

第一核心网设备接收所述第二核心网设备发送的请求消息,所述请求消息中包括UE的标识,第一核心网设备根据所述UE的标识,查找对应的鉴权数据,并将该鉴权数据发送给所述第二核心网设备。The first core network device receives the request message sent by the second core network device, the request message includes the identifier of the UE, the first core network device searches for the corresponding authentication data according to the identifier of the UE, and stores the The authentication data is sent to the second core network device.

较佳地,在第一核心网设备将该鉴权数据发送给所述第二核心网设备之前,该方法还包括:第一核心网设备验证请求消息中的校验值;Preferably, before the first core network device sends the authentication data to the second core network device, the method further includes: the first core network device verifies the check value in the request message;

第一核心网将该鉴权数据发送给所述第二核心网设备,具体为:当验证成功时,第一核心网设备将鉴权数据发送给第二核心网设备。The first core network sends the authentication data to the second core network device, specifically: when the verification is successful, the first core network device sends the authentication data to the second core network device.

较佳地,所述第一核心网设备验证请求消息中的校验值,具体包括:Preferably, the verification value in the first core network device verification request message specifically includes:

当所述请求消息中还包括密钥集标识时,第一核心网设备利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, the first core network device uses the UE identifier and the key set identifier to determine the corresponding security context, and uses the security context to calculate a check value, if If the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

第一核心网设备通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The first core network device calculates the check value by using the hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

第一核心网设备查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The first core network device searches for the locally stored check value, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

较佳地,在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,该方法还包括:所述第一核心网设备通过与所述UE之间的鉴权过程,或者从第三核心网设备获取所述UE的安全上下文;Preferably, before determining that the NAS message needs to be rerouted to a second core network device in a specific network, the method further includes: passing an authentication process between the first core network device and the UE, or Obtain the security context of the UE from the third core network device;

在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之后,第一核心网设备向接入网设备发送重路由命令之前,该方法还包括:第一核心网设备为所述UE分配标识,并确定校验值;After it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, and before the first core network device sends a rerouting command to the access network device, the method further includes: the first core network device is the The UE allocates the identity and determines the check value;

所述重路由命令中,还包括:所述第一核心网设备为所述UE分配的标识和所述校验值;The rerouting command further includes: an identifier allocated by the first core network device to the UE and the check value;

或者,所述重路由命令中,还包括:所述第一核心网设备为所述UE分配的标识、所述校验值、以及该UE的安全上下文的密钥集标识。Alternatively, the rerouting command further includes: an identifier allocated to the UE by the first core network device, the check value, and a key set identifier of the security context of the UE.

较佳地,所述第一核心网确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还包括:Preferably, before the first core network determines that the NAS message needs to be rerouted to a second core network device in a specific network, the method further includes:

所述第一核心网设备向第三核心网设备发送请求消息,请求消息中包含所述NAS消息,并接收第三核心网设备回复的响应消息,其中包括所述UE的安全上下文、校验值以及用于确定所述第二核心网设备的信息;其中,所述校验值是所述第三核心网设备确定的;The first core network device sends a request message to the third core network device, the request message includes the NAS message, and receives a response message replied by the third core network device, including the security context of the UE, the check value and information for determining the second core network device; wherein the check value is determined by the third core network device;

所述第一核心网设备通过所述用于确定所述第二核心网设备的信息,确定所述NAS消息需要重路由到所述特定网络中的第二核心网设备;The first core network device determines, by using the information for determining the second core network device, that the NAS message needs to be rerouted to the second core network device in the specific network;

所述重路由命令中还包括:所述校验值,或者所述校验值和密钥集标识。The rerouting command further includes: the check value, or the check value and a key set identifier.

相应地,参见图21,在第二核心网设备侧,本发明实施例提供的另一种获取安全上下文的方法,包括步骤:Correspondingly, referring to FIG. 21 , on the second core network device side, another method for acquiring a security context provided by an embodiment of the present invention includes the steps:

S2101、第二核心网设备接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;S2101. The second core network device receives a specific message sent by the access network device, where the specific message includes a non-access stratum NAS message;

S2102、第二核心网设备根据所述特定消息确定第一核心网设备,并向第一核心网设备发送请求消息,所述请求消息中包括UE的标识;S2102. The second core network device determines the first core network device according to the specific message, and sends a request message to the first core network device, where the request message includes the identifier of the UE;

其中的第一核心网设备,可以是新的MME,也可以是旧的MME。The first core network device may be a new MME or an old MME.

S2103、第二核心网设备接收第一核心网设备发送的响应消息,并从中获取所述UE的鉴权数据,该鉴权数据中包括所述UE的安全上下文,该鉴权数据是所述第一核心网设备根据所述UE的标识确定的。S2103. The second core network device receives the response message sent by the first core network device, and obtains the authentication data of the UE therefrom, where the authentication data includes the security context of the UE, and the authentication data is the first authentication data of the UE. A core network device is determined according to the identifier of the UE.

较佳地,所述UE的标识,为所述第一核心网设备为所述UE分配的标识;Preferably, the identifier of the UE is an identifier allocated by the first core network device to the UE;

所述特定消息中还包括:校验值,或者校验值和密钥集标识;The specific message also includes: a check value, or a check value and a key set identifier;

所述请求消息中还包括:校验值,或者校验值和密钥集标识。The request message also includes: a check value, or a check value and a key set identifier.

较佳地,所述特定消息中还包括:重路由指示,所述重路由指示用于指示所述NAS消息是重路由到第二核心网设备的;Preferably, the specific message further includes: a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device;

所述请求消息中包括所述NAS消息,所述NAS消息中包括所述UE的标识,并且,所述请求消息中还包括所述重路由指示。The request message includes the NAS message, the NAS message includes the identifier of the UE, and the request message further includes the rerouting indication.

相应地,参见图22,在第三核心网设备侧,本发明实施例提供的另一种提供安全上下文的方法,包括步骤:Correspondingly, referring to FIG. 22 , on the device side of the third core network, another method for providing a security context provided by an embodiment of the present invention includes the steps:

S2201、第三核心网设备接收第一核心网设备发送的请求消息,其中包括用户设备UE的非接入层NAS消息;S2201. The third core network device receives the request message sent by the first core network device, including the non-access stratum NAS message of the user equipment UE;

S2202、当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,第三核心网设备向所述第一核心网设备发送响应消息,其中包括所述UE的安全上下文和用于确定所述第二核心网设备的信息。S2202. When it is determined that the NAS message needs to be rerouted to the second core network device in a specific network, the third core network device sends a response message to the first core network device, including the security context and the user interface of the UE. for determining the information of the second core network device.

较佳地,当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,还包括:Preferably, when it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the method further includes:

第三核心网设备确定该UE的校验值;The third core network device determines the check value of the UE;

所述响应消息中还包括:所述校验值,或者所述校验值和所述UE的安全上下文对应的密钥集标识。The response message further includes: the check value, or a key set identifier corresponding to the check value and the security context of the UE.

较佳地,该方法还包括:Preferably, the method also includes:

第三核心网设备接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息、校验值和密钥集标识;The third core network device receives the request message sent by the second core network device, which includes the NAS message, the check value and the key set identifier;

第三核心网设备根据所述UE的标识找到对应的鉴权数据,向所述第二核心网设备发送响应消息,其中包括该UE的鉴权数据。The third core network device finds the corresponding authentication data according to the identifier of the UE, and sends a response message to the second core network device, which includes the authentication data of the UE.

较佳地,在第三核心网设备向所述第二核心网设备发送响应消息之前,该方法还包括:第三核心网设备验证所述请求消息中的校验值;Preferably, before the third core network device sends the response message to the second core network device, the method further includes: the third core network device verifies the check value in the request message;

第三核心网设备向所述第二核心网设备发送响应消息,具体为:当验证成功时,第三核心网设备向所述第二核心网设备发送响应消息。The third core network device sends a response message to the second core network device, specifically: when the verification is successful, the third core network device sends a response message to the second core network device.

较佳地,所述第三核心网设备验证所述请求消息中的校验值,具体包括:Preferably, the third core network device verifies the check value in the request message, specifically including:

当所述请求消息中还包括密钥集标识时,所述第三核心网设备利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message further includes a key set identifier, the third core network device determines a corresponding security context by using the UE's identifier and the key set identifier, and uses the security context to calculate a check value , if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

所述第三核心网设备通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The third core network device calculates the check value by using the hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

所述第三核心网设备查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The third core network device searches for the locally stored check value, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

较佳地,该方法还包括:Preferably, the method also includes:

第三核心网设备接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息和重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的;The third core network device receives the request message sent by the second core network device, which includes the NAS message and a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device;

第三核心网设备通过所述重路由指示确定该请求消息中的NAS消息是重路由到第二核心网设备的;The third core network device determines that the NAS message in the request message is rerouted to the second core network device through the rerouting indication;

第三核心网设备根据该NAS消息中的UE的标识和密钥集标识找到对应的安全上下文,并利用该安全上下文验证该请求消息中的完整性校验码,当验证成功时,第三核心网设备根据所述UE的标识找到对应的鉴权数据,并将该鉴权数据返回给第二核心网设备。The third core network device finds the corresponding security context according to the UE's identity and key set identity in the NAS message, and uses the security context to verify the integrity check code in the request message. When the verification is successful, the third core The network device finds the corresponding authentication data according to the identifier of the UE, and returns the authentication data to the second core network device.

参见图23,在第一核心网设备侧,本发明实施例提供的另一种提供安全上下文的设备,包括:Referring to FIG. 23, on the side of the first core network device, another device for providing a security context provided by an embodiment of the present invention includes:

接收NAS消息单元2301,用于接收用户设备UE发送的非接入层NAS消息;A receiving NAS message unit 2301, configured to receive a non-access stratum NAS message sent by the user equipment UE;

发送重路由命令单元2302,用于当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息。The sending rerouting command unit 2302 is configured to send a rerouting command to the access network device when it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, where the rerouting command includes the NAS message and the information for determining the second core network device.

较佳地,该设备还包括:Preferably, the device further includes:

鉴权数据提供单元2303,用于接收所述第二核心网设备发送的请求消息,所述请求消息中包括UE的标识,根据所述UE的标识,查找对应的鉴权数据,并将该鉴权数据发送给所述第二核心网设备。The authentication data providing unit 2303 is configured to receive a request message sent by the second core network device, where the request message includes the identifier of the UE, search for the corresponding authentication data according to the identifier of the UE, and use the authentication data. The right data is sent to the second core network device.

较佳地,所述鉴权数据提供单元将该鉴权数据发送给所述第二核心网设备之前,还用于验证请求消息中的校验值;Preferably, before the authentication data providing unit sends the authentication data to the second core network device, it is also used to verify the check value in the request message;

所述鉴权数据提供单元将该鉴权数据发送给所述第二核心网设备,具体为:当验证成功时,将鉴权数据发送给第二核心网设备。The authentication data providing unit sends the authentication data to the second core network device, specifically: when the verification is successful, sending the authentication data to the second core network device.

较佳地,所述鉴权数据提供单元验证请求消息中的校验值时,具体用于:Preferably, when the authentication data providing unit verifies the check value in the request message, it is specifically used for:

当所述请求消息中还包括密钥集标识时,利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, use the UE identifier and the key set identifier to determine the corresponding security context, and use the security context to calculate a check value. If the verification value is consistent with the verification value in the request message, it is determined that the verification is successful; or,

通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The check value is calculated by a hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The locally stored check value is searched, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

较佳地,所述发送重路由命令单元在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还用于:通过与所述UE之间的鉴权过程,或者从第三核心网设备获取所述UE的安全上下文;Preferably, before determining that the NAS message needs to be rerouted to the second core network device in the specific network, the sending rerouting command unit is further configured to: pass an authentication process with the UE, or from the UE. The third core network device obtains the security context of the UE;

在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之后,向接入网设备发送重路由命令之前,所述发送重路由命令单元还用于:为所述UE分配标识,并确定校验值;After determining that the NAS message needs to be rerouted to the second core network device in the specific network, and before sending the rerouting command to the access network device, the unit for sending the rerouting command is further configured to: assign an identifier to the UE, and determine the check value;

所述重路由命令中,还包括:所述发送重路由命令单元为所述UE分配的标识和所述校验值;The rerouting command further includes: an identifier allocated by the rerouting command unit for the UE and the check value;

或者,所述重路由命令中,还包括:所述发送重路由命令单元为所述UE分配的标识、所述校验值、以及该UE的安全上下文的密钥集标识。Or, the rerouting command further includes: the identifier allocated by the rerouting command sending unit to the UE, the check value, and the key set identifier of the security context of the UE.

较佳地,所述发送重路由命令单元确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还用于:Preferably, before the unit for sending a rerouting command determines that the NAS message needs to be rerouted to the second core network device in the specific network, it is further used to:

向第三核心网设备发送请求消息,请求消息中包含所述NAS消息,并接收第三核心网设备回复的响应消息,其中包括所述UE的安全上下文、校验值以及用于确定所述第二核心网设备的信息;其中,所述校验值是所述第三核心网设备确定的;Send a request message to the third core network device, where the request message includes the NAS message, and receive a response message replied by the third core network device, including the security context of the UE, a check value and a Information of the second core network device; wherein, the check value is determined by the third core network device;

通过所述用于确定所述第二核心网设备的信息,确定所述NAS消息需要重路由到所述特定网络中的第二核心网设备;determining that the NAS message needs to be rerouted to the second core network device in the specific network by using the information for determining the second core network device;

所述重路由命令中还包括:所述校验值,或者所述校验值和密钥集标识。The rerouting command further includes: the check value, or the check value and a key set identifier.

图23所示的设备可以是核心网设备,例如MME。The device shown in Figure 23 may be a core network device, such as an MME.

相应地,参见图24,在第二核心网设备侧,本发明实施例提供的另一种获取安全上下文的设备,包括:Correspondingly, referring to FIG. 24 , on the device side of the second core network, another device for acquiring a security context provided by an embodiment of the present invention includes:

特定消息接收单元2401,用于接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;A specific message receiving unit 2401, configured to receive a specific message sent by an access network device, where the specific message includes a non-access stratum NAS message;

请求单元2402,用于根据所述特定消息确定第一核心网设备,并向第一核心网设备发送请求消息,所述请求消息中包括UE的标识;a requesting unit 2402, configured to determine a first core network device according to the specific message, and send a request message to the first core network device, where the request message includes the identifier of the UE;

获取单元2403,用于接收第一核心网设备发送的响应消息,并从中获取所述UE的鉴权数据,该鉴权数据中包括所述UE的安全上下文,该鉴权数据是所述第一核心网设备根据所述UE的标识确定的。Obtaining unit 2403, configured to receive the response message sent by the first core network device, and obtain the authentication data of the UE therefrom, where the authentication data includes the security context of the UE, and the authentication data is the first The core network device is determined according to the identifier of the UE.

较佳地,所述UE的标识,为所述第一核心网设备为所述UE分配的标识;Preferably, the identifier of the UE is an identifier allocated by the first core network device to the UE;

所述特定消息中还包括:校验值,或者校验值和密钥集标识;The specific message also includes: a check value, or a check value and a key set identifier;

所述请求消息中还包括:校验值,或者校验值和密钥集标识。The request message also includes: a check value, or a check value and a key set identifier.

较佳地,所述特定消息中还包括:重路由指示,所述重路由指示用于指示所述NAS消息是重路由到第二核心网设备的;Preferably, the specific message further includes: a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device;

所述请求消息中包括所述NAS消息,所述NAS消息中包括所述UE的标识,并且,所述请求消息中还包括所述重路由指示。The request message includes the NAS message, the NAS message includes the identifier of the UE, and the request message further includes the rerouting indication.

图24所示的设备可以是核心网设备,例如MME。The device shown in Figure 24 may be a core network device, such as an MME.

参见图25,在第三核心网设备侧,本发明实施例提供的另一种提供安全上下文的设备,包括:Referring to FIG. 25 , on the device side of the third core network, another device for providing a security context provided by an embodiment of the present invention includes:

接收请求单元2501,用于接收第一核心网设备发送的请求消息,其中包括用户设备UE的非接入层NAS消息;A receiving request unit 2501, configured to receive a request message sent by a first core network device, including a non-access stratum NAS message of a user equipment UE;

响应单元2502,用于当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,向所述第一核心网设备发送响应消息,其中包括所述UE的安全上下文和用于确定所述第二核心网设备的信息。A response unit 2502, configured to send a response message to the first core network device when it is determined that the NAS message needs to be rerouted to a second core network device in a specific network, including the security context of the UE and a Determine the information of the second core network device.

较佳地,所述响应单元当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,还用于:Preferably, when determining that the NAS message needs to be rerouted to the second core network device in the specific network, the response unit is further configured to:

确定该UE的校验值;determine the check value of the UE;

所述响应消息中还包括:所述校验值,或者所述校验值和所述UE的安全上下文对应的密钥集标识。The response message further includes: the check value, or a key set identifier corresponding to the check value and the security context of the UE.

较佳地,所述接收请求单元还用于:接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息、校验值和密钥集标识;Preferably, the receiving request unit is further configured to: receive a request message sent by the second core network device, which includes the NAS message, a check value and a key set identifier;

所述响应单元还用于:根据所述UE的标识找到对应的鉴权数据,向所述第二核心网设备发送响应消息,其中包括该UE的鉴权数据。The response unit is further configured to: find corresponding authentication data according to the identifier of the UE, and send a response message to the second core network device, which includes the authentication data of the UE.

较佳地,所述响应单元在向所述第二核心网设备发送响应消息之前,还用于验证所述请求消息中的校验值;Preferably, before sending the response message to the second core network device, the response unit is further configured to verify the check value in the request message;

所述响应单元向所述第二核心网设备发送响应消息,具体为:当验证成功时,所述响应单元向所述第二核心网设备发送响应消息。The response unit sends a response message to the second core network device, specifically: when the verification is successful, the response unit sends a response message to the second core network device.

较佳地,所述响应单元验证所述请求消息中的校验值时,具体用于:Preferably, when the response unit verifies the check value in the request message, it is specifically used for:

当所述请求消息中还包括密钥集标识时,利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, use the UE identifier and the key set identifier to determine the corresponding security context, and use the security context to calculate a check value. If the verification value is consistent with the verification value in the request message, it is determined that the verification is successful; or,

通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The check value is calculated by a hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The locally stored check value is searched, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

较佳地,所述接收请求单元还用于:Preferably, the receiving request unit is also used for:

接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息和重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的;receiving a request message sent by the second core network device, including the NAS message and a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device;

通过所述重路由指示确定该请求消息中的NAS消息是重路由到第二核心网设备的;Determine through the rerouting indication that the NAS message in the request message is rerouted to the second core network device;

根据该NAS消息中的UE的标识和密钥集标识找到对应的安全上下文,并利用该安全上下文验证该请求消息中的完整性校验码,当验证成功时,根据所述UE的标识找到对应的鉴权数据,并将该鉴权数据返回给第二核心网设备。Find the corresponding security context according to the UE's identity and key set identity in the NAS message, and use the security context to verify the integrity check code in the request message. When the verification is successful, find the corresponding security context according to the UE's identity and returns the authentication data to the second core network device.

图25所示的设备可以是核心网设备,例如MME。The device shown in Figure 25 may be a core network device, such as an MME.

本发明实施例提供的另一种提供安全上下文的设备,该设备包括收发机和处理器,其中,Another device for providing a security context provided by an embodiment of the present invention includes a transceiver and a processor, wherein,

收发机接收用户设备UE发送的非接入层NAS消息;The transceiver receives the non-access stratum NAS message sent by the user equipment UE;

处理器当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,通过收发机向接入网设备发送重路由命令,所述重路由命令中包含NAS消息和用于确定所述第二核心网设备的信息。When it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the processor sends a rerouting command to the access network device through the transceiver, where the rerouting command includes the NAS message and is used to determine the information about the second core network device.

较佳地,收发机还用于接收所述第二核心网设备发送的请求消息,所述请求消息中包括UE的标识,所述处理器还用于根据所述UE的标识,查找对应的鉴权数据,并通过收发机将该鉴权数据发送给所述第二核心网设备。Preferably, the transceiver is further configured to receive a request message sent by the second core network device, where the request message includes the identifier of the UE, and the processor is further configured to search for a corresponding authentication device according to the identifier of the UE. and send the authentication data to the second core network device through the transceiver.

较佳地,所述处理器还用于:Preferably, the processor is also used for:

在所述收发机将该鉴权数据发送给所述第二核心网设备之前,验证请求消息中的校验值;当验证成功时,通过所述收发机将鉴权数据发送给第二核心网设备。Before the transceiver sends the authentication data to the second core network device, verify the check value in the request message; when the verification is successful, send the authentication data to the second core network through the transceiver equipment.

较佳地,所述处理器验证请求消息中的校验值时,具体用于:Preferably, when the processor verifies the check value in the request message, it is specifically used for:

当所述请求消息中还包括密钥集标识时,利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, use the UE identifier and the key set identifier to determine the corresponding security context, and use the security context to calculate a check value. If the verification value is consistent with the verification value in the request message, it is determined that the verification is successful; or,

通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The check value is calculated by a hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The locally stored check value is searched, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

较佳地,所述处理器在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还用于:通过与所述UE之间的鉴权过程,或者从第三核心网设备获取所述UE的安全上下文;Preferably, before determining that the NAS message needs to be rerouted to the second core network device in the specific network, the processor is further configured to: pass an authentication process with the UE, or obtain information from a third core network device. The network device obtains the security context of the UE;

在确定所述NAS消息需要重路由到特定网络中的第二核心网设备之后,通过收发机向接入网设备发送重路由命令之前,所述处理器还用于:为所述UE分配标识,并确定校验值;After determining that the NAS message needs to be rerouted to the second core network device in the specific network, and before sending a rerouting command to the access network device through the transceiver, the processor is further configured to: assign an identifier to the UE, and determine the check value;

所述重路由命令中,还包括:所述处理器为所述UE分配的标识和所述校验值;The rerouting command further includes: an identifier allocated by the processor to the UE and the check value;

或者,所述重路由命令中,还包括:所述处理器为所述UE分配的标识、所述校验值、以及该UE的安全上下文的密钥集标识。Or, the rerouting command further includes: the identifier allocated by the processor to the UE, the check value, and the key set identifier of the security context of the UE.

较佳地,所述处理器确定所述NAS消息需要重路由到特定网络中的第二核心网设备之前,还用于:通过收发机向第三核心网设备发送请求消息,请求消息中包含所述NAS消息,并通过收发机接收第三核心网设备回复的响应消息,其中包括所述UE的安全上下文、校验值以及用于确定所述第二核心网设备的信息;其中,所述校验值是所述第三核心网设备确定的;Preferably, before determining that the NAS message needs to be rerouted to the second core network device in the specific network, the processor is further configured to: send a request message to the third core network device through the transceiver, where the request message includes the The NAS message is received, and a response message replied by the third core network device is received through the transceiver, which includes the security context of the UE, the check value, and the information used to determine the second core network device; The verification value is determined by the third core network device;

通过所述用于确定所述第二核心网设备的信息,确定所述NAS消息需要重路由到所述特定网络中的第二核心网设备;determining that the NAS message needs to be rerouted to the second core network device in the specific network by using the information for determining the second core network device;

所述重路由命令中还包括:所述校验值,或者所述校验值和密钥集标识。The rerouting command further includes: the check value, or the check value and a key set identifier.

本发明实施例提供的另一种获取安全上下文的设备,该设备包括:收发机和处理器,其中,Another device for acquiring a security context provided by an embodiment of the present invention includes: a transceiver and a processor, wherein:

收发机接收接入网设备发送的特定消息,该特定消息中包括非接入层NAS消息;The transceiver receives a specific message sent by the access network device, where the specific message includes a non-access stratum NAS message;

处理器根据所述特定消息确定第一核心网设备,并通过收发机向第一核心网设备发送请求消息,所述请求消息中包括UE的标识;The processor determines the first core network device according to the specific message, and sends a request message to the first core network device through the transceiver, where the request message includes the identifier of the UE;

收发机接收第一核心网设备发送的响应消息,处理器从中获取所述UE的鉴权数据,该鉴权数据中包括所述UE的安全上下文,该鉴权数据是所述第一核心网设备根据所述UE的标识确定的。The transceiver receives the response message sent by the first core network device, from which the processor obtains the authentication data of the UE, the authentication data includes the security context of the UE, and the authentication data is the first core network device It is determined according to the identity of the UE.

较佳地,所述UE的标识,为所述第一核心网设备为所述UE分配的标识;Preferably, the identifier of the UE is an identifier allocated by the first core network device to the UE;

所述特定消息中还包括:校验值,或者校验值和密钥集标识;The specific message also includes: a check value, or a check value and a key set identifier;

所述请求消息中还包括:校验值,或者校验值和密钥集标识。The request message also includes: a check value, or a check value and a key set identifier.

较佳地,所述特定消息中还包括:重路由指示,所述重路由指示用于指示所述NAS消息是重路由到第二核心网设备的;Preferably, the specific message further includes: a rerouting indication, where the rerouting indication is used to indicate that the NAS message is rerouted to the second core network device;

所述请求消息中包括所述NAS消息,所述NAS消息中包括所述UE的标识,并且,所述请求消息中还包括所述重路由指示。The request message includes the NAS message, the NAS message includes the identifier of the UE, and the request message further includes the rerouting indication.

本发明实施例提供的另一种提供安全上下文的设备,该设备包括:收发机和处理器,其中,Another device for providing a security context provided by an embodiment of the present invention includes: a transceiver and a processor, wherein:

收发机接收第一核心网设备发送的请求消息,其中包括用户设备UE的非接入层NAS消息;The transceiver receives the request message sent by the first core network device, including the non-access stratum NAS message of the user equipment UE;

处理器当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,通过收发机向所述第一核心网设备发送响应消息,其中包括所述UE的安全上下文和用于确定所述第二核心网设备的信息。When it is determined that the NAS message needs to be rerouted to the second core network device in the specific network, the processor sends a response message to the first core network device through the transceiver, which includes the security context of the UE and the information used for determining Information about the second core network device.

较佳地,处理器当确定所述NAS消息需要重路由到特定网络中的第二核心网设备时,还用于:Preferably, when determining that the NAS message needs to be rerouted to the second core network device in the specific network, the processor is further configured to:

确定该UE的校验值;determine the check value of the UE;

所述响应消息中还包括:所述校验值,或者所述校验值和所述UE的安全上下文对应的密钥集标识。The response message further includes: the check value, or a key set identifier corresponding to the check value and the security context of the UE.

较佳地,所述收发机还用于接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息、校验值和密钥集标识;Preferably, the transceiver is further configured to receive a request message sent by the second core network device, including the NAS message, a check value and a key set identifier;

所述处理器根据所述UE的标识找到对应的鉴权数据,通过所述收发机向所述第二核心网设备发送响应消息,其中包括该UE的鉴权数据。The processor finds the corresponding authentication data according to the identifier of the UE, and sends a response message to the second core network device through the transceiver, which includes the authentication data of the UE.

较佳地,所述处理器在通过收发机向所述第二核心网设备发送响应消息之前,还用于验证所述请求消息中的校验值;Preferably, before the processor sends a response message to the second core network device through the transceiver, it is further configured to verify the check value in the request message;

所述处理器通过收发机向所述第二核心网设备发送响应消息,具体为:当验证成功时,所述处理器通过收发机向所述第二核心网设备发送响应消息。The processor sends a response message to the second core network device through the transceiver, specifically: when the verification is successful, the processor sends a response message to the second core network device through the transceiver.

较佳地,所述处理器验证所述请求消息中的校验值时,具体用于:Preferably, when the processor verifies the check value in the request message, it is specifically used for:

当所述请求消息中还包括密钥集标识时,利用所述UE的标识和所述密钥集标识确定对应的安全上下文,并利用所述安全上下文计算校验值,如果所述计算的校验值和所述请求消息中的校验值一致,则确定验证成功;或者,When the request message also includes a key set identifier, use the UE identifier and the key set identifier to determine the corresponding security context, and use the security context to calculate a check value. If the verification value is consistent with the verification value in the request message, it is determined that the verification is successful; or,

通过哈希函数计算校验值,如果所述计算的校验值和请求消息中的校验值一致,则确定验证成功;或者,The check value is calculated by a hash function, and if the calculated check value is consistent with the check value in the request message, it is determined that the verification is successful; or,

查找本地保存的校验值,如果所述保存的校验值和请求消息中的校验值一致,则确定验证成功。The locally stored check value is searched, and if the stored check value is consistent with the check value in the request message, it is determined that the verification is successful.

较佳地,所述收发机还用于接收所述第二核心网设备发送的请求消息,其中包括所述NAS消息和重路由指示,所述重路由指示用于指示NAS消息是重路由到第二核心网设备的;Preferably, the transceiver is further configured to receive a request message sent by the second core network device, including the NAS message and a rerouting indication, where the rerouting indication is used to indicate that the NAS message is to be rerouted to the second core network device. Two core network equipment;

所述处理器还用于通过所述重路由指示确定该请求消息中的NAS消息是重路由到第二核心网设备的;根据该NAS消息中的UE的标识和密钥集标识找到对应的安全上下文,并利用该安全上下文验证该请求消息中的完整性校验码,当验证成功时,根据所述UE的标识找到对应的鉴权数据,并将该鉴权数据通过收发机返回给第二核心网设备。The processor is further configured to determine, through the rerouting indication, that the NAS message in the request message is rerouted to the second core network device; find the corresponding security device according to the UE identifier and the key set identifier in the NAS message. context, and use the security context to verify the integrity check code in the request message, when the verification is successful, find the corresponding authentication data according to the identity of the UE, and return the authentication data to the second through the transceiver core network equipment.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of the present invention.

显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, provided that these modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (33)

1. A method for providing a security context, the method comprising:
the method comprises the steps that first core network equipment receives a non-access stratum (NAS) message sent by User Equipment (UE);
the first core network equipment and the UE perform authentication and key agreement to establish a security context shared between the first core network equipment and the UE;
when determining that the NAS message needs to be rerouted to a second core network device in a specific network, the first core network device reconstructs the received NAS message;
the reconstructing, by the first core network device, the NAS message received from the UE includes:
the first core network device replaces the UE identifier in the NAS message received from the UE with the global unique temporary identifier GUTI allocated to the UE by the first core network device;
the first core network device replaces the key set identifier in the NAS message sent by the UE with the key set identifier in the security context shared between the first core network device and the UE;
the first core network device sends a rerouting command to an access network device, wherein the rerouting command comprises the reconstructed NAS message;
the first core network device receives a context request sent by the second core network device, wherein the context request comprises the reconstructed NAS message;
the first core network device finds the security context shared between the first core network device and the UE according to the GUTI in the reconstructed NAS message and the key set identifier in the security context shared between the first core network device and the UE, and sends the security context shared between the first core network device and the UE to the second core network device.
2. The method of claim 1, wherein the first core network device reconstructs the received NAS message from the UE, further comprising:
and the first core network equipment calculates an integrity protection check value according to the security context shared between the first core network equipment and the UE, and uses the integrity protection check value as a message authentication code MAC information element IE in the NAS message sent by the UE.
3. The method of claim 2, wherein using the integrity protection check value as a Message Authentication Code (MAC) Information Element (IE) in a NAS message sent by the UE comprises:
filling the integrity protection check value into a Message Authentication Code (MAC) information element IE in an NAS message sent by the UE; or
And replacing the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.
4. The method according to any of claims 1 to 3, wherein before the first core network sends the security context shared between the first core network device and the UE to the second core network device, the method further comprises:
the first core network device verifies the integrity of the reconstructed NAS message carried in the context request by using a security context shared between the first core network device and the UE;
then, the step of the first core network device sending the security context shared between the first core network device and the UE to the second core network device is performed when the verification is successful.
5. The method of claim 4, wherein the verifying, by the first core network device, the integrity of the NAS message carried in the context request using the security context shared between the first core network device and the UE comprises:
the first core network device acquires a security context shared between the first core network device and the UE according to the GUTI and a key set identifier in the security context shared between the first core network device and the UE; calculating a check value by using the acquired security context; and if the calculated check value is consistent with the check value in the reconstructed NAS message, determining that the verification is successful.
6. The method of claim 1, wherein the context request further comprises:
a rerouting indication and/or an integrity protection check value, the rerouting indication indicating that the reconstructed NAS message is rerouted to the second core network device.
7. A method for obtaining a security context, the method comprising:
a second core network device receives a specific message sent by an access network device, wherein the specific message comprises an NAS message obtained by reconstructing a received non-access stratum NAS message sent by a User Equipment (UE) by a first core network device, and the reconstructed NAS message comprises a Globally Unique Temporary Identifier (GUTI) allocated to the UE by the first core network device and a key set identifier in a security context shared between the first core network device and the UE;
the second core network device determines a first core network device according to the GUTI and sends a context request to the first core network device, wherein the context request comprises the reconstructed NAS message;
and the second core network equipment receives the context response sent by the first core network equipment and acquires the security context from the context response.
8. The method of claim 7, wherein the NAS message further includes an integrity protection check value calculated by the first core network device according to a security context shared between the first core network device and the UE.
9. The method according to claim 7 or 8, wherein the security context of the UE acquired by the second core network device includes a ciphering algorithm and an integrity protection algorithm used by the first core network device to protect NAS messages.
10. The method of claim 9, wherein after the second core network device obtains the security context of the UE, the method further comprises:
when the second core network device needs to select a new algorithm, the second core network device derives a new NAS key by using the new algorithm, and sends an NAS security mode command message to the UE, where the message includes an identifier of the new algorithm; wherein the new algorithm comprises a ciphering algorithm and/or an integrity protection algorithm;
and the second core network equipment receives the NAS security mode completion message fed back by the UE.
11. An apparatus for providing a security context, the apparatus comprising:
the receiving NAS message unit is used for receiving a non-access stratum NAS message sent by User Equipment (UE);
the authentication and key agreement unit is used for performing authentication and key agreement with the UE so as to establish a security context shared between the equipment of the security context and the UE;
a rerouting command sending unit, configured to reconstruct the received NAS message when it is determined that the NAS message needs to be rerouted to a second core network device in a specific network;
reconstructing the received NAS message from the UE, wherein the reconstructing comprises:
replacing the UE identity in the NAS message received from the UE with a Globally Unique Temporary Identity (GUTI) allocated to the UE;
replacing the key set identifier in the NAS message sent by the UE with the key set identifier in the security context shared between the device of the security context and the UE;
the rerouting command sending unit is further configured to send a rerouting command to the access network device, where the rerouting command includes the reconstructed NAS message;
a security context providing unit, configured to receive a context request sent by the second core network device, where the context request includes the reconstructed NAS message, find, according to the GUTI in the reconstructed NAS message and a key set identifier in a security context shared between the security context device and the UE, and send the security context shared between the security context device and the UE to the second core network device.
12. The device of claim 11, wherein the sending rerouting command unit, when reconstructing the received NAS message from the UE, is further configured to:
and calculating an integrity protection check value according to the security context shared between the equipment and the UE, and using the integrity protection check value as a message authentication code MAC information element IE in an NAS message sent by the UE.
13. The apparatus according to claim 12, wherein when the rerouting command sending unit uses the integrity protection check value as a message authentication code MAC information element IE in a NAS message sent by the UE, the rerouting command sending unit is specifically configured to:
filling the integrity protection check value into a Message Authentication Code (MAC) information element IE in an NAS message sent by the UE; or
And replacing the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.
14. The apparatus according to claim 12 or 13, wherein the security context providing unit is further configured to:
before sending the security context shared between the security context device and the UE to the second core network device, verifying the integrity of the reconstructed NAS message carried in the context request by using the security context shared between the security context device and the UE;
then, when the verification is successful, the security context is sent to the second core network device.
15. The device according to claim 14, wherein the security context providing unit is specifically configured to:
acquiring a security context shared between the equipment and the UE according to the GUTI and a key set identifier in the security context shared between the equipment and the UE; calculating a check value by using the acquired security context; and if the calculated check value is consistent with the check value in the reconstructed NAS message, determining that the verification is successful.
16. The apparatus of claim 11, wherein the context request further comprises:
a rerouting indication and/or an integrity protection check value, the rerouting indication indicating that the reconstructed NAS message is rerouted to the second core network device.
17. An apparatus for obtaining a security context, the apparatus comprising:
a specific message receiving unit, configured to receive a specific message sent by an access network device, where the specific message includes an NAS message obtained by a first core network device reconstructing a received NAS message of a non-access stratum sent by a user equipment UE, where the reconstructed NAS message includes a globally unique temporary identifier GUTI allocated by the first core network device to the UE and a key set identifier in a security context shared between the first core network device and the UE;
a context request unit, configured to determine a first core network device according to the GUTI, and send a context request to the first core network device, where the context request includes the reconstructed NAS message;
and the context obtaining unit is used for receiving the context response sent by the first core network device and obtaining the security context from the context response.
18. The device of claim 17, wherein the NAS message further includes an integrity protection check value calculated by the first core network device according to a security context shared between the first core network device and the UE.
19. The device according to claim 17 or 18, wherein the security context includes a ciphering algorithm and an integrity protection algorithm used by the first core network device to protect NAS messages.
20. The apparatus of claim 19, wherein after the context obtaining unit obtains the security context of the UE, the context obtaining unit is further configured to:
when a new algorithm needs to be selected, deriving a new NAS secret key by using the new algorithm, and sending an NAS security mode command message to the UE, wherein the NAS security mode command message comprises an identifier of the new algorithm; wherein the new algorithm comprises a ciphering algorithm and/or an integrity protection algorithm;
and receiving the NAS security mode completion message fed back by the UE.
21. An apparatus for providing a security context, the apparatus comprising a processor and a transceiver, wherein,
the transceiver receives a non-access stratum (NAS) message sent by User Equipment (UE);
the processor is configured to perform authentication and key agreement with the UE to establish a security context shared between the UE and the device of the security context, and when the processor determines that the NAS message needs to be rerouted to a second core network device in a specific network, the processor is further configured to reconstruct the received NAS message;
the processor reconstructs the received NAS message from the UE in the following way:
replacing the UE identity in the NAS message received from the UE with a Globally Unique Temporary Identity (GUTI) allocated to the UE;
replacing the key set identifier in the NAS message sent by the UE with the key set identifier in the security context shared between the device of the security context and the UE;
the processor is further configured to send a rerouting command to an access network device through the transceiver, where the rerouting command includes the reconstructed NAS message;
the transceiver receives a context request sent by the second core network device, where the context request includes the reconstructed NAS message, the processor finds a security context shared between the security context device and the UE according to the GUTI in the reconstructed NAS message and a key set identifier in a security context shared between the security context device and the UE, and the transceiver sends the security context shared between the security context device and the UE to the second core network device.
22. The device of claim 21, wherein the processor, when reconstructing the received NAS message, is further configured to:
and calculating an integrity protection check value according to the security context shared between the equipment with the security context and the UE, and taking the integrity protection check value as a message authentication code MAC information element IE in an NAS message sent by the UE.
23. The device of claim 22, wherein when the processor uses the integrity protection check value as a message authentication code MAC information element IE in a NAS message sent by the UE, the processor is specifically configured to:
filling the integrity protection check value into a Message Authentication Code (MAC) information element IE in an NAS message sent by the UE; or
And replacing the message authentication code MAC in the NAS message sent by the UE with the integrity protection check value.
24. The device of claim 22 or 23, wherein before the transceiver sends the security context shared between the device and the UE to the second core network device, the processor is further configured to:
verifying the integrity of the reconstructed NAS message carried in the context request by using a security context shared between the device with the security context and the UE;
then, when the verification is successful, the transceiver sends the security context to the second core network device.
25. The device of claim 24, wherein the processor is specifically configured to:
acquiring a security context shared between the equipment with the security context and the UE according to the GUTI and a key set identifier in the security context shared between the equipment with the security context and the UE; calculating a check value by using the acquired security context; and if the calculated check value is consistent with the check value in the reconstructed NAS message, determining that the verification is successful.
26. The apparatus of claim 21, wherein the context request further comprises:
a rerouting indication and/or an integrity protection check value, the rerouting indication indicating that the reconstructed NAS message is rerouted to the second core network device.
27. An apparatus for obtaining a security context, the apparatus comprising a transceiver and a processor, wherein:
the transceiver receives a specific message sent by access network equipment, wherein the specific message comprises an NAS message obtained by reconstructing a received non-access stratum NAS message sent by User Equipment (UE) by first core network equipment, and the reconstructed NAS message comprises a Globally Unique Temporary Identifier (GUTI) allocated to the UE by the first core network equipment and a key set identifier in a security context shared between the first core network equipment and the UE;
the processor is configured to determine a first core network device according to the GUTI, and the transceiver is further configured to send a context request to the first core network device, where the context request includes the reconstructed NAS message;
the transceiver is further configured to receive a context response sent by the first core network device, from which the processor obtains a security context.
28. The device of claim 27, wherein the NAS message further includes an integrity protection check value calculated by the first core network device according to a security context shared between the first core network device and the UE.
29. The device according to claim 27 or 28, wherein the security context comprises a ciphering algorithm and an integrity protection algorithm used by the first core network device to protect NAS messages.
30. The apparatus of claim 29, wherein after obtaining the security context of the UE, the processor is further configured to: when a new algorithm needs to be selected, deriving a new NAS secret key by using the new algorithm, and sending an NAS security mode command message to the UE through the transceiver, wherein the NAS security mode command message comprises an identifier of the new algorithm; wherein the new algorithm comprises a ciphering algorithm and/or an integrity protection algorithm;
and the transceiver receives the NAS security mode completion message fed back by the UE.
31. A system comprising an apparatus for providing a security context according to any one of claims 11 to 16 and an apparatus for obtaining a security context according to any one of claims 17 to 20.
32. A system comprising an apparatus for providing a security context according to any one of claims 21 to 26 and an apparatus for obtaining a security context according to any one of claims 27 to 30.
33. The system of claim 32, wherein the system further comprises an access network device.
CN201480035973.7A 2013-10-28 2014-10-28 Method and equipment for providing and acquiring security context Active CN105340319B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201480035973.7A CN105340319B (en) 2013-10-28 2014-10-28 Method and equipment for providing and acquiring security context

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CNPCT/CN2013/086088 2013-10-28
PCT/CN2013/086088 WO2015061951A1 (en) 2013-10-28 2013-10-28 Method and device for providing and acquiring security context
PCT/CN2014/089734 WO2015062488A1 (en) 2013-10-28 2014-10-28 Method and device for providing and acquiring security context
CN201480035973.7A CN105340319B (en) 2013-10-28 2014-10-28 Method and equipment for providing and acquiring security context

Publications (2)

Publication Number Publication Date
CN105340319A CN105340319A (en) 2016-02-17
CN105340319B true CN105340319B (en) 2021-02-23

Family

ID=55288979

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201480035973.7A Active CN105340319B (en) 2013-10-28 2014-10-28 Method and equipment for providing and acquiring security context

Country Status (1)

Country Link
CN (1) CN105340319B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109842877B (en) * 2019-04-09 2022-03-18 中国电子科技集团公司第三十研究所 Method for realizing IMSI changing function in SIM card

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007036764A1 (en) * 2005-09-30 2007-04-05 Telefonaktiebolaget Lm Ericsson (Publ) Means and methods for improving the handover characteristics of integrated radio access networks
CN101064938A (en) * 2006-04-28 2007-10-31 华为技术有限公司 Method for applying MIP when the mobile terminal switched between 3GPP and non-3GPP access system
CN101114927A (en) * 2006-07-24 2008-01-30 华为技术有限公司 A system and method for realizing load balancing
CN102348201A (en) * 2010-08-05 2012-02-08 华为技术有限公司 Method and device for acquiring security context

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007036764A1 (en) * 2005-09-30 2007-04-05 Telefonaktiebolaget Lm Ericsson (Publ) Means and methods for improving the handover characteristics of integrated radio access networks
CN101064938A (en) * 2006-04-28 2007-10-31 华为技术有限公司 Method for applying MIP when the mobile terminal switched between 3GPP and non-3GPP access system
CN101114927A (en) * 2006-07-24 2008-01-30 华为技术有限公司 A system and method for realizing load balancing
CN102348201A (en) * 2010-08-05 2012-02-08 华为技术有限公司 Method and device for acquiring security context

Also Published As

Publication number Publication date
CN105340319A (en) 2016-02-17

Similar Documents

Publication Publication Date Title
WO2015062488A1 (en) Method and device for providing and acquiring security context
US10299119B2 (en) Method and system for providing security from a radio access network
US20200213290A1 (en) Authorization method and network element
KR101630582B1 (en) Key agreement for wireless communication
CN102196436B (en) Security authentication method, device and system
KR101929699B1 (en) GPRS system key enforcement method, SGSN device, UE, HLR / HSS, and GPRS system
US8750515B2 (en) Method and system for generating an identifier of a key
TWI392382B (en) Method of handling security configuration in wireless communications system and related communication device
JP2023513501A (en) Key acquisition method and device
CN102215474A (en) Method and device for carrying out authentication on communication equipment
Khan et al. Trashing IMSI catchers in mobile networks
CN101640887A (en) Authentication method, communication device and communication system
CN104219650B (en) Method for sending user identity authentication information and user equipment
CN102595400B (en) Method, system and the user equipment whether detection UICC uses in authorisation device
CN106535219A (en) User information backfilling method and device
JPWO2018079690A1 (en) System, network device, terminal, and method
CN103297224A (en) Encryption key information distribution method and related device
CN103415010A (en) D2D network authentication method and system
JP7559222B2 (en) Method, apparatus and system for configuring security modes, and computer-readable storage medium
CN108737431B (en) Confusion-based hierarchical distributed authentication method, device and system in IoT scenarios
CN110719292A (en) Connection authentication method and system between edge computing equipment and central cloud platform
CN102892114B (en) Method and device for checking equipment validity
CN105340319B (en) Method and equipment for providing and acquiring security context
US11943612B2 (en) Method and network server for authenticating a communication apparatus
CN101938743B (en) Generation method and device of safe keys

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant