Nothing Special   »   [go: up one dir, main page]

WO2022134089A1 - Method and apparatus for generating security context, and computer-readable storage medium - Google Patents

Method and apparatus for generating security context, and computer-readable storage medium Download PDF

Info

Publication number
WO2022134089A1
WO2022134089A1 PCT/CN2020/139666 CN2020139666W WO2022134089A1 WO 2022134089 A1 WO2022134089 A1 WO 2022134089A1 CN 2020139666 W CN2020139666 W CN 2020139666W WO 2022134089 A1 WO2022134089 A1 WO 2022134089A1
Authority
WO
WIPO (PCT)
Prior art keywords
security
key
terminal device
security context
network element
Prior art date
Application number
PCT/CN2020/139666
Other languages
French (fr)
Chinese (zh)
Inventor
胡力
吴�荣
Original Assignee
华为技术有限公司
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
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2020/139666 priority Critical patent/WO2022134089A1/en
Priority to EP20966652.8A priority patent/EP4262258A4/en
Priority to CN202080107902.9A priority patent/CN116601985A/en
Publication of WO2022134089A1 publication Critical patent/WO2022134089A1/en
Priority to US18/340,651 priority patent/US20230337002A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/043Key management, e.g. using generic bootstrapping architecture [GBA] using a trusted network node as an anchor
    • H04W12/0433Key management protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/30Security of mobile devices; Security of mobile applications
    • H04W12/37Managing security policies for mobile devices or for controlling mobile applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/041Key generation or derivation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/60Context-dependent security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/18Selecting a network or a communication service

Definitions

  • the embodiments of the present application relate to the field of communications technologies, and in particular, to a method, an apparatus, and a computer-readable storage medium for generating a security context.
  • a public network is a communication network constructed by network service providers for public users.
  • the operator allocates network resources that can be divided into parts for these users, and the divided network resources form a private network.
  • the private network formed at this time can be called a public network integrated non-public network (PNI-NPN).
  • PNI-NPN public network integrated non-public network
  • UE user equipment
  • PLMN public land mobile network
  • NPN non-public network
  • a UE can be connected to the same radio access network (RAN) to perform public network services and private network services at the same time.
  • RAN radio access network
  • the public network services and private network services communicate using the same set of security contexts.
  • the security context corresponding to the private network service is obtained.
  • the attacker obtains the algorithm used by the private network service, he also obtains the security context corresponding to the public network service. Therefore, security attacks on public network services or private network services may affect the corresponding private network services or public network services, thereby reducing the security of communication services.
  • Embodiments of the present invention disclose a method, device and computer-readable storage medium for generating a security context, which are used to improve the security of communication services.
  • a first aspect discloses a method for generating a security context.
  • the method for generating a security context can be applied to a terminal device, and can also be applied to a module (eg, a chip) in the terminal device.
  • the security context generation method may include: the terminal device obtains a first security context, where the first security context is used to protect the first communication service of the terminal device; the terminal device sends a session request message to a session management function network element, The session request message is used to request the establishment of a session for a second communication service, and the second communication service is different from the first communication service; the terminal device receives a session acceptance message from the session management function network element, and the second communication service is different from the first communication service.
  • the session acceptance message is used to complete the establishment of the session for the second communication service; the terminal device obtains an additional generation instruction; the terminal device obtains a second security context according to the additional generation instruction, and the second security context is used for The second communication service is protected.
  • the terminal device may further acquire the second security context on the basis of acquiring the first security context.
  • the first security context and the second security context can respectively protect different communication services. Thereby, the protection of different services can be isolated to prevent that when one of the communication services is attacked, the other communication service is affected, thereby improving the security of the communication services.
  • the session request message includes first indication information, where the first indication information is used to indicate that the terminal device supports generating the second security context.
  • the session management function network element when the session request message includes the first indication information, the session management function network element can directly determine the second security context according to the indication information, which can reduce the processing process of the session management function network element, thereby improving the second security context. Generation efficiency of security context.
  • acquiring, by the terminal device, the second security context according to the additional generation instruction includes: acquiring, by the terminal device, a security key based on the first key according to the additional generation instruction; and/or The terminal device acquires a security algorithm according to the additional generation instruction.
  • the security context may include a security key and/or a security algorithm.
  • the security context can perform encryption protection and integrity protection on data, so as to ensure the security and reliability of data in communication services.
  • the terminal device acquiring the security key based on the first key according to the additional generation instruction includes: the terminal device obtaining the security key based on the first security context according to the additional generation instruction An access stratum (access stratum, AS) root key obtains the first key; the terminal device generates the security key according to the first key.
  • An access stratum (access stratum, AS) root key obtains the first key; the terminal device generates the security key according to the first key.
  • the first key when the terminal device generates the security key, the first key may be generated by generating the AS root key of the first security context. Since the AS root key is known and does not need to be generated, the process of generating the second security context can be reduced, thereby improving the efficiency of generating the second security context.
  • the additional generation instruction includes an indication of a first derivative parameter
  • the terminal device obtains the first secret key based on the AS root key of the first security context according to the additional generation instruction
  • the key includes: the terminal device generates the first key according to the AS root key of the first security context and the first derivative parameter.
  • the generated key is different, therefore, it can be prevented that the security key included in the second security context and the first security context include The same security key can ensure that different communication services use different security contexts, thereby ensuring the effectiveness of security isolation and improving the security of communication services.
  • the first derivative parameter is a downlink packet data convergence protocol (packet data convergence potocol, PDCP) number COUNT
  • the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
  • the corresponding COUNT value may change accordingly.
  • the change of the COUNT value can prevent the generated first keys from being the same, so that the generated security keys can be prevented from being the same, so that the generated security contexts can be guaranteed to be different.
  • Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
  • the security context generation method further includes: The terminal device performs secondary authentication; the terminal device generates a secondary authentication key in the process of performing the secondary authentication; the terminal device obtains a security key based on the first key according to the additional generation instruction, The method includes: obtaining, by the terminal device, the first key based on the secondary authentication key according to the additional generation instruction; and generating, by the terminal device, a security key according to the first key.
  • the terminal device may perform secondary authentication, and then generate the first key through the authentication key obtained by the secondary authentication. Since the first keys generated by different authentication keys are different, the security keys included in the second security context generated by using the first keys are also different from the security keys included in the first security context, so that the generated security can be guaranteed.
  • the context is different. Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
  • the additional generation instruction includes an indication of a second derivative parameter
  • the terminal device obtains the first key based on the secondary authentication key according to the additional generation instruction, including: The terminal device generates the first key based on the secondary authentication key and the second derivative parameter according to the indication of the second derivative parameter.
  • the terminal device may generate the first key according to the second derivative parameter. Since the second derivative parameter is different, the generated first key is different. Therefore, it is possible to prevent the generated second security context from including the same security key as the first security context, to ensure that the security contexts used by different communication services are different, to ensure the effectiveness of security isolation, and to improve communication services. security.
  • the second derived parameter is one or more of the following parameters: downlink non-access stratum (non-access stratum, NAS) number COUNT, protocol data unit (protocol data unit, PDU) Session (session) identity document (ID), network slice selection assistance information (NSSAI) and data network name (DNN).
  • NAS downlink non-access stratum
  • COUNT protocol data unit
  • PDU protocol data unit
  • Session session
  • ID identity document
  • NSSAI network slice selection assistance information
  • DNN data network name
  • the derived first keys may be different.
  • the PDU session ID, NSSAI or DNN are used as the parameters for deriving the first key, the derived first keys may also be different due to differences in the PDU session of the terminal device, the access slice and the data network. Different first keys can generate different security keys, and different security keys can ensure that the generated security contexts are different. Different security contexts can be used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
  • the generating, by the terminal device, the security key according to the first key includes: generating, by the terminal device, the security key according to the first key and a third derivative parameter. .
  • the terminal device may generate the security key according to the first key and the third derived parameter. Since the generated security keys are different due to different third derived parameters, it can be avoided that the generated security keys are the same as the existing security keys, so that the generated security contexts can be guaranteed to be different. By protecting different communication services through different security contexts, the effectiveness of security isolation of communication services can be ensured, thereby improving the security of communication services.
  • the additional generation instruction includes an identifier of the security algorithm
  • the terminal device generates the security key according to the first key and the third derived parameter, including: the terminal device
  • the security key is generated based on the first key and the identity and type of the security algorithm.
  • the security key can be determined by the identifier and type of the corresponding security algorithm, thereby ensuring the validity of the generated security key. sex.
  • the additional generation indication includes the identification of the security algorithm.
  • the terminal device after the terminal device obtains the identifier of the security algorithm, it can directly determine the security algorithm according to the identifier, thereby ensuring the consistency of the security algorithm generated by the terminal device and the data transmission network element, and reducing the process of determining the security algorithm by the terminal device. And can improve the generation efficiency of the security context.
  • the second communication service when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
  • the first communication service and the second communication service are different communication services.
  • one communication service is a private network service
  • the other communication service is a public network service, which can ensure that different communication services use different services. It can ensure the security isolation between public network services and private network services, thereby improving the security of public network services and private network services.
  • a second aspect discloses a security context generation method.
  • the security context generation method can be applied to a session management function network element, and can also be applied to a module (for example, a chip) in a session management function network element.
  • the session management function network element is hereinafter referred to as the session management function network element. Take an example to illustrate.
  • the security context generation method may include: the session management function network element receives a session request message from the terminal device, where the session request message is used to request the establishment of a session of the second communication service; the session management function network element sends a data transmission network element to the sending an additional security context indication, where the additional security context indication is used to instruct the generation of a second security context, where the second security context is used to protect the second communication service; the session management function network element sends to the terminal device A session accept message, where the session accept message is used to complete the establishment of the session of the second communication service.
  • the network element of the session management function may respond to the request for generating the second security context.
  • the session management function network element sends an additional security context indication, and the data transmission network element may generate a second security context according to the additional security context.
  • the session management function network element can coordinate the terminal device and the data transmission network element to generate the second security context, so as to ensure the generation of the second security context.
  • the session request message includes first indication information, where the first indication information is used to instruct the terminal device to support generating the second security context, and the session management function network element reports to the data transmission network sending an additional security context indication by the element, including: when the first indication information indicates that the terminal device supports generating the second security context, the session management function network element sends the additional security context to the data transmission network element contextual indication.
  • the session management function network element when the session request message includes the first indication information, can directly determine to generate the second security context according to the indication information, which can reduce the processing process of the session management function network element, thereby improving the first security context. Second, the generation efficiency of the security context.
  • the session management function network element sending an additional security context indication to the data transmission network element includes: the session management function network element obtains the subscription information of the terminal device according to the session request message; When the subscription information of the terminal device indicates that the second security context needs to be generated, the session management function network element sends the additional security context indication to the data transmission network element.
  • the network element of the session management function may also determine whether to send an additional security context indication according to the subscription information, and the session request message may not carry the indication information for determining whether to generate the second security context, thereby reducing information transmission and Save communication resources.
  • the session management function network element sends an additional security context indication to the data transmission network element, including: when the local policy configured by the session management function network element indicates that the second security context needs to be generated , the session management function network element sends the additional security context indication to the data transmission network element.
  • the session management function network element may determine whether to send an additional security context indication according to a local policy.
  • the session request message may not carry the indication information for determining whether to generate the second security context, thereby reducing information transmission. and save communication resources.
  • the additional security context indication includes an identifier of a security algorithm
  • the method further includes: acquiring the security algorithm by the session management function network element.
  • the terminal device and the data transmission network element can receive the identification of the security algorithm determined by the session management function network element, and the terminal device and the data transmission network element can directly determine the security algorithm according to the identification
  • the security algorithm is determined, so that the process of determining the security algorithm by the terminal device and the data transmission network element can be reduced and processing resources can be saved, so that the generation efficiency of the security context can be improved.
  • the additional security context indication includes a first key
  • the method further includes: the session management function network element triggers secondary authentication; after the secondary authentication is successful, the session management The functional network element receives the secondary authentication key from the authentication, authorization and accounting network element; the session management functional network element obtains the first key according to the secondary authentication key.
  • the session management function network element may trigger the secondary authentication to obtain the authentication key, and then generate the first key by using the secondary authentication authentication key. Since the first keys generated by different authentication keys are different, the security keys included in the second security context generated by using the first keys are also different from the security keys included in the first security context, so that the generated security can be guaranteed.
  • the context is different. Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
  • obtaining the first key by the session management function network element according to the secondary authentication key includes: the session management function network element obtains the first key according to the secondary authentication key and the second authentication key.
  • the derived parameter obtains the first key.
  • the session management network element may generate the first key according to the second derivative parameter, and the generated first key is different due to the difference of the second derivative parameter. Therefore, it can be prevented that the security key included in the generated second security context is the same as the security key included in the first security context, and it can be ensured that the security contexts used by different communication services are different. The effectiveness of security isolation can be guaranteed, thereby improving the security of communication services.
  • the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
  • the derived first keys may be different.
  • the PDU session ID, NSSAI and DNN are used as the parameters for deriving the first key, due to the difference in the PDU session of the terminal device, the slice accessed and the data network, the derived first key can also be used.
  • the keys are all different. Different first keys can generate different security keys, and different security keys can ensure that the generated security contexts are different. Different security contexts can be used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
  • the session acceptance message includes an indication of a second derivative parameter, where the indication of the second derivative parameter is used to instruct to obtain a security key according to the secondary authentication key.
  • the session management network element when the session management function network element receives the indication of the second derived parameter, the session management network element may generate the first key according to the secondary authentication key and the second derived parameter.
  • the difference in the second derived parameter makes the generated security key different.
  • the generated security context can be made different. Different security contexts can ensure the effectiveness of the security isolation of communication services, thereby improving the security of communication services.
  • a third aspect discloses a security context generation method.
  • the security context generation method can be applied to a data transmission network element, and can also be applied to a module (for example, a chip) in the data transmission network element.
  • the following takes the data transmission network element as an example to perform illustrate.
  • the security context generation method may include: the data transmission network element receives an additional security context indication from the session management function network element; the data transmission network element obtains a second security context according to the additional security context indication, and the second security context is used to protect the second communication service; the data transmission network element sends an additional generation instruction to the terminal device, where the additional generation instruction is used to instruct the generation of the second security context.
  • the data transmission network element may acquire the second security context, and the second security context may protect the second communication service, thereby improving the security of the second communication service.
  • the data transmission network element acquiring the second security context according to the additional security context indication includes: the data transmission network element acquiring the security context based on the first key according to the additional security context indication and/or the data transmission network element obtains a security algorithm according to the additional security context indication.
  • the security context may include a security key and/or a security algorithm.
  • the security context can perform encryption protection and integrity protection on data, so as to ensure the security and reliability of data in communication services.
  • the security context generation further includes: the data transmission network element obtains a first security context, and the first security context is obtained by the data transmission network element.
  • a security context is used to protect the first communication service, the first communication service being different from the second communication service.
  • the data transmission network element may further acquire the second security context on the basis of acquiring the first security context.
  • the first security context and the second security context can respectively protect different communication services. Therefore, the protection of different services can be isolated, so as to prevent one communication service from being attacked, affecting the other communication service. Thereby, the security of the communication service can be improved.
  • the data transmission network element generating the security key based on the first key according to the additional security context indication includes: the data transmission network element, according to the additional security context indication, The first key is obtained based on the AS root key of the first security context; the data transmission network element generates the security key according to the first key.
  • the first key when the data transmission network element generates the security key, the first key may be generated by generating the AS root key of the first security context. Since the AS root key is known and does not need to be generated, the process of generating the second security context can be reduced, thereby improving the efficiency of generating the second security context.
  • the additionally generated indication includes an indication of a first derived parameter
  • the data transmission network element obtains the The first key includes: the data transmission network element generates the first key according to the AS root key of the first security context and the first derivative parameter.
  • the generated second security context includes the security key and the The security keys included in the first security context are the same, which can ensure that the security contexts used by different communication services are different, thereby ensuring the effectiveness of security isolation and improving the security of communication services.
  • the first derivative parameter is a downlink PDCP COUNT
  • the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
  • the corresponding COUNT value may change accordingly.
  • the change of the COUNT value can prevent the generated first keys from being the same, so that the generated security keys can be prevented from being the same, so that the generated security contexts can be guaranteed to be different.
  • Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
  • the additional security context indication includes the first key
  • the data transmission network element obtains the security key based on the first key according to the additional security context indication, including: The data transmission network element generates the security key according to the first key.
  • the data transmission network element may generate a security key according to the received first key, and the first key may be a key generated by the session management function network element according to the authentication key of the secondary authentication. Since the first keys generated by different authentication keys are different, the security keys included in the second security context generated by using the first keys are also different from the security keys included in the first security context, so that the generated security can be guaranteed.
  • the context is different. Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
  • generating, by the data transmission network element, the security key according to the first key includes: generating, by the data transmission network element, the security key according to the first key and a third derived parameter. the security key.
  • the data transmission network element may generate the security key according to the first key and the third derived parameter. Because the third derivative parameters are different, the generated security keys are different, and different communication services are protected through different security contexts. The effectiveness of the security isolation of the communication service can be guaranteed, thereby improving the security of the communication service.
  • the additional security context indication includes an identifier of a security algorithm
  • the data transmission network element generates the security key according to the first key and the third derived parameter, including: the data The transmission network element generates the security key according to the first key and the identity and type of the security algorithm.
  • the security key can be determined by the identifier and type of the corresponding security algorithm, thereby ensuring the validity of the generated security key. sex.
  • the additional generation indication includes the identification of the security algorithm.
  • the terminal device after the terminal device obtains the identifier of the security algorithm, it can directly determine the security algorithm according to the identifier, thereby ensuring the consistency of the security algorithm generated by the terminal device and the data transmission network element, and reducing the number of data transmission network elements to determine the security algorithm process, and can improve the generation efficiency of the security context.
  • the data transmission network element can determine the security algorithm, and identify the security algorithm
  • the additional security context indication includes an identifier of the security algorithm.
  • the security algorithm can be directly determined according to the identifier, thereby ensuring the consistency of the security algorithm generated by the terminal device and the data transmission network element, and reducing the need for the data transmission network element to determine the security algorithm.
  • the process of security algorithm, and the generation efficiency of security context can be improved.
  • the data transmission network element acquiring the security algorithm according to the additional security context indication includes: the data transmission network element, according to the additional security context indication, based on the security capability of the terminal device and the The security algorithm is obtained from a preconfigured algorithm priority list, and the security capability of the terminal device is used to indicate all security algorithms supported by the terminal device.
  • the data transmission network element may acquire the security algorithm according to the security capability of the corresponding terminal device and the preconfigured algorithm priority list.
  • the algorithm priority list is pre-configured by the data transmission network element, and the corresponding terminal device can pre-configure its own corresponding security algorithm.
  • the data transmission network element can determine the security algorithms of all corresponding terminal devices through the algorithm priority list. When a terminal device suffers a security attack, the security algorithm of the corresponding terminal device may be leaked, but the security algorithms of all terminal devices will not be leaked, thereby improving the security of communication services of different terminal devices.
  • the second communication service when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
  • the first communication service and the second communication service are different communication services.
  • one communication service is a private network service
  • the other communication service is a public network service, which can ensure that different communication services use different services. It can ensure the security isolation between public network services and private network services, thereby improving the security of public network services and private network services.
  • a fourth aspect discloses an apparatus for generating a security context.
  • the apparatus for generating a security context may be a terminal device or a module (eg, a chip) in the terminal device, and the apparatus may include:
  • an acquiring unit configured to acquire a first security context, where the first security context is used to protect the first communication service of the terminal device;
  • a sending unit configured to send a session request message to the session management function network element, where the session request message is used to request the establishment of a session of a second communication service, where the second communication service is different from the first communication service;
  • a receiving unit configured to receive a session acceptance message from the session management function network element, where the session acceptance message is used to complete the establishment of the session of the second communication service;
  • the obtaining unit is also used to obtain additional generation instructions
  • the obtaining unit is further configured to obtain a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service.
  • the session request message includes first indication information, where the first indication information is used to indicate that the terminal device supports generating the second security context.
  • the acquiring unit acquires a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service includes:
  • a security algorithm is obtained according to the additional generation indication.
  • the obtaining unit obtaining the security key based on the first key according to the additional generation instruction includes:
  • the security key is generated from the first key.
  • the additional generation instruction includes an indication of a first derivative parameter
  • the obtaining unit obtains the first secret key based on the AS root key of the first security context according to the additional generation instruction Keys include:
  • the first key is generated according to the AS root key of the first security context and the first derived parameter.
  • the first derivative parameter is a downlink PDCP COUNT
  • the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
  • the device may further include:
  • a generating unit configured to generate a secondary authentication key during the execution of the secondary authentication process
  • the obtaining unit obtaining the security key based on the first key according to the additional generation instruction includes:
  • a security key is generated from the first key.
  • the additional generation instruction includes an indication of a second derivative parameter, and according to the additional generation instruction, the obtaining unit, according to the additional generation instruction, obtains the first key based on the secondary authentication key, including:
  • the first key is generated based on the secondary authentication key and the second derivative parameter according to the indication of the second derivative parameter.
  • the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
  • the obtaining unit generating the security key according to the first key includes:
  • the security key is generated based on the first key and the third derived parameter.
  • the additional generation instruction includes the identifier of the security algorithm
  • the acquiring unit generating the security key according to the first key and the third derivative parameter includes:
  • the security key is generated based on the first key and the identity and type of the security algorithm.
  • the additional generation indication includes the identification of the security algorithm.
  • the second communication service when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
  • a fifth aspect discloses an apparatus for generating a security context.
  • the apparatus for generating a security context may be a session management function network element, or a module (eg, a chip) in the session management function network element, and the apparatus may include:
  • a receiving unit configured to receive a session request message from the terminal device, where the session request message is used to request the establishment of a session of the second communication service;
  • a sending unit configured to send an additional security context indication to a data transmission network element, where the additional security context indication is used to instruct to generate a second security context, and the second security context is used to protect the second communication service;
  • the sending unit is further configured to send a session acceptance message to the terminal device, where the session acceptance message is used to complete the establishment of the session of the second communication service.
  • the session request message includes first indication information, where the first indication information is used to instruct the terminal device to support generating the second security context, and the sending unit sends an additional information to the data transmission network element Security context indications include:
  • the additional security context indication is sent to the data transmission network element.
  • the sending unit sending the additional security context indication to the data transmission network element includes:
  • the additional security context indication is sent to the data transmission network element.
  • the sending unit to the data transmission network element to send the additional security context indication includes:
  • the additional security context indication is sent to the data transmission network element.
  • the additional security context indication includes an identifier of a security algorithm
  • the apparatus may further include an acquisition unit, wherein:
  • an obtaining unit configured to obtain the security algorithm.
  • the additional security context indication includes a first key
  • the apparatus may further include:
  • Trigger unit used to trigger secondary authentication
  • the receiving unit is further configured to receive the secondary authentication key from the authentication, authorization and accounting network element after the secondary authentication is successful;
  • the obtaining unit is further configured to obtain the first key according to the secondary authentication key.
  • the acquiring unit acquiring the first key according to the secondary authentication key includes:
  • the first key is obtained according to the secondary authentication key and the second derivative parameter.
  • the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
  • the session acceptance message includes an indication of a second derivative parameter, where the indication of the second derivative parameter is used to instruct to obtain a security key according to the secondary authentication key.
  • a sixth aspect discloses an apparatus for generating a security context.
  • the apparatus for generating a security context may be a data transmission network element, or may be a module (eg, a chip) in the data transmission network element, and the apparatus may include:
  • a receiving unit configured to receive an additional security context indication from the session management function network element
  • an acquiring unit configured to acquire a second security context according to the additional security context indication, where the second security context is used to protect the second communication service;
  • a sending unit configured to send an additional generation instruction to the terminal device, where the additional generation instruction is used to instruct to generate the second security context.
  • the obtaining unit is specifically used for:
  • a security algorithm is obtained according to the additional security context indication.
  • the acquiring unit is further configured to acquire a first security context before receiving the additional security context indication from the session management function network element, where the first security context is used to protect the first communication service, The first communication service is different from the second communication service.
  • the obtaining unit, according to the additional security context indication, generating the security key based on the first key includes:
  • the security key is generated from the first key.
  • the additionally generated indication includes an indication of a first derived parameter
  • the first key is generated according to the AS root key of the first security context and the first derived parameter.
  • the first derivative parameter is a downlink PDCP COUNT
  • the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
  • the additional security context indication includes the first key, and according to the additional security context indication, the obtaining unit, according to the additional security context indication, obtains the security key based on the first key including:
  • the security key is generated from the first key.
  • the obtaining unit generating the security key according to the first key includes:
  • the security key is generated based on the first key and the third derived parameter.
  • the additional security context indication includes an identifier of a security algorithm
  • the acquiring unit generating the security key according to the first key and the third derived parameter includes:
  • the security key is generated based on the first key and the identity and type of the security algorithm.
  • the additional generation indication includes the identification of the security algorithm.
  • the additional security context indication includes an identifier of the security algorithm.
  • the obtaining unit obtaining the security algorithm according to the additional security context indication includes:
  • the security algorithm is acquired based on the security capability of the terminal device and a preconfigured algorithm priority list, where the security capability of the terminal device is used to indicate all security algorithms supported by the terminal device.
  • the second communication service when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
  • a seventh aspect discloses an apparatus for generating a security context, where the apparatus for generating a security context may be a terminal device or a module (eg, a chip) in the terminal device.
  • the security context generating apparatus may include: a processor, a memory, an input interface for receiving information from other apparatuses other than the apparatus, and an output interface for sending information to outside the apparatus.
  • the other means of outputting information when the processor executes the computer program stored in the memory, causes the processor to execute the security context generation method disclosed in the first aspect or any embodiment of the first aspect.
  • An eighth aspect discloses a security context generating apparatus, where the security context generating apparatus may be a session management function network element or a module (eg, a chip) in the session management function network element.
  • the security context generating apparatus may include: a processor, a memory, an input interface for receiving information from other apparatuses other than the apparatus, and an output interface for sending information to outside the apparatus.
  • the other means of outputting information when the processor executes the computer program stored in the memory, causes the processor to execute the security context generation method disclosed in the second aspect or any embodiment of the second aspect.
  • a ninth aspect discloses an apparatus for generating a security context
  • the apparatus for generating a security context may be a data transmission network element or a module (eg, a chip) in the data transmission network element.
  • the security context generating apparatus may include: a processor, a memory, an input interface for receiving information from other apparatuses other than the apparatus, and an output interface for sending information to outside the apparatus.
  • the other means of outputting information when the processor executes the computer program stored in the memory, causes the processor to execute the security context generation method disclosed in the third aspect or any embodiment of the third aspect.
  • a tenth aspect discloses a communication system, which includes the security context generating apparatus of the seventh aspect, the security context generating apparatus of the eighth aspect, and the security context generating apparatus of the ninth aspect.
  • An eleventh aspect discloses a computer-readable storage medium, where a computer program or computer instruction is stored thereon, and when the computer program or computer instruction is executed, the security context generation method disclosed in the above aspects is implemented.
  • a twelfth aspect discloses a chip including a processor for executing a program stored in a memory, and when the program is executed, the chip executes the above method.
  • the memory is located off-chip.
  • a thirteenth aspect discloses a computer program product, the computer program product comprising computer program code which, when executed, causes the above-mentioned method to be performed.
  • FIG. 1 is a schematic diagram of a network architecture disclosed in an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a security context generation disclosed in an embodiment of the present application
  • FIG. 3 is a schematic flowchart of another security context generation disclosed in an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of yet another security context generation disclosed in an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of yet another security context generation disclosed in an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of yet another security context generation disclosed in an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a communication device disclosed in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of another communication device disclosed in an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of another communication device disclosed in an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of another communication device disclosed in an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of another communication apparatus disclosed in an embodiment of the present invention.
  • the embodiments of the present application disclose a method, device and computer-readable storage medium for generating a security context, which are used to improve the security of communication services. Each of them will be described in detail below.
  • FIG. 1 is a schematic diagram of a network architecture disclosed in an embodiment of the present invention. As shown in FIG.
  • the network architecture may include user equipment (UE), (radio access network, (R)AN) equipment, and user plane function (UPF) network elements , data network (DN), session management function (session management function, SMF) network element, access and mobility management function (access and mobility management function, AMF) network element, unified data management (unified data management, UDM) network element ) network element, authentication server function (AUSF) network element, network slice selection function (NSSF) network element, policy control function (PCF) network element, application function (application function) , AF) network element, network slice selection assistance information (NSSAI) network element, network data analysis function (NWDAF) network element, network exposure function (network exposure function, NEF) network element and Network Repository Function (NRF) network elements.
  • UE user equipment
  • R radio access network
  • UPF user plane function
  • DN data network
  • SMF session management function
  • AMF access and mobility management function
  • AMF access and mobility management function
  • unified data management unified data management
  • UDM unified data
  • the terminal device also known as terminal equipment, mobile station (mobile station, MS), mobile terminal (mobile terminal, MT), etc., is a device that provides voice and/or data connectivity to users.
  • the terminal device can be a handheld terminal, a notebook computer, a subscriber unit, a cellular phone, a smart phone, a wireless data card, a personal digital assistant (PDA) computer, a tablet computer , wireless modem (modem), handheld device (handheld), laptop computer (laptop computer), cordless phone (cordless phone) or wireless local loop (wireless local loop, WLL) station, machine type communication (machine type communication, MTC) terminals, wearable devices (such as smart watches, smart bracelets, pedometers, etc.), in-vehicle devices (such as cars, bicycles, electric vehicles, airplanes, ships, trains, high-speed rail, etc.), virtual reality (virtual reality, VR) equipment, augmented reality (AR) equipment, wireless terminals in industrial control (industrial control), smart home equipment (for example, refrigerators, TV
  • the terminal device in FIG. 1 is shown as a UE, which is only an example and does not limit the terminal device.
  • the UE can access the DN by establishing a session between the UE-(R)AN device-UPF-DN, that is, a protocol data unit (PDU) session.
  • PDU protocol data unit
  • the (R)AN device is a device that provides wireless access for the UE, and is mainly responsible for functions such as radio resource management, quality of service (QoS) flow management, data compression, and encryption on the air interface side.
  • the (R)AN can communicate directly with the UE through the AS.
  • (R)AN devices may include various forms of base stations, such as: macro base stations, micro base stations (also called small stations), relay stations, access points, and the like.
  • the (R)AN device may also include a wireless fidelity (WiFi) access point (AP).
  • WiMax worldwide interoperability for microwave access
  • RAN can be a network-side device in a 5G network or a network after 5G or a network device in a PLMN network, such as a next-generation base station (generation NodeB, gNB), or a next-generation evolved base station (next generation- evolved NodeB, ng-eNB), and may also be a long-term evolved base station (evloved NodeB, eNB).
  • generation NodeB generation NodeB
  • ng-eNB next-generation evolved NodeB
  • evloved NodeB, eNB long-term evolved base station
  • AMF network elements can access UE's non-access stratum (NAS) signaling (including mobility management (MM) signaling and session management (session management, SM) signaling) and N2 through the N1 interface
  • NAS non-access stratum
  • MM mobility management
  • SM session management
  • the interface accesses the signaling of the RAN to complete the forwarding of the UE's SM signaling and mobility management.
  • the SMF network element is mainly responsible for session management in the mobile network, such as session establishment, modification, release, update and other procedures. Specific functions include assigning IP addresses to users and selecting UPF network elements that provide packet forwarding functions.
  • the messages between the SMF and the UE can be encapsulated in the session management (session management, SM) container (contianer) of the NAS message, and the AMF can extract the SM contianer content from the NAS message, and then send it to the SMF.
  • session management session management
  • SM session management
  • the PCF network element can be responsible for terminal device policy management, including mobility-related policies and PDU session-related policies, such as QoS policies, charging policies, and the like. PCF can manage the user's session policy.
  • the AF network element mainly supports interaction with the 3rd generation partnership project (3GPP) core network to provide services to affect service flow routing, access network capability opening, and policy control.
  • 3GPP 3rd generation partnership project
  • the UDM network element is responsible for user key management, user identification processing, access authorization for subscription data, UE network function entity management, session and service continuity management, short message push, legal interception, subscription management, short message management, and management and control. Management of user data, such as subscription information.
  • the UPF network element is mainly responsible for processing user packets, such as forwarding and charging.
  • the user packet can be received from the DN and transmitted to the UE through the RAN device; the user packet can also be received from the UE through the RAN device and forwarded to the DN.
  • the transmission resources and scheduling functions provided by the UPF network element to serve the UE are managed and controlled by the SMF network element.
  • the DN may be the Internet, an IP multi-media service (IMS) network, a regional network, i.e. a local network, such as a multi access edge computing (MEC) network, etc.
  • IMS IP multi-media service
  • MEC multi access edge computing
  • the DN is the destination of the UE's PDU session access.
  • An application server is included or deployed in the DN, and the application server can perform data transmission with the UE and provide business services for the UE.
  • the AUSF network element may be responsible for authenticating and authorizing the access of the UE.
  • the data transmission network element is mainly responsible for processing user packets, which can be a RAN device or a UPF network element.
  • Each of the above network elements in the core network may also be referred to as functional entities, that is, network elements implemented on dedicated hardware, software instances running on dedicated hardware, or instances of virtualized functions on an appropriate platform
  • the above-mentioned virtualization platform may be a cloud platform.
  • system architecture shown in FIG. 1 is not limited to including only the network elements shown in the figure, but may also include other devices or network elements that are not shown in the figure. enumerate.
  • the 5G network architecture shown in FIG. 1 does not constitute a limitation on the 5G network.
  • the methods in the embodiments of the present application are also applicable to various future communication systems, such as 6G or other communication networks.
  • the above-mentioned network structure may further include an authentication authorization and accounting (authentication authorization and accounting, AAA) network element, and the AAA network element can complete the authentication of the access terminal device.
  • AAA authentication authorization and accounting
  • terminal equipment for example, company computers used by Volkswagen employees, etc.
  • PLMN for example, China Mobile, etc.
  • NPN for example, Volkswagen car companies, etc.
  • Terminal equipment can simultaneously perform public network services and private network services through PLMN.
  • terminal devices can use instant messaging applications and emails at the same time.
  • the terminal device can perform security protection with the access network. That is, a set of security contexts can be used for communication protection between the UE and the (R)AN device, so that the security of the user plane data flow between the user and the network can be guaranteed.
  • the security context is a context in which security protection of communication content can be performed, and the security protection may include confidentiality protection and/or integrity protection.
  • a context contains at least a security key and a security algorithm.
  • the context may also include security policies, security activation instructions, freshness parameters, and the like.
  • the security key used for confidentiality protection can be Kup-enc
  • the security algorithm used for confidentiality protection can be 5G encryption algorithm (encryption algorithm for 5G, NEA) or EPS encryption algorithm (evolved packet system encryption algorithm, EEA)
  • the security key used for integrity protection can be Kup-int
  • the security algorithm used for integrity protection can be 5G integrity algorithm (intergrity algorithm for 5G, NIA) or EPS integrity algorithm (evolved packet system integrity algorithm, EIA).
  • the communication party can configure the security key and security algorithm to the PDCP layer
  • the sender can use the security key and security algorithm to encrypt and/or integrity protect the sent communication content
  • the receiver can use the same security key and security algorithm.
  • Algorithms decrypt and/or integrity check received communications.
  • the communication service is the user plane traffic that the terminal device communicates with the service provided by the server through the mobile network. It can include public network services and/or private network services.
  • the service provided by the public network service representative server can be publicly accessed, for example, the application provided by the service provider.
  • the services provided by the private network agent server are restricted access, for example, the private operation application of the enterprise.
  • the terminal equipment may need to establish different sessions with the mobile network for different services.
  • the encryption key kup-enc and the encryption algorithm can be used between the UE and the (R)AN device to encrypt and protect the user plane traffic, and the integrity protection key kup-int and the integrity protection algorithm can be used to protect the integrity of the user plane traffic.
  • the security key may include an encryption key and an integrity protection key
  • the security algorithm may include an encryption algorithm and an integrity protection algorithm.
  • the security context may include security keys and/or security algorithms.
  • User plane traffic can be sent through different data radio bearers (DRBs), and different DRBs may enable or disable encryption protection or integrity protection. When DRBs enable protection, the keys and algorithms used by all DRBs that enable protection are the same, that is, all terminal devices and access network devices can use the same set of security contexts for communication protection.
  • DRBs data radio bearers
  • the attacker obtains the security key used by the public network service, he also obtains the security key of the private network service, thereby obtaining the service traffic of the private network, and vice versa.
  • an attacker can obtain the security key used by the public network service by deciphering the security algorithm used by the public network service, so as to obtain the security context of the public network service.
  • an attacker obtains the security context of the public network, he can also obtain the security context of the private network, and then obtain the service traffic of the private network through the security context of the private network.
  • the above protection methods do not realize the security isolation of public network service protection and private network service protection. Therefore, how to realize the security isolation of public network services and private network services in PNI-NPN is a technical problem that needs to be solved urgently.
  • FIG. 2 is a schematic flowchart of a method for generating a security context disclosed in an embodiment of the present invention.
  • the security context generation method may include the following steps.
  • a terminal device acquires a first security context.
  • the terminal device can generate the first security context, so that the first security context can be used to perform security protection on the data.
  • the first security context may include a first security key, and/or a first security algorithm.
  • the first security key may include a first encryption key, and/or a first integrity protection key.
  • the first security algorithm may include a first encryption algorithm, and/or a first integrity protection algorithm.
  • the first security context may protect the first communication service of the terminal device.
  • the first communication service may be a public network service or a private network service. It should be understood that the above data may be user plane data.
  • the terminal device and the access network device can obtain the first security context for protecting the first communication service, and can use the first security context to protect the first security context. communication business.
  • the process of obtaining the first security context by the terminal device reference may be made to the relevant description of 3GPP TS 33.501.
  • the terminal device sends a session request message to the session management function network element.
  • the terminal device may send a session request message to the session management function network element, and correspondingly, the session management function network element may receive the session request message from the terminal device.
  • the terminal device may first send a NAS message to the access and mobility management network element, and the NAS message may include an SM message.
  • the access and mobility management function network element can first extract the SM message from the NAS message, and then can send the SM message to the session management function network element.
  • the session request message may be an SM message.
  • the SM message may be a PDU Session Proposal Request message or a PDU Session Modification Request message.
  • the session request message may be used to request the establishment of a session for the second communication service.
  • the NAS message may include DNN and/or NSSAI, and the access and mobility management network element may extract the DNN and/or NSSAI from the NAS message and send it to the session management function network element.
  • the session request message may include the identification of the terminal device, and the identification of the terminal device may be used to determine the user plane function network element. It should be understood that the session request message refers to a session for completing a request to establish a second communication service, and the name of this message is not limited.
  • the session request message may include first indication information, and the first indication information may indicate that the terminal device supports generating the second security context. That is, it can be understood that the first indication information can indicate that the terminal device supports the generation of the second security context, the first indication information can also be used to request the generation of the second security context, and the first indication information can also be used to indicate that the session needs to implement security. isolation.
  • the second security context may include a second security algorithm, and/or a second security key.
  • the second security algorithm may include a second encryption algorithm, and/or a second integrity protection algorithm.
  • the second security key may include a second encryption key, and/or a second integrity protection key.
  • the first communication service and the second communication service are different communication services.
  • the second communication service may be a public network service or a private network service.
  • the first communication service is a public network service
  • the second communication service may be a private network service
  • the first communication service is a private network service
  • the second communication service may be a public network service.
  • the first security context and the second security context are different security contexts. It can be understood that the second security key is different from the first security key, but the second security algorithm is the same as the first security algorithm; it can also be understood as the second security key.
  • the security algorithm is different from the first security algorithm, but the second security key is the same as the first security key; it can also be understood that the second security key is different from the first security key, and the second security algorithm is different from the first security algorithm. different.
  • the second security context may protect the second communication service, and the first security context and the second security context may respectively protect different communication services.
  • the session management function network element sends an additional security context indication to the data transmission network element.
  • the session management function network element After the session management function network element receives the session request message from the terminal device, it can first determine whether the second security context needs to be generated for the terminal device. When it is determined that the terminal device needs to generate the second security context, it can send the message to the data transmission network element Additional security context indication, correspondingly, the data transmission network element may receive the additional security context indication from the session management function network element. When it is determined that the terminal device does not need to generate the second security context, steps 203 to 207 may not be performed.
  • the session management function network element after the session management function network element receives the session request message from the terminal device, it can judge whether the terminal device supports the generation of the second security context according to the first indication information.
  • the first indication information is an explicit indication
  • the session management function network element can judge whether the session request message includes the first indication information, and when it is judged that the session request message includes the first indication information, it indicates that the terminal device supports the Generation of a second security context.
  • the first indication information is an implicit indication.
  • the session request message may include 1 bit.
  • this bit is a specific value, such as 0 or 1, it indicates that the terminal device supports the generation of the second security context. If this bit is not the above-mentioned specific value or does not include the above-mentioned specific value In this case, it indicates that the session request message terminal device does not support the generation of the second security context.
  • the session management function network element can obtain the subscription information of the terminal device, and then can determine whether the terminal device needs to generate the second security context according to the subscription information.
  • the subscription information includes the second indication information, it indicates that the terminal device needs to generate the second security context. Otherwise, it indicates that the terminal device does not need to generate the second security context.
  • the second indication information may indicate that the terminal device supports the generation of the second security context, that is, indicates that the terminal device supports the generation of the second security context, or the second indication information is used to request the generation of the second security context, or the second indication information is used to generate the second security context. Indicates that this session requires security isolation.
  • the network element of the session management function can obtain the subscription information of the terminal device from the UDM network element or the PCF network element.
  • the session management function network element may be pre-configured or configured with a local policy by default. Therefore, after receiving the session request message from the terminal device, it can determine whether the terminal device is based on the relevant information of the session and the local policy. A second security context needs to be generated. For example, if the local policy is to use different security contexts for protection for a specific session, after the session management function network element receives the DNN and/or NSSAI from the terminal device, it can determine the corresponding service of the DNN and/or NSSAI according to the local policy Whether it is necessary to use different security contexts for protection, when judging that it is necessary, the network element of the session management function determines that a second security context needs to be generated for the UE.
  • the session management function network element may determine whether the second security context needs to be generated through one or more of the above-mentioned manners. That is, whether the terminal device supports the generation of the second security context can be determined through the first indication information, and when it is determined through the first indication information that the terminal device supports the generation of the second security context, it is determined that the second security context needs to be generated; or the subscription information can be used to determine whether the terminal device supports the generation of the second security context. It is determined whether the second security context needs to be generated; it can also be determined through the local policy whether the second security context needs to be generated. It can also be determined whether the second security context needs to be generated through the first indication information and the subscription information.
  • the first indication information determines that the terminal device supports the generation of the second security context, and it is determined through the subscription information that the second security context needs to be generated, it is determined that the second security context needs to be generated.
  • the second security context is generated; it can also be determined whether the second security context needs to be generated through the first indication information and the local policy.
  • the first indication information determines that the terminal device supports the generation of the second security context, and the local policy determines that the second security context needs to be generated When generating a security context, it is determined that a second security context needs to be generated.
  • the additional security context indication may be used to instruct the generation of the second security context. Additional security context indications may be indicated explicitly. For example, the additional security context indication may include 1 bit, when the value of this bit is 1, it may indicate that the second security context is generated, and when the value of this bit is 0, it may indicate that the second security context is not generated. Additional security context indications may also be indicated implicitly.
  • the additional security context indication may be an information element required to generate the second security context, such as a key, algorithm, flag bit, indicator, index, transmission resource, etc., to send the additional security context indication to the data transmission network element. For example, when the data transmission network element receives the key, it indicates that the session management function network element instructs the data transmission network element to generate the second security context.
  • the security algorithm may be determined.
  • the session management function network element can pre-configure the mapping relationship between the DNN and the security algorithm, when it is determined that the terminal device needs to generate the second security context, it can be directly searched according to the DNN reported by the terminal device and the above-mentioned mapping relationship. to the security algorithm it uses.
  • the session management function network element may pre-configure the mapping relationship between the DNN and the algorithm priority list, and when it is determined that the terminal device needs to generate the second security context, the DNN and the above mapping reported by the terminal device may be used.
  • the relationship finds the algorithm priority list, and then obtains the security algorithm used by the terminal device according to the security capability and the algorithm priority list.
  • the algorithm priority list is an algorithm list reflecting the use priority, which can be expressed as priority 1: algorithm B, priority 2: algorithm A, priority 3: algorithm C, the smaller the priority number, the higher the priority. high.
  • the security capability of the terminal device is reported by the terminal device, which can indicate the algorithms that the terminal device can support.
  • Algorithm A Algorithm A, Algorithm B, Algorithm C, since the terminal device supports the three algorithms A, B, and C at the same time, but because Algorithm B has the highest priority, Algorithm B is finally obtained as the security algorithm.
  • the additional security context indication may include the identification of the security algorithm.
  • the session management function network element determines that the second security context needs to be generated for the terminal device.
  • the first key may be determined.
  • the first key may also be obtained from a secondary authentication key, wherein the session management function network element receives the secondary authentication key from the authentication authorization and accounting network element.
  • the session management function network element may generate the first key according to the secondary authentication key and the second derived parameter.
  • the session management function network element can trigger the secondary authentication of the terminal device. For example, when the session management function network element confirms that the second security context needs to be generated, the session management function network element can trigger the execution of secondary authentication between the terminal device and the authentication authorization and charging network element according to the subscription information of the DNN and the terminal device. After the secondary authentication of the terminal device is successful, the authentication, authorization and accounting network element may send the secondary authentication key to the session management function network element.
  • the session management function network element can receive the secondary authentication key from the authentication, authorization and accounting network element.
  • the second derived parameter may be a freshness parameter, and the second derived parameter may include one or more of the uplink or downlink NAS COUNT, NSSAI, DNN, and PDU session ID.
  • the NAS COUNT can be stored in the non-access stratum context of the terminal device, and the NAS COUNT is updated every time the key is derived, which can prevent the first key generated two consecutive times from being the same. For example, if the value of NAS COUNT is a, after derivation using NAS COUNT once, the NAS COUNT can be updated to a+b. Therefore, the updated value of NAS COUNT can be used for the second derivation.
  • b may be 1 or 2, and may also be other values, which are not limited here.
  • the value of b can be the same for each update, that is, the value of NAS COUNT is incremented or decremented according to the step size of b, or it can be different.
  • the session management function network element can obtain the NSSAI, DNN and PDU session ID from the terminal device through the session request message. Since the slices (NSSAI identifiers), data networks (DNN identifiers) and PDU sessions (PDU session ID identifiers) accessed by different terminal devices or session management network elements are different, the generated first keys may be different.
  • the additional security context indication may include the first key.
  • the additional security context indication may contain different information according to different ways of generating the second security context.
  • the additional security context indication may be an explicit indication, an identification of a security algorithm, or a first key
  • the additional security context indication may also include an explicit indication and an identification of the security algorithm, and may also include the first encryption key. key and the identity of the security algorithm.
  • the session management function network element may send additional security context indications to the data transmission network element through different messages, signaling, etc.
  • the session management function network element can encapsulate the additional security context indication in an N2SM information (Information) container and send it to the data transmission network element; when the data transmission network element is a user
  • the session management function network element may encapsulate the additional security context indication in an N4 session (Session) establishment (Establishment) request (Request) message and send it to the data transmission network element.
  • the data transmission network element acquires the second security context according to the additional security context indication.
  • the data transmission network element may acquire the second security context according to the additional security context indication.
  • the data transmission network element can obtain the security algorithm according to the additional security context indication.
  • the algorithm priority list may be preconfigured in the data transmission network element.
  • the algorithm priority list may include the security capability of the terminal device and the priority information of the security algorithm.
  • the data transmission network element can determine the security algorithm according to the algorithm priority list.
  • the data transmission network element may acquire the security capability of the above-mentioned terminal device from the stored context of the terminal device.
  • the data transmission network elements use the same algorithm priority list, which is likely to cause the finalized first security algorithm and the second security algorithm to be the same, thus failing to achieve the purpose of security isolation. It should be understood that the security algorithm obtained according to the additional security context indication is the second security algorithm.
  • the data transmission network element may determine the security algorithm corresponding to the identifier as the security algorithm.
  • the data transmission network element when the data transmission network element has the first security context, the data transmission network element may obtain the security algorithm from the first security algorithm of the first security context according to the indication of the additional security context.
  • the data transmission network element may obtain the security key based on the first key according to the additional security context indication. It can be understood that the additional security context indication can trigger the data transmission network element to acquire the security key based on the first key. It can also be understood that the data transmission network element may respond to the additional security context indication and obtain the security key based on the first key.
  • the data transmission network element may first determine the first key, and then may obtain the security key based on the first key.
  • the data transmission device may obtain the first key based on the AS root key of the first security context according to the indication of the additional security context, that is, determine according to the AS root key of the first security context (or generate) the first key.
  • the AS root key may be the key K gNB , K eNB , or the next hop (next hop, NH).
  • the data transmission network element may use the AS root key of the first security context as the first key.
  • the data transmission network element may generate the first key according to the AS root key of the first security context and the first derived parameter.
  • the first derived parameter may be the PDCP COUNT, and the first derived parameter may be stored in the access stratum context of the terminal device.
  • the value of the PDCP COUNT needs to be updated, that is, the value of the PDCP COUNT is updated every time the key is derived, which can prevent two consecutively generated keys from being the same. For example, assuming that the value of PDCP COUNT is a, after using PDCP COUNT to derive once, the value of PDCP COUNT can be updated to a+b.
  • the updated value of PDCP COUNT can be used for the next derivation.
  • b may be 1 or 2, and may also be other values, which are not limited here.
  • the value of b can be the same for each update, that is, the value of PDCP COUNT is incremented or decremented according to the step size of b, or it can be different.
  • the first derived parameter may be a freshness parameter.
  • the data transmission network element can obtain the first key according to the identifier of the terminal device.
  • key that is, the first key is determined (or generated) according to Kn.
  • the Kn root key should be different for each terminal device, and may be pre-configured on the data transmission network element.
  • the data transmission network element may determine the Kn root key according to the identification of the terminal device and the corresponding relationship between the terminal device and the Kn root key.
  • the data transmission network element may use the Kn root key as the first key.
  • the first key may be generated according to the Kn root key and the first derived parameter.
  • the generation of the first key reference may be made to the above-mentioned description of the generation of the first key by the data transmission network element according to the AS root key and the first derived parameter, which will not be repeated here.
  • the additional security context indication may include the first key.
  • the data transmission network element may first extract the first key from the additional security context indication, and then may generate the security key according to the first key.
  • the security key may be further generated according to the first key.
  • the data transmission network element may generate the security key according to the first key and the third derived parameter.
  • the third derived parameter may contain the identity and type of the security algorithm.
  • the data transmission network element may determine the identity and type of the security algorithm according to the acquired security algorithm.
  • the data transmission network element may acquire the security algorithm according to the additional security context indication, and determine the identity and type of the security algorithm according to the acquired security algorithm.
  • the data transmission network element may obtain the security algorithm according to the first security algorithm of the first security context, and determine the identity and type of the security algorithm according to the obtained security algorithm.
  • the identifier of the security algorithm may be used to identify the acquired security algorithm.
  • the encryption algorithm may be EIA1, NEA1, etc.
  • the integrity algorithm may be EIA1, NIA1, and so on.
  • the type of the security algorithm can be set to different values according to the current algorithm used in different scenarios. For example, when the security algorithm is used for user plane confidentiality protection, the type of the security algorithm can be set to N-UP-ENC-ALG corresponding to The value of 0x05, when the security algorithm is used for user plane integrity protection, the type of security algorithm can be set to the value 0x06 corresponding to N-UP-INT-ALG. Therefore, the type of the security algorithm can be either 0x05 or 0x06. In addition, the type of the security algorithm may also be a value different from the existing 0x01-0x06, which is used to indicate that the security algorithm is used for the user plane confidentiality protection of the second communication service or the user plane integrity protection of the second communication service.
  • the security algorithm type when the current algorithm is used for user plane confidentiality protection of the second communication service, the security algorithm type may be 0x07, and when the current algorithm is used for user plane integrity protection of the second communication service, the security algorithm type may be 0x08.
  • the data transmission network element may generate the security key according to the first key and the identifier and type of the security algorithm. For the specific method of generating the first key, reference may be made to the above-mentioned related descriptions, which will not be repeated here.
  • the data transmission network element may also generate the security key according to the first key and the special character string.
  • Special strings can be preconfigured specific strings such as “NPN”, “Secondary”, etc.
  • the method for determining the security algorithm and the method for generating the security key may be related to each other, or may be independent.
  • the data transmission network element sends an additional generation instruction to the terminal device.
  • An additional generation indication may be used to indicate the generation of the second security context. Additional generation indications may be indicated explicitly. For example, the additional generation indication may include 1 bit, when the value of this bit is 1, it may indicate that the second security context is generated, and when the value of this bit is 0, it may indicate that the second security context is not generated. Additional build indications may also be indicated implicitly.
  • the additional generation indication may be an information element required to generate the second security context, such as an algorithm, a flag bit, an indicator, an index, a transmission resource, etc., to send the additional generation indication to the terminal device. For example, when the terminal device receives the indicator, it indicates that the data transmission network element instructs the terminal device to generate the second security context.
  • the additional generation instruction may also be used to instruct the terminal device to obtain the security key.
  • the additional generation indication may include an indication of the first derived parameter.
  • the indication of the first derived parameter may be the first derived parameter itself, or may be a value used to indicate the first derived parameter. For example, if the second derived parameter contains the PDCP COUNT, the indication of the first derived parameter may contain part of the bits of the PDCP COUNT.
  • the additionally generated instruction may also be used to instruct the terminal device to acquire the security algorithm.
  • the additional generation indication may include the identification of the security algorithm
  • the additional generation instructions may be generated according to the second security context generation method. different, contain different information.
  • the additional generated indication may be an explicit indication, an indication of the first derivative parameter, or an identification of a security algorithm
  • the additional security context indication may also include an explicit indication and an identification of the security algorithm, and may also include the first
  • the indication of the derived parameter and the identification of the security algorithm may also include an explicit indication, the indication of the first derived parameter and the identification of the security algorithm.
  • the additionally generated indication corresponds to the indication of the packet or the first derivative parameter and/or the identifier of the security algorithm.
  • the data transmission network element may directly send the additional generation indication to the terminal device, which may be sent through an RRC message.
  • the RRC message may be an RRC reconfiguration message.
  • the data transmission network element can indirectly send an additional generation instruction to the terminal device through the session management function network element.
  • the additional generation instruction can be encapsulated in the N4Session Establishment Response message and sent to the session management function network element, and the session management function network element will The additional generation indication is encapsulated in the session accept message and sent to the terminal device.
  • step 205 is an optional step.
  • the session management function network element sends a session acceptance message to the terminal device.
  • the session management function network element After receiving the session request message from the terminal device, the session management function network element can establish a session for transmitting the second communication service according to the session request message, and after establishing the session, can send a session accept message to the terminal device.
  • the terminal device can receive the session acceptance message of the session management function network element.
  • the session accept message may indicate completion of the establishment of the session for the second communication service.
  • the session accept message may be a PDU session suggestion request message or a PDU session modification request message.
  • the session accept message may include an additional generation instruction, where the additional generation instruction is used to instruct the terminal device to generate the second security context.
  • the additionally generated instruction may also be used to instruct the terminal device to acquire the security algorithm.
  • the additional generation indication may include the identification of the security algorithm. It should be understood that the identity of the security algorithm may be carried by one of the session acceptance message and the additional generation instruction sent by the data transmission network element to the terminal device, or may not be carried at all. There is no limitation on which specific information the identifier of the security algorithm is included in.
  • the additional generation instruction may also be used to instruct the terminal device to obtain the first key.
  • the additional generation indication may include an indication of the second derived parameter.
  • the indication of the second derived parameter may be the second derived parameter itself, or may be a value used to indicate the second derived parameter.
  • the indication of the second derivative parameter may include some bits of the NAS COUNT
  • the indication of the second derivative parameter may include NSSAI, DNN and PDU session ID itself, or since the terminal device knows NSSAI, DNN and PDU session ID, the indication of the second derived parameter may contain a specific value, when the value is 1, it is used to instruct the terminal device to obtain NSSAI, DNN and PDU session ID.
  • the session management function network element When the session management function network element receives the additional generation instruction from the data transmission network element, the additional generation instruction may be forwarded to the terminal device.
  • the session management function network element may encapsulate the additional generation indication in a session accept message and send it to the terminal device.
  • step 205 and step 206 may be executed in series or in parallel, and the execution order is not limited.
  • the terminal device obtains an additional generation instruction.
  • the terminal device may acquire the additional generation instruction, which may be understood as the terminal device may receive the additional generation instruction from the data transmission network element and/or the session management network element.
  • the terminal device may receive additional generation indications from the data transmission network element.
  • the terminal device can directly receive the additional generation instruction from the data transmission network element, that is, the terminal device can receive the additional generation instruction from the data transmission device.
  • the terminal device may indirectly receive the additional generation instruction from the data transmission network element, that is, the data transmission network element may forward the additional generation instruction to the terminal device through the session management function network element.
  • the specific description can refer to the description of the additional security indication sent by the data transmission network element to the terminal device through the session function management network element in step 205, and will not be repeated here.
  • the terminal device may receive additional generation instructions from the session management function network element, that is, the terminal device may receive additional generation instructions from the session management function.
  • the additional generation indications may include one or more of the following: an indication of the first derived parameter, an indication of the second derived parameter, and an identification of the security algorithm.
  • the terminal device may generate additional instructions from a part of the data transmission network element, and obtain another part of the additional generation instructions from the session management network element. For example, the terminal device may obtain the indication of the first derived parameter and the identity of the security algorithm from the data transmission network element, and may also obtain the indication of the second derived parameter from the session management function network element. The terminal device may obtain the indication of the first derivative parameter from the data transmission network element, and may also obtain the indication of the second derivative parameter and the identity of the security algorithm from the session management function network element. The terminal device may obtain the identification of the security algorithm from the data transmission network element, and may also obtain the indication of the second derivative parameter from the session management function network element.
  • the terminal device acquires the second security context according to the additionally generated instruction.
  • the terminal device may generate the second security context according to the additional generation instruction. It should be understood that the manner in which the terminal device generates the second security context is the same as the manner in which the data transmission network element generates the second security context. For a detailed description, reference may be made to the relevant description of step 204 .
  • the terminal device can acquire the security algorithm according to the additional generated instructions.
  • the terminal device may determine the security algorithm according to the identifier.
  • the terminal device may acquire the security algorithm according to the first security algorithm in the first security context.
  • the terminal device may acquire the first key according to the additional generation instruction.
  • the terminal device When the terminal device has the first security context, it can obtain the first key based on the AS root key of the first security context according to the additional generation instruction, that is, determine the first key according to the AS root key of the first security context.
  • the terminal device may use the AS root key of the first security context as the first key.
  • the additionally generated indication includes an indication of the first derivative parameter
  • the terminal device may generate the first key according to the AS root key of the first security context and the first derivative parameter.
  • the terminal device may generate the first key according to the AS root key of the first security context and the first derivative parameter.
  • the terminal device may correspondingly preconfigure a Kn root key, and the terminal device may generate the first key based on the Kn root key according to the additional generation instruction.
  • the terminal device can use the Kn root key as the first key
  • the additionally generated indication includes an indication of the first derivative parameter
  • the terminal device may generate the first key according to the Kn root key and the first derivative parameter.
  • the terminal device can perform the secondary authentication.
  • the terminal device can generate a secondary authentication key during the secondary authentication process.
  • the terminal device may receive an additional generation indication, and the additional generation indication may include an indication of the second derived parameter.
  • the terminal device may generate the first key according to the secondary authentication key and the second derivative parameter.
  • the terminal device After the terminal device generates the first key, it may further obtain the security key based on the first key according to the additional generation instruction.
  • a second security context is generated based on the first key.
  • the specific generation method may be the same as the generation method of the data transmission network element in step 204 .
  • the additional generation indication includes the identification of the security algorithm, and the terminal device can generate the security key according to the first key and the third derived parameter.
  • the terminal device can generate the security key according to the first key and the third derived parameter.
  • the second security context may be generated by the terminal device and the data transmission network element.
  • the data transmission network element can be an access network device, a user plane functional network element, or other network elements with the same function. That is, it can be understood that a set of security contexts can be generated by two devices, wherein, when the data transmission network element has the first security context, the first security context and the second security context can both be generated by the terminal device and the data transmission network element. . When the data transmission network element does not have the first security context, the second security context can be acquired by the terminal device and the data transmission network element. At this time, the two sets of security contexts are located in different devices. Since the two sets of security contexts have different algorithms and/or keys and are located in different network elements, security isolation can be further implemented.
  • the terminal device After receiving the session acceptance message from the session management function network element, the terminal device can determine that the establishment of the second communication service is completed according to the session acceptance message, and then can perform service transmission corresponding to the second communication service with the data network, and transmit the second communication service.
  • the communication traffic can be protected using the second security context. It can be seen that when the public network service is attacked, the impact on the private network service can be avoided, and vice versa, so the security isolation of the public network service and the private network service can be realized, and the security of the public network service and the private network service can be improved. .
  • FIG. 3 is a schematic flowchart of another method for generating a security context disclosed in an embodiment of the present invention.
  • the security context generation method may include the following steps.
  • a terminal device acquires a first security context.
  • step 301 may refer to the description of step 201, which will not be repeated here.
  • the access network device acquires a first security context.
  • step 302 may refer to the description of step 201, and details are not repeated here.
  • the terminal device sends a session request message to the session management function network element.
  • step 303 may refer to the description of step 202, and details are not repeated here.
  • the session management function network element sends an additional security context indication to the access network device.
  • step 304 may refer to the description of step 203, and details are not repeated here.
  • the additional security context indication may also include the identification of the security algorithm.
  • the access network device acquires the second security context according to the additional security context indication.
  • the access network device may generate a second security context according to the additional security context indication.
  • the additional security context indication For a detailed description of generating the second security context, reference may be made to the description of step 204 .
  • the access network device may obtain the security algorithm according to the additional security context indication.
  • the access network device may acquire the security algorithm according to the algorithm priority list.
  • the algorithm priority list For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
  • the additional security context indication may include an identifier of the security algorithm, and the access network device may determine the security algorithm according to the identifier.
  • the security algorithm may already be determined in the session management function network element. For detailed description, reference may be made to the corresponding descriptions of determining the security algorithm by the session management function network element in step 203 and determining the security algorithm according to the additional security context indication in step 204, which will not be repeated here.
  • the access network device may obtain the security algorithm from the first security algorithm of the first security context according to the indication of the additional security context.
  • the access network device may generate the first key according to the additional security context indication.
  • the access network device may acquire the AS root key of the first security context, and use this AS root key as the first key.
  • AS root key of the first security context
  • the access network device may generate the first key according to the AS root key of the first security context and the first derivative parameter.
  • the access network device may generate the first key according to the AS root key of the first security context and the first derivative parameter.
  • the access network device may generate the security key based on the first key according to the additional security context indication.
  • the access network device may generate the security key according to the first key and the third derived parameter.
  • the security key For a detailed description of generating the security key, reference may be made to the description of generating the security key according to the first key and the third derived parameter in step 204, and details are not repeated here.
  • the session management function network element sends a session acceptance message to the terminal device.
  • step 306 may refer to the description of step 206, and details are not repeated here.
  • the session accept message may include an additional generation indication, and the additional generation indication may include an identification of the security algorithm.
  • the access network device sends an additional generation instruction to the terminal device.
  • the access network device may send the additional generation instruction to the terminal device, and correspondingly, the terminal device may receive the additional generation instruction from the access network device.
  • the terminal device may receive the additional generation instruction from the access network device.
  • the additional generation indication may include one or more of the following: an explicit indication, an indication of the first derived parameter, and an identification of a security algorithm.
  • one of the messages includes the identification of the security algorithm.
  • the terminal device acquires the second security context according to the additionally generated instruction.
  • step 308 may refer to the description of step 305 and step 208 .
  • the terminal device can acquire the security algorithm according to the additional generated instructions.
  • the additional generation indication may include the identification of the security algorithm.
  • the terminal device can determine the security algorithm based on this identification.
  • the terminal device may also acquire the security algorithm according to the first security algorithm of the first security context. For a detailed description, reference may be made to the relevant description of step 208, which is not repeated here.
  • the terminal device may generate the first key according to the additional generation instruction.
  • the terminal device may obtain the AS root key of the first security context, and use this AS root key as the first key.
  • AS root key of the first security context
  • the terminal device may generate the first key according to the AS root key of the first security context and the first derivative parameter.
  • the terminal device may generate the first key according to the AS root key of the first security context and the first derivative parameter.
  • the terminal device may generate the security key based on the first key according to the additional generation instruction.
  • the terminal device may generate the security key according to the first key and the third derived parameter.
  • the third derived parameter may be an identification of the security algorithm.
  • the terminal device can protect the user plane data by using the first security context and the second security context.
  • the first security context and the second security context may be used to protect private network services (public network data) and public network services (private network data), respectively.
  • private network services public network data
  • public network services private network data
  • the other set of security contexts will not be exposed because the two sets of security contexts are different. Therefore, the goal of protecting the public network service and the private network service separately can be achieved, and the security of the communication service can be improved.
  • the data transmission network element in this embodiment is an access network device.
  • FIG. 4 is a schematic flowchart of another method for generating a security context disclosed in an embodiment of the present invention.
  • the security context generation method may include the following steps.
  • a terminal device acquires a first security context.
  • step 401 may refer to the description of step 201, which will not be repeated here.
  • the access network device acquires a first security context.
  • step 402 may refer to the description of step 201, and details are not repeated here.
  • the terminal device sends a session request message to the session management function network element.
  • step 403 may refer to the description of step 202, and details are not repeated here.
  • the terminal device performs secondary authentication.
  • the network element of the session management function may trigger the execution of secondary authentication between the terminal device and the authentication, authorization and charging network element according to the subscription information of the DNN and/or the terminal device carried in the session request message.
  • the subscription information of the terminal device may be obtained by requesting the UDM.
  • the session management function network element may trigger the execution of the secondary authentication.
  • the terminal device can obtain the secondary authentication key through secondary authentication.
  • the secondary authentication can be implemented based on the extensible authentication protocol (EAP).
  • EAP extensible authentication protocol
  • the terminal device and the authentication, authorization and accounting network element can generate a secondary authentication key.
  • the secondary authentication key can be a master session key (MSK) or an extended master session key (EMSK).
  • the secondary authentication process can refer to 3GPP TS 33.501 and RFC 3748.
  • the authentication, authorization and accounting network element After the authentication, authorization and accounting network element completes the secondary authentication, the authentication, authorization and accounting network element can send the secondary authentication key to the session management function network element.
  • the session management function network element can receive the Secondary authentication key.
  • the session management function network element generates a first key according to the secondary authentication key.
  • the session management function network element may first determine whether the second security context needs to be generated. For a detailed description, reference may be made to the description in step 203 that the session management function network element determines whether the terminal device needs to generate the second security context, which is not repeated here.
  • the session management function network element may determine a security algorithm.
  • the process of determining the security algorithm generation process by the network element of the session management function reference may be made to the relevant description in step 203, and details are not repeated here.
  • the session management function network element may generate the first key according to the received secondary authentication key.
  • the session management function network element may generate the first key according to the second derivative parameter and the secondary authentication key.
  • the session management function network element sends an additional security context indication to the access network device.
  • step 406 may refer to the description of step 203, and details are not repeated here.
  • the additional security context indication includes at least the first key.
  • the additional security context indication may also include the identification of the security algorithm.
  • the access network device acquires the second security context according to the additional security context indication.
  • the access network device may acquire the second security context according to the additional security context indication.
  • the additional security context indication For a detailed description of generating the second security context, reference may be made to the description of step 204 .
  • the access network device may obtain the security algorithm according to the additional security context indication.
  • the access network device may acquire the security algorithm according to the algorithm priority list.
  • the algorithm priority list For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
  • the additional security context indication may include an identifier of the security algorithm, and the access network device may determine the security algorithm according to the identifier.
  • the security algorithm may be determined by the session management function network element.
  • the access network device may obtain the security algorithm from the first security algorithm of the first security context according to the indication of the additional security context.
  • the access network device may generate the first key according to the additional security context indication.
  • the additional security context indication may include the first key, and the access network device may directly obtain the first key.
  • the access network device may directly obtain the first key.
  • the access network device may generate the security key based on the first key according to the additional security context indication.
  • the access network device may generate the security key according to the first key and the third derived parameter.
  • the security key For a detailed description of generating the security key, reference may be made to the relevant description in step 204, and details are not repeated here.
  • the session management function network element sends a session acceptance message to the terminal device.
  • step 408 can refer to the description of step 206, and details are not repeated here.
  • the session accept message may include an additional generation indication, which may include an indication of the second derived parameter and/or an identification of the security algorithm.
  • the access network device sends an additional generation instruction to the terminal device.
  • the terminal device receives an additional generation indication from the session management function network element.
  • the detailed description of step 409 can refer to the description of step 205 and step 207 .
  • the additional generated indication may include one or more of the following: an explicit indication and an identification of a security algorithm.
  • one of the messages includes the identification of the security algorithm.
  • the terminal device acquires the second security context according to the additionally generated indication.
  • step 410 may refer to the description of step 407 and step 208 .
  • the additional generation indication may include an identification of the security algorithm, from which the terminal device may determine the security algorithm. If the additionally generated indication does not include the identifier of the security algorithm, the terminal device may also acquire the security algorithm according to the first security algorithm of the first security context. For a detailed description, reference may be made to the relevant descriptions in step 407 and step 208, which will not be repeated here.
  • the terminal device may generate the first key according to the additional generation instruction.
  • the additional generation indication may include an indication of the second derivative parameter, and the indication of the second derivative parameter may instruct the terminal device to obtain the first key according to the second derivative parameter.
  • the terminal device may generate the first key according to the secondary authentication key and the second derived parameter.
  • the terminal device may generate the security key based on the first key according to the additional generation instruction.
  • the terminal device may generate the security key according to the first key and the third derived parameter.
  • the security key For the detailed description of generating the security key, reference may be made to the description of generating the security key according to the first key and the third derivative parameter in step 204, step 208 and step 407, which will not be repeated here.
  • the terminal device can protect the user plane data by using the second security context and the first security context.
  • the terminal device can acquire two sets of security contexts, the second security context and the first security context.
  • the terminal device can use the second security context to perform user plane security protection.
  • the terminal device can use the first security context to perform user plane security protection, thereby realizing security isolation between public network services and public network services.
  • the data transmission network element in this embodiment is an access network device.
  • FIG. 5 is a schematic flowchart of another method for generating a security context disclosed in an embodiment of the present invention.
  • the security context generation method may include the following steps.
  • a terminal device acquires a first security context.
  • the access network device acquires a first security context.
  • the terminal device sends a session request message to the session management function network element.
  • the terminal device performs secondary authentication.
  • the session management function network element generates a first key according to the secondary authentication key.
  • steps 501-505 For the detailed description of steps 501-505, reference may be made to the description of steps 401-405, which will not be repeated here.
  • the session management function network element sends an additional security context indication to the user plane function network element.
  • step 506 For a detailed description of step 506, reference may be made to the relevant description in step 203, and details are not repeated here.
  • the additional security context indication includes at least the first key.
  • the additional security context indication may also include the identification of the security algorithm.
  • the user plane function network element acquires the second security context according to the additional security context indication.
  • the user plane function network element may generate a second security context according to the additional security context indication. For a detailed description of generating the second security context, reference may be made to the description of step 204 .
  • the user plane function network element can obtain the security algorithm according to the additional security context indication.
  • the user plane function network element may acquire the security algorithm according to the algorithm priority list.
  • the relevant description in step 204 may be made to the relevant description in step 204, which is not repeated here.
  • the additional security context indication may include the identification of the security algorithm, and the user plane function network element may determine the security algorithm according to this identification.
  • the security algorithm can be determined by the session management function network element or by the user plane function network element.
  • the user plane function network element may generate the first key according to the additional security context indication.
  • the additional security context indication may include the first key, and the user plane function network element may directly obtain the first key.
  • the user plane function network element may directly obtain the first key.
  • the user plane function network element may generate the security key based on the first key according to the additional security context indication.
  • the user plane function network element may generate the security key according to the first key and the third derived parameter.
  • the security key For a detailed description of generating the security key, reference may be made to the relevant description in step 204, and details are not repeated here.
  • the user plane function network element sends an additional generation instruction to the session management function network element.
  • the user plane function network element may send an additional generation instruction to the session management function network element, and correspondingly, the session management function network element may receive the additional generation instruction from the user plane function network element.
  • the additional generation indication may include the identification of the security algorithm. Additional build indications may be encapsulated in the N4Session Establishment Response message.
  • step 508 For the detailed description of step 508, reference may be made to the relevant descriptions in step 205 and step 207, and details are not repeated here.
  • step 508 is an optional step.
  • the session management function network element sends a session acceptance message to the terminal device.
  • the session management function network element After the session management function network element receives the additional generation instruction from the user plane function network element, it can encapsulate the received additional generation instruction in a session accept message, and then can send a session accept message to the terminal device.
  • the terminal device can A session accept message is received from the session management function network element.
  • the session acceptance message may include an additional generation indication
  • the additional generation indication may include one or more of the following: an indication of the second derived parameter and an identifier of a security algorithm.
  • the indication of the second derivative parameter may come from the session management function network element; the identification of the security algorithm may come from the user plane function network element or the session management function network element.
  • the terminal device acquires the second security context according to the additionally generated instruction.
  • the terminal device may acquire the second security context according to the additionally generated instruction.
  • the detailed description of step 510 can refer to the description in step 507 and step 208 .
  • the terminal device can acquire the security algorithm according to the additional generated instructions.
  • the additional generation indication may include the identification of the security algorithm, and the terminal device may determine the security algorithm according to the identification of the security algorithm. If the additionally generated indication does not include the identifier of the security algorithm, the terminal device may also acquire the security algorithm according to the first security algorithm of the first security context.
  • the terminal device may also acquire the security algorithm according to the first security algorithm of the first security context.
  • the terminal device may generate the first key according to the additional generation instruction.
  • the additional generation indication may include an indication of the second derivative parameter, and the indication of the second derivative parameter may instruct the terminal device to obtain the first key according to the second derivative parameter.
  • the terminal device may generate the first key according to the secondary authentication key and the second derived parameter.
  • the terminal device may generate the security key based on the first key according to the additional generation instruction.
  • the terminal device may generate the security key according to the first key and the third derived parameter.
  • the security key For the detailed description of generating the security key, refer to the description of generating the security key according to the first key and the third derivative parameter in step 204, step 208 and step 507, which will not be repeated here.
  • the terminal device can protect the user plane data by using the second security context and the first security context.
  • the terminal device can acquire two sets of security contexts, the second security context and the first security context.
  • the terminal device may use the first security context to perform user plane security protection when sending data corresponding to the PDU session (for example, private network data), and the access network device performs deprotection.
  • the terminal device sends data corresponding to the PDU session (eg, public network data)
  • the terminal device can use the second security context to perform user plane security protection, and the user plane functional network element performs deprotection. Therefore, one set of security contexts is on the access network equipment, and the other set of security contexts is on the user plane functional network elements.
  • the two sets of security contexts have different algorithms and keys, and are located in different entities, so it can be realized. Safe isolation.
  • the second security context may be generated by a key generated after the terminal device and the authentication, authorization and accounting network element perform secondary authentication.
  • the first security context may be generated by a key generated after the terminal device and the unified data management network element (located on the public network) perform the first authentication. In this way, even if the key of the unified data management network element is obtained by the attacker, since the attacker does not obtain the key of the authentication, authorization and accounting network element, the attacker cannot obtain the first key of the second security context. achieve isolation.
  • the user plane function network elements, session management function network elements, and authentication, authorization and accounting network elements are maintained by the private network, while the access network equipment, access and mobility management function network elements, etc. are maintained by the public network. Also, the first security context cannot be obtained, so that the problem of mutual distrust between the private network and the public network can be solved.
  • the data transmission network element in this embodiment is a user plane functional network element.
  • FIG. 6 is a schematic flowchart of another method for generating a security context disclosed in an embodiment of the present invention.
  • the security context generation method may include the following steps.
  • a terminal device acquires a first security context.
  • step 601 may refer to the description of step 201, which will not be repeated here.
  • the user plane function network element preconfigures the corresponding relationship between the identifier of the terminal device and the Kn root key.
  • the user plane function network element may preconfigure the correspondence between the identifier of the terminal device and the Kn root key.
  • the identifier of the terminal device may be a generic public subscription identifier (GPSI) or an internet protocol (IP) address. That is, the identification of the terminal device itself is known, and the user plane function network element may determine the first key according to the corresponding relationship between the identification of the terminal device and the Kn root key.
  • the user plane function network element may preconfigure a mapping relationship table between the identifier of the terminal device and the Kn root key, where one identifier may correspond to one Kn root key. It should be understood that the above example is an example for the user plane function network element that can preconfigure the corresponding relationship between the identifier of the terminal device and the Kn root key, and does not constitute a limitation.
  • the Kn root key can be delivered to the corresponding terminal device.
  • step 602 For the detailed description of step 602, reference may be made to the description of step 205, which will not be repeated here.
  • the terminal device preconfigures the Kn root key.
  • the terminal device sends a session request message to the session management function network element.
  • step 604 may refer to the description of step 202, and details are not repeated here.
  • the session request message may include the identifier of the terminal device.
  • the session management function network element determines the corresponding user plane function network element.
  • the session management function network element may first determine whether the second security context needs to be generated. For a detailed description, reference may be made to the description of step 203, which will not be repeated here.
  • the session management function network element may determine the user plane function network element.
  • the user plane function network element has a corresponding relationship between the identifier of the terminal device and the Kn root key.
  • this user plane function network element is the network element that generates the corresponding second security context.
  • the session management function network element may determine the user plane function network element by pre-configuring the corresponding relationship between the identifier of the terminal device and the user plane function network element.
  • the session management function network element can also obtain the context of the corresponding terminal device according to the session request message, and then determine the identity of the terminal device according to the context of the terminal device. The corresponding relationship determines the user plane function network element. It should be understood that the identity of the terminal device may be carried in the SM message, or may be stored in the context of the session management function network element.
  • the session management function network element sends an additional security context indication to the user plane function network element.
  • step 606 may refer to the description of step 203, which will not be repeated here.
  • the additional security context indication may include the identifier of the terminal device.
  • the user plane function network element acquires the second security context according to the additional security context indication.
  • the user plane function network element may generate a second security context according to the additional security context indication.
  • the additional security context indication may be received from the session management function network element.
  • the user plane function network element can obtain the security algorithm according to the additional security context indication.
  • additional security context indication For a detailed description, reference may be made to the description in step 204, which is not repeated here.
  • the user plane function network element may generate the first key according to the additional security context indication.
  • the user plane function network element may first determine the Kn root key according to the received identifier of the terminal device and the corresponding relationship between the terminal device and the Kn root key. The user plane function network element may use the Kn root key as the first key.
  • the user plane function network element determines the root Kn key, it can generate the first key according to the Kn root key and the first derivative parameter.
  • the specific generation method please refer to the relevant description in step 204 , will not be repeated here.
  • the user plane function network element may generate the security key based on the first key according to the additional security context indication.
  • the user plane function network element may generate the security key according to the first key and the third derived parameter.
  • the security key For a detailed description of generating the security key, reference may be made to the description of generating the security key according to the first key and the third derived parameter in step 204, and details are not repeated here.
  • the user plane function network element sends an additional generation instruction to the session management function network element.
  • the user plane function network element may send an additional generation instruction to the session management function network element, and correspondingly, the session management function network element may receive the additional generation instruction from the user plane function network element.
  • step 608 may refer to the description of step 205 and step 207, and details are not repeated here.
  • the session management function network element sends a session acceptance message to the terminal device.
  • the session management function network element After the session management function network element receives the additional generation instruction from the user plane function network element, it can encapsulate the received additional generation instruction in a session accept message, and then can send a session accept message to the terminal device.
  • the terminal device can A session accept message is received from the session management function network element.
  • the session accept message may include an additional generation indication
  • the additional generation indication may include one or more of the following: an indication of the first derived parameter, an indication of the second derived parameter, and an identification of a security algorithm.
  • the indication of the first derivative parameter may come from the user plane functional network element; the indication of the second derivative parameter may come from the session management functional network element; the identification of the security algorithm may come from the user plane functional network element or the session management functional network element .
  • step 609 may refer to the description of steps 205-207, which will not be repeated here.
  • the terminal device generates a second security context according to the additional generation instruction.
  • the terminal device may acquire the second security context according to the additionally generated instruction.
  • the detailed description of step 610 can refer to the description in step 607 and step 208 .
  • the terminal device can acquire the security algorithm according to the additional generated instructions.
  • the additional generation indication may include the identification of the security algorithm, and the terminal device may determine the security algorithm according to the identification of the security algorithm.
  • the terminal device may generate the first key according to the additional generation instruction.
  • the additional generation instruction For a detailed description, reference may be made to the relevant descriptions in step 607 and step 208, which will not be repeated here.
  • the terminal device may use the preconfigured Kn root key as the first key.
  • Kn root key the preconfigured Kn root key
  • the additional generation indication may include an indication of the first derivative parameter, and the terminal device may generate the first key according to the Kn root key and the first derivative parameter.
  • the terminal device may generate the security key based on the first key according to the additional generation instruction.
  • the terminal device may generate the security key according to the first key and the third derived parameter.
  • the terminal device may generate the security key according to the first key and the third derived parameter.
  • the terminal device when the terminal device can generate the first key when generating the second security context, the first key can be determined according to the Kn root key and the first derivative parameter configured by the terminal device at this time.
  • the terminal device can protect the user plane data by using the second security context and the first security context.
  • the second security context is generated by the Kn root key preconfigured on the terminal device and the user plane functional network element
  • the first security context is generated by the terminal device and the unified data management network Element (located on the public network) is generated by the key generated after the first authentication is performed.
  • the unified data management network Element located on the public network
  • this embodiment can not only implement the above-mentioned functions, but also further reduce the cost of the private network device.
  • the data transmission network element in this embodiment is a user plane functional network element.
  • the functions performed by the terminal device in the above security context generation method may also be performed by a module (for example, a chip) in the terminal device, and the functions performed by the session management function network element may also be performed by the session management function network element.
  • modules for example, chips
  • the functions performed by the data transmission network elements may also be performed by modules (for example, chips) in the data transmission network elements
  • the functions performed by the user plane function network elements may also be performed by the user plane functions.
  • a module (eg, a chip) in a network element is performed, and functions performed by an access network device may also be performed by a module (eg, a chip) in the access network device.
  • FIG. 7 is a schematic structural diagram of an apparatus for generating a security context disclosed in an embodiment of the present application.
  • the apparatus may include an obtaining unit 701, a sending unit 702 and a receiving unit 703, wherein:
  • an obtaining unit 701 configured to obtain a first security context, where the first security context is used to protect a first communication service of the terminal device;
  • a sending unit 702 configured to send a session request message to a session management function network element, where the session request message is used to request the establishment of a session of a second communication service, where the second communication service is different from the first communication service;
  • a receiving unit 703 configured to receive a session acceptance message from the session management function network element, where the session acceptance message is used to complete the establishment of the session of the second communication service;
  • the obtaining unit 701 is further configured to obtain a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service.
  • the session request message includes first indication information, where the first indication information is used to indicate that the terminal device supports generating the second security context.
  • the obtaining unit 701 obtains a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service including:
  • a security algorithm is obtained according to the additional generation indication.
  • the obtaining unit 701 obtains the security key based on the first key according to the additional generation instruction, including:
  • the security key is generated from the first key.
  • the additional generation instruction includes an indication of a first derivative parameter
  • the first key is generated according to the AS root key of the first security context and the first derived parameter.
  • the first derivative parameter is a downlink PDCP COUNT
  • the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
  • the device may further include:
  • a generating unit 705, configured to generate a secondary authentication key during the execution of the secondary authentication process
  • the obtaining unit 701 obtaining the security key based on the first key according to the additional generation instruction includes:
  • a security key is generated from the first key.
  • the additional generation instruction includes an indication of a second derivative parameter
  • the obtaining unit 701 obtains the first key based on the secondary authentication key, including:
  • the first key is generated based on the secondary authentication key and the second derivative parameter according to the indication of the second derivative parameter.
  • the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
  • the obtaining unit 701 generating a security key according to the first key includes:
  • the security key is generated based on the first key and the third derived parameter.
  • the additional generation instruction includes the identifier of the security algorithm, and the acquiring unit 701 generates the security key according to the first key and the third derived parameter, including:
  • the security key is generated based on the first key and the identity and type of the security algorithm.
  • the additional generation indication includes the identification of the security algorithm.
  • the second communication service when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
  • FIG. 8 is a schematic structural diagram of another security context generating apparatus disclosed in an embodiment of the present application. As shown in Figure 8, the apparatus may include:
  • a receiving unit 801 configured to receive a session request message from a terminal device, where the session request message is used to request the establishment of a session of the second communication service;
  • a sending unit 802 configured to send an additional security context indication to a data transmission network element, where the additional security context indication is used to instruct to generate a second security context, and the second security context is used to protect the second communication service;
  • the sending unit 802 is further configured to send a session acceptance message to the terminal device, where the session acceptance message is used to complete the establishment of the session of the second communication service.
  • the session request message includes first indication information, where the first indication information is used to instruct the terminal device to support generating the second security context, and the sending unit 802 sends to the data transmission network element Additional security context indications include:
  • the additional security context indication is sent to the data transmission network element.
  • the sending unit 802 sending the additional security context indication to the data transmission network element includes:
  • the additional security context indication is sent to the data transmission network element.
  • the sending unit 802 sending the additional security context indication to the data transmission network element includes:
  • the additional security context indication is sent to the data transmission network element.
  • the additional security context indication includes an identifier of a security algorithm
  • the apparatus may further include an obtaining unit 803, wherein:
  • the obtaining unit 803 is configured to obtain the security algorithm.
  • the additional security context indication includes a first key
  • the apparatus may further include:
  • the receiving unit 801 is further configured to receive the secondary authentication key from the authentication, authorization and accounting network element after the secondary authentication is successful;
  • the obtaining unit 803 is further configured to obtain the first key according to the secondary authentication key.
  • the obtaining unit 803 obtaining the first key according to the secondary authentication key includes:
  • the first key is obtained according to the secondary authentication key and the second derived parameter.
  • the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
  • the session acceptance message includes an indication of a second derivative parameter, where the indication of the second derivative parameter is used to instruct to obtain a security key according to the secondary authentication key.
  • receiving unit 801, sending unit 802, obtaining unit 803, and triggering unit 804 can be obtained directly by referring to the relevant descriptions of the network elements of session management function in the method embodiments shown in FIG. 2 to FIG. Add elaboration.
  • FIG. 9 is a schematic structural diagram of another security context generating apparatus disclosed in an embodiment of the present application. As shown in Figure 9, the apparatus may include:
  • a receiving unit 901 configured to receive an additional security context indication from a session management function network element
  • an obtaining unit 902 configured to obtain a second security context according to the additional security context indication, where the second security context is used to protect the second communication service;
  • the sending unit 903 is configured to send an additional generation instruction to the terminal device, where the additional generation instruction is used to instruct to generate the second security context.
  • the obtaining unit 902 is specifically configured to:
  • a security algorithm is obtained according to the additional security context indication.
  • the acquiring unit 902 is further configured to acquire a first security context before receiving the additional security context indication from the session management function network element, where the first security context is used to protect the first communication service , the first communication service is different from the second communication service.
  • the obtaining unit 902 generates the security key based on the first key according to the additional security context indication, including:
  • the security key is generated from the first key.
  • the additional generation indication includes an indication of a first derivative parameter
  • the obtaining unit 902 obtains the first derivative parameter based on the AS root key of the first security context according to the additional security context indication.
  • a key includes:
  • the first key is generated according to the AS root key of the first security context and the first derived parameter.
  • the first derivative parameter is a downlink PDCP COUNT
  • the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
  • the additional security context indication includes the first key
  • the obtaining unit 902 obtains the security key based on the first key including:
  • the security key is generated from the first key.
  • the obtaining unit 902 generating the security key according to the first key includes:
  • the security key is generated based on the first key and the third derived parameter.
  • the additional security context indication includes an identifier of a security algorithm
  • the obtaining unit 902 generates the security key according to the first key and the third derived parameter, including:
  • the security key is generated based on the first key and the identity and type of the security algorithm.
  • the additional generation indication includes the identification of the security algorithm.
  • the additional security context indication includes an identifier of the security algorithm.
  • the obtaining unit 902 obtains the security algorithm according to the additional security context indication, including:
  • the security algorithm is acquired based on the security capability of the terminal device and a preconfigured algorithm priority list, where the security capability of the terminal device is used to indicate all security algorithms supported by the terminal device.
  • the second communication service when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
  • receiving unit 901 More detailed descriptions of the above receiving unit 901 , acquiring unit 902 and sending unit 903 can be obtained directly by referring to the relevant descriptions of the data transmission network elements in the method embodiments shown in FIG. 2 to FIG. 6 , which will not be repeated here.
  • FIG. 10 is a schematic structural diagram of another security context generating apparatus disclosed in an embodiment of the present application.
  • the security context generating device may include a processor 1001 , a memory 1002 , an input interface 1003 , an output interface 1004 and a bus 1005 .
  • the memory 1002 may exist independently, and may be connected to the processor 1001 through the bus 1005 .
  • the memory 1002 may also be integrated with the processor 1001 .
  • the bus 1005 is used to realize the connection between these components.
  • the security context generating apparatus may be a terminal device or a module (eg, a chip) in the terminal device.
  • the processor 1001 is configured to control the sending unit 702 and The receiving unit 703 performs the operations performed in the foregoing embodiments, the processor 1001 is further configured to perform the operations performed by the acquiring unit 701, the executing unit 704, and the generating unit 705 performed in the foregoing embodiments, and the input interface 1003 is configured to perform the receiving operations performed in the foregoing embodiments.
  • the operation performed by the unit 703, and the output interface 1004 is used to perform the operation performed by the sending unit 702 in the foregoing embodiment.
  • the above-mentioned terminal device or modules in the terminal device may also be used to execute various methods performed by the terminal device in the above-mentioned method embodiments of FIG. 2 to FIG.
  • the security context generating apparatus may be a session management function network element or a module (eg, a chip) in the session management function network element.
  • the processor 1001 uses the For controlling the receiving unit 801 and the sending unit 803 to perform the operations performed in the above embodiments, the processor 1001 is further configured to perform the operations performed by the acquiring unit 803 and the triggering unit 804 in the above embodiments, and the input interface 1003 is used to perform the above embodiments.
  • the operation performed by the receiving unit 801 in the above-mentioned embodiment, and the output interface 1004 is used to perform the operation performed by the sending unit 802 in the above-mentioned embodiment.
  • the above session management function network element or modules in the session management function network element can also be used to execute various methods performed by the session management function network element in the above method embodiments of FIG. 2 to FIG.
  • the security context generating apparatus may be a data transmission network element or a module (eg, a chip) in the data transmission network element.
  • the processor 1001 is used to control the The receiving unit 901 and the sending unit 903 perform the operations performed in the foregoing embodiments, the processor 1001 is further configured to perform the operations performed by the acquiring unit 902 in the foregoing embodiments, and the input interface 1003 is configured to perform the operations performed by the receiving unit 901 in the foregoing embodiments. Operation, the output interface 1004 is used to perform the operation performed by the sending unit 903 in the above-mentioned embodiment.
  • the foregoing data transmission network element or modules within the data transmission network element may also be used to execute various methods performed by the data transmission network element in the foregoing method embodiments of FIG. 2 to FIG. 6 , which will not be repeated.
  • FIG. 11 is a schematic structural diagram of another security context generating apparatus disclosed in an embodiment of the present application.
  • the security context generating apparatus may include an input interface 1101 , a logic circuit 1102 and an output interface 1103 .
  • the input interface 1101 and the output interface 1103 are connected through the logic circuit 1102 .
  • the input interface 1101 is used for receiving information from other devices, and the output interface 1103 is used for outputting, scheduling or sending information to other devices.
  • the logic circuit 1102 is configured to perform operations other than the operations of the input interface 1101 and the output interface 1103, for example, to implement the functions implemented by the processor 1001 in the above-mentioned embodiment.
  • the security context generating apparatus may be a terminal device or a module of the terminal device, a session management function network element or a module of a session management function network element, or a data transmission network element or a module of the data transmission network element.
  • the more detailed description of the input interface 1101, the logic circuit 1102 and the output interface 1103 can be obtained directly by referring to the relevant descriptions of the terminal device, the session management function network element and the data transmission network element in the above method embodiments, and will not be repeated here.
  • the embodiments of the present application further disclose a computer-readable storage medium, on which instructions are stored, and when the instructions are executed, the methods in the foregoing method embodiments are executed.
  • the embodiment of the present application further discloses a computer program product including an instruction, when the instruction is executed, the method in the foregoing method embodiment is executed.
  • the embodiment of the present application also discloses a communication system, which includes a terminal device, a session management function network element, and a data transmission network element.
  • a communication system which includes a terminal device, a session management function network element, and a data transmission network element.
  • a session management function network element for a specific description, reference may be made to the security context generation method shown in FIG. 2 to FIG. 6 .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Disclosed in embodiments of the present invention are a method and apparatus for generating a security context, and a computer-readable storage medium. The method comprises: a terminal device acquiring a first security context, wherein the first security context is used for protecting a first communication service of the terminal device; the terminal device sending a session request message to a session management function network element, wherein the session request message is used for requesting the establishment of a session of a second communication service, and the second communication service is different from the first communication service; the terminal device receiving a session acceptance message from the session management function network element, wherein the session acceptance message is used for completing the establishment of the session of the second communication service; the terminal device acquiring an extra generation indication; and the terminal device acquiring a second security context according to the extra generation indication, wherein the second security context is used for protecting the second communication service. By means of the embodiments of the present invention, different communication services are protected by means of different security contexts, so that the security of the communication services can be improved.

Description

一种安全上下文生成方法、装置及计算机可读存储介质A security context generation method, device and computer-readable storage medium 技术领域technical field
本申请实施例涉及通信技术领域,尤其涉及一种安全上下文生成方法、装置及计算机可读存储介质。The embodiments of the present application relate to the field of communications technologies, and in particular, to a method, an apparatus, and a computer-readable storage medium for generating a security context.
背景技术Background technique
公有网络是由网络服务提供商建设,供公共用户使用的通信网络。为了满足某些个人、企业、公司等用户对网络资源的需求,运营商给可以给这些用户划分部分的网络资源,划分的这部分网络资源形成私有网络。此时形成的私有网络可以称为公共网络集成的非公共网络(public network integrated non-public network,PNI-NPN)。在PNI-NPN中,用户设备(user equipment,UE)可以连接公用陆地移动网络(public land mobile network,PLMN)进行的公网业务,也可以连接非公共网络/私网(non-public network,NPN)处理私网业务。目前,UE可以连入同一无线接入网(radio access network,RAN)同时进行公网业务和私网业务,此时的公网业务与私网业务使用同一套安全上下文进行通信。当攻击者破解公网业务使用的安全上下文时,就获取了对应私网业务的安全上下文。反之,当攻击者获取私网业务使用的算法也就获取对应公网业务的安全上下文。因此,针对公网业务或私网业务的安全攻击可能会影响到对应的私网业务或公网业务,以致降低了通信业务的安全性。A public network is a communication network constructed by network service providers for public users. In order to meet the needs of some individuals, enterprises, companies and other users for network resources, the operator allocates network resources that can be divided into parts for these users, and the divided network resources form a private network. The private network formed at this time can be called a public network integrated non-public network (PNI-NPN). In PNI-NPN, user equipment (UE) can be connected to public network services performed by public land mobile network (PLMN), and can also be connected to non-public network/private network (non-public network, NPN). ) to handle private network services. Currently, a UE can be connected to the same radio access network (RAN) to perform public network services and private network services at the same time. At this time, the public network services and private network services communicate using the same set of security contexts. When an attacker deciphers the security context used by the public network service, the security context corresponding to the private network service is obtained. Conversely, when the attacker obtains the algorithm used by the private network service, he also obtains the security context corresponding to the public network service. Therefore, security attacks on public network services or private network services may affect the corresponding private network services or public network services, thereby reducing the security of communication services.
发明内容SUMMARY OF THE INVENTION
本发明实施例公开了一种安全上下文生成方法,装置及计算机可读存储介质,用于提高通信业务的安全性。Embodiments of the present invention disclose a method, device and computer-readable storage medium for generating a security context, which are used to improve the security of communication services.
第一方面公开一种安全上下文生成方法,该安全上下文生成方法可以应用于终端设备,也可以应用于终端设备中的模块(例如,芯片),以下以终端设备为例进行说明。该安全上下文生成方法可以包括:终端设备获取第一安全上下文,所述第一安全上下文用于保护所述终端设备的第一通信业务;所述终端设备向会话管理功能网元发送会话请求消息,所述会话请求消息用于请求建立第二通信业务的会话,所述第二通信业务与所述第一通信业务不同;所述终端设备接收来自所述会话管理功能网元的会话接受消息,所述会话接受消息用于完成建立所述第二通信业务的会话;所述终端设备获取额外生成指示;所述终端设备根据所述额外生成指示获取第二安全上下文,所述第二安全上下文用于保护所述第二通信业务。A first aspect discloses a method for generating a security context. The method for generating a security context can be applied to a terminal device, and can also be applied to a module (eg, a chip) in the terminal device. The following describes the terminal device as an example. The security context generation method may include: the terminal device obtains a first security context, where the first security context is used to protect the first communication service of the terminal device; the terminal device sends a session request message to a session management function network element, The session request message is used to request the establishment of a session for a second communication service, and the second communication service is different from the first communication service; the terminal device receives a session acceptance message from the session management function network element, and the second communication service is different from the first communication service. The session acceptance message is used to complete the establishment of the session for the second communication service; the terminal device obtains an additional generation instruction; the terminal device obtains a second security context according to the additional generation instruction, and the second security context is used for The second communication service is protected.
本申请实施例中,终端设备可以在获取第一安全上下文的基础上,进一步可以获取第二安全上下文。第一安全上下文和第二安全上下文可以分别保护不同的通信业务。由此,可以对不同业务的保护进行隔离,以防止其中一个通信业务受到攻击时,影响另一个通信业务,从而可以提高通信业务的安全性。In this embodiment of the present application, the terminal device may further acquire the second security context on the basis of acquiring the first security context. The first security context and the second security context can respectively protect different communication services. Thereby, the protection of different services can be isolated to prevent that when one of the communication services is attacked, the other communication service is affected, thereby improving the security of the communication services.
作为一种可能的实施方式,所述会话请求消息包括第一指示信息,所述第一指示信息用于指示所述终端设备支持生成所述第二安全上下文。As a possible implementation manner, the session request message includes first indication information, where the first indication information is used to indicate that the terminal device supports generating the second security context.
本申请实施例中,会话请求消息包括第一指示信息时,会话管理功能网元可以根据这一指示信息直接确定第二安全上下文,可以减少会话管理功能网元的处理过程,从而可以 提高第二安全上下文的生成效率。In this embodiment of the present application, when the session request message includes the first indication information, the session management function network element can directly determine the second security context according to the indication information, which can reduce the processing process of the session management function network element, thereby improving the second security context. Generation efficiency of security context.
作为一种可能的实施方式,所述终端设备根据所述额外生成指示获取第二安全上下文,包括:所述终端设备根据所述额外生成指示,基于第一密钥获取安全密钥;和/或所述终端设备根据所述额外生成指示获取安全算法。As a possible implementation manner, acquiring, by the terminal device, the second security context according to the additional generation instruction includes: acquiring, by the terminal device, a security key based on the first key according to the additional generation instruction; and/or The terminal device acquires a security algorithm according to the additional generation instruction.
本申请实施例中,安全上下文可以包括安全密钥和/或安全算法。安全上下文可以对数据进行加密保护和完整性保护,从而可以保证通信业务中数据的安全性和可靠性。In this embodiment of the present application, the security context may include a security key and/or a security algorithm. The security context can perform encryption protection and integrity protection on data, so as to ensure the security and reliability of data in communication services.
作为一种可能的实施方式,所述终端设备根据所述额外生成指示,基于第一密钥获取安全密钥,包括:所述终端设备根据所述额外生成指示,基于所述第一安全上下文的接入层(access stratum,AS)根密钥获取所述第一密钥;所述终端设备根据所述第一密钥生成所述安全密钥。As a possible implementation manner, the terminal device acquiring the security key based on the first key according to the additional generation instruction includes: the terminal device obtaining the security key based on the first security context according to the additional generation instruction An access stratum (access stratum, AS) root key obtains the first key; the terminal device generates the security key according to the first key.
本申请实施例中,终端设备生成安全密钥时,可以通过生成第一安全上下文的AS根密钥生成第一密钥。由于AS根密钥是已知的,不需要生成,因此,可以减少生成第二安全上下文的过程,从而可以提高生成第二安全上下文的效率。In this embodiment of the present application, when the terminal device generates the security key, the first key may be generated by generating the AS root key of the first security context. Since the AS root key is known and does not need to be generated, the process of generating the second security context can be reduced, thereby improving the efficiency of generating the second security context.
作为一种可能的实施方式,所述额外生成指示包含第一衍生参数的指示,所述终端设备根据所述额外生成指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥,包括:所述终端设备根据所述第一安全上下文的AS根密钥以及所述第一衍生参数生成所述第一密钥。As a possible implementation manner, the additional generation instruction includes an indication of a first derivative parameter, and the terminal device obtains the first secret key based on the AS root key of the first security context according to the additional generation instruction The key includes: the terminal device generates the first key according to the AS root key of the first security context and the first derivative parameter.
本申请实施例中,由于第一密钥根据第一衍生参数生成,而第一衍生参数不同,生成的密钥不同,因此,可以防止第二安全上下文包括的安全密钥和第一安全上下文包括的安全密钥相同,可以保证不同通信业务所使用的安全上下文不同,从而可以保证安全隔离的有效性和可以提高通信业务的安全性。In this embodiment of the present application, since the first key is generated according to the first derivative parameter, and the first derivative parameter is different, the generated key is different, therefore, it can be prevented that the security key included in the second security context and the first security context include The same security key can ensure that different communication services use different security contexts, thereby ensuring the effectiveness of security isolation and improving the security of communication services.
作为一种可能的实施方式,所述第一衍生参数为下行分组数据汇聚协议(packet data convergence potocol,PDCP)数COUNT,所述第一衍生参数的指示为所述下行PDCP COUNT的部分比特位。As a possible implementation manner, the first derivative parameter is a downlink packet data convergence protocol (packet data convergence potocol, PDCP) number COUNT, and the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
本申请实施例中,当第一衍生参数为下行PDCP COUNT时,随着生成安全上下文次数的不断变化,对应的COUNT值可以随之发生变化。COUNT值的变化可以防止生成的第一密钥相同,以便可以防止生成的安全密钥相同,从而可以保证生成的安全上下文不同。不同的安全上下文用于保护不同的通信业务,可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In the embodiment of the present application, when the first derivative parameter is the downlink PDCP COUNT, as the number of times of generating the security context is constantly changing, the corresponding COUNT value may change accordingly. The change of the COUNT value can prevent the generated first keys from being the same, so that the generated security keys can be prevented from being the same, so that the generated security contexts can be guaranteed to be different. Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
作为一种可能的实施方式,在所述终端设备向所述会话管理功能网元发送所述会话请求消息之后,所述终端设备接收所述额外生成指示之前,所述安全上下文生成方法还包括:所述终端设备执行二次认证;所述终端设备在执行所述二次认证过程中生成二次认证密钥;所述终端设备根据所述额外生成指示,基于第一密钥获取安全密钥,包括:所述终端设备根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥;所述终端设备根据所述第一密钥生成安全密钥。As a possible implementation manner, after the terminal device sends the session request message to the session management function network element, and before the terminal device receives the additional generation instruction, the security context generation method further includes: The terminal device performs secondary authentication; the terminal device generates a secondary authentication key in the process of performing the secondary authentication; the terminal device obtains a security key based on the first key according to the additional generation instruction, The method includes: obtaining, by the terminal device, the first key based on the secondary authentication key according to the additional generation instruction; and generating, by the terminal device, a security key according to the first key.
本申请实施例中,终端设备可以执行二次认证,之后可以通过二次认证获取的认证密钥生成第一密钥。由于认证密钥不同生成的第一密钥不同,因此,通过第一密钥生成的第二安全上下文包括的安全密钥与第一安全上下文包括的安全密钥也不同,从而可以保证生 成的安全上下文不同。不同的安全上下文用于保护不同的通信业务,可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In this embodiment of the present application, the terminal device may perform secondary authentication, and then generate the first key through the authentication key obtained by the secondary authentication. Since the first keys generated by different authentication keys are different, the security keys included in the second security context generated by using the first keys are also different from the security keys included in the first security context, so that the generated security can be guaranteed. The context is different. Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
作为一种可能的实施方式,所述额外生成指示包含第二衍生参数的指示,所述终端设备根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥,包括:所述终端设备根据所述第二衍生参数的指示,基于所述二次认证密钥以及所述第二衍生参数生成所述第一密钥。As a possible implementation manner, the additional generation instruction includes an indication of a second derivative parameter, and the terminal device obtains the first key based on the secondary authentication key according to the additional generation instruction, including: The terminal device generates the first key based on the secondary authentication key and the second derivative parameter according to the indication of the second derivative parameter.
本申请实施例中,终端设备可以根据第二衍生参数生成第一密钥,由于第二衍生参数不同,生成的第一密钥不同。因此,可以防止生成的第二安全上下文包括的安全密钥和第一安全上下文包括的安全密钥相同,可以保证不同通信业务使用的安全上下文不同,可以保证安全隔离的有效性,从而提高通信业务的安全性。In this embodiment of the present application, the terminal device may generate the first key according to the second derivative parameter. Since the second derivative parameter is different, the generated first key is different. Therefore, it is possible to prevent the generated second security context from including the same security key as the first security context, to ensure that the security contexts used by different communication services are different, to ensure the effectiveness of security isolation, and to improve communication services. security.
作为一种可能的实施方式,所述第二衍生参数为以下参数的一项或多项:下行非接入层(non-access stratum,NAS)数COUNT、协议数据单元(protocol data unit,PDU)会话(session)身份标识(identity document,ID)、网络切片选择支撑信息(network slice selection assistance information,NSSAI)和数据网络名称(data network name,DNN)。As a possible implementation manner, the second derived parameter is one or more of the following parameters: downlink non-access stratum (non-access stratum, NAS) number COUNT, protocol data unit (protocol data unit, PDU) Session (session) identity document (ID), network slice selection assistance information (NSSAI) and data network name (DNN).
本申请实施例中,当NAS COUNT作为推衍第一密钥的参数时,由于每次推衍的COUNT值都会发生变化,可以使得推衍得到的第一密钥均不同。当PDU session ID、NSSAI或DNN作为推衍第一密钥的参数时,由于终端设备PDU会话、接入的切片和数据网络不同,也可以使得推衍得到的第一密钥均不同。不同的第一密钥可以生成不同的安全密钥,不同的安全密钥可以保证生成的安全上下文不同。不同的安全上下文可以用于保护不同的通信业务,可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In the embodiment of the present application, when the NAS COUNT is used as a parameter for deriving the first key, since the value of the deduced COUNT will change each time, the derived first keys may be different. When the PDU session ID, NSSAI or DNN are used as the parameters for deriving the first key, the derived first keys may also be different due to differences in the PDU session of the terminal device, the access slice and the data network. Different first keys can generate different security keys, and different security keys can ensure that the generated security contexts are different. Different security contexts can be used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
作为一种可能的实施方式,所述终端设备根据所述第一密钥生成所述安全密钥,包括:所述终端设备根据所述第一密钥以及第三衍生参数生成所述安全密钥。As a possible implementation manner, the generating, by the terminal device, the security key according to the first key includes: generating, by the terminal device, the security key according to the first key and a third derivative parameter. .
本申请实施例中,终端设备可以根据第一密钥和第三衍生参数生成安全密钥。由于第三衍生参数不同,生成的安全密钥不同,因此,可以避免生成的安全密钥与已存在的安全密钥相同,从而可以保证生成的安全上下文不同。通过不同的安全上下文保护不同的通信业务,可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In this embodiment of the present application, the terminal device may generate the security key according to the first key and the third derived parameter. Since the generated security keys are different due to different third derived parameters, it can be avoided that the generated security keys are the same as the existing security keys, so that the generated security contexts can be guaranteed to be different. By protecting different communication services through different security contexts, the effectiveness of security isolation of communication services can be ensured, thereby improving the security of communication services.
作为一种可能的实施方式,所述额外生成指示包含所述安全算法的标识,所述终端设备根据所述第一密钥以及第三衍生参数生成所述安全密钥,包括:所述终端设备根据所述第一密钥以及所述安全算法的标识和类型生成所述安全密钥。As a possible implementation manner, the additional generation instruction includes an identifier of the security algorithm, and the terminal device generates the security key according to the first key and the third derived parameter, including: the terminal device The security key is generated based on the first key and the identity and type of the security algorithm.
本申请实施例中,由于第二安全上下文中安全密钥的类型和长度均是确定的,因此,可以通过对应的安全算法的标识和类型确定安全密钥,从而可以保证生成安全密钥的有效性。In this embodiment of the present application, since the type and length of the security key in the second security context are determined, the security key can be determined by the identifier and type of the corresponding security algorithm, thereby ensuring the validity of the generated security key. sex.
作为一种可能的实施方式,所述额外生成指示包括所述安全算法的标识。As a possible implementation manner, the additional generation indication includes the identification of the security algorithm.
本申请实施例中,终端设备获取安全算法的标识后,可以直接根据标识确定安全算法,从而可以保证终端设备和数据传输网元生成的安全算法的一致性,可以减少终端设备确定安全算法过程,以及可以提高安全上下文的生成效率。In the embodiment of the present application, after the terminal device obtains the identifier of the security algorithm, it can directly determine the security algorithm according to the identifier, thereby ensuring the consistency of the security algorithm generated by the terminal device and the data transmission network element, and reducing the process of determining the security algorithm by the terminal device. And can improve the generation efficiency of the security context.
作为一种可能的实施方式,当所述第一通信业务是公网业务时,所述第二通信业务是私网业务;当所述第一通信业务是私网业务时,所述第二通信业务是公网业务。As a possible implementation manner, when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
本申请实施例中,第一通信业务和第二通信业务为不同的通信业务,在一个通信业务为私网业务的情况下,另一个通信业务为公网业务,可以保证不同的通信业务使用不同的安全上下文进行保护,可以保证公网业务和私网业务间的安全隔离,从而可以提高公网业务和私网业务的安全性。In the embodiment of the present application, the first communication service and the second communication service are different communication services. In the case where one communication service is a private network service, the other communication service is a public network service, which can ensure that different communication services use different services. It can ensure the security isolation between public network services and private network services, thereby improving the security of public network services and private network services.
第二方面公开一种安全上下文生成方法,该安全上下文生成方法可以应用于会话管理功能网元,也可以应用于会话管理功能网元中的模块(例如,芯片),以下以会话管理功能网元为例进行说明。该安全上下文生成方法可以包括:会话管理功能网元接收来自终端设备的会话请求消息,所述会话请求消息用于请求建立第二通信业务的会话;所述会话管理功能网元向数据传输网元发送额外安全上下文指示,所述额外安全上下文指示用于指示生成第二安全上下文,所述第二安全上下文用于保护所述第二通信业务;所述会话管理功能网元向所述终端设备发送会话接受消息,所述会话接受消息用于完成建立所述第二通信业务的会话。A second aspect discloses a security context generation method. The security context generation method can be applied to a session management function network element, and can also be applied to a module (for example, a chip) in a session management function network element. The session management function network element is hereinafter referred to as the session management function network element. Take an example to illustrate. The security context generation method may include: the session management function network element receives a session request message from the terminal device, where the session request message is used to request the establishment of a session of the second communication service; the session management function network element sends a data transmission network element to the sending an additional security context indication, where the additional security context indication is used to instruct the generation of a second security context, where the second security context is used to protect the second communication service; the session management function network element sends to the terminal device A session accept message, where the session accept message is used to complete the establishment of the session of the second communication service.
本申请实施例中,会话管理功能网元接收会话请求消息之后,可以响应第二安全上下文的生成请求。会话管理功能网元发送额外安全上下文指示,数据传输网元可以根据额外安全上下文生成第二安全上下文。会话管理功能网元可以协调终端设备和数据传输网元生成第二安全上下文,从而可以保证第二安全上下文的生成。In this embodiment of the present application, after receiving the session request message, the network element of the session management function may respond to the request for generating the second security context. The session management function network element sends an additional security context indication, and the data transmission network element may generate a second security context according to the additional security context. The session management function network element can coordinate the terminal device and the data transmission network element to generate the second security context, so as to ensure the generation of the second security context.
作为一种可能的实施方式,所述会话请求消息包括第一指示信息,所述第一指示信息用于指示所述终端设备支持生成第二安全上下文,所述会话管理功能网元向数据传输网元发送额外安全上下文指示,包括:当所述第一指示信息指示所述终端设备支持生成所述第二安全上下文时,所述会话管理功能网元向所述数据传输网元发送所述额外安全上下文指示。As a possible implementation manner, the session request message includes first indication information, where the first indication information is used to instruct the terminal device to support generating the second security context, and the session management function network element reports to the data transmission network sending an additional security context indication by the element, including: when the first indication information indicates that the terminal device supports generating the second security context, the session management function network element sends the additional security context to the data transmission network element contextual indication.
本申请实施例中,会话请求消息包括第一指示信息时,会话管理功能网元可以根据这一指示信息直接确定生成第二安全上下文,可以减少会话管理功能网元的处理过程,从而可以提高第二安全上下文的生成效率。In the embodiment of the present application, when the session request message includes the first indication information, the session management function network element can directly determine to generate the second security context according to the indication information, which can reduce the processing process of the session management function network element, thereby improving the first security context. Second, the generation efficiency of the security context.
作为一种可能的实施方式,所述会话管理功能网元向数据传输网元发送额外安全上下文指示,包括:所述会话管理功能网元根据所述会话请求消息获得所述终端设备的签约信息;当所述终端设备的签约信息指示需要生成所述第二安全上下文时,所述会话管理功能网元向所述数据传输网元发送所述额外安全上下文指示。As a possible implementation manner, the session management function network element sending an additional security context indication to the data transmission network element includes: the session management function network element obtains the subscription information of the terminal device according to the session request message; When the subscription information of the terminal device indicates that the second security context needs to be generated, the session management function network element sends the additional security context indication to the data transmission network element.
本申请实施例中,会话管理功能网元也可以根据签约信息确定是否发送额外安全上下文指示,会话请求消息可以不携带用于确定是否生成第二安全上下文的指示信息,从而可以减少信息的传输以及节约通信资源。In this embodiment of the present application, the network element of the session management function may also determine whether to send an additional security context indication according to the subscription information, and the session request message may not carry the indication information for determining whether to generate the second security context, thereby reducing information transmission and Save communication resources.
作为一种可能的实施方式,所述会话管理功能网元向数据传输网元发送额外安全上下文指示,包括:当所述会话管理功能网元配置的本地策略指示需要生成所述第二安全上下文时,所述会话管理功能网元向所述数据传输网元发送所述额外安全上下文指示。As a possible implementation manner, the session management function network element sends an additional security context indication to the data transmission network element, including: when the local policy configured by the session management function network element indicates that the second security context needs to be generated , the session management function network element sends the additional security context indication to the data transmission network element.
本申请实施例中,会话管理功能网元可以根据本地策略确定是否发送额外安全上下文指示,此时会话请求消息可以不携带用于确定是否生成第二安全上下文的指示信息,从而可以减少信息的传输和节约通信资源。In this embodiment of the present application, the session management function network element may determine whether to send an additional security context indication according to a local policy. In this case, the session request message may not carry the indication information for determining whether to generate the second security context, thereby reducing information transmission. and save communication resources.
作为一种可能的实施方式,所述额外安全上下文指示包括安全算法的标识,所述方法还包括:所述会话管理功能网元获取所述安全算法。As a possible implementation manner, the additional security context indication includes an identifier of a security algorithm, and the method further includes: acquiring the security algorithm by the session management function network element.
本申请实施例中,会话管理功能网元可以确定安全算法后,终端设备和数据传输网元可以接收到会话管理功能网元确定的安全算法的标识,终端设备和数据传输网元可以直接根据标识确定安全算法,以便可以减少终端设备和数据传输网元确定安全算法的过程以及节约处理资源,从而可以提高安全上下文的生成效率。In the embodiment of the present application, after the session management function network element can determine the security algorithm, the terminal device and the data transmission network element can receive the identification of the security algorithm determined by the session management function network element, and the terminal device and the data transmission network element can directly determine the security algorithm according to the identification The security algorithm is determined, so that the process of determining the security algorithm by the terminal device and the data transmission network element can be reduced and processing resources can be saved, so that the generation efficiency of the security context can be improved.
作为一种可能的实施方式,所述额外安全上下文指示包括第一密钥,所述方法还包括:所述会话管理功能网元触发二次认证;所述二次认证成功后,所述会话管理功能网元接收来自认证授权计费网元的二次认证密钥;所述会话管理功能网元根据所述二次认证密钥获取所述第一密钥。As a possible implementation manner, the additional security context indication includes a first key, and the method further includes: the session management function network element triggers secondary authentication; after the secondary authentication is successful, the session management The functional network element receives the secondary authentication key from the authentication, authorization and accounting network element; the session management functional network element obtains the first key according to the secondary authentication key.
本申请实施例中,会话管理功能网元可以触发二次认证来获取的认证密钥,之后可以通过二次认证的认证密钥生成第一密钥。由于认证密钥不同生成的第一密钥不同,因此,通过第一密钥生成的第二安全上下文包括的安全密钥与第一安全上下文包括的安全密钥也不同,从而可以保证生成的安全上下文不同。不同的安全上下文用于保护不同的通信业务,可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In the embodiment of the present application, the session management function network element may trigger the secondary authentication to obtain the authentication key, and then generate the first key by using the secondary authentication authentication key. Since the first keys generated by different authentication keys are different, the security keys included in the second security context generated by using the first keys are also different from the security keys included in the first security context, so that the generated security can be guaranteed. The context is different. Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
作为一种可能的实施方式,所述会话管理功能网元根据所述二次认证密钥获取所述第一密钥包括:所述会话管理功能网元根据所述二次认证密钥以及第二衍生参数获取所述第一密钥。As a possible implementation manner, obtaining the first key by the session management function network element according to the secondary authentication key includes: the session management function network element obtains the first key according to the secondary authentication key and the second authentication key. The derived parameter obtains the first key.
本申请实施例中,会话管理网元可以根据第二衍生参数生成第一密钥,由于第二衍生参数的不同,生成的第一密钥不同。因此,可以防止生成的第二安全上下文包括的安全密钥和第一安全上下文包括的安全密钥相同,可以保证不同通信业务的使用的安全上下文不同。可以保证安全隔离的有效性,从而提高通信业务的安全性。In this embodiment of the present application, the session management network element may generate the first key according to the second derivative parameter, and the generated first key is different due to the difference of the second derivative parameter. Therefore, it can be prevented that the security key included in the generated second security context is the same as the security key included in the first security context, and it can be ensured that the security contexts used by different communication services are different. The effectiveness of security isolation can be guaranteed, thereby improving the security of communication services.
作为一种可能的实施方式,所述第二衍生参数为以下参数的一项或多项:下行NAS COUNT、PDU session ID、NSSAI和DNN。As a possible implementation manner, the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
本申请实施例中,当NAS COUNT作为推衍第一密钥的参数时,由于每次推衍的COUNT值都会发生变化,可以使得推衍得到的第一密钥均不同。当PDU session ID、NSSAI和DNN其中的一项或多项作为推衍第一密钥的参数时,由于终端设备PDU会话、接入的切片和数据网络不同,也可以使得推衍得到的第一密钥均不同。不同的第一密钥可以生成不同的安全密钥,不同的安全密钥可以保证生成的安全上下文不同。不同的安全上下文可以用于保护不同的通信业务,可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In the embodiment of the present application, when the NAS COUNT is used as a parameter for deriving the first key, since the value of the deduced COUNT will change each time, the derived first keys may be different. When one or more of the PDU session ID, NSSAI and DNN are used as the parameters for deriving the first key, due to the difference in the PDU session of the terminal device, the slice accessed and the data network, the derived first key can also be used. The keys are all different. Different first keys can generate different security keys, and different security keys can ensure that the generated security contexts are different. Different security contexts can be used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
作为一种可能的实施方式,所述会话接受消息包含第二衍生参数的指示,所述第二衍生参数的指示用于指示根据所述二次认证密钥获取安全密钥。As a possible implementation manner, the session acceptance message includes an indication of a second derivative parameter, where the indication of the second derivative parameter is used to instruct to obtain a security key according to the secondary authentication key.
本申请实施例中,当会话管理功能网元接收到第二衍生参数的指示时,会话管理网元可以根据二次认证密钥和第二推衍参数生成第一密钥。第二推衍参数的不同使得生成的安全密钥不同。可以使得生成的安全上下文不同。安全上下文的不同可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In this embodiment of the present application, when the session management function network element receives the indication of the second derived parameter, the session management network element may generate the first key according to the secondary authentication key and the second derived parameter. The difference in the second derived parameter makes the generated security key different. The generated security context can be made different. Different security contexts can ensure the effectiveness of the security isolation of communication services, thereby improving the security of communication services.
第三方面公开一种安全上下文生成方法,该安全上下文生成方法可以应用于数据传输 网元,也可以应用于数据传输网元中的模块(例如,芯片),以下以数据传输网元为例进行说明。该安全上下文生成方法可以包括:数据传输网元接收来自会话管理功能网元的额外安全上下文指示;所述数据传输网元根据所述额外安全上下文指示获取第二安全上下文,所述第二安全上下文用于保护第二通信业务;所述数据传输网元向终端设备发送额外生成指示,所述额外生成指示用于指示生成所述第二安全上下文。A third aspect discloses a security context generation method. The security context generation method can be applied to a data transmission network element, and can also be applied to a module (for example, a chip) in the data transmission network element. The following takes the data transmission network element as an example to perform illustrate. The security context generation method may include: the data transmission network element receives an additional security context indication from the session management function network element; the data transmission network element obtains a second security context according to the additional security context indication, and the second security context is used to protect the second communication service; the data transmission network element sends an additional generation instruction to the terminal device, where the additional generation instruction is used to instruct the generation of the second security context.
本申请实施例中,数据传输网元可以获取第二安全上下文,第二安全上下文可以保护第二通信业务,从而可以提高第二通信业务的安全性。In this embodiment of the present application, the data transmission network element may acquire the second security context, and the second security context may protect the second communication service, thereby improving the security of the second communication service.
作为一种可能的实施方式,所述数据传输网元根据所述额外安全上下文指示获取第二安全上下文,包括:所述数据传输网元根据所述额外安全上下文指示,基于第一密钥获取安全密钥;和/或所述数据传输网元根据所述额外安全上下文指示获取安全算法。As a possible implementation manner, the data transmission network element acquiring the second security context according to the additional security context indication includes: the data transmission network element acquiring the security context based on the first key according to the additional security context indication and/or the data transmission network element obtains a security algorithm according to the additional security context indication.
本申请实施例中,安全上下文可以包括安全密钥和/或安全算法。安全上下文可以对数据进行加密保护和完整性保护,从而可以保证通信业务中数据的安全性和可靠性。In this embodiment of the present application, the security context may include a security key and/or a security algorithm. The security context can perform encryption protection and integrity protection on data, so as to ensure the security and reliability of data in communication services.
作为一种可能的实施方式,在数据传输网元接收来自会话管理功能网元的额外安全上下文指示之前,所述安全上下文生成还包括:所述数据传输网元获取第一安全上下文,所述第一安全上下文用于保护第一通信业务,所述第一通信业务与所述第二通信业务不同。As a possible implementation manner, before the data transmission network element receives the additional security context indication from the session management function network element, the security context generation further includes: the data transmission network element obtains a first security context, and the first security context is obtained by the data transmission network element. A security context is used to protect the first communication service, the first communication service being different from the second communication service.
本申请实施例中,数据传输网元可以在获取第一安全上下文的基础上,进一步可以获取第二安全上下文。第一安全上下文和第二安全上下文可以分别保护不同的通信业务。由此,可以对不同业务的保护进行隔离,以防止其中一个通信业务受到攻击时,影响另一个通信业务。从而可以提高通信业务的安全性。In this embodiment of the present application, the data transmission network element may further acquire the second security context on the basis of acquiring the first security context. The first security context and the second security context can respectively protect different communication services. Therefore, the protection of different services can be isolated, so as to prevent one communication service from being attacked, affecting the other communication service. Thereby, the security of the communication service can be improved.
作为一种可能的实施方式,所述数据传输网元根据所述额外安全上下文指示,基于第一密钥生成所述安全密钥,包括:所述数据传输网元根据所述额外安全上下文指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥;所述数据传输网元根据所述第一密钥生成所述安全密钥。As a possible implementation manner, the data transmission network element generating the security key based on the first key according to the additional security context indication includes: the data transmission network element, according to the additional security context indication, The first key is obtained based on the AS root key of the first security context; the data transmission network element generates the security key according to the first key.
本申请实施例中,数据传输网元生成安全密钥时,可以通过生成第一安全上下文的AS根密钥生成第一密钥。由于AS根密钥是已知的,不需要生成,因此,可以减少生成第二安全上下文的过程,从而可以提高生成第二安全上下文的效率。In this embodiment of the present application, when the data transmission network element generates the security key, the first key may be generated by generating the AS root key of the first security context. Since the AS root key is known and does not need to be generated, the process of generating the second security context can be reduced, thereby improving the efficiency of generating the second security context.
作为一种可能的实施方式,所述额外生成指示包含第一衍生参数的指示,所述数据传输网元根据所述额外安全上下文指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥,包括:所述数据传输网元根据所述第一安全上下文的AS根密钥以及所述第一衍生参数生成所述第一密钥。As a possible implementation manner, the additionally generated indication includes an indication of a first derived parameter, and the data transmission network element obtains the The first key includes: the data transmission network element generates the first key according to the AS root key of the first security context and the first derivative parameter.
本申请实施例中,由于第一密钥根据第一衍生参数生成,而第一衍生参数的不同,生成的第一密钥不同,因此,可以防止生成的第二安全上下文包括的安全密钥和第一安全上下文包括的安全密钥相同,可以保证不同通信业务所使用的安全上下文不同,从而可以保证安全隔离的有效性和可以提高通信业务的安全性。In this embodiment of the present application, since the first key is generated according to the first derivative parameter, and the first key generated is different depending on the first derivative parameter, it can be prevented that the generated second security context includes the security key and the The security keys included in the first security context are the same, which can ensure that the security contexts used by different communication services are different, thereby ensuring the effectiveness of security isolation and improving the security of communication services.
作为一种可能的实施方式,所述第一衍生参数为下行PDCP COUNT,所述第一衍生参数的指示为所述下行PDCP COUNT的部分比特位。As a possible implementation manner, the first derivative parameter is a downlink PDCP COUNT, and the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
本申请实施例中,当第一衍生参数为下行PDCP COUNT时,随着生成安全上下文次数的不断变化,对应的COUNT值可以随之发生变化。COUNT值的变化可以防止生成的第一 密钥相同,以便可以防止生成的安全密钥的相同,从而可以保证生成的安全上下文不同。不同的安全上下文用于保护不同的通信业务,可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In the embodiment of the present application, when the first derivative parameter is the downlink PDCP COUNT, as the number of times of generating the security context is constantly changing, the corresponding COUNT value may change accordingly. The change of the COUNT value can prevent the generated first keys from being the same, so that the generated security keys can be prevented from being the same, so that the generated security contexts can be guaranteed to be different. Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
作为一种可能的实施方式,所述额外安全上下文指示包括所述第一密钥,所述数据传输网元根据所述额外安全上下文指示,基于第一密钥获取所述安全密钥,包括:所述数据传输网元根据所述第一密钥生成所述安全密钥。As a possible implementation manner, the additional security context indication includes the first key, and the data transmission network element obtains the security key based on the first key according to the additional security context indication, including: The data transmission network element generates the security key according to the first key.
本申请实施例中,数据传输网元可以根据接收的第一密钥生成安全密钥,第一密钥可以是会话管理功能网元根据二次认证的认证密钥生成的密钥。由于认证密钥不同生成的第一密钥不同,因此,通过第一密钥生成的第二安全上下文包括的安全密钥与第一安全上下文包括的安全密钥也不同,从而可以保证生成的安全上下文不同。不同的安全上下文用于保护不同的通信业务,可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In the embodiment of the present application, the data transmission network element may generate a security key according to the received first key, and the first key may be a key generated by the session management function network element according to the authentication key of the secondary authentication. Since the first keys generated by different authentication keys are different, the security keys included in the second security context generated by using the first keys are also different from the security keys included in the first security context, so that the generated security can be guaranteed. The context is different. Different security contexts are used to protect different communication services, which can ensure the effectiveness of security isolation of communication services, thereby improving the security of communication services.
作为一种可能的实施方式,所述数据传输网元根据所述第一密钥生成所述安全密钥,包括:所述数据传输网元根据所述第一密钥以及第三衍生参数生成所述安全密钥。As a possible implementation manner, generating, by the data transmission network element, the security key according to the first key includes: generating, by the data transmission network element, the security key according to the first key and a third derived parameter. the security key.
本申请实施例中,数据传输网元可以根据第一密钥和第三衍生参数生成安全密钥。由于第三衍生参数不同,生成的安全密钥不同,通过不同的安全上下文保护不同的通信业务。可以保证通信业务安全隔离的有效性,从而可以提高通信业务的安全性。In this embodiment of the present application, the data transmission network element may generate the security key according to the first key and the third derived parameter. Because the third derivative parameters are different, the generated security keys are different, and different communication services are protected through different security contexts. The effectiveness of the security isolation of the communication service can be guaranteed, thereby improving the security of the communication service.
作为一种可能的实施方式,所述额外安全上下文指示包含安全算法的标识,所述数据传输网元根据所述第一密钥以及第三衍生参数生成所述安全密钥,包括:所述数据传输网元根据所述第一密钥以及所述安全算法的标识和类型生成所述安全密钥。As a possible implementation manner, the additional security context indication includes an identifier of a security algorithm, and the data transmission network element generates the security key according to the first key and the third derived parameter, including: the data The transmission network element generates the security key according to the first key and the identity and type of the security algorithm.
本申请实施例中,由于第二安全上下文中安全密钥的类型和长度均是确定的,因此,可以通过对应的安全算法的标识和类型确定安全密钥,从而可以保证生成安全密钥的有效性。In this embodiment of the present application, since the type and length of the security key in the second security context are determined, the security key can be determined by the identifier and type of the corresponding security algorithm, thereby ensuring the validity of the generated security key. sex.
作为一种可能的实施方式,所述额外生成指示包括所述安全算法的标识。As a possible implementation manner, the additional generation indication includes the identification of the security algorithm.
本申请实施例中,终端设备获取安全算法的标识后,可以直接根据标识确定安全算法,从而可以保证终端设备和数据传输网元生成的安全算法的一致性,可以减少数据传输网元确定安全算法的过程,以及可以提高安全上下文的生成效率。此外,数据传输网元可以确定安全算法,并将安全算法的标识In the embodiment of the present application, after the terminal device obtains the identifier of the security algorithm, it can directly determine the security algorithm according to the identifier, thereby ensuring the consistency of the security algorithm generated by the terminal device and the data transmission network element, and reducing the number of data transmission network elements to determine the security algorithm process, and can improve the generation efficiency of the security context. In addition, the data transmission network element can determine the security algorithm, and identify the security algorithm
作为一种可能的实施方式,所述额外安全上下文指示包括所述安全算法的标识。As a possible implementation manner, the additional security context indication includes an identifier of the security algorithm.
本申请实施例中,数据传输网元获取安全算法的标识后,可以直接根据标识确定安全算法,从而可以保证终端设备和数据传输网元生成的安全算法的一致性,可以减少数据传输网元确定安全算法的过程,以及可以提高安全上下文的生成效率。In the embodiment of the present application, after the data transmission network element obtains the identifier of the security algorithm, the security algorithm can be directly determined according to the identifier, thereby ensuring the consistency of the security algorithm generated by the terminal device and the data transmission network element, and reducing the need for the data transmission network element to determine the security algorithm. The process of security algorithm, and the generation efficiency of security context can be improved.
作为一种可能的实施方式,所述数据传输网元根据所述额外安全上下文指示获取安全算法,包括:所述数据传输网元根据所述额外安全上下文指示,基于所述终端设备的安全能力和预配置的算法优先级列表获取所述安全算法,所述终端设备的安全能力用于指示所述终端设备支持的所有安全算法。As a possible implementation manner, the data transmission network element acquiring the security algorithm according to the additional security context indication includes: the data transmission network element, according to the additional security context indication, based on the security capability of the terminal device and the The security algorithm is obtained from a preconfigured algorithm priority list, and the security capability of the terminal device is used to indicate all security algorithms supported by the terminal device.
本申请实施例中,数据传输网元可以根据对应的终端设备的安全能力和预配置的算法优先级列表获取安全算法。算法优先级列表是数据传输网元预配置的,对应终端设备可以 预配置自身对应的安全算法。数据传输网元可以通过算法优先级列表确定所有对应的终端设备的安全算法。当终端设备遭受安全攻击时,可能会泄露对应终端设备的安全算法,而不会泄露所有终端设备的安全算法,从而可以提高不同终端设备的通信业务的安全性。In this embodiment of the present application, the data transmission network element may acquire the security algorithm according to the security capability of the corresponding terminal device and the preconfigured algorithm priority list. The algorithm priority list is pre-configured by the data transmission network element, and the corresponding terminal device can pre-configure its own corresponding security algorithm. The data transmission network element can determine the security algorithms of all corresponding terminal devices through the algorithm priority list. When a terminal device suffers a security attack, the security algorithm of the corresponding terminal device may be leaked, but the security algorithms of all terminal devices will not be leaked, thereby improving the security of communication services of different terminal devices.
作为一种可能的实施方式,当所述第一通信业务是公网业务时,所述第二通信业务是私网业务;当所述第一通信业务是私网业务时,所述第二通信业务是公网业务。As a possible implementation manner, when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
本申请实施例中,第一通信业务和第二通信业务为不同的通信业务,在一个通信业务为私网业务的情况下,另一个通信业务为公网业务,可以保证不同的通信业务使用不同的安全上下文进行保护,可以保证公网业务和私网业务间的安全隔离,从而可以提高公网业务和私网业务的安全性。In the embodiment of the present application, the first communication service and the second communication service are different communication services. In the case where one communication service is a private network service, the other communication service is a public network service, which can ensure that different communication services use different services. It can ensure the security isolation between public network services and private network services, thereby improving the security of public network services and private network services.
第四方面公开一种安全上下文生成装置,所述安全上下文生成装置可以为终端设备,也可以为终端设备中的模块(例如,芯片),所述装置可以包括:A fourth aspect discloses an apparatus for generating a security context. The apparatus for generating a security context may be a terminal device or a module (eg, a chip) in the terminal device, and the apparatus may include:
获取单元,用于获取第一安全上下文,所述第一安全上下文用于保护所述终端设备的第一通信业务;an acquiring unit, configured to acquire a first security context, where the first security context is used to protect the first communication service of the terminal device;
发送单元,用于向会话管理功能网元发送会话请求消息,所述会话请求消息用于请求建立第二通信业务的会话,所述第二通信业务与所述第一通信业务不同;a sending unit, configured to send a session request message to the session management function network element, where the session request message is used to request the establishment of a session of a second communication service, where the second communication service is different from the first communication service;
接收单元,用于接收来自所述会话管理功能网元的会话接受消息,所述会话接受消息用于完成建立所述第二通信业务的会话;a receiving unit, configured to receive a session acceptance message from the session management function network element, where the session acceptance message is used to complete the establishment of the session of the second communication service;
获取单元,还用于获取额外生成指示;The obtaining unit is also used to obtain additional generation instructions;
获取单元,还用于根据所述额外生成指示获取第二安全上下文,所述第二安全上下文用于保护所述第二通信业务。The obtaining unit is further configured to obtain a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service.
作为一种可能的实施方式,所述会话请求消息包括第一指示信息,所述第一指示信息用于指示所述终端设备支持生成所述第二安全上下文。As a possible implementation manner, the session request message includes first indication information, where the first indication information is used to indicate that the terminal device supports generating the second security context.
作为一种可能的实施方式,所述获取单元根据所述额外生成指示获取第二安全上下文,所述第二安全上下文用于保护所述第二通信业务包括:As a possible implementation manner, the acquiring unit acquires a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service includes:
根据所述额外生成指示,基于第一密钥获取安全密钥;和/或obtaining a security key based on the first key according to the additional generation indication; and/or
根据所述额外生成指示获取安全算法。A security algorithm is obtained according to the additional generation indication.
作为一种可能的实施方式,所述获取单元根据所述额外生成指示,基于第一密钥获取安全密钥包括:As a possible implementation manner, the obtaining unit obtaining the security key based on the first key according to the additional generation instruction includes:
根据所述额外生成指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥;obtaining the first key based on the AS root key of the first security context according to the additional generation instruction;
根据所述第一密钥生成所述安全密钥。The security key is generated from the first key.
作为一种可能的实施方式,所述额外生成指示包含第一衍生参数的指示,所述获取单元根据所述额外生成指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥包括:As a possible implementation manner, the additional generation instruction includes an indication of a first derivative parameter, and the obtaining unit obtains the first secret key based on the AS root key of the first security context according to the additional generation instruction Keys include:
根据所述第一安全上下文的AS根密钥以及所述第一衍生参数生成所述第一密钥。The first key is generated according to the AS root key of the first security context and the first derived parameter.
作为一种可能的实施方式,所述第一衍生参数为下行PDCP COUNT,所述第一衍生参数的指示为所述下行PDCP COUNT的部分比特位。As a possible implementation manner, the first derivative parameter is a downlink PDCP COUNT, and the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
作为一种可能的实施方式,所述装置还可以包括:As a possible implementation manner, the device may further include:
执行单元,用于执行二次认证;an execution unit for performing secondary authentication;
生成单元,用于在执行所述二次认证过程中生成二次认证密钥;a generating unit, configured to generate a secondary authentication key during the execution of the secondary authentication process;
所述获取单元根据所述额外生成指示,基于第一密钥获取安全密钥包括:The obtaining unit obtaining the security key based on the first key according to the additional generation instruction includes:
根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥;obtaining the first key based on the secondary authentication key according to the additional generation instruction;
根据所述第一密钥生成安全密钥。A security key is generated from the first key.
作为一种可能的实施方式,所述额外生成指示包含第二衍生参数的指示,所述获取单元根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥包括:As a possible implementation manner, the additional generation instruction includes an indication of a second derivative parameter, and according to the additional generation instruction, the obtaining unit, according to the additional generation instruction, obtains the first key based on the secondary authentication key, including:
根据所述第二衍生参数的指示,基于所述二次认证密钥以及所述第二衍生参数生成所述第一密钥。The first key is generated based on the secondary authentication key and the second derivative parameter according to the indication of the second derivative parameter.
作为一种可能的实施方式,所述第二衍生参数为以下参数的一项或多项:下行NAS COUNT、PDU session ID、NSSAI和DNN。As a possible implementation manner, the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
作为一种可能的实施方式,所述获取单元根据所述第一密钥生成安全密钥包括:As a possible implementation manner, the obtaining unit generating the security key according to the first key includes:
根据所述第一密钥以及第三衍生参数生成所述安全密钥。The security key is generated based on the first key and the third derived parameter.
作为一种可能的实施方式,所述额外生成指示包含所述安全算法的标识,所述获取单元根据所述第一密钥以及第三衍生参数生成所述安全密钥包括:As a possible implementation manner, the additional generation instruction includes the identifier of the security algorithm, and the acquiring unit generating the security key according to the first key and the third derivative parameter includes:
根据所述第一密钥以及所述安全算法的标识和类型生成所述安全密钥。The security key is generated based on the first key and the identity and type of the security algorithm.
作为一种可能的实施方式,所述额外生成指示包括所述安全算法的标识。As a possible implementation manner, the additional generation indication includes the identification of the security algorithm.
作为一种可能的实施方式,当所述第一通信业务是公网业务时,所述第二通信业务是私网业务;当所述第一通信业务是私网业务时,所述第二通信业务是公网业务。As a possible implementation manner, when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
第五方面公开一种安全上下文生成装置,该安全上下文生成装置可以为会话管理功能网元,也可以为会话管理功能网元中的模块(例如,芯片),所述装置可以包括:A fifth aspect discloses an apparatus for generating a security context. The apparatus for generating a security context may be a session management function network element, or a module (eg, a chip) in the session management function network element, and the apparatus may include:
接收单元,用于接收来自终端设备的会话请求消息,所述会话请求消息用于请求建立第二通信业务的会话;a receiving unit, configured to receive a session request message from the terminal device, where the session request message is used to request the establishment of a session of the second communication service;
发送单元,用于向数据传输网元发送额外安全上下文指示,所述额外安全上下文指示用于指示生成第二安全上下文,所述第二安全上下文用于保护所述第二通信业务;a sending unit, configured to send an additional security context indication to a data transmission network element, where the additional security context indication is used to instruct to generate a second security context, and the second security context is used to protect the second communication service;
所述发送单元,还用于向所述终端设备发送会话接受消息,所述会话接受消息用于完成建立所述第二通信业务的会话。The sending unit is further configured to send a session acceptance message to the terminal device, where the session acceptance message is used to complete the establishment of the session of the second communication service.
作为一种可能的实施方式,所述会话请求消息包括第一指示信息,所述第一指示信息用于指示所述终端设备支持生成第二安全上下文,所述发送单元向数据传输网元发送额外安全上下文指示包括:As a possible implementation manner, the session request message includes first indication information, where the first indication information is used to instruct the terminal device to support generating the second security context, and the sending unit sends an additional information to the data transmission network element Security context indications include:
当所述第一指示信息指示所述终端设备支持生成所述第二安全上下文时,向所述数据传输网元发送所述额外安全上下文指示。When the first indication information indicates that the terminal device supports generating the second security context, the additional security context indication is sent to the data transmission network element.
作为一种可能的实施方式,所述发送单元向数据传输网元发送额外安全上下文指示包括:As a possible implementation manner, the sending unit sending the additional security context indication to the data transmission network element includes:
根据所述会话请求消息获取所述终端设备的签约信息;Acquire the subscription information of the terminal device according to the session request message;
当所述终端设备的签约信息指示需要生成所述第二安全上下文时,向所述数据传输网元发送所述额外安全上下文指示。When the subscription information of the terminal device indicates that the second security context needs to be generated, the additional security context indication is sent to the data transmission network element.
作为一种可能的实施方式,所述发送单元向数据传输网元发送额外安全上下文指示包 括:As a possible implementation manner, the sending unit to the data transmission network element to send the additional security context indication includes:
当所述会话管理功能网元配置的本地策略指示需要生成所述第二安全上下文时,向所述数据传输网元发送所述额外安全上下文指示。When the local policy configured by the session management function network element indicates that the second security context needs to be generated, the additional security context indication is sent to the data transmission network element.
作为一种可能的实施方式,所述额外安全上下文指示包括安全算法的标识,所述装置还可以包括获取单元,其中:As a possible implementation manner, the additional security context indication includes an identifier of a security algorithm, and the apparatus may further include an acquisition unit, wherein:
获取单元,用于获取所述安全算法。an obtaining unit, configured to obtain the security algorithm.
作为一种可能的实施方式,所述额外安全上下文指示包括第一密钥,所述装置还可以包括:As a possible implementation manner, the additional security context indication includes a first key, and the apparatus may further include:
触发单元,用于触发二次认证;Trigger unit, used to trigger secondary authentication;
所述接收单元,还用于所述二次认证成功后,接收来自认证授权计费网元的二次认证密钥;The receiving unit is further configured to receive the secondary authentication key from the authentication, authorization and accounting network element after the secondary authentication is successful;
获取单元,还用于根据所述二次认证密钥获取所述第一密钥。The obtaining unit is further configured to obtain the first key according to the secondary authentication key.
作为一种可能的实施方式,所述获取单元根据所述二次认证密钥获取所述第一密钥包括:As a possible implementation manner, the acquiring unit acquiring the first key according to the secondary authentication key includes:
根据所述二次认证密钥以及第二衍生参数获取所述第一密钥。The first key is obtained according to the secondary authentication key and the second derivative parameter.
作为一种可能的实施方式,所述第二衍生参数为以下参数的一项或多项:下行NAS COUNT、PDU session ID、NSSAI和DNN。As a possible implementation manner, the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
作为一种可能的实施方式,所述会话接受消息包含第二衍生参数的指示,所述第二衍生参数的指示用于指示根据所述二次认证密钥获取安全密钥。As a possible implementation manner, the session acceptance message includes an indication of a second derivative parameter, where the indication of the second derivative parameter is used to instruct to obtain a security key according to the secondary authentication key.
第六方面公开一种安全上下文生成装置,该安全上下文生成装置可以为数据传输网元,也可以为数据传输网元中的模块(例如,芯片),所述装置可以包括:A sixth aspect discloses an apparatus for generating a security context. The apparatus for generating a security context may be a data transmission network element, or may be a module (eg, a chip) in the data transmission network element, and the apparatus may include:
接收单元,用于接收来自会话管理功能网元的额外安全上下文指示;a receiving unit, configured to receive an additional security context indication from the session management function network element;
获取单元,用于根据所述额外安全上下文指示获取第二安全上下文,所述第二安全上下文用于保护第二通信业务;an acquiring unit, configured to acquire a second security context according to the additional security context indication, where the second security context is used to protect the second communication service;
发送单元,用于向终端设备发送额外生成指示,所述额外生成指示用于指示生成所述第二安全上下文。A sending unit, configured to send an additional generation instruction to the terminal device, where the additional generation instruction is used to instruct to generate the second security context.
作为一种可能的实施方式,所述获取单元具体用于:As a possible implementation manner, the obtaining unit is specifically used for:
根据所述额外安全上下文指示,基于第一密钥获取安全密钥;和/或obtaining a security key based on the first key according to the additional security context indication; and/or
根据所述额外安全上下文指示获取安全算法。A security algorithm is obtained according to the additional security context indication.
作为一种可能的实施方式,所述获取单元,还用于接收来自会话管理功能网元的额外安全上下文指示之前,获取第一安全上下文,所述第一安全上下文用于保护第一通信业务,所述第一通信业务与所述第二通信业务不同。As a possible implementation manner, the acquiring unit is further configured to acquire a first security context before receiving the additional security context indication from the session management function network element, where the first security context is used to protect the first communication service, The first communication service is different from the second communication service.
作为一种可能的实施方式,所述获取单元根据所述额外安全上下文指示,基于第一密钥生成所述安全密钥包括:As a possible implementation manner, the obtaining unit, according to the additional security context indication, generating the security key based on the first key includes:
根据所述额外安全上下文指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥;obtaining the first key based on the AS root key of the first security context according to the additional security context indication;
根据所述第一密钥生成所述安全密钥。The security key is generated from the first key.
作为一种可能的实施方式,所述额外生成指示包含第一衍生参数的指示,所述获取单元根据所述额外安全上下文指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥包括:As a possible implementation manner, the additionally generated indication includes an indication of a first derived parameter, and the obtaining unit obtains the first derived parameter based on the AS root key of the first security context according to the additional security context indication Keys include:
根据所述第一安全上下文的AS根密钥以及所述第一衍生参数生成所述第一密钥。The first key is generated according to the AS root key of the first security context and the first derived parameter.
作为一种可能的实施方式,所述第一衍生参数为下行PDCP COUNT,所述第一衍生参数的指示为所述下行PDCP COUNT的部分比特位。As a possible implementation manner, the first derivative parameter is a downlink PDCP COUNT, and the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
作为一种可能的实施方式,所述额外安全上下文指示包括所述第一密钥,所述获取单元根据所述额外安全上下文指示,基于第一密钥获取所述安全密钥包括:As a possible implementation manner, the additional security context indication includes the first key, and according to the additional security context indication, the obtaining unit, according to the additional security context indication, obtains the security key based on the first key including:
根据所述第一密钥生成所述安全密钥。The security key is generated from the first key.
作为一种可能的实施方式,所述获取单元根据所述第一密钥生成所述安全密钥包括:As a possible implementation manner, the obtaining unit generating the security key according to the first key includes:
根据所述第一密钥以及第三衍生参数生成所述安全密钥。The security key is generated based on the first key and the third derived parameter.
作为一种可能的实施方式,所述额外安全上下文指示包含安全算法的标识,所述获取单元根据所述第一密钥以及第三衍生参数生成所述安全密钥包括:As a possible implementation manner, the additional security context indication includes an identifier of a security algorithm, and the acquiring unit generating the security key according to the first key and the third derived parameter includes:
根据所述第一密钥以及所述安全算法的标识和类型生成所述安全密钥。The security key is generated based on the first key and the identity and type of the security algorithm.
作为一种可能的实施方式,所述额外生成指示包括所述安全算法的标识。As a possible implementation manner, the additional generation indication includes the identification of the security algorithm.
作为一种可能的实施方式,所述额外安全上下文指示包括所述安全算法的标识。As a possible implementation manner, the additional security context indication includes an identifier of the security algorithm.
作为一种可能的实施方式,所述获取单元根据所述额外安全上下文指示获取安全算法包括:As a possible implementation manner, the obtaining unit obtaining the security algorithm according to the additional security context indication includes:
根据所述额外安全上下文指示,基于所述终端设备的安全能力和预配置的算法优先级列表获取所述安全算法,所述终端设备的安全能力用于指示所述终端设备支持的所有安全算法。According to the additional security context indication, the security algorithm is acquired based on the security capability of the terminal device and a preconfigured algorithm priority list, where the security capability of the terminal device is used to indicate all security algorithms supported by the terminal device.
作为一种可能的实施方式,当所述第一通信业务是公网业务时,所述第二通信业务是私网业务;当所述第一通信业务是私网业务时,所述第二通信业务是公网业务。As a possible implementation manner, when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
第七方面公开一种安全上下文生成装置,该安全上下文生成装置可以终端设备或者终端设备内的模块(例如,芯片)。该安全上下文生成装置可以包括:处理器、存储器、输入接口和输出接口,所述输入接口用于接收来自所述装置之外的其它装置的信息,所述输出接口用于向所述装置之外的其它装置输出信息,当所述处理器执行所述存储器存储的计算机程序时,使得所述处理器执行第一方面或第一方面的任一实施方式公开的安全上下文生成方法。A seventh aspect discloses an apparatus for generating a security context, where the apparatus for generating a security context may be a terminal device or a module (eg, a chip) in the terminal device. The security context generating apparatus may include: a processor, a memory, an input interface for receiving information from other apparatuses other than the apparatus, and an output interface for sending information to outside the apparatus The other means of outputting information, when the processor executes the computer program stored in the memory, causes the processor to execute the security context generation method disclosed in the first aspect or any embodiment of the first aspect.
第八方面公开一种安全上下文生成装置,该安全上下文生成装置可以会话管理功能网元或者会话管理功能网元内的模块(例如,芯片)。该安全上下文生成装置可以包括:处理器、存储器、输入接口和输出接口,所述输入接口用于接收来自所述装置之外的其它装置的信息,所述输出接口用于向所述装置之外的其它装置输出信息,当所述处理器执行所述存储器存储的计算机程序时,使得所述处理器执行第二方面或第二方面的任一实施方式公开的安全上下文生成方法。An eighth aspect discloses a security context generating apparatus, where the security context generating apparatus may be a session management function network element or a module (eg, a chip) in the session management function network element. The security context generating apparatus may include: a processor, a memory, an input interface for receiving information from other apparatuses other than the apparatus, and an output interface for sending information to outside the apparatus The other means of outputting information, when the processor executes the computer program stored in the memory, causes the processor to execute the security context generation method disclosed in the second aspect or any embodiment of the second aspect.
第九方面公开一种安全上下文生成装置,该安全上下文生成装置可以数据传输网元或者数据传输网元内的模块(例如,芯片)。该安全上下文生成装置可以包括:处理器、存 储器、输入接口和输出接口,所述输入接口用于接收来自所述装置之外的其它装置的信息,所述输出接口用于向所述装置之外的其它装置输出信息,当所述处理器执行所述存储器存储的计算机程序时,使得所述处理器执行第三方面或第三方面的任一实施方式公开的安全上下文生成方法。A ninth aspect discloses an apparatus for generating a security context, and the apparatus for generating a security context may be a data transmission network element or a module (eg, a chip) in the data transmission network element. The security context generating apparatus may include: a processor, a memory, an input interface for receiving information from other apparatuses other than the apparatus, and an output interface for sending information to outside the apparatus The other means of outputting information, when the processor executes the computer program stored in the memory, causes the processor to execute the security context generation method disclosed in the third aspect or any embodiment of the third aspect.
第十方面公开一种通信系统,该通信系统包括第七方面的安全上下文生成装置、第八方面的安全上下文生成装置和第九方面的安全上下文生成装置。A tenth aspect discloses a communication system, which includes the security context generating apparatus of the seventh aspect, the security context generating apparatus of the eighth aspect, and the security context generating apparatus of the ninth aspect.
第十一方面公开一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序或计算机指令,当该计算机程序或计算机指令运行时,实现如上述各方面公开的安全上下文生成方法。An eleventh aspect discloses a computer-readable storage medium, where a computer program or computer instruction is stored thereon, and when the computer program or computer instruction is executed, the security context generation method disclosed in the above aspects is implemented.
第十二方面公开一种芯片,包括处理器,用于执行存储器中存储的程序,当程序被执行时,使得芯片执行上面的方法。A twelfth aspect discloses a chip including a processor for executing a program stored in a memory, and when the program is executed, the chip executes the above method.
作为一种可能的实施方式,存储器位于芯片之外。As a possible implementation, the memory is located off-chip.
第十三方面公开一种计算机程序产品,该计算机程序产品包括计算机程序代码,当该计算机程序代码被运行时,使得上述的方法被执行。A thirteenth aspect discloses a computer program product, the computer program product comprising computer program code which, when executed, causes the above-mentioned method to be performed.
附图说明Description of drawings
图1是本申请实施例公开的一种网络架构示意图;1 is a schematic diagram of a network architecture disclosed in an embodiment of the present application;
图2是本申请实施例公开的一种安全上下文生成的流程示意图;FIG. 2 is a schematic flowchart of a security context generation disclosed in an embodiment of the present application;
图3是本申请实施例公开的另一种安全上下文生成的流程示意图;3 is a schematic flowchart of another security context generation disclosed in an embodiment of the present application;
图4是本申请实施例公开的又一种安全上下文生成的流程示意图;4 is a schematic flowchart of yet another security context generation disclosed in an embodiment of the present application;
图5是本申请实施例公开的又一种安全上下文生成的流程示意图;5 is a schematic flowchart of yet another security context generation disclosed in an embodiment of the present application;
图6是本申请实施例公开的又一种安全上下文生成的流程示意图;FIG. 6 is a schematic flowchart of yet another security context generation disclosed in an embodiment of the present application;
图7是本申请实施例公开的一种通信装置的结构示意图;FIG. 7 is a schematic structural diagram of a communication device disclosed in an embodiment of the present application;
图8是本发明实施例公开的另一种通信装置的结构示意图;8 is a schematic structural diagram of another communication device disclosed in an embodiment of the present invention;
图9是本发明实施例公开的又一种通信装置的结构示意图;9 is a schematic structural diagram of another communication device disclosed in an embodiment of the present invention;
图10是本发明实施例公开的又一种通信装置的结构示意图;10 is a schematic structural diagram of another communication device disclosed in an embodiment of the present invention;
图11是本发明实施例公开的又一种通信装置的结构示意图。FIG. 11 is a schematic structural diagram of another communication apparatus disclosed in an embodiment of the present invention.
具体实施方式Detailed ways
本申请实施例公开了一种安全上下文生成方法、装置及计算机可读存储介质,用于提高通信业务的安全性。以下分别进行详细说明。The embodiments of the present application disclose a method, device and computer-readable storage medium for generating a security context, which are used to improve the security of communication services. Each of them will be described in detail below.
为了更好地理解本发明实施例公开的一种安全上下文生成方法、装置及计算机可读存储介质,下面先对本发明实施例使用的网络架构进行描述。请参阅图1,图1是本发明实施例公开的一种网络架构示意图。如图1所示,该网络架构可以包括用户设备(user equipment,UE)、(无线)接入网(radio access network,(R)AN)设备、用户功能面(user plane function,UPF)网元、数据网络(data network,DN)、会话管理功能(session management function,SMF)网元、接入与移动管理功能(access and mobility management function,AMF)网元、统一数据管理(unified data management,UDM)网元、鉴权服务器功能(authentication server  function,AUSF)网元、网络切片选择(network slice selection function,NSSF)网元、策略控制功能(policy control function,PCF)网元、应用功能(application function,AF)网元、网络切片选择支撑信息(network slice selection assistance information,NSSAI)网元、网络数据分析功能(network data analytics function,NWDAF)网元、网络开放功能(network exposure function,NEF)网元和网络存储功能(network repository function,NRF)网元。In order to better understand a security context generation method, apparatus, and computer-readable storage medium disclosed in the embodiments of the present invention, the network architecture used in the embodiments of the present invention is first described below. Please refer to FIG. 1. FIG. 1 is a schematic diagram of a network architecture disclosed in an embodiment of the present invention. As shown in FIG. 1 , the network architecture may include user equipment (UE), (radio access network, (R)AN) equipment, and user plane function (UPF) network elements , data network (DN), session management function (session management function, SMF) network element, access and mobility management function (access and mobility management function, AMF) network element, unified data management (unified data management, UDM) network element ) network element, authentication server function (AUSF) network element, network slice selection function (NSSF) network element, policy control function (PCF) network element, application function (application function) , AF) network element, network slice selection assistance information (NSSAI) network element, network data analysis function (NWDAF) network element, network exposure function (network exposure function, NEF) network element and Network Repository Function (NRF) network elements.
UE,又可以称之为终端设备、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等,是一种向用户提供语音和/或数据连通性的设备。终端设备可以为手持终端、笔记本电脑、用户单元(subscriber unit)、蜂窝电话(cellular phone)、智能电话(smart phone)、无线数据卡、个人数字助理(personal digital assistant,PDA)电脑、平板型电脑、无线调制解调器(modem)、手持设备(handheld)、膝上型电脑(laptop computer)、无绳电话(cordless phone)或者无线本地环路(wireless local loop,WLL)台、机器类型通信(machine type communication,MTC)终端,可穿戴设备(例如智能手表、智能手环、计步器等),车载设备(例如,汽车、自行车、电动车、飞机、船舶、火车、高铁等)、虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、智能家居设备(例如,冰箱、电视、空调、电表等)、智能机器人、车间设备、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端,或智慧家庭(smart home)中的无线终端、飞行设备(例如,智能机器人、热气球、无人机、飞机)或其他可以接入网络的设备。图1中终端设备以UE示出,仅作为示例,并不对终端设备进行限定。UE可以通过建立UE-(R)AN设备-UPF-DN之间的会话,即协议数据单元(protocol data unit,PDU)会话,来访问DN。UE, also known as terminal equipment, mobile station (mobile station, MS), mobile terminal (mobile terminal, MT), etc., is a device that provides voice and/or data connectivity to users. The terminal device can be a handheld terminal, a notebook computer, a subscriber unit, a cellular phone, a smart phone, a wireless data card, a personal digital assistant (PDA) computer, a tablet computer , wireless modem (modem), handheld device (handheld), laptop computer (laptop computer), cordless phone (cordless phone) or wireless local loop (wireless local loop, WLL) station, machine type communication (machine type communication, MTC) terminals, wearable devices (such as smart watches, smart bracelets, pedometers, etc.), in-vehicle devices (such as cars, bicycles, electric vehicles, airplanes, ships, trains, high-speed rail, etc.), virtual reality (virtual reality, VR) equipment, augmented reality (AR) equipment, wireless terminals in industrial control (industrial control), smart home equipment (for example, refrigerators, TVs, air conditioners, electricity meters, etc.), intelligent robots, workshop equipment, unmanned driving Wireless terminals in (self driving), wireless terminals in remote medical surgery, wireless terminals in smart grid, wireless terminals in transportation safety, in smart city wireless terminals, or wireless terminals in smart homes, flying devices (eg, smart robots, hot air balloons, drones, airplanes), or other devices that can access the network. The terminal device in FIG. 1 is shown as a UE, which is only an example and does not limit the terminal device. The UE can access the DN by establishing a session between the UE-(R)AN device-UPF-DN, that is, a protocol data unit (PDU) session.
(R)AN设备是为UE提供无线接入的设备,主要负责空口侧的无线资源管理、服务质量(quality of service,QoS)流管理、数据压缩和加密等功能。(R)AN可以与UE通过AS直接进行通信。(R)AN设备可以包括各种形式的基站,例如:宏基站,微基站(也称为小站),中继站,接入点等。(R)AN设备还可以包括无线上网(wireless fidelity,WiFi)接入节点(access point,AP)。(R)AN设备还可以包括全球微波互联接入(worldwide interoperability for microwave access,WiMax)基站(base station,BS)。(R)AN可以是5G网络或5G之后的网络中的网络侧设备或PLMN网络中的网络设备,如可以是下一代基站(generation NodeB,gNB),也可以是下一代演进基站(next generation-evolved NodeB,ng-eNB),还可以是长期演进基站(evloved NodeB,eNB)等。The (R)AN device is a device that provides wireless access for the UE, and is mainly responsible for functions such as radio resource management, quality of service (QoS) flow management, data compression, and encryption on the air interface side. The (R)AN can communicate directly with the UE through the AS. (R)AN devices may include various forms of base stations, such as: macro base stations, micro base stations (also called small stations), relay stations, access points, and the like. The (R)AN device may also include a wireless fidelity (WiFi) access point (AP). The (R)AN device may also include a worldwide interoperability for microwave access (WiMax) base station (BS). (R)AN can be a network-side device in a 5G network or a network after 5G or a network device in a PLMN network, such as a next-generation base station (generation NodeB, gNB), or a next-generation evolved base station (next generation- evolved NodeB, ng-eNB), and may also be a long-term evolved base station (evloved NodeB, eNB).
AMF网元可以通过N1接口接入UE的非接入层(non access stratum,NAS)信令(包括移动管理(mobility management,MM)信令和会话管理(session management,SM)信令)和N2接口接入RAN的信令,完成UE的SM信令的转发以及移动性管理。AMF network elements can access UE's non-access stratum (NAS) signaling (including mobility management (MM) signaling and session management (session management, SM) signaling) and N2 through the N1 interface The interface accesses the signaling of the RAN to complete the forwarding of the UE's SM signaling and mobility management.
SMF网元主要负责移动网络中的会话管理,如会话的建立、修改、释放、更新等流程。具体功能如为用户分配IP地址、选择提供报文转发功能的UPF网元等。SMF与UE的消息可以封分装在NAS消息的会话管理(session management,SM)容器(contianer)中,AMF可以从NAS消息中提取SM contianer内容,接着可以发送给SMF。The SMF network element is mainly responsible for session management in the mobile network, such as session establishment, modification, release, update and other procedures. Specific functions include assigning IP addresses to users and selecting UPF network elements that provide packet forwarding functions. The messages between the SMF and the UE can be encapsulated in the session management (session management, SM) container (contianer) of the NAS message, and the AMF can extract the SM contianer content from the NAS message, and then send it to the SMF.
PCF网元可以负责终端设备策略管理,即包括移动性相关策略,也包括PDU会话相关 策略,如QoS策略、计费策略等。PCF可以管理用户的会话策略。The PCF network element can be responsible for terminal device policy management, including mobility-related policies and PDU session-related policies, such as QoS policies, charging policies, and the like. PCF can manage the user's session policy.
AF网元主要支持与第三代合作伙伴计划(3rd generation partnership project,3GPP)核心网交互来提供服务,来影响业务流路由、接入网能力开放、策略控制等。The AF network element mainly supports interaction with the 3rd generation partnership project (3GPP) core network to provide services to affect service flow routing, access network capability opening, and policy control.
UDM网元负责用户密钥管理、用户标识处理、订阅数据的访问授权、UE的网络功能实体管理、会话和业务连续性管理、短消息推送、合法监听、签约管理、短消息管理、用于管控用户数据,如签约信息的管理。The UDM network element is responsible for user key management, user identification processing, access authorization for subscription data, UE network function entity management, session and service continuity management, short message push, legal interception, subscription management, short message management, and management and control. Management of user data, such as subscription information.
UPF网元主要负责对用户报文进行处理,如转发、计费等。可以从DN接收用户报文,并通过RAN设备传输给UE;也可以通过RAN设备从UE接收用户报文,并转发到DN。UPF网元为UE提供服务的传输资源和调度功能由SMF网元管理控制。The UPF network element is mainly responsible for processing user packets, such as forwarding and charging. The user packet can be received from the DN and transmitted to the UE through the RAN device; the user packet can also be received from the UE through the RAN device and forwarded to the DN. The transmission resources and scheduling functions provided by the UPF network element to serve the UE are managed and controlled by the SMF network element.
DN可以是因特网(internet)、IP多媒体业务(IP multi-media service,IMS)网络、区域网络,即本地网络,例如多接入边缘计算(multi access edge computing,MEC)网络,等。DN是UE的PDU会话访问的目的地。DN中包括或部署有应用服务器,应用服务器可以与UE进行数据传输,为UE提供业务服务。The DN may be the Internet, an IP multi-media service (IMS) network, a regional network, i.e. a local network, such as a multi access edge computing (MEC) network, etc. The DN is the destination of the UE's PDU session access. An application server is included or deployed in the DN, and the application server can perform data transmission with the UE and provide business services for the UE.
AUSF网元可以负责对UE的接入进行认证授权。The AUSF network element may be responsible for authenticating and authorizing the access of the UE.
数据传输网元主要负责对用户报文进行处理,可以是RAN设备,也可以是UPF网元。The data transmission network element is mainly responsible for processing user packets, which can be a RAN device or a UPF network element.
核心网中的以上各个网元也可以称为功能实体,即可以是在专用硬件上实现的网络元件,也可以是在专用硬件上运行的软件实例,或者是在适当平台上虚拟化功能的实例,例如,上述虚拟化平台可以为云平台。Each of the above network elements in the core network may also be referred to as functional entities, that is, network elements implemented on dedicated hardware, software instances running on dedicated hardware, or instances of virtualized functions on an appropriate platform For example, the above-mentioned virtualization platform may be a cloud platform.
需要说明的是,图1所示的系统架构中不限于仅包括图中所示的网元,还可以包括其它未在图中表示的设备或网元,具体本申请在此处不再一一列举。It should be noted that the system architecture shown in FIG. 1 is not limited to including only the network elements shown in the figure, but may also include other devices or network elements that are not shown in the figure. enumerate.
需要说明的是,本申请实施例并不限定核心网中各个网元的分布形式,图1所示的分布形式只是示例性的,本申请不作限定。It should be noted that the embodiments of the present application do not limit the distribution form of each network element in the core network, and the distribution form shown in FIG. 1 is only exemplary and is not limited in the present application.
应理解,本申请中所有网元的名称仅仅作为示例,在未来通信中,如6G中,还可以称为其它名称,或者在未来通信中,如6G中,本申请涉及的网元还可以通过其它具有相同功能的实体或者设备等来替代,本申请对此均不作限定。这里做统一说明,后续不再赘述。It should be understood that the names of all network elements in this application are only examples, and in future communications, such as 6G, they may also be called other names, or in future communications, such as 6G, the network elements involved in this application can also be referred to by It can be replaced by other entities or devices with the same function, which are not limited in this application. A unified description is made here, and will not be repeated in the future.
需要说明的是,图1所示的5G网络架构,并不构成对5G网络的限定。可选地,本申请实施例的方法还适用于未来的各种通信系统,例如6G或者其他通信网络等。It should be noted that the 5G network architecture shown in FIG. 1 does not constitute a limitation on the 5G network. Optionally, the methods in the embodiments of the present application are also applicable to various future communication systems, such as 6G or other communication networks.
此外,上述网络结构中还可以包括认证授权计费(authentication authorization and accounting,AAA)网元,AAA网元可以完成对接入终端设备的认证。In addition, the above-mentioned network structure may further include an authentication authorization and accounting (authentication authorization and accounting, AAA) network element, and the AAA network element can complete the authentication of the access terminal device.
为了更好地理解本申请实施例,下面先对本申请实施例的应用场景进行描述。In order to better understand the embodiments of the present application, the following first describes application scenarios of the embodiments of the present application.
在PNI-NPN场景下中,可以存在三个角色,即终端设备(例如,大众的员工使用的公司电脑等),PLMN(例如,中国移动等),NPN(例如,大众车企等)。终端设备可以通过PLMN同时进行公网业务和私网业务。例如,终端设备可以同时使用即时通信应用和邮件。在考虑到5G网络的安全问题的情况下,终端设备可以与接入网进行安全保护。即UE与(R)AN设备之间可以使用一套安全上下文进行通信保护,从而可以保证用户与网络之间用户面数据流的安全性。In the PNI-NPN scenario, there can be three roles, namely terminal equipment (for example, company computers used by Volkswagen employees, etc.), PLMN (for example, China Mobile, etc.), NPN (for example, Volkswagen car companies, etc.). Terminal equipment can simultaneously perform public network services and private network services through PLMN. For example, terminal devices can use instant messaging applications and emails at the same time. Taking into account the security issues of the 5G network, the terminal device can perform security protection with the access network. That is, a set of security contexts can be used for communication protection between the UE and the (R)AN device, so that the security of the user plane data flow between the user and the network can be guaranteed.
为了便于理解本申请,首先在此介绍本申请实施例涉及的相关技术知识。In order to facilitate the understanding of the present application, the related technical knowledge involved in the embodiments of the present application is first introduced here.
安全上下文是可以对通信内容进行安全保护的上下文,安全保护可以包括机密性保护和/或完整性保护。上下文至少包含安全密钥和安全算法。可选的,上下文还可以包含安全策略,安全激活指示,新鲜性参数等。当通信内容是通信业务时,用于机密性保护的安全密钥可以是Kup-enc,用于机密性保护的安全算法可以是5G加密算法(encryption algorithm for 5G,NEA)或者EPS加密算法(evolved packet system encryption algorithm,EEA),用于完整性保护的安全密钥可以是Kup-int,用于完整性保护的安全算法可以是5G完整性算法(intergrity algorithm for 5G,NIA)或者EPS完整性算法(evolved packet system integrity algorithm,EIA)。通信方可以将安全密钥以及安全算法配置到PDCP层,发送方可以使用安全密钥以及安全算法对发送的通信内容进行加密和/或完整性保护,接收方可以使用相同的安全密钥以及安全算法对接收的通信内容进行解密和/或完整性校验。The security context is a context in which security protection of communication content can be performed, and the security protection may include confidentiality protection and/or integrity protection. A context contains at least a security key and a security algorithm. Optionally, the context may also include security policies, security activation instructions, freshness parameters, and the like. When the communication content is a communication service, the security key used for confidentiality protection can be Kup-enc, and the security algorithm used for confidentiality protection can be 5G encryption algorithm (encryption algorithm for 5G, NEA) or EPS encryption algorithm (evolved packet system encryption algorithm, EEA), the security key used for integrity protection can be Kup-int, and the security algorithm used for integrity protection can be 5G integrity algorithm (intergrity algorithm for 5G, NIA) or EPS integrity algorithm (evolved packet system integrity algorithm, EIA). The communication party can configure the security key and security algorithm to the PDCP layer, the sender can use the security key and security algorithm to encrypt and/or integrity protect the sent communication content, and the receiver can use the same security key and security algorithm. Algorithms decrypt and/or integrity check received communications.
通信业务是终端设备通过移动网络与服务器提供的服务进行通信的用户面流量。可以包含公网业务和/或私网业务。其中,公网业务代表服务器提供的服务是可以被公共访问的,例如,服务提供商提供的应用。私网业务代表服务器提供的服务是受限制访问的,例如,企业私有的运营应用。终端设备针对不同的业务可能需要与移动网络建立不同的会话。The communication service is the user plane traffic that the terminal device communicates with the service provided by the server through the mobile network. It can include public network services and/or private network services. The service provided by the public network service representative server can be publicly accessed, for example, the application provided by the service provider. The services provided by the private network agent server are restricted access, for example, the private operation application of the enterprise. The terminal equipment may need to establish different sessions with the mobile network for different services.
UE与(R)AN设备之间可以使用加密密钥kup-enc和加密算法对用户面流量进行加密保护,以及使用完整性保护密钥kup-int和完整性保护算法对用户面流量进行完整性保护。安全密钥可以包括加密密钥和完整性保护密钥,安全算法可以包括加密算法和完整性保护算法。安全上下文可以包括安全密钥和/或安全算法。用户面流量可以通过不同的数据无线承载(data radio bearer,DRB)发送,不同的DRB可能开启或关闭加密保护或者完整性保护。当DRB开启保护时,所有开启保护的DRB所使用的密钥和算法都是相同的,即所有的终端设备与接入网设备之间均可以使用同一套安全上下文进行通信保护。此时,当攻击者获得公网业务使用的安全密钥时,也就获得了私网业务的安全密钥,从而可以得到私网的业务流量,反之亦然。例如,攻击者可以通过破解公网业务使用的安全算法获取到公网业务使用的安全密钥,从而可以获取到公网业务的安全上下文。当攻击者获取到公网的安全上下文也就可以获取到私网的安全上下文,进而通过私网的安全上下文可以得到私网的业务流量。上述保护方式并没有实现公网业务保护和私网业务保护的安全隔离,因此,在PNI-NPN中如何实现公网业务和私网业务的安全隔离是一个亟待解决的技术问题。The encryption key kup-enc and the encryption algorithm can be used between the UE and the (R)AN device to encrypt and protect the user plane traffic, and the integrity protection key kup-int and the integrity protection algorithm can be used to protect the integrity of the user plane traffic. Protect. The security key may include an encryption key and an integrity protection key, and the security algorithm may include an encryption algorithm and an integrity protection algorithm. The security context may include security keys and/or security algorithms. User plane traffic can be sent through different data radio bearers (DRBs), and different DRBs may enable or disable encryption protection or integrity protection. When DRBs enable protection, the keys and algorithms used by all DRBs that enable protection are the same, that is, all terminal devices and access network devices can use the same set of security contexts for communication protection. At this time, when the attacker obtains the security key used by the public network service, he also obtains the security key of the private network service, thereby obtaining the service traffic of the private network, and vice versa. For example, an attacker can obtain the security key used by the public network service by deciphering the security algorithm used by the public network service, so as to obtain the security context of the public network service. When an attacker obtains the security context of the public network, he can also obtain the security context of the private network, and then obtain the service traffic of the private network through the security context of the private network. The above protection methods do not realize the security isolation of public network service protection and private network service protection. Therefore, how to realize the security isolation of public network services and private network services in PNI-NPN is a technical problem that needs to be solved urgently.
基于上述网络架构,请参阅图2,图2是本发明实施例公开的一种安全上下文生成方法的流程示意图。如图2所示,该安全上下文生成方法可以包括以下步骤。Based on the above network architecture, please refer to FIG. 2 , which is a schematic flowchart of a method for generating a security context disclosed in an embodiment of the present invention. As shown in FIG. 2, the security context generation method may include the following steps.
201、终端设备获取第一安全上下文。201. A terminal device acquires a first security context.
当终端设备需要对数据进行保护时,终端设备可以生成第一安全上下文,以便可以使用第一安全上下文对数据进行安全保护。第一安全上下文可以包括第一安全密钥,和/或第一安全算法。第一安全密钥可以包括第一加密密钥,和/或第一完整性保护密钥。第一安全算法可以包括第一加密算法,和/或第一完整性保护算法。第一安全上下文可以保护终端设备的第一通信业务。第一通信业务可以是公网业务,也可以是私网业务。应理解,上述数据可以为用户面数据。When the terminal device needs to protect the data, the terminal device can generate the first security context, so that the first security context can be used to perform security protection on the data. The first security context may include a first security key, and/or a first security algorithm. The first security key may include a first encryption key, and/or a first integrity protection key. The first security algorithm may include a first encryption algorithm, and/or a first integrity protection algorithm. The first security context may protect the first communication service of the terminal device. The first communication service may be a public network service or a private network service. It should be understood that the above data may be user plane data.
其中,终端设备在注册到PLMN,并请求建立第一通信业务的会话后,终端设备和接入网设备可以获得保护第一通信业务的第一安全上下文,并可以使用第一安全上下文保护第一通信业务。终端设备获取第一安全上下文的流程可以参考3GPP TS 33.501相关描述。Wherein, after the terminal device registers with the PLMN and requests to establish a session of the first communication service, the terminal device and the access network device can obtain the first security context for protecting the first communication service, and can use the first security context to protect the first security context. communication business. For the process of obtaining the first security context by the terminal device, reference may be made to the relevant description of 3GPP TS 33.501.
202、终端设备向会话管理功能网元发送会话请求消息。202. The terminal device sends a session request message to the session management function network element.
终端设备可以向会话管理功能网元发送会话请求消息,对应地,会话管理功能网元可以接收来自终端设备的会话请求消息。具体地,终端设备可以先向接入和移动管理网元发送NAS消息,NAS消息可以包括SM消息。接入与移动管理功能网元接收到来自终端设备的NAS消息之后,可以先从NAS消息中提取SM消息,之后可以将该SM消息发送给会话管理功能网元。会话请求消息可以是SM消息。SM消息可以是PDU会话建议请求消息或者PDU会话修改请求消息。会话请求消息可以用于请求建立第二通信业务的会话。NAS消息可以包括DNN和/或NSSAI,接入和移动管理网元可以从NAS消息中可以提取DNN和/或NSSAI,并发送给会话管理功能网元。此外,当数据传输网元是用户面功能网元时,会话请求消息可以包括终端设备的标识,终端设备的标识可以用于确定用户面功能网元。应理解,会话请求消息是指完成请求建立第二通信业务的会话,并不对这一消息的名称进行限定。The terminal device may send a session request message to the session management function network element, and correspondingly, the session management function network element may receive the session request message from the terminal device. Specifically, the terminal device may first send a NAS message to the access and mobility management network element, and the NAS message may include an SM message. After receiving the NAS message from the terminal device, the access and mobility management function network element can first extract the SM message from the NAS message, and then can send the SM message to the session management function network element. The session request message may be an SM message. The SM message may be a PDU Session Proposal Request message or a PDU Session Modification Request message. The session request message may be used to request the establishment of a session for the second communication service. The NAS message may include DNN and/or NSSAI, and the access and mobility management network element may extract the DNN and/or NSSAI from the NAS message and send it to the session management function network element. In addition, when the data transmission network element is a user plane function network element, the session request message may include the identification of the terminal device, and the identification of the terminal device may be used to determine the user plane function network element. It should be understood that the session request message refers to a session for completing a request to establish a second communication service, and the name of this message is not limited.
会话请求消息可以包括第一指示信息,第一指示信息可以指示终端设备支持生成第二安全上下文。即可以理解为,第一指示信息可以指示终端设备支持第二安全上下文的生成,第一指示信息也可以用于请求生成第二安全上下文,第一指示信息还可以用于指示该会话需要实现安全隔离。第二安全上下文可以包括第二安全算法,和/或第二安全密钥。第二安全算法可以包括第二加密算法,和/或第二完整性保护算法。第二安全密钥可以包括第二加密密钥,和/或第二完整性保护密钥。The session request message may include first indication information, and the first indication information may indicate that the terminal device supports generating the second security context. That is, it can be understood that the first indication information can indicate that the terminal device supports the generation of the second security context, the first indication information can also be used to request the generation of the second security context, and the first indication information can also be used to indicate that the session needs to implement security. isolation. The second security context may include a second security algorithm, and/or a second security key. The second security algorithm may include a second encryption algorithm, and/or a second integrity protection algorithm. The second security key may include a second encryption key, and/or a second integrity protection key.
第一通信业务与第二通信业务为不同的通信业务。第二通信业务可以是公网业务,也可以是私网业务。当第一通信业务是公网业务时,第二通信业务可以是私网业务;当第一通信业务是私网业务时,第二通信业务可以是公网业务。The first communication service and the second communication service are different communication services. The second communication service may be a public network service or a private network service. When the first communication service is a public network service, the second communication service may be a private network service; when the first communication service is a private network service, the second communication service may be a public network service.
第一安全上下文与第二安全上下文为不同的安全上下文,可以理解为,第二安全密钥与第一安全密钥不同,但第二安全算法与第一安全算法相同;也可以理解为第二安全算法与第一安全算法不同,但第二安全密钥与第一安全密钥相同;还可以理解为第二安全密钥与第一安全密钥不同,以及第二安全算法与第一安全算法不同。第二安全上下文可以保护第二通信业务,第一安全上下文和第二安全上下文可以分别保护不同的通信业务。The first security context and the second security context are different security contexts. It can be understood that the second security key is different from the first security key, but the second security algorithm is the same as the first security algorithm; it can also be understood as the second security key. The security algorithm is different from the first security algorithm, but the second security key is the same as the first security key; it can also be understood that the second security key is different from the first security key, and the second security algorithm is different from the first security algorithm. different. The second security context may protect the second communication service, and the first security context and the second security context may respectively protect different communication services.
203、会话管理功能网元向数据传输网元发送额外安全上下文指示。203. The session management function network element sends an additional security context indication to the data transmission network element.
会话管理功能网元接收到来自终端设备的会话请求消息之后,可以先确定是否需要为终端设备生成第二安全上下文,当确定出终端设备需要生成第二安全上下文时,可以向数据传输网元发送额外安全上下文指示,对应地,数据传输网元可以接收来自会话管理功能网元的额外安全上下文指示。当确定出终端设备不需要生成第二安全上下文时,可以不执行步骤203-步骤207。After the session management function network element receives the session request message from the terminal device, it can first determine whether the second security context needs to be generated for the terminal device. When it is determined that the terminal device needs to generate the second security context, it can send the message to the data transmission network element Additional security context indication, correspondingly, the data transmission network element may receive the additional security context indication from the session management function network element. When it is determined that the terminal device does not need to generate the second security context, steps 203 to 207 may not be performed.
一种可能的实现方式,会话管理功能网元接收到来自终端设备的会话请求消息之后,可以根据第一指示信息判断终端设备是否支持第二安全上下文的生成。一种方式中,第一指示信息是显式地指示时,会话管理功能网元可以判断会话请求消息是否包括第一指示信息,当判断出会话请求消息包括第一指示信息时,表明终端设备支持第二安全上下文的生 成。当判断出会话请求消息不包括第一指示信息时,表明终端设备不支持第二安全上下文的生成。另一种方式中,第一指示信息是隐式地指示。例如,会话请求消息可以包括1bit,在这个比特为特定值,如0或1,的情况下,表明终端设备支持第二安全上下文的生成,在这个比特不是上述特定值或者不包括上述特定值的情况下,表明会话请求消息终端设备不支持第二安全上下文的生成。In a possible implementation manner, after the session management function network element receives the session request message from the terminal device, it can judge whether the terminal device supports the generation of the second security context according to the first indication information. In one way, when the first indication information is an explicit indication, the session management function network element can judge whether the session request message includes the first indication information, and when it is judged that the session request message includes the first indication information, it indicates that the terminal device supports the Generation of a second security context. When it is determined that the session request message does not include the first indication information, it indicates that the terminal device does not support the generation of the second security context. In another manner, the first indication information is an implicit indication. For example, the session request message may include 1 bit. If this bit is a specific value, such as 0 or 1, it indicates that the terminal device supports the generation of the second security context. If this bit is not the above-mentioned specific value or does not include the above-mentioned specific value In this case, it indicates that the session request message terminal device does not support the generation of the second security context.
另一种可能的实现方式,会话管理功能网元接收到来自终端设备的会话请求消息之后,可以获取终端设备的签约信息,之后可以根据签约信息确定终端设备是否需要生成第二安全上下文。当签约信息包括第二指示信息时,表明终端设备需要生成第二安全上下文。否则,表明终端设备不需要生成第二安全上下文。其中,第二指示信息可以指示终端设备支持生成第二安全上下文,即指示终端设备支持第二安全上下文的生成,或者第二指示信息用于请求生成第二安全上下文,或者第二指示信息用于指示该会话需要实现安全隔离。会话管理功能网元可以从UDM网元或者PCF网元获取终端设备的签约信息。In another possible implementation manner, after receiving the session request message from the terminal device, the session management function network element can obtain the subscription information of the terminal device, and then can determine whether the terminal device needs to generate the second security context according to the subscription information. When the subscription information includes the second indication information, it indicates that the terminal device needs to generate the second security context. Otherwise, it indicates that the terminal device does not need to generate the second security context. The second indication information may indicate that the terminal device supports the generation of the second security context, that is, indicates that the terminal device supports the generation of the second security context, or the second indication information is used to request the generation of the second security context, or the second indication information is used to generate the second security context. Indicates that this session requires security isolation. The network element of the session management function can obtain the subscription information of the terminal device from the UDM network element or the PCF network element.
又一种可能的实现方式,会话管理功能网元可以预配置或默认配置有本地策略,因此,接收到来自终端设备的会话请求消息之后,可以根据该会话的相关信息以及本地策略判断终端设备是否需要生成第二安全上下文。例如,本地策略为对于特定的会话需要使用不同安全上下文进行保护,则当会话管理功能网元接收到来自终端设备的DNN和/或NSSAI之后,可以根据本地策略判断该DNN和/或NSSAI对应业务是否需要使用不同的安全上下文进行保护,当判断出需要时,会话管理功能网元确定需要为UE生成第二安全上下文。In another possible implementation, the session management function network element may be pre-configured or configured with a local policy by default. Therefore, after receiving the session request message from the terminal device, it can determine whether the terminal device is based on the relevant information of the session and the local policy. A second security context needs to be generated. For example, if the local policy is to use different security contexts for protection for a specific session, after the session management function network element receives the DNN and/or NSSAI from the terminal device, it can determine the corresponding service of the DNN and/or NSSAI according to the local policy Whether it is necessary to use different security contexts for protection, when judging that it is necessary, the network element of the session management function determines that a second security context needs to be generated for the UE.
应理解,会话管理功能网元可以通过上述的一种或多种方式确定是否需要生成第二安全上下文。即可以通过第一指示信息确定终端设备是否支持第二安全上下文的生成,当通过第一指示信息确定终端设备支持第二安全上下文的生成时,确定需要生成第二安全上下文;也可以通过签约信息确定是否需要生成第二安全上下文;还可以通过本地策略确定是否需要生成第二安全上下文。还可以通过第一指示信息和签约信息确定是否需要生成第二安全上下文,当第一指示信息确定终端设备支持第二安全上下文的生成,且过签约信息确定需要生成第二安全上下文时,确定需要生成第二安全上下文;还可以通过第一指示信息和本地策略确定是否需要生成第二安全上下文,当第一指示信息确定终端设备支持第二安全上下文的生成,且过本地策略确定需要生成第二安全上下文时,确定需要生成第二安全上下文。It should be understood that the session management function network element may determine whether the second security context needs to be generated through one or more of the above-mentioned manners. That is, whether the terminal device supports the generation of the second security context can be determined through the first indication information, and when it is determined through the first indication information that the terminal device supports the generation of the second security context, it is determined that the second security context needs to be generated; or the subscription information can be used to determine whether the terminal device supports the generation of the second security context. It is determined whether the second security context needs to be generated; it can also be determined through the local policy whether the second security context needs to be generated. It can also be determined whether the second security context needs to be generated through the first indication information and the subscription information. When the first indication information determines that the terminal device supports the generation of the second security context, and it is determined through the subscription information that the second security context needs to be generated, it is determined that the second security context needs to be generated. The second security context is generated; it can also be determined whether the second security context needs to be generated through the first indication information and the local policy. When the first indication information determines that the terminal device supports the generation of the second security context, and the local policy determines that the second security context needs to be generated When generating a security context, it is determined that a second security context needs to be generated.
额外安全上下文指示可以用于指示生成第二安全上下文。额外安全上下文指示可以显式地指示。例如,额外安全上下文指示可以包括1bit,当这个bit的值为1时,可以指示生成第二安全上下文,当这个bit的值为0时,可以指示不生成第二安全上下文。额外安全上下文指示也可以隐式地指示。例如,额外安全上下文指示可以是生成第二安全上下文所需要的信元,例如密钥、算法、标志位、指示符、索引、传输资源等向数据传输网元发送额外安全上下文指示。例如,当数据传输网元接收到密钥时,表明会话管理功能网元指示数据传输网元生成第二安全上下文。The additional security context indication may be used to instruct the generation of the second security context. Additional security context indications may be indicated explicitly. For example, the additional security context indication may include 1 bit, when the value of this bit is 1, it may indicate that the second security context is generated, and when the value of this bit is 0, it may indicate that the second security context is not generated. Additional security context indications may also be indicated implicitly. For example, the additional security context indication may be an information element required to generate the second security context, such as a key, algorithm, flag bit, indicator, index, transmission resource, etc., to send the additional security context indication to the data transmission network element. For example, when the data transmission network element receives the key, it indicates that the session management function network element instructs the data transmission network element to generate the second security context.
可选的,会话管理功能网元确定出需要为终端设备生成第二安全上下文的生成之后,可以确定安全算法。Optionally, after the session management function network element determines that the second security context needs to be generated for the terminal device, the security algorithm may be determined.
一种可能的实现方式,会话管理功能网元可以预配置DNN与安全算法之间的映射关系, 当确定终端设备需要生成第二安全上下文时,可以直接根据终端设备上报的DNN和上述映射关系查找到其使用的安全算法。A possible implementation manner, the session management function network element can pre-configure the mapping relationship between the DNN and the security algorithm, when it is determined that the terminal device needs to generate the second security context, it can be directly searched according to the DNN reported by the terminal device and the above-mentioned mapping relationship. to the security algorithm it uses.
另一种可能的实现方式,会话管理功能网元可以预配置DNN与算法优先级列表之间的映射关系,当确定终端设备需要生成第二安全上下文时,可以根据终端设备上报的DNN和上述映射关系查找到算法优先级列表,再根据终端设备的安全能力以及算法优先级列表获得其使用的安全算法。其中,算法优先级列表是一个体现使用优先级的算法列表,可以表示为优先级1:算法B,优先级2:算法A,优先级3:算法C,优先级数字越小可以表示优先度越高。终端设备的安全能力是由终端设备上报的,可以表示终端设备可以支持的算法。例如:算法A,算法B,算法C,则由于终端设备同时支持A,B,C三个算法,但由于算法B优先级最高,因此最终获得算法B作为安全算法。In another possible implementation manner, the session management function network element may pre-configure the mapping relationship between the DNN and the algorithm priority list, and when it is determined that the terminal device needs to generate the second security context, the DNN and the above mapping reported by the terminal device may be used. The relationship finds the algorithm priority list, and then obtains the security algorithm used by the terminal device according to the security capability and the algorithm priority list. Among them, the algorithm priority list is an algorithm list reflecting the use priority, which can be expressed as priority 1: algorithm B, priority 2: algorithm A, priority 3: algorithm C, the smaller the priority number, the higher the priority. high. The security capability of the terminal device is reported by the terminal device, which can indicate the algorithms that the terminal device can support. For example: Algorithm A, Algorithm B, Algorithm C, since the terminal device supports the three algorithms A, B, and C at the same time, but because Algorithm B has the highest priority, Algorithm B is finally obtained as the security algorithm.
当会话管理功能网元确定安全算法之后,额外安全上下文指示可以包括安全算法的标识。After the session management function network element determines the security algorithm, the additional security context indication may include the identification of the security algorithm.
可选的,会话管理功能网元确定出需要为终端设备生成第二安全上下文之后,可以确定第一密钥。Optionally, after the session management function network element determines that the second security context needs to be generated for the terminal device, the first key may be determined.
第一密钥也可以根据二次认证密钥获得,其中,会话管理功能网元从认证授权计费网元接收二次认证密钥。The first key may also be obtained from a secondary authentication key, wherein the session management function network element receives the secondary authentication key from the authentication authorization and accounting network element.
会话管理功能网元可以根据二次认证密钥以及第二衍生参数生成第一密钥。会话管理功能网元可以触发终端设备的二次认证。例如,当会话管理功能网元确认需要生成第二安全上下文时,会话管理功能网元可以根据DNN和终端设备的签约信息触发执行终端设备和认证授权计费网元的二次认证。在终端设备二次认证成功之后,认证授权计费网元可以向会话管理功能网元发送二次认证密钥。会话管理功能网元可以接收来自认证授权计费网元的二次认证密钥。第二衍生参数可以是新鲜性参数,第二衍生参数可以包含上行或下行NAS COUNT、NSSAI、DNN和PDU session ID中的一项或多项。NAS COUNT可以保存在终端设备的非接入层上下文中,每推衍一次密钥NAS COUNT更新一次,可以防止连续两次生成的第一密钥相同。例如,假设NAS COUNT的值为a,则使用NAS COUNT推衍一次之后,可以将NAS COUNT更新为a+b,因此,第二次推衍可以使用更新后的NAS COUNT的值。b可以为1,也可以2,还可以为其它值,在此不加限定。每次更新时b的值可以相同,即NAS COUNT的值是按照b为步长进行递增或递减的,也可以不同。会话管理功能网元可以通过会话请求消息从终端设备获取NSSAI、DNN和PDU session ID。由于不同终端设备或会话管理网元接入的切片(NSSAI标识)、数据网络(DNN标识)和PDU会话(PDU session ID标识)不同,因而生成的第一密钥可以不同。The session management function network element may generate the first key according to the secondary authentication key and the second derived parameter. The session management function network element can trigger the secondary authentication of the terminal device. For example, when the session management function network element confirms that the second security context needs to be generated, the session management function network element can trigger the execution of secondary authentication between the terminal device and the authentication authorization and charging network element according to the subscription information of the DNN and the terminal device. After the secondary authentication of the terminal device is successful, the authentication, authorization and accounting network element may send the secondary authentication key to the session management function network element. The session management function network element can receive the secondary authentication key from the authentication, authorization and accounting network element. The second derived parameter may be a freshness parameter, and the second derived parameter may include one or more of the uplink or downlink NAS COUNT, NSSAI, DNN, and PDU session ID. The NAS COUNT can be stored in the non-access stratum context of the terminal device, and the NAS COUNT is updated every time the key is derived, which can prevent the first key generated two consecutive times from being the same. For example, if the value of NAS COUNT is a, after derivation using NAS COUNT once, the NAS COUNT can be updated to a+b. Therefore, the updated value of NAS COUNT can be used for the second derivation. b may be 1 or 2, and may also be other values, which are not limited here. The value of b can be the same for each update, that is, the value of NAS COUNT is incremented or decremented according to the step size of b, or it can be different. The session management function network element can obtain the NSSAI, DNN and PDU session ID from the terminal device through the session request message. Since the slices (NSSAI identifiers), data networks (DNN identifiers) and PDU sessions (PDU session ID identifiers) accessed by different terminal devices or session management network elements are different, the generated first keys may be different.
当会话管理功能网元确定第一密钥之后,额外安全上下文指示可以包括第一密钥。After the session management function network element determines the first key, the additional security context indication may include the first key.
应理解,在生成第二安全上下文的方式不同的情况下,生成第二安全上下文所需信息不同。因此,额外安全上下文指示可以根据第二安全上下文生成方式的不同,包含不同的信息。例如,额外安全上下文指示可以为显示地指示,也可以为安全算法的标识,还可以为第一密钥,额外安全上下文指示还可以包含显示地指示和安全算法的标识,还可以包含第一密钥和安全算法的标识。It should be understood that when the manner of generating the second security context is different, the information required for generating the second security context is different. Therefore, the additional security context indication may contain different information according to different ways of generating the second security context. For example, the additional security context indication may be an explicit indication, an identification of a security algorithm, or a first key, and the additional security context indication may also include an explicit indication and an identification of the security algorithm, and may also include the first encryption key. key and the identity of the security algorithm.
会话管理功能网元可以通过不同的消息、信令等向数据传输网元发送额外安全上下文 指示。例如,在数据传输网元为接入网设备的情况下,会话管理功能网元可以将额外安全上下文指示封装在N2SM信息(Information)容器中发送给数据传输网元;在数据传输网元为用户面功能网元的情况下,会话管理功能网元可以将额外安全上下文指示封装在N4会话(Session)建立(Establishment)请求(Request)消息中发送给数据传输网元。The session management function network element may send additional security context indications to the data transmission network element through different messages, signaling, etc. For example, when the data transmission network element is an access network device, the session management function network element can encapsulate the additional security context indication in an N2SM information (Information) container and send it to the data transmission network element; when the data transmission network element is a user In the case of the plane function network element, the session management function network element may encapsulate the additional security context indication in an N4 session (Session) establishment (Establishment) request (Request) message and send it to the data transmission network element.
204、数据传输网元根据额外安全上下文指示获取第二安全上下文。204. The data transmission network element acquires the second security context according to the additional security context indication.
数据传输网元接收到来自会话管理功能网元的额外安全上下文指示之后,可以根据额外安全上下文指示获取第二安全上下文。After receiving the additional security context indication from the session management function network element, the data transmission network element may acquire the second security context according to the additional security context indication.
数据传输网元可以根据额外安全上下文指示获取安全算法。The data transmission network element can obtain the security algorithm according to the additional security context indication.
一种可能实现的方式,数据传输网元中可以预配置算法优先级列表。算法优先级列表可以包括终端设备的安全能力与安全算法的优先级信息。数据传输网元可以根据算法优先级列表确定安全算法。其中,数据传输网元可以从存储的终端设备的上下文中获取上述终端设备的安全能力。当数据传输网元具备第一安全上下文时,由于数据传输网元需要生成同一终端设备的第一安全算法和第二安全算法,为了保证第一安全算法和第二安全算法不同,第一安全算法与第二安全算法对应的算法优先级列表需要不同。对于相同的终端设备,数据传输网元使用同样的算法优先级列表,很可能会导致最终确定的第一安全算法和第二安全算法相同,从而未能达到安全隔离的目的。应理解,根据额外安全上下文指示获取的安全算法是第二安全算法。In a possible implementation manner, the algorithm priority list may be preconfigured in the data transmission network element. The algorithm priority list may include the security capability of the terminal device and the priority information of the security algorithm. The data transmission network element can determine the security algorithm according to the algorithm priority list. The data transmission network element may acquire the security capability of the above-mentioned terminal device from the stored context of the terminal device. When the data transmission network element has the first security context, since the data transmission network element needs to generate the first security algorithm and the second security algorithm of the same terminal device, in order to ensure that the first security algorithm and the second security algorithm are different, the first security algorithm The algorithm priority list corresponding to the second security algorithm needs to be different. For the same terminal device, the data transmission network elements use the same algorithm priority list, which is likely to cause the finalized first security algorithm and the second security algorithm to be the same, thus failing to achieve the purpose of security isolation. It should be understood that the security algorithm obtained according to the additional security context indication is the second security algorithm.
另一种可能实现的方式,当额外安全上下文指示包括安全算法的标识时,数据传输网元可以将该标识对应的安全算法确定为安全算法。In another possible implementation manner, when the additional security context indicates an identifier including a security algorithm, the data transmission network element may determine the security algorithm corresponding to the identifier as the security algorithm.
又一种可能实现的方式,当数据传输网元具备第一安全上下文时,数据传输网元可以根据额外安全上下文指示,从第一安全上下文的第一安全算法获得安全算法。In another possible implementation manner, when the data transmission network element has the first security context, the data transmission network element may obtain the security algorithm from the first security algorithm of the first security context according to the indication of the additional security context.
数据传输网元可以根据额外安全上下文指示,基于第一密钥获取安全密钥。可以理解为,额外安全上下文指示可以触发数据传输网元基于第一密钥获取安全密钥。也可以理解为,数据传输网元可以响应额外安全上下文指示,基于第一密钥获取安全密钥。The data transmission network element may obtain the security key based on the first key according to the additional security context indication. It can be understood that the additional security context indication can trigger the data transmission network element to acquire the security key based on the first key. It can also be understood that the data transmission network element may respond to the additional security context indication and obtain the security key based on the first key.
在一种情况下,数据传输网元可以先确定第一密钥,之后可以基于第一密钥获取安全密钥。In one case, the data transmission network element may first determine the first key, and then may obtain the security key based on the first key.
当数据传输网元具备第一安全上下文时,数据传输设备可以根据额外安全上下文指示,基于第一安全上下文的AS根密钥获取第一密钥,即根据第一安全上下文的AS根密钥确定(或生成)第一密钥。AS根密钥可以是密钥K gNB,也可以是K eNB,还可以是下一跳(next hop,NH)。 When the data transmission network element has the first security context, the data transmission device may obtain the first key based on the AS root key of the first security context according to the indication of the additional security context, that is, determine according to the AS root key of the first security context (or generate) the first key. The AS root key may be the key K gNB , K eNB , or the next hop (next hop, NH).
一种方式下,数据传输网元可以将第一安全上下文的AS根密钥作为第一密钥。In one way, the data transmission network element may use the AS root key of the first security context as the first key.
另一种方式下,数据传输网元可以根据第一安全上下文的AS根密钥以及第一衍生参数生成第一密钥。第一衍生参数可以为PDCP COUNT,第一衍生参数可以保存在终端设备的接入层上下文中。数据传输网元每使用一次PDCP COUNT,则需要更新PDCP COUNT的值,即每推衍一次密钥更新一次PDCP COUNT的值,可以防止连续两次生成的密钥相同。例如,假设PDCP COUNT的值为a,则使用PDCP COUNT推衍一次之后,可以将PDCP COUNT的值更新为a+b,因此,下一次推衍可以使用更新后的PDCP COUNT的值。b可以为1,也可以2,还可以为其它值,在此不加限定。每次更新时b的值可以相同,即PDCP COUNT的值是 按照b为步长进行递增或递减的,也可以不同。应理解,第一衍生参数可以是新鲜性参数。通过更新PDCP COUNT的值可以使每次生成的安全密钥不同,从而可以提高密钥的安全性,达到安全隔离的效果。In another manner, the data transmission network element may generate the first key according to the AS root key of the first security context and the first derived parameter. The first derived parameter may be the PDCP COUNT, and the first derived parameter may be stored in the access stratum context of the terminal device. Each time the data transmission network element uses the PDCP COUNT, the value of the PDCP COUNT needs to be updated, that is, the value of the PDCP COUNT is updated every time the key is derived, which can prevent two consecutively generated keys from being the same. For example, assuming that the value of PDCP COUNT is a, after using PDCP COUNT to derive once, the value of PDCP COUNT can be updated to a+b. Therefore, the updated value of PDCP COUNT can be used for the next derivation. b may be 1 or 2, and may also be other values, which are not limited here. The value of b can be the same for each update, that is, the value of PDCP COUNT is incremented or decremented according to the step size of b, or it can be different. It should be understood that the first derived parameter may be a freshness parameter. By updating the value of PDCP COUNT, the security key generated each time can be different, thereby improving the security of the key and achieving the effect of security isolation.
当数据传输网元配置有终端设备的标识与Kn根密钥之间的对应关系,且额外安全上下文指示可以携带有终端设备的标识时,数据传输网元可以根据终端设备的标识获取第一密钥,即根据Kn确定(或生成)第一密钥。其中,Kn根密钥对于每个终端设备都应该不同,可以是预先配置在数据传输网元上的。数据传输网元可以根据这一终端设备的标识以及终端设备与Kn根密钥之间的对应关系确定Kn根密钥。When the data transmission network element is configured with the corresponding relationship between the identifier of the terminal device and the Kn root key, and the additional security context indication can carry the identifier of the terminal device, the data transmission network element can obtain the first key according to the identifier of the terminal device. key, that is, the first key is determined (or generated) according to Kn. The Kn root key should be different for each terminal device, and may be pre-configured on the data transmission network element. The data transmission network element may determine the Kn root key according to the identification of the terminal device and the corresponding relationship between the terminal device and the Kn root key.
一种方式下,数据传输网元可以将Kn根密钥作为第一密钥。In one way, the data transmission network element may use the Kn root key as the first key.
另一种方式下,数据传输网元确定Kn根密钥之后,可以根据Kn根密钥和第一衍生参数生成第一密钥。生成第一密钥的详细描述可以参考上述数据传输网元根据AS根密钥以及第一衍生参数生成第一密钥的相关描述,此处不加赘述。In another manner, after the data transmission network element determines the Kn root key, the first key may be generated according to the Kn root key and the first derived parameter. For a detailed description of the generation of the first key, reference may be made to the above-mentioned description of the generation of the first key by the data transmission network element according to the AS root key and the first derived parameter, which will not be repeated here.
在另一种情况下,额外安全上下文指示可以包括第一密钥。数据传输网元可以先从额外安全上下文指示中提取第一密钥,之后可以根据第一密钥生成安全密钥。In another case, the additional security context indication may include the first key. The data transmission network element may first extract the first key from the additional security context indication, and then may generate the security key according to the first key.
在数据传输网元确定第一密钥之后,可以根据第一密钥进一步生成安全密钥。After the data transmission network element determines the first key, the security key may be further generated according to the first key.
可选地,数据传输网元可以根据第一密钥以及第三衍生参数生成安全密钥。Optionally, the data transmission network element may generate the security key according to the first key and the third derived parameter.
第三衍生参数可以包含安全算法的标识和类型。此时,数据传输网元可以根据获取的安全算法确定安全算法的标识和类型。The third derived parameter may contain the identity and type of the security algorithm. At this time, the data transmission network element may determine the identity and type of the security algorithm according to the acquired security algorithm.
可选的,数据传输网元可以根据额外安全上下文指示获取安全算法,并根据获取的安全算法确定安全算法的标识和类型。Optionally, the data transmission network element may acquire the security algorithm according to the additional security context indication, and determine the identity and type of the security algorithm according to the acquired security algorithm.
可选的,当数据传输网元具备第一安全上下文时,数据传输网元可以根据第一安全上下文的第一安全算法获得安全算法,并根据获取的安全算法确定安全算法的标识和类型。Optionally, when the data transmission network element has the first security context, the data transmission network element may obtain the security algorithm according to the first security algorithm of the first security context, and determine the identity and type of the security algorithm according to the obtained security algorithm.
其中,安全算法的标识可以用于标识获取的安全算法。例如,加密算法可以是EEA1、NEA1等,完整性算法可以是EIA1、NIA1等。The identifier of the security algorithm may be used to identify the acquired security algorithm. For example, the encryption algorithm may be EIA1, NEA1, etc., and the integrity algorithm may be EIA1, NIA1, and so on.
其中,安全算法的类型可以根据当前算法用于不同的场景设置不同的值,例如,当安全算法用于用户面机密性保护时,则安全算法的类型可设置为N-UP-ENC-ALG对应的值0x05,当安全算法用于用户面完整性保护时,则安全算法的类型可设置为N-UP-INT-ALG对应的值0x06。因此,安全算法的类型可以是0x05,也可以是0x06。此外,安全算法的类型还可以是区别于现有0x01-0x06的值,用于指示安全算法用于第二通信业务的用户面机密性保护或者第二通信业务的用户面完整性保护。例如,当前算法用于第二通信业务的用户面机密性保护时,安全算法的类型可以是0x07,当前算法用于第二通信业务的用户面完整性保护时,安全算法的类型可以是0x08。数据传输网元可以根据第一密钥以及所述安全算法的标识和类型生成安全密钥,具体的生成第一密钥的方式详细可以参考上述的相关描述,在此不加赘述。The type of the security algorithm can be set to different values according to the current algorithm used in different scenarios. For example, when the security algorithm is used for user plane confidentiality protection, the type of the security algorithm can be set to N-UP-ENC-ALG corresponding to The value of 0x05, when the security algorithm is used for user plane integrity protection, the type of security algorithm can be set to the value 0x06 corresponding to N-UP-INT-ALG. Therefore, the type of the security algorithm can be either 0x05 or 0x06. In addition, the type of the security algorithm may also be a value different from the existing 0x01-0x06, which is used to indicate that the security algorithm is used for the user plane confidentiality protection of the second communication service or the user plane integrity protection of the second communication service. For example, when the current algorithm is used for user plane confidentiality protection of the second communication service, the security algorithm type may be 0x07, and when the current algorithm is used for user plane integrity protection of the second communication service, the security algorithm type may be 0x08. The data transmission network element may generate the security key according to the first key and the identifier and type of the security algorithm. For the specific method of generating the first key, reference may be made to the above-mentioned related descriptions, which will not be repeated here.
可选地,数据传输网元也可以根据第一密钥和特殊字符串生成安全密钥。特殊字符串可以是预配置的特定字符串,例如“NPN”,“Secondary”等。Optionally, the data transmission network element may also generate the security key according to the first key and the special character string. Special strings can be preconfigured specific strings such as "NPN", "Secondary", etc.
引入特殊字符串可以区别于现有0x01-0x06的安全算法的类型作为密钥的衍生参数生成第二加密密钥和第二完整性保护密钥,可以使得即使在获得的安全算法和第一安全算法 相同并且获得的第一密钥与第一安全上下文的AS根密钥相同的情况下,依然可以保证获得的安全密钥与第一安全密钥不同。可以理解为,第一加密密钥与第二加密密钥不同,也可以理解为,第一完整性保护密钥与第二完整性保护密钥不同,还可以理解为,第一加密密钥与第二加密密钥不同,以及第一完整性保护密钥与第二完整性保护密钥不同。由此可以避免第一安全上下文和第二安全上下文相同,可以保证安全隔离的有效性,从而可以保证通信业务的安全性。Introducing a special string that can be differentiated from the existing 0x01-0x06 security algorithm type as a derivative parameter of the key to generate the second encryption key and the second integrity protection key, which can make the obtained security algorithm and the first security If the algorithm is the same and the obtained first key is the same as the AS root key of the first security context, it can still be guaranteed that the obtained security key is different from the first security key. It can be understood that the first encryption key is different from the second encryption key, it can also be understood that the first integrity protection key is different from the second integrity protection key, and it can also be understood that the first encryption key is different from the second integrity protection key. The second encryption key is different, and the first integrity protection key is different from the second integrity protection key. Therefore, it can be avoided that the first security context and the second security context are the same, the effectiveness of the security isolation can be ensured, and the security of the communication service can be guaranteed.
应理解,确定安全算法的方法和生成安全密钥的方法可以是相互关联的,也可以是独立的。It should be understood that the method for determining the security algorithm and the method for generating the security key may be related to each other, or may be independent.
205、数据传输网元向终端设备发送额外生成指示。205. The data transmission network element sends an additional generation instruction to the terminal device.
额外生成指示可以用于指示生成第二安全上下文。额外生成指示可以显式地指示。例如,额外生成指示可以包括1bit,当这个bit的值为1时,可以指示生成第二安全上下文,当这个bit的值为0时,可以指示不生成第二安全上下文。额外生成指示也可以隐式地指示。例如,额外生成指示可以是生成第二安全上下文所需要的信元,例如算法、标志位、指示符、索引、传输资源等向终端设备发送额外生成指示。例如,当终端设备接收到指示符时,表明数据传输网元指示终端设备生成第二安全上下文。An additional generation indication may be used to indicate the generation of the second security context. Additional generation indications may be indicated explicitly. For example, the additional generation indication may include 1 bit, when the value of this bit is 1, it may indicate that the second security context is generated, and when the value of this bit is 0, it may indicate that the second security context is not generated. Additional build indications may also be indicated implicitly. For example, the additional generation indication may be an information element required to generate the second security context, such as an algorithm, a flag bit, an indicator, an index, a transmission resource, etc., to send the additional generation indication to the terminal device. For example, when the terminal device receives the indicator, it indicates that the data transmission network element instructs the terminal device to generate the second security context.
当数据传输网元确定安全密钥之后,额外生成指示还可以用于指示终端设备获取安全密钥。此时,额外生成指示可以包括第一衍生参数的指示。第一衍生参数的指示可以是第一衍生参数本身,也可以是用于指示第一衍生参数的值。例如,若第二衍生参数包含PDCP COUNT,那么第一衍生参数的指示可以包含PDCP COUNT的部分比特位。After the data transmission network element determines the security key, the additional generation instruction may also be used to instruct the terminal device to obtain the security key. At this point, the additional generation indication may include an indication of the first derived parameter. The indication of the first derived parameter may be the first derived parameter itself, or may be a value used to indicate the first derived parameter. For example, if the second derived parameter contains the PDCP COUNT, the indication of the first derived parameter may contain part of the bits of the PDCP COUNT.
当数据传输网元确定安全算法之后,额外生成指示还可以用于指示终端设备获取安全算法。此时,额外生成指示可以包括安全算法的标识After the data transmission network element determines the security algorithm, the additionally generated instruction may also be used to instruct the terminal device to acquire the security algorithm. At this point, the additional generation indication may include the identification of the security algorithm
应理解,第二安全上下文的确定方式并不唯一,确定方法不同数据传输网元对应接收的额外安全上下文指示和发送的额外生成指示可以不同,因此,额外生成指示可以根据第二安全上下文生成方式的不同,包含不同的信息。例如,额外生成指示可以为显示地指示,也可以为第一衍生参数的指示,还可以为安全算法的标识,额外安全上下文指示还可以包含显示地指示和安全算法的标识,还可以包含第一衍生参数的指示和安全算法的标识,还可以包含显示地指示、第一衍生参数的指示和安全算法的标识。应理解,当数据传输网元使用到第一衍生参数和/或第三衍生参数生成第二安全上下文时,额外生成指示才会对应包或第一衍生参数的指示和/或安全算法的标识。It should be understood that the method for determining the second security context is not unique, and the additional security context indications received and the additional generation instructions sent by the data transmission network elements corresponding to different determination methods may be different. Therefore, the additional generation instructions may be generated according to the second security context generation method. different, contain different information. For example, the additional generated indication may be an explicit indication, an indication of the first derivative parameter, or an identification of a security algorithm, and the additional security context indication may also include an explicit indication and an identification of the security algorithm, and may also include the first The indication of the derived parameter and the identification of the security algorithm may also include an explicit indication, the indication of the first derived parameter and the identification of the security algorithm. It should be understood that when the data transmission network element uses the first derivative parameter and/or the third derivative parameter to generate the second security context, the additionally generated indication corresponds to the indication of the packet or the first derivative parameter and/or the identifier of the security algorithm.
数据传输网元可以直接向终端设备发送额外生成指示,可以通过RRC消息发送。可选地,RRC消息可以是RRC重配置消息。The data transmission network element may directly send the additional generation indication to the terminal device, which may be sent through an RRC message. Optionally, the RRC message may be an RRC reconfiguration message.
数据传输网元可以间接得通过会话管理功能网元向终端设备发送额外生成指示,此时,额外生成指示可以封装在N4Session Establishment Response消息中发送给会话管理功能网元,并且会话管理功能网元将额外生成指示封装在会话接受消息中发送给终端设备。The data transmission network element can indirectly send an additional generation instruction to the terminal device through the session management function network element. At this time, the additional generation instruction can be encapsulated in the N4Session Establishment Response message and sent to the session management function network element, and the session management function network element will The additional generation indication is encapsulated in the session accept message and sent to the terminal device.
应理解,步骤205是可选的步骤。It should be understood that step 205 is an optional step.
206、会话管理功能网元向终端设备发送会话接受消息。206. The session management function network element sends a session acceptance message to the terminal device.
会话管理功能网元接收到来自终端设备的会话请求消息之后,可以根据会话请求消息建立传输第二通信业务的会话,建立该会话之后,可以向终端设备发送会话接受消息。对 应地,终端设备可以接收会话管理功能网元的会话接受消息。会话接受消息可以指示完成第二通信业务的会话的建立。会话接受消息可以是PDU会话建议请求消息或者PDU会话修改请求消息。After receiving the session request message from the terminal device, the session management function network element can establish a session for transmitting the second communication service according to the session request message, and after establishing the session, can send a session accept message to the terminal device. Correspondingly, the terminal device can receive the session acceptance message of the session management function network element. The session accept message may indicate completion of the establishment of the session for the second communication service. The session accept message may be a PDU session suggestion request message or a PDU session modification request message.
可选的,会话接受消息可以包含额外生成指示,额外生成指示用于指示终端设备生成第二安全上下文。Optionally, the session accept message may include an additional generation instruction, where the additional generation instruction is used to instruct the terminal device to generate the second security context.
当会话管理功能网元确定安全算法之后,额外生成指示还可以用于指示终端设备获取安全算法。此时,额外生成指示可以包括安全算法的标识。应理解,安全算法的标识可以由会话接受消息和数据传输网元向终端设备发送的额外生成指示的其中一个携带,也可以均不携带。此处不对安全算法的标识包含于哪个具体信息构成限定。After the session management function network element determines the security algorithm, the additionally generated instruction may also be used to instruct the terminal device to acquire the security algorithm. At this point, the additional generation indication may include the identification of the security algorithm. It should be understood that the identity of the security algorithm may be carried by one of the session acceptance message and the additional generation instruction sent by the data transmission network element to the terminal device, or may not be carried at all. There is no limitation on which specific information the identifier of the security algorithm is included in.
当会话管理功能网元确定第一密钥之后,额外生成指示还可以用于指示终端设备获取第一密钥。此时,额外生成指示可以包括第二衍生参数的指示。第二衍生参数的指示可以是第二衍生参数本身,也可以是用于指示第二衍生参数的值。例如,若第二衍生参数包含NAS COUNT,那么第二衍生参数的指示可以包含NAS COUNT的部分比特位,若第二衍生参数包含NSSAI、DNN和PDU session ID,那么第二衍生参数的指示可以包含NSSAI、DNN和PDU session ID本身,或者由于终端设备已知NSSAI、DNN和PDU session ID,则第二衍生参数的指示可以包含一个特定的值,当该值为1时,用于指示终端设备获得NSSAI、DNN和PDU session ID。After the session management function network element determines the first key, the additional generation instruction may also be used to instruct the terminal device to obtain the first key. At this point, the additional generation indication may include an indication of the second derived parameter. The indication of the second derived parameter may be the second derived parameter itself, or may be a value used to indicate the second derived parameter. For example, if the second derivative parameter includes NAS COUNT, the indication of the second derivative parameter may include some bits of the NAS COUNT, and if the second derivative parameter includes NSSAI, DNN and PDU session ID, the indication of the second derivative parameter may include NSSAI, DNN and PDU session ID itself, or since the terminal device knows NSSAI, DNN and PDU session ID, the indication of the second derived parameter may contain a specific value, when the value is 1, it is used to instruct the terminal device to obtain NSSAI, DNN and PDU session ID.
当会话管理功能网元接收到来自数据传输网元的额外生成指示时,可以向终端设备转发该额外生成指示。会话管理功能网元可以将额外生成指示封装在会话接受消息中发送给终端设备。When the session management function network element receives the additional generation instruction from the data transmission network element, the additional generation instruction may be forwarded to the terminal device. The session management function network element may encapsulate the additional generation indication in a session accept message and send it to the terminal device.
应理解,步骤205和步骤206可以串行执行,也可以并行执行,执行顺序不予限制。It should be understood that step 205 and step 206 may be executed in series or in parallel, and the execution order is not limited.
207、终端设备获取额外生成指示。207. The terminal device obtains an additional generation instruction.
终端设备可以获取额外生成指示,可以理解为,终端设备可以接收来自数据传输网元和/或会话管理网元的额外生成指示。The terminal device may acquire the additional generation instruction, which may be understood as the terminal device may receive the additional generation instruction from the data transmission network element and/or the session management network element.
终端设备可以接收来自数据传输网元的额外生成指示。The terminal device may receive additional generation indications from the data transmission network element.
一种情况下,终端设备可以直接接收来自数据传输网元的额外生成指示,即终端设备可以接收来自数据传输设备的额外生成指示。In one case, the terminal device can directly receive the additional generation instruction from the data transmission network element, that is, the terminal device can receive the additional generation instruction from the data transmission device.
另一种情况下,终端设备可以间接接收来自数据传输网元的额外生成指示,即数据传输网元可以将额外生成指示通过会话管理功能网元转发给终端设备。具体的描述可以参数考步骤205中数据传输网元通过会话功能管理网元向终端设备发送的额外安全指示的描述,在此不加赘述。In another case, the terminal device may indirectly receive the additional generation instruction from the data transmission network element, that is, the data transmission network element may forward the additional generation instruction to the terminal device through the session management function network element. The specific description can refer to the description of the additional security indication sent by the data transmission network element to the terminal device through the session function management network element in step 205, and will not be repeated here.
终端设备可以接收来自会话管理功能网元的额外生成指示,即终端设备可以接收来自会话管理功能的额外生成指示。The terminal device may receive additional generation instructions from the session management function network element, that is, the terminal device may receive additional generation instructions from the session management function.
额外生成指示可以包括以下的一项或多项:第一衍生参数的指示,第二衍生参数的指示和安全算法的标识。The additional generation indications may include one or more of the following: an indication of the first derived parameter, an indication of the second derived parameter, and an identification of the security algorithm.
应理解,由于额外生成指示可以包含多项指示,因此可以根据接收的来源分成两部分,一部分从数据传输网元获得,另一部分从会话管理网元获得。因此,终端设备可以从数据传输网元一部分额外生成指示,再从会话管理网元获得另一部分额外生成指示。例如,终 端设备可以从数据传输网元获得第一衍生参数的指示以及安全算法的标识,还可以从会话管理功能网元获得第二衍生参数的指示。终端设备可以从数据传输网元获得第一衍生参数的指示,还可以从会话管理功能网元获得第二衍生参数的指示以及安全算法的标识。终端设备可以从数据传输网元获得安全算法的标识,还可以从会话管理功能网元获得第二衍生参数的指示。It should be understood that since the additionally generated indication may include multiple indications, it may be divided into two parts according to the received source, one part is obtained from the data transmission network element, and the other part is obtained from the session management network element. Therefore, the terminal device may generate additional instructions from a part of the data transmission network element, and obtain another part of the additional generation instructions from the session management network element. For example, the terminal device may obtain the indication of the first derived parameter and the identity of the security algorithm from the data transmission network element, and may also obtain the indication of the second derived parameter from the session management function network element. The terminal device may obtain the indication of the first derivative parameter from the data transmission network element, and may also obtain the indication of the second derivative parameter and the identity of the security algorithm from the session management function network element. The terminal device may obtain the identification of the security algorithm from the data transmission network element, and may also obtain the indication of the second derivative parameter from the session management function network element.
208、终端设备根据额外生成指示获取第二安全上下文。208. The terminal device acquires the second security context according to the additionally generated instruction.
终端设备获取到额外生成指示之后,可以根据额外生成指示生成第二安全上下文。应理解,终端设备生成第二安全上下文与数据传输网元生成第二安全上下文的方式相同,详细描述可以参考步骤204的相关描述。After acquiring the additional generation instruction, the terminal device may generate the second security context according to the additional generation instruction. It should be understood that the manner in which the terminal device generates the second security context is the same as the manner in which the data transmission network element generates the second security context. For a detailed description, reference may be made to the relevant description of step 204 .
终端设备可以根据额外生成指示获取安全算法。The terminal device can acquire the security algorithm according to the additional generated instructions.
需要说明的是,当额外生成指示包括安全算法的标识时,终端设备可以根据这一标识确定安全算法。当额外生成指示不包括安全算法的标识时,终端设备可以根据第一安全上下文中的第一安全算法获取安全算法。It should be noted that when an identifier indicating that the indication includes a security algorithm is additionally generated, the terminal device may determine the security algorithm according to the identifier. When the identifier indicating that the security algorithm is not included is additionally generated, the terminal device may acquire the security algorithm according to the first security algorithm in the first security context.
终端设备可以根据额外生成指示,获取第一密钥。The terminal device may acquire the first key according to the additional generation instruction.
当终端设备具备第一安全上下文时,可以根据额外生成指示,基于第一安全上下文的AS根密钥获取第一密钥,即根据第一安全上下文的AS根密钥确定第一密钥。When the terminal device has the first security context, it can obtain the first key based on the AS root key of the first security context according to the additional generation instruction, that is, determine the first key according to the AS root key of the first security context.
一种方式下,终端设备可以将第一安全上下文的AS根密钥作为第一密钥。In one way, the terminal device may use the AS root key of the first security context as the first key.
另一种方式下,额外生成指示包括第一衍生参数的指示,终端设备可以根据第一安全上下文的AS根密钥以及第一衍生参数生成第一密钥。详细描述可以参考步骤204中数据传输网元根据第一安全上下文的AS根密钥以及第一衍生参数生成第一密钥,在此不加赘述。In another manner, the additionally generated indication includes an indication of the first derivative parameter, and the terminal device may generate the first key according to the AS root key of the first security context and the first derivative parameter. For a detailed description, reference may be made to the generation of the first key by the data transmission network element according to the AS root key of the first security context and the first derivative parameter in step 204, which will not be repeated here.
终端设备可以对应预配置一个Kn根密钥,终端设备可以根据额外生成指示,基于Kn根密钥生成第一密钥。The terminal device may correspondingly preconfigure a Kn root key, and the terminal device may generate the first key based on the Kn root key according to the additional generation instruction.
一种方式下,终端设备可以将Kn根密钥作为第一密钥In one way, the terminal device can use the Kn root key as the first key
另一种方式下,额外生成指示包括第一衍生参数的指示,终端设备可以根据Kn根密钥和第一衍生参数生成第一密钥。详细描述可以参考步骤204中数据传输网元根据Kn根密钥和第一衍生参数生成第一密钥的描述,在此不加赘述。In another manner, the additionally generated indication includes an indication of the first derivative parameter, and the terminal device may generate the first key according to the Kn root key and the first derivative parameter. For a detailed description, reference may be made to the description of the generation of the first key by the data transmission network element according to the Kn root key and the first derived parameter in step 204, which will not be repeated here.
当会话管理功能网元触发二次认证后,终端设备可以执行二次认证。终端设备可以在二次认证过程中生成二次认证密钥。终端设备可以接收额外生成指示,额外生成指示可以包括第二衍生参数的指示。终端设备可以根据二次认证密钥以及第二衍生参数生成第一密钥。其生成的方法详细描述可以参考步骤203中会话管理功能网元根据二次认证密钥以及第二衍生参数生成第一密钥的描述,在此不加赘述。After the session management function network element triggers the secondary authentication, the terminal device can perform the secondary authentication. The terminal device can generate a secondary authentication key during the secondary authentication process. The terminal device may receive an additional generation indication, and the additional generation indication may include an indication of the second derived parameter. The terminal device may generate the first key according to the secondary authentication key and the second derivative parameter. For a detailed description of the generation method, reference may be made to the description of the generation of the first key by the session management function network element according to the secondary authentication key and the second derivative parameter in step 203, which will not be repeated here.
终端设备生成第一密钥之后,可以进一步根据额外生成指示,基于第一密钥获取安全密钥。基于第一密钥生成第二安全上下文。具体的生成方式可以与步骤204中数据传输网元的生成方式对应相同。After the terminal device generates the first key, it may further obtain the security key based on the first key according to the additional generation instruction. A second security context is generated based on the first key. The specific generation method may be the same as the generation method of the data transmission network element in step 204 .
额外生成指示包括安全算法的标识,终端设备可以根据所述第一密钥以及第三衍生参数生成安全密钥。详细描述可以参考步骤204中数据传输网元根据第一密钥以及第三衍生参数生成安全密钥的描述,在此不加赘述。The additional generation indication includes the identification of the security algorithm, and the terminal device can generate the security key according to the first key and the third derived parameter. For a detailed description, reference may be made to the description of the generation of the security key by the data transmission network element according to the first key and the third derived parameter in step 204, which will not be repeated here.
应理解,第二安全上下文可以是终端设备和数据传输网元生成的。数据传输网元可以 是接入网设备,也可以是用户面功能网元,还可以是其他具有相同功能的网元。即可以理解为,一套安全上下文可以由两个设备生成,其中,当数据传输网元具备第一安全上下文时,第一安全上下文和第二安全上下文可以均由终端设备和数据传输网元生成。当数据传输网元不具备第一安全上下文时,第二安全上下文可以由终端设备和数据传输网元获取。此时,两套安全上下文处于不同的设备,由于两套安全上下文具有不同的算法和/或密钥,且处于不同网元,从而可以进一步实现安全隔离。It should be understood that the second security context may be generated by the terminal device and the data transmission network element. The data transmission network element can be an access network device, a user plane functional network element, or other network elements with the same function. That is, it can be understood that a set of security contexts can be generated by two devices, wherein, when the data transmission network element has the first security context, the first security context and the second security context can both be generated by the terminal device and the data transmission network element. . When the data transmission network element does not have the first security context, the second security context can be acquired by the terminal device and the data transmission network element. At this time, the two sets of security contexts are located in different devices. Since the two sets of security contexts have different algorithms and/or keys and are located in different network elements, security isolation can be further implemented.
终端设备接收到来自会话管理功能网元的会话接受消息之后,可以根据会话接受消息确定第二通信业务建立完成,之后可以与数据网络进行第二通信业务对应的业务传输,并且对传输的第二通信业务可以使用第二安全上下文进行保护。可见,当公网业务受到攻击时,可以避免对私网业务的影响,反之亦然,因此可以实现公网业务和私网业务的安全隔离,从而可以提高公网业务和私网业务的安全性。After receiving the session acceptance message from the session management function network element, the terminal device can determine that the establishment of the second communication service is completed according to the session acceptance message, and then can perform service transmission corresponding to the second communication service with the data network, and transmit the second communication service. The communication traffic can be protected using the second security context. It can be seen that when the public network service is attacked, the impact on the private network service can be avoided, and vice versa, so the security isolation of the public network service and the private network service can be realized, and the security of the public network service and the private network service can be improved. .
基于上述网络架构,请参阅图3,图3是本发明实施例公开的另一种安全上下文生成方法的流程示意图。如图3所示,该安全上下文生成方法可以包括以下步骤。Based on the above network architecture, please refer to FIG. 3 , which is a schematic flowchart of another method for generating a security context disclosed in an embodiment of the present invention. As shown in FIG. 3 , the security context generation method may include the following steps.
301、终端设备获取第一安全上下文。301. A terminal device acquires a first security context.
其中,步骤301的详细描述可以参考步骤201的描述,在此不加赘述。The detailed description of step 301 may refer to the description of step 201, which will not be repeated here.
302、接入网设备获取第一安全上下文。302. The access network device acquires a first security context.
其中,步骤302的详细描述可以参考步骤201的描述,在此不加赘述。The detailed description of step 302 may refer to the description of step 201, and details are not repeated here.
303、终端设备向会话管理功能网元发送会话请求消息。303. The terminal device sends a session request message to the session management function network element.
其中,步骤303的详细描述可以参考步骤202的描述,在此不加赘述。The detailed description of step 303 may refer to the description of step 202, and details are not repeated here.
304、会话管理功能网元向接入网设备发送额外安全上下文指示。304. The session management function network element sends an additional security context indication to the access network device.
其中,步骤304的详细描述可以参考步骤203的描述,在此不加赘述。The detailed description of step 304 may refer to the description of step 203, and details are not repeated here.
应理解,当会话管理功能网元已经确定安全算法时,额外安全上下文指示还可以包括安全算法的标识。It should be understood that when the session management function network element has determined the security algorithm, the additional security context indication may also include the identification of the security algorithm.
305、接入网设备根据额外安全上下文指示获取第二安全上下文。305. The access network device acquires the second security context according to the additional security context indication.
接入网设备接收到来自会话管理功能网元的额外安全上下文指示之后,可以根据额外安全上下文指示生成第二安全上下文。生成第二安全上下文的详细描述可以参考步骤204的描述。After receiving the additional security context indication from the session management function network element, the access network device may generate a second security context according to the additional security context indication. For a detailed description of generating the second security context, reference may be made to the description of step 204 .
接入网设备可以根据额外安全上下文指示获取安全算法。The access network device may obtain the security algorithm according to the additional security context indication.
一种可能实现的方式,当额外安全上下文指示支持生成第二安全上下文时,接入网设备可以根据算法优先级列表获取安全算法。详细描述可以参考步骤204中的相关描述,在此不加赘述。In a possible implementation manner, when the additional security context indicates that the second security context is supported, the access network device may acquire the security algorithm according to the algorithm priority list. For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
另一种可能实现的方式,额外安全上下文指示可以包括安全算法的标识,接入网设备可以根据这个标识确定安全算法。安全算法可以已经在会话管理功能网元中确定。详细描述可以参考步骤203会话管理功能网元确定安全算法和步骤204中根据额外安全上下文指示确定安全算法的对应的描述,在此不加赘述。In another possible implementation manner, the additional security context indication may include an identifier of the security algorithm, and the access network device may determine the security algorithm according to the identifier. The security algorithm may already be determined in the session management function network element. For detailed description, reference may be made to the corresponding descriptions of determining the security algorithm by the session management function network element in step 203 and determining the security algorithm according to the additional security context indication in step 204, which will not be repeated here.
又一种可能实现的方式,接入网设备可以根据额外安全上下文指示,从第一安全上下文的第一安全算法获得安全算法。In another possible implementation manner, the access network device may obtain the security algorithm from the first security algorithm of the first security context according to the indication of the additional security context.
接入网设备可以根据额外安全上下文指示生成第一密钥。The access network device may generate the first key according to the additional security context indication.
一种可能实现的方式,接入网设备可以获取第一安全上下文的AS根密钥,将这一AS根密钥作为第一密钥。详细描述可以参考步骤204中的相关描述,在此不加赘述。In a possible implementation manner, the access network device may acquire the AS root key of the first security context, and use this AS root key as the first key. For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
另一种可能实现的方式,接入网设备可以根据第一安全上下文的AS根密钥,以及第一衍生参数生成第一密钥。详细描述可以参考步骤204中的相关描述,在此不加赘述。In another possible implementation manner, the access network device may generate the first key according to the AS root key of the first security context and the first derivative parameter. For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
进一步地,接入网设备可以根据额外安全上下文指示,基于第一密钥生成安全密钥。Further, the access network device may generate the security key based on the first key according to the additional security context indication.
接入网设备可以根据第一密钥以及第三衍生参数生成安全密钥。生成安全密钥的详细描述可以参考步骤204中根据第一密钥以及第三衍生参数生成安全密钥的描述,在此不加赘述。The access network device may generate the security key according to the first key and the third derived parameter. For a detailed description of generating the security key, reference may be made to the description of generating the security key according to the first key and the third derived parameter in step 204, and details are not repeated here.
306、会话管理功能网元向终端设备发送会话接受消息。306. The session management function network element sends a session acceptance message to the terminal device.
其中,步骤306的详细描述可以参考步骤206的描述,在此不加赘述。The detailed description of step 306 may refer to the description of step 206, and details are not repeated here.
应理解,当会话管理功能网元已经确定安全算法时,会话接受消息可以包括额外生成指示,额外生成指示可以包括安全算法的标识。It should be understood that when the session management function network element has determined the security algorithm, the session accept message may include an additional generation indication, and the additional generation indication may include an identification of the security algorithm.
307、接入网设备向终端设备发送额外生成指示。307. The access network device sends an additional generation instruction to the terminal device.
接入网设备可以向终端设备发送额外生成指示,对应地,终端设备可以接收来自接入网设备的额外生成指示。相关详细描述可以参考步骤205-步骤207的描述,在此不加赘述。The access network device may send the additional generation instruction to the terminal device, and correspondingly, the terminal device may receive the additional generation instruction from the access network device. For the relevant detailed description, reference may be made to the description of step 205 to step 207, which will not be repeated here.
需要说明的是,额外生成指示可以包括以下的一项或多项:显示地指示、第一衍生参数的指示和安全算法的标识。It should be noted that the additional generation indication may include one or more of the following: an explicit indication, an indication of the first derived parameter, and an identification of a security algorithm.
应理解,步骤306和步骤307中是由其中一个消息包括安全算法的标识。It should be understood that in steps 306 and 307, one of the messages includes the identification of the security algorithm.
308、终端设备根据额外生成指示获取第二安全上下文。308. The terminal device acquires the second security context according to the additionally generated instruction.
其中,步骤308的详细描述可以参考步骤305和步骤208的描述。The detailed description of step 308 may refer to the description of step 305 and step 208 .
终端设备可以根据额外生成指示获取安全算法。The terminal device can acquire the security algorithm according to the additional generated instructions.
额外生成指示可以包括安全算法的标识。终端设备可以根据这一标识确定安全算法。终端设备也可以根据第一安全上下文的第一安全算法获取安全算法。详细描述可以参考步骤208的相关描述,在此不加赘述。The additional generation indication may include the identification of the security algorithm. The terminal device can determine the security algorithm based on this identification. The terminal device may also acquire the security algorithm according to the first security algorithm of the first security context. For a detailed description, reference may be made to the relevant description of step 208, which is not repeated here.
终端设备可以根据额外生成指示生成第一密钥。The terminal device may generate the first key according to the additional generation instruction.
一种可能实现的方式,终端设备可以获取第一安全上下文的AS根密钥,将这一AS根密钥作为第一密钥。详细描述可以参考步骤208和步骤305中的相关描述,在此不加赘述。In a possible implementation manner, the terminal device may obtain the AS root key of the first security context, and use this AS root key as the first key. For a detailed description, reference may be made to the relevant descriptions in step 208 and step 305, which will not be repeated here.
另一种可能实现的方式,当额外生成指示包括第一衍生参数的指示时,终端设备可以根据第一安全上下文的AS根密钥以及第一衍生参数生成第一密钥。详细描述可以参考步骤204、步骤208和步骤305中的根据AS根密钥以及第一衍生参数生成第一密钥的描述,在此不加赘述。In another possible implementation manner, when the additionally generated indication includes the first derivative parameter, the terminal device may generate the first key according to the AS root key of the first security context and the first derivative parameter. For a detailed description, reference may be made to the description of generating the first key according to the AS root key and the first derivative parameter in step 204, step 208 and step 305, and details are not repeated here.
进一步地,终端设备可以根据额外生成指示,基于第一密钥生成安全密钥。Further, the terminal device may generate the security key based on the first key according to the additional generation instruction.
当额外生成指示包括安全算法的标识时,终端设备可以根据第一密钥以及第三衍生参数生成安全密钥。第三衍生参数可以是安全算法的标识。生成安全密钥的详细描述可以参考步骤204、步骤208和步骤305中根据第一密钥以及第三衍生参数生成安全密钥的描述,在此不加赘述。When the identification including the security algorithm is additionally generated, the terminal device may generate the security key according to the first key and the third derived parameter. The third derived parameter may be an identification of the security algorithm. For a detailed description of generating the security key, reference may be made to the description of generating the security key according to the first key and the third derived parameter in step 204, step 208 and step 305, which will not be repeated here.
至此,终端设备可以通过第一安全上下文和第二安全上下文对用户面数据进行保护。 第一安全上下文和第二安全上下文可以分别用于保护私网业务(公网数据)和公网业务(私网数据)。当攻击者获取其中一套安全上下文时,由于两套安全上下文是不同的,另一套安全上下文不会暴露。从而可以达到从公网业务和私网业务分别保护的目标,可以提高通信业务的安全性。So far, the terminal device can protect the user plane data by using the first security context and the second security context. The first security context and the second security context may be used to protect private network services (public network data) and public network services (private network data), respectively. When an attacker obtains one set of security contexts, the other set of security contexts will not be exposed because the two sets of security contexts are different. Therefore, the goal of protecting the public network service and the private network service separately can be achieved, and the security of the communication service can be improved.
应理解,本实施例的数据传输网元是接入网设备。It should be understood that the data transmission network element in this embodiment is an access network device.
基于上述网络架构,请参阅图4,图4是本发明实施例公开的又一种安全上下文生成方法的流程示意图。如图4所示,该安全上下文生成方法可以包括以下步骤。Based on the above network architecture, please refer to FIG. 4 , which is a schematic flowchart of another method for generating a security context disclosed in an embodiment of the present invention. As shown in FIG. 4 , the security context generation method may include the following steps.
401、终端设备获取第一安全上下文。401. A terminal device acquires a first security context.
其中,步骤401的详细描述可以参考步骤201的描述,在此不加赘述。The detailed description of step 401 may refer to the description of step 201, which will not be repeated here.
402、接入网设备获取第一安全上下文。402. The access network device acquires a first security context.
其中,步骤402的详细描述可以参考步骤201的描述,在此不加赘述。The detailed description of step 402 may refer to the description of step 201, and details are not repeated here.
403、终端设备向会话管理功能网元发送会话请求消息。403. The terminal device sends a session request message to the session management function network element.
其中,步骤403的详细描述可以参考步骤202的描述,在此不加赘述。The detailed description of step 403 may refer to the description of step 202, and details are not repeated here.
404、终端设备执行二次认证。404. The terminal device performs secondary authentication.
会话管理功能网元可以根据会话请求消息携带的DNN和/或终端设备的签约信息触发执行终端设备和认证授权计费网元的二次认证。其中,终端设备的签约信息可以是向UDM请求获得的。例如,当DNN是特定的DNN时,或者终端设备的签约信息指示需要触发二次认证时,会话管理功能网元可以触发执行二次认证。The network element of the session management function may trigger the execution of secondary authentication between the terminal device and the authentication, authorization and charging network element according to the subscription information of the DNN and/or the terminal device carried in the session request message. The subscription information of the terminal device may be obtained by requesting the UDM. For example, when the DNN is a specific DNN, or when the subscription information of the terminal device indicates that the secondary authentication needs to be triggered, the session management function network element may trigger the execution of the secondary authentication.
终端设备可以通过二次认证获得二次认证密钥。二次认证可以是基于扩展的身份认证协议(extensible authentication protocol,EAP)实现的。终端设备和认证授权计费网元可以生成二次认证密钥。二次认证密钥可以是主会话密钥(master session key,MSK)或扩展主会话密钥(extended master session key,EMSK)。The terminal device can obtain the secondary authentication key through secondary authentication. The secondary authentication can be implemented based on the extensible authentication protocol (EAP). The terminal device and the authentication, authorization and accounting network element can generate a secondary authentication key. The secondary authentication key can be a master session key (MSK) or an extended master session key (EMSK).
其中,二次认证过程可以参见3GPP TS 33.501以及RFC 3748。Among them, the secondary authentication process can refer to 3GPP TS 33.501 and RFC 3748.
认证授权计费网元完成二次认证之后,认证授权计费网元可以向会话管理功能网元发送二次认证密钥,对应地,会话管理功能网元可以接收来自认证授权计费网元的二次认证密钥。After the authentication, authorization and accounting network element completes the secondary authentication, the authentication, authorization and accounting network element can send the secondary authentication key to the session management function network element. Correspondingly, the session management function network element can receive the Secondary authentication key.
405、会话管理功能网元根据二次认证密钥生成第一密钥。405. The session management function network element generates a first key according to the secondary authentication key.
会话管理功能网元可以先确定是否需要生成第二安全上下文。详细描述可以参考步骤203中会话管理功能网元确定终端设备是否需要生成第二安全上下文的描述,在此不加赘述。The session management function network element may first determine whether the second security context needs to be generated. For a detailed description, reference may be made to the description in step 203 that the session management function network element determines whether the terminal device needs to generate the second security context, which is not repeated here.
当会话管理功能网元确定出需要生成第二安全上下文时,会话管理功能网元可以确定安全算法。会话管理功能网元确定安全算法生成过程的详细描述可以参考步骤203中的相关描述,在此不加赘述。When the session management function network element determines that the second security context needs to be generated, the session management function network element may determine a security algorithm. For a detailed description of the process of determining the security algorithm generation process by the network element of the session management function, reference may be made to the relevant description in step 203, and details are not repeated here.
当会话管理功能网元确定出需要生成第二安全上下文时,会话管理功能网元可以根据接收到的二次认证密钥生成第一密钥。会话管理功能网元可以根据第二衍生参数和二次认证密钥生成第一密钥。生成过程的详细描述可以参考步骤203中的相关描述,在此不加赘述。When the session management function network element determines that the second security context needs to be generated, the session management function network element may generate the first key according to the received secondary authentication key. The session management function network element may generate the first key according to the second derivative parameter and the secondary authentication key. For a detailed description of the generation process, reference may be made to the relevant description in step 203, which is not repeated here.
406、会话管理功能网元向接入网设备发送额外安全上下文指示。406. The session management function network element sends an additional security context indication to the access network device.
其中,步骤406的详细描述可以参考步骤203的描述,在此不加赘述。The detailed description of step 406 may refer to the description of step 203, and details are not repeated here.
需要说明的是,额外安全上下文指示至少包括第一密钥。It should be noted that the additional security context indication includes at least the first key.
应理解,当会话管理功能网元已经确定安全算法时,额外安全上下文指示还可以包括安全算法的标识。It should be understood that when the session management function network element has determined the security algorithm, the additional security context indication may also include the identification of the security algorithm.
407、接入网设备根据额外安全上下文指示获取第二安全上下文。407. The access network device acquires the second security context according to the additional security context indication.
接入网设备接收到来自会话管理功能网元的额外安全上下文指示之后,可以根据额外安全上下文指示的获取第二安全上下文。生成第二安全上下文的详细描述可以参考步骤204的描述。After receiving the additional security context indication from the session management function network element, the access network device may acquire the second security context according to the additional security context indication. For a detailed description of generating the second security context, reference may be made to the description of step 204 .
接入网设备可以根据额外安全上下文指示获取安全算法。The access network device may obtain the security algorithm according to the additional security context indication.
一种可能实现的方式,当额外安全上下文指示支持生成第二安全上下文时,接入网设备可以根据算法优先级列表获取安全算法。详细描述可以参考步骤204中的相关描述,在此不加赘述。In a possible implementation manner, when the additional security context indicates that the second security context is supported, the access network device may acquire the security algorithm according to the algorithm priority list. For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
另一种可能实现的方式,额外安全上下文指示可以包括安全算法的标识,接入网设备可以根据这个标识确定安全算法。安全算法可以由会话管理功能网元确定。详细描述可以参考步骤203和步骤204中对应的描述,在此不加赘述。In another possible implementation manner, the additional security context indication may include an identifier of the security algorithm, and the access network device may determine the security algorithm according to the identifier. The security algorithm may be determined by the session management function network element. For a detailed description, reference may be made to the corresponding descriptions in step 203 and step 204, and details are not repeated here.
又一种可能实现的方式,接入网设备可以根据额外安全上下文指示,从第一安全上下文的第一安全算法获得安全算法。In another possible implementation manner, the access network device may obtain the security algorithm from the first security algorithm of the first security context according to the indication of the additional security context.
接入网设备可以根据额外安全上下文指示生成第一密钥。The access network device may generate the first key according to the additional security context indication.
额外安全上下文指示可以包括第一密钥,接入网设备可以直接获取第一密钥。详细描述可以参考步骤204中的相关描述,在此不加赘述。The additional security context indication may include the first key, and the access network device may directly obtain the first key. For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
进一步地,接入网设备可以根据额外安全上下文指示,基于第一密钥生成安全密钥。Further, the access network device may generate the security key based on the first key according to the additional security context indication.
接入网设备可以根据第一密钥以及第三衍生参数生成安全密钥。生成安全密钥的详细描述可以参考步骤204中的相关描述,在此不加赘述。The access network device may generate the security key according to the first key and the third derived parameter. For a detailed description of generating the security key, reference may be made to the relevant description in step 204, and details are not repeated here.
408、会话管理功能网元向终端设备发送会话接受消息。408. The session management function network element sends a session acceptance message to the terminal device.
其中,步骤408的详细描述可以参考步骤206的描述,在此不加赘述。The detailed description of step 408 can refer to the description of step 206, and details are not repeated here.
会话接受消息可以包括额外生成指示,额外生成指示可以包括第二衍生参数的指示和/或安全算法的标识。The session accept message may include an additional generation indication, which may include an indication of the second derived parameter and/or an identification of the security algorithm.
409、接入网设备向终端设备发送额外生成指示。409. The access network device sends an additional generation instruction to the terminal device.
对应地,终端设备接收来自会话管理功能网元的额外生成指示。步骤409的详细描述可以参考步骤205和步骤207的描述。Correspondingly, the terminal device receives an additional generation indication from the session management function network element. The detailed description of step 409 can refer to the description of step 205 and step 207 .
需要说明的是,额外生成指示可以包括以下的一项或多项:显示地指示和安全算法的标识。It should be noted that the additional generated indication may include one or more of the following: an explicit indication and an identification of a security algorithm.
应理解,步骤408和步骤409中是由其中一个消息包括安全算法的标识。It should be understood that in steps 408 and 409, one of the messages includes the identification of the security algorithm.
410、终端设备根据额外生成指示获取第二安全上下文。410. The terminal device acquires the second security context according to the additionally generated indication.
其中,步骤410的详细描述可以参考步骤407和步骤208的描述。The detailed description of step 410 may refer to the description of step 407 and step 208 .
额外生成指示可以包括安全算法的标识,终端设备可以根据这一标识确定安全算法。若额外生成指示不包括安全算法的标识时,终端设备也可以根据第一安全上下文的第一安全算法获取安全算法。详细描述可以参考步骤407和步骤208中的相关描述,在此不加赘述。The additional generation indication may include an identification of the security algorithm, from which the terminal device may determine the security algorithm. If the additionally generated indication does not include the identifier of the security algorithm, the terminal device may also acquire the security algorithm according to the first security algorithm of the first security context. For a detailed description, reference may be made to the relevant descriptions in step 407 and step 208, which will not be repeated here.
终端设备可以根据额外生成指示生成第一密钥。The terminal device may generate the first key according to the additional generation instruction.
额外生成指示可以包括第二衍生参数的指示,第二衍生参数的指示可以指示终端设备根据第二衍生参数获取第一密钥。终端设备可以根据二次认证密钥和第二衍生参数生成第一密钥。详细描述可以参考步骤203、步骤208和步骤407中的相关描述,在此不加赘述。The additional generation indication may include an indication of the second derivative parameter, and the indication of the second derivative parameter may instruct the terminal device to obtain the first key according to the second derivative parameter. The terminal device may generate the first key according to the secondary authentication key and the second derived parameter. For a detailed description, reference may be made to the related descriptions in step 203, step 208 and step 407, which will not be repeated here.
进一步地,终端设备可以根据额外生成指示,基于第一密钥生成安全密钥。Further, the terminal device may generate the security key based on the first key according to the additional generation instruction.
当额外生成指示包括安全算法的标识时,终端设备可以根据第一密钥以及第三衍生参数生成安全密钥。生成安全密钥的详细描述可以参考步骤204、步骤208和步骤407中根据第一密钥以及第三衍生参数生成安全密钥的描述,在此不加赘述。When the identification including the security algorithm is additionally generated, the terminal device may generate the security key according to the first key and the third derived parameter. For the detailed description of generating the security key, reference may be made to the description of generating the security key according to the first key and the third derivative parameter in step 204, step 208 and step 407, which will not be repeated here.
至此,终端设备可以通过第二安全上下文和第一安全上下文对用户面数据进行保护。终端设备可以获取第二安全上下文和第一安全上下文两套安全上下文。终端设备可以在发送对应PDU会话的数据(例如,私网数据)时,终端设备可以使用第二安全上下文进行用户面安全保护。终端设备可以在发送对应PDU会话的数据(例如,公网数据)时,终端设备可以使用第一安全上下文进行用户面安全保护,从而可以实现公网业务和公网业务的安全隔离。So far, the terminal device can protect the user plane data by using the second security context and the first security context. The terminal device can acquire two sets of security contexts, the second security context and the first security context. When the terminal device sends data corresponding to the PDU session (for example, private network data), the terminal device can use the second security context to perform user plane security protection. When the terminal device sends data corresponding to the PDU session (for example, public network data), the terminal device can use the first security context to perform user plane security protection, thereby realizing security isolation between public network services and public network services.
应理解,本实施例的数据传输网元是接入网设备。It should be understood that the data transmission network element in this embodiment is an access network device.
基于上述网络架构,请参阅图5,图5是本发明实施例公开的又一种安全上下文生成方法的流程示意图。如图5所示,该安全上下文生成方法可以包括以下步骤。Based on the above network architecture, please refer to FIG. 5 , which is a schematic flowchart of another method for generating a security context disclosed in an embodiment of the present invention. As shown in FIG. 5 , the security context generation method may include the following steps.
501、终端设备获取第一安全上下文。501. A terminal device acquires a first security context.
502、接入网设备获取第一安全上下文。502. The access network device acquires a first security context.
503、终端设备向会话管理功能网元发送会话请求消息。503. The terminal device sends a session request message to the session management function network element.
504、终端设备执行二次认证。504. The terminal device performs secondary authentication.
505、会话管理功能网元根据二次认证密钥生成第一密钥。505. The session management function network element generates a first key according to the secondary authentication key.
其中、步骤501-505的详细描述可以参考步骤401-405的描述,在此不加赘述。For the detailed description of steps 501-505, reference may be made to the description of steps 401-405, which will not be repeated here.
506、会话管理功能网元向用户面功能网元发送额外安全上下文指示。506. The session management function network element sends an additional security context indication to the user plane function network element.
步骤506的详细描述可以参考步骤203中的相关描述,在此不加赘述。For a detailed description of step 506, reference may be made to the relevant description in step 203, and details are not repeated here.
需要说明的是,额外安全上下文指示至少包括第一密钥。It should be noted that the additional security context indication includes at least the first key.
应理解,当会话管理功能网元已经确定安全算法时,额外安全上下文指示还可以包括安全算法的标识。It should be understood that when the session management function network element has determined the security algorithm, the additional security context indication may also include the identification of the security algorithm.
507、用户面功能网元根据额外安全上下文指示获取第二安全上下文。507. The user plane function network element acquires the second security context according to the additional security context indication.
用户面功能网元接收到来自会话管理功能网元的额外安全上下文指示之后,可以根据额外安全上下文指示生成第二安全上下文。生成第二安全上下文的详细描述可以参考步骤204的描述。After receiving the additional security context indication from the session management function network element, the user plane function network element may generate a second security context according to the additional security context indication. For a detailed description of generating the second security context, reference may be made to the description of step 204 .
用户面功能网元可以根据额外安全上下文指示获取安全算法。The user plane function network element can obtain the security algorithm according to the additional security context indication.
一种可能实现的方式,当额外安全上下文指示支持生成第二安全上下文时,用户面功能网元可以根据算法优先级列表获取安全算法。详细描述可以参考步骤204中的相关描述,在此不加赘述。In a possible implementation manner, when the additional security context indicates that the generation of the second security context is supported, the user plane function network element may acquire the security algorithm according to the algorithm priority list. For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
另一种可能实现的方式,额外安全上下文指示可以包括安全算法的标识,用户面功能 网元可以根据这个标识确定安全算法。安全算法可以由会话管理功能网元确定,也可以由用户面功能网元确定。详细描述可以参考步骤203和步骤204中对应的描述,在此不加赘述。In another possible implementation manner, the additional security context indication may include the identification of the security algorithm, and the user plane function network element may determine the security algorithm according to this identification. The security algorithm can be determined by the session management function network element or by the user plane function network element. For a detailed description, reference may be made to the corresponding descriptions in step 203 and step 204, and details are not repeated here.
用户面功能网元可以根据额外安全上下文指示生成第一密钥。The user plane function network element may generate the first key according to the additional security context indication.
额外安全上下文指示可以包括第一密钥,用户面功能网元可以直接获取第一密钥。详细描述可以参考步骤204中的相关描述,在此不加赘述。The additional security context indication may include the first key, and the user plane function network element may directly obtain the first key. For a detailed description, reference may be made to the relevant description in step 204, which is not repeated here.
进一步地,用户面功能网元可以根据额外安全上下文指示,基于第一密钥生成安全密钥。Further, the user plane function network element may generate the security key based on the first key according to the additional security context indication.
用户面功能网元可以根据第一密钥以及第三衍生参数生成安全密钥。生成安全密钥的详细描述可以参考步骤204中的相关描述,在此不加赘述。The user plane function network element may generate the security key according to the first key and the third derived parameter. For a detailed description of generating the security key, reference may be made to the relevant description in step 204, and details are not repeated here.
508、用户面功能网元向会话管理功能网元发送额外生成指示。508. The user plane function network element sends an additional generation instruction to the session management function network element.
用户面功能网元可以向会话管理功能网元发送额外生成指示,对应地,会话管理功能网元可以接收来自用户面功能网元的额外生成指示。额外生成指示可以包括安全算法的标识。额外生成指示可以封装在N4Session Establishment Response消息中。The user plane function network element may send an additional generation instruction to the session management function network element, and correspondingly, the session management function network element may receive the additional generation instruction from the user plane function network element. The additional generation indication may include the identification of the security algorithm. Additional build indications may be encapsulated in the N4Session Establishment Response message.
其中,步骤508详细描述可以参考步骤205和步骤207中的相关描述,在此不加赘述。For the detailed description of step 508, reference may be made to the relevant descriptions in step 205 and step 207, and details are not repeated here.
应理解,步骤508是可选步骤。It should be understood that step 508 is an optional step.
509、会话管理功能网元向终端设备发送会话接受消息。509. The session management function network element sends a session acceptance message to the terminal device.
会话管理功能网元接收到来自用户面功能网元的额外生成指示之后,可以将接收到的额外生成指示封装在会话接受消息中,之后可以向终端设备发送会话接受消息,对应地,终端设备可以接收来自会话管理功能网元的会话接受消息。After the session management function network element receives the additional generation instruction from the user plane function network element, it can encapsulate the received additional generation instruction in a session accept message, and then can send a session accept message to the terminal device. Correspondingly, the terminal device can A session accept message is received from the session management function network element.
需要说明的是,会话接受消息可以包括额外生成指示,额外生成指示可以包括以下的一项或多项:第二衍生参数的指示和安全算法的标识。其中,第二衍生参数的指示可以来自会话管理功能网元;安全算法的标识可以来自用户面功能网元,也可以来自会话管理功能网元。It should be noted that the session acceptance message may include an additional generation indication, and the additional generation indication may include one or more of the following: an indication of the second derived parameter and an identifier of a security algorithm. Wherein, the indication of the second derivative parameter may come from the session management function network element; the identification of the security algorithm may come from the user plane function network element or the session management function network element.
其中,509的详细描述可以参考步骤205-207中的相关描述,在此不加赘述。For the detailed description of 509, reference may be made to the relevant descriptions in steps 205-207, which will not be repeated here.
510、终端设备根据额外生成指示获取第二安全上下文。510. The terminal device acquires the second security context according to the additionally generated instruction.
终端设备可以根据额外生成指示获取第二安全上下文。步骤510的详细描述可以参考步骤507和步骤208中的描述。The terminal device may acquire the second security context according to the additionally generated instruction. The detailed description of step 510 can refer to the description in step 507 and step 208 .
终端设备可以根据额外生成指示获取安全算法。额外生成指示可以包括安全算法的标识,终端设备可以根据安全算法的标识确定安全算法。若额外生成指示不包括安全算法的标识时,终端设备也可以根据第一安全上下文的第一安全算法获取安全算法。详细描述可以参考步骤508和步骤208中的相关描述,在此不加赘述。The terminal device can acquire the security algorithm according to the additional generated instructions. The additional generation indication may include the identification of the security algorithm, and the terminal device may determine the security algorithm according to the identification of the security algorithm. If the additionally generated indication does not include the identifier of the security algorithm, the terminal device may also acquire the security algorithm according to the first security algorithm of the first security context. For a detailed description, reference may be made to the related descriptions in step 508 and step 208, which will not be repeated here.
终端设备可以根据额外生成指示生成第一密钥。The terminal device may generate the first key according to the additional generation instruction.
额外生成指示可以包括第二衍生参数的指示,第二衍生参数的指示可以指示终端设备根据第二衍生参数获取第一密钥。终端设备可以根据二次认证密钥和第二衍生参数生成第一密钥。详细描述可以参考步骤203、步骤208和步骤507中的相关描述,在此不加赘述。The additional generation indication may include an indication of the second derivative parameter, and the indication of the second derivative parameter may instruct the terminal device to obtain the first key according to the second derivative parameter. The terminal device may generate the first key according to the secondary authentication key and the second derived parameter. For a detailed description, reference may be made to the relevant descriptions in step 203, step 208, and step 507, and details are not repeated here.
进一步地,终端设备可以根据额外生成指示,基于第一密钥生成安全密钥。Further, the terminal device may generate the security key based on the first key according to the additional generation instruction.
额外生成指示包括安全算法的标识时,终端设备可以根据第一密钥以及第三衍生参数生成安全密钥。生成安全密钥的详细描述可以参考步骤204、步骤208和步骤507中根据第一 密钥以及第三衍生参数生成安全密钥的描述,在此不加赘述。When additionally generating the identifier including the security algorithm, the terminal device may generate the security key according to the first key and the third derived parameter. For the detailed description of generating the security key, refer to the description of generating the security key according to the first key and the third derivative parameter in step 204, step 208 and step 507, which will not be repeated here.
至此,终端设备可以通过第二安全上下文和第一安全上下文对用户面数据进行保护。终端设备可以获取第二安全上下文和第一安全上下文两套安全上下文。终端设备可以在发送对应PDU会话的数据(例如,私网数据)时,使用第一安全上下文进行用户面安全保护,由接入网设备进行解保护。终端设备可以在发送对应PDU会话的数据(例如,公网数据)时,终端设备可以使用第二安全上下文进行用户面安全保护,由用户面功能网元进行解保护。由此,其中一套安全上下文在接入网设备上,另一套安全上下文在用户面功能网元上,两套安全上下文具备不同的算法和密钥,且处于不同的实体,因此可以实现了安全隔离。此外,其中第二安全上下文可以是由终端设备与认证授权计费网元执行二次认证后产生的密钥生成的。第一安全上下文可以是由终端设备与统一数据管理网元(位于公网)执行首次认证后产生的密钥生成的。这样,即使统一数据管理网元的密钥被攻击者获得,由于攻击者没有获得认证授权计费网元的密钥,因此攻击者也无法获取第二安全上下文的第一密钥,从而可以进一步实现隔离。并且,假设用户面功能网元、会话管理功能网元、认证授权计费网元都由私网维护,而接入网设备、接入和移动性管理功能网元等由公网维护,公网也无法获得第一安全上下文,从而可以解决私网与公网互不信任的问题。So far, the terminal device can protect the user plane data by using the second security context and the first security context. The terminal device can acquire two sets of security contexts, the second security context and the first security context. The terminal device may use the first security context to perform user plane security protection when sending data corresponding to the PDU session (for example, private network data), and the access network device performs deprotection. When the terminal device sends data corresponding to the PDU session (eg, public network data), the terminal device can use the second security context to perform user plane security protection, and the user plane functional network element performs deprotection. Therefore, one set of security contexts is on the access network equipment, and the other set of security contexts is on the user plane functional network elements. The two sets of security contexts have different algorithms and keys, and are located in different entities, so it can be realized. Safe isolation. In addition, the second security context may be generated by a key generated after the terminal device and the authentication, authorization and accounting network element perform secondary authentication. The first security context may be generated by a key generated after the terminal device and the unified data management network element (located on the public network) perform the first authentication. In this way, even if the key of the unified data management network element is obtained by the attacker, since the attacker does not obtain the key of the authentication, authorization and accounting network element, the attacker cannot obtain the first key of the second security context. achieve isolation. In addition, it is assumed that the user plane function network elements, session management function network elements, and authentication, authorization and accounting network elements are maintained by the private network, while the access network equipment, access and mobility management function network elements, etc. are maintained by the public network. Also, the first security context cannot be obtained, so that the problem of mutual distrust between the private network and the public network can be solved.
应理解,本实施例的数据传输网元是用户面功能网元。It should be understood that the data transmission network element in this embodiment is a user plane functional network element.
基于上述网络架构,请参阅图6,图6是本发明实施例公开的又一种安全上下文生成方法的流程示意图。如图6所示,该安全上下文生成方法可以包括以下步骤。Based on the above network architecture, please refer to FIG. 6 , which is a schematic flowchart of another method for generating a security context disclosed in an embodiment of the present invention. As shown in FIG. 6 , the security context generation method may include the following steps.
601、终端设备获取第一安全上下文。601. A terminal device acquires a first security context.
其中,步骤601的详细描述可以参考步骤201的描述,在此不加赘述。The detailed description of step 601 may refer to the description of step 201, which will not be repeated here.
602、用户面功能网元预配置终端设备的标识和Kn根密钥对应关系。602. The user plane function network element preconfigures the corresponding relationship between the identifier of the terminal device and the Kn root key.
用户面功能网元可以预配置终端设备的标识和Kn根密钥之间的对应关系。终端设备的标识可以是通用公共用户标识(generic public subscription identifier,GPSI),也可以是互联网协议(internet protocol,IP)地址。即已知终端设备自身的标识,用户面功能网元可以在根据终端设备的标识与Kn根密钥对应关系确定第一密钥。例如,用户面功能网元可以预配置终端设备的标识与Kn根密钥的映射关系表,其中一个标识可以对应一个Kn根密钥。应理解,上述举例是对于用户面功能网元可以预配置终端设备的标识与Kn根密钥对应关系的举例说明,并不构成限定。The user plane function network element may preconfigure the correspondence between the identifier of the terminal device and the Kn root key. The identifier of the terminal device may be a generic public subscription identifier (GPSI) or an internet protocol (IP) address. That is, the identification of the terminal device itself is known, and the user plane function network element may determine the first key according to the corresponding relationship between the identification of the terminal device and the Kn root key. For example, the user plane function network element may preconfigure a mapping relationship table between the identifier of the terminal device and the Kn root key, where one identifier may correspond to one Kn root key. It should be understood that the above example is an example for the user plane function network element that can preconfigure the corresponding relationship between the identifier of the terminal device and the Kn root key, and does not constitute a limitation.
用户面功能网元预配置终端设备的标识和Kn根密钥对应关系之后,可以向对应的终端设备下发Kn根密钥。After the user plane function network element preconfigures the corresponding relationship between the identifier of the terminal device and the Kn root key, the Kn root key can be delivered to the corresponding terminal device.
步骤602的详细描述可以参考步骤205的描述,在此不加赘述。For the detailed description of step 602, reference may be made to the description of step 205, which will not be repeated here.
603、终端设备预配置Kn根密钥。603. The terminal device preconfigures the Kn root key.
604、终端设备向会话管理功能网元发送会话请求消息。604. The terminal device sends a session request message to the session management function network element.
其中,步骤604的详细描述可以参考步骤202的描述,在此不加赘述。The detailed description of step 604 may refer to the description of step 202, and details are not repeated here.
需要说明的是,会话请求消息可以包括终端设备的标识。It should be noted that the session request message may include the identifier of the terminal device.
605、会话管理功能网元确定对应的用户面功能网元。605. The session management function network element determines the corresponding user plane function network element.
会话管理功能网元可以先判断是否需要生成第二安全上下文。详细描述可以参考步骤 203的描述,在此不加赘述。The session management function network element may first determine whether the second security context needs to be generated. For a detailed description, reference may be made to the description of step 203, which will not be repeated here.
会话管理功能网元可以确定用户面功能网元。可选的,用户面功能网元具有终端设备的标识和Kn根密钥的对应关系。The session management function network element may determine the user plane function network element. Optionally, the user plane function network element has a corresponding relationship between the identifier of the terminal device and the Kn root key.
一种可能实现的方式,会话请求消息的DNN对应的用户面功能网元有一个,即可以确定这一用户面功能网元为生成对应第二安全上下文的网元。In a possible implementation manner, there is one user plane function network element corresponding to the DNN of the session request message, and it can be determined that this user plane function network element is the network element that generates the corresponding second security context.
另一种可能实现的方式,会话请求消息中DNN对应的用户面功能网元有多个。会话管理功能网元可以通过预配置终端设备的标识与用户面功能网元的对应关系确定用户面功能网元。可选地,会话管理功能网元也可以根据会话请求消息获得对应终端设备的上下文,再根据终端设备的上下文确定终端设备的标识,接着可以根据预配置的终端设备的标识与用户面功能网元的对应关系确定用户面功能网元。应理解,终端设备的标识可以由SM消息中携带,也可以由会话管理功能网元的上下文中保存。In another possible implementation manner, there are multiple user plane function network elements corresponding to the DNN in the session request message. The session management function network element may determine the user plane function network element by pre-configuring the corresponding relationship between the identifier of the terminal device and the user plane function network element. Optionally, the session management function network element can also obtain the context of the corresponding terminal device according to the session request message, and then determine the identity of the terminal device according to the context of the terminal device. The corresponding relationship determines the user plane function network element. It should be understood that the identity of the terminal device may be carried in the SM message, or may be stored in the context of the session management function network element.
606、会话管理功能网元向用户面功能网元发送额外安全上下文指示。606. The session management function network element sends an additional security context indication to the user plane function network element.
其中,步骤606的详细描述可以参考步骤203的描述,在此不加赘述。The detailed description of step 606 may refer to the description of step 203, which will not be repeated here.
需要说明的是,额外安全上下文指示可以包括终端设备的标识。It should be noted that the additional security context indication may include the identifier of the terminal device.
607、用户面功能网元根据额外安全上下文指示获取第二安全上下文。607. The user plane function network element acquires the second security context according to the additional security context indication.
用户面功能网元接收到来自会话管理功能网元的额外安全上下文指示之后,可以根据额外安全上下文指示生成第二安全上下文。详细描述可以参考步骤204的描述。After receiving the additional security context indication from the session management function network element, the user plane function network element may generate a second security context according to the additional security context indication. For a detailed description, please refer to the description of step 204 .
用户面功能网元可以根据额外安全上下文指示获取安全算法。详细描述可以参考步骤204中的描述,在此不加赘述。The user plane function network element can obtain the security algorithm according to the additional security context indication. For a detailed description, reference may be made to the description in step 204, which is not repeated here.
用户面功能网元可以根据额外安全上下文指示生成第一密钥。The user plane function network element may generate the first key according to the additional security context indication.
一种可能的实现方式,用户面功能网元可以先根据接收到终端设备的标识以及终端设备与Kn根密钥的对应关系确定Kn根密钥。用户面功能网元可以将Kn根密钥作为第一密钥。In a possible implementation manner, the user plane function network element may first determine the Kn root key according to the received identifier of the terminal device and the corresponding relationship between the terminal device and the Kn root key. The user plane function network element may use the Kn root key as the first key.
另一种可能的实现方式,用户面功能网元确定根Kn密钥之后,可以根据Kn根密钥和第一衍生参数生成第一密钥,具体生成方式的描述可以参考步骤204中的相关描述,在此不加赘述。In another possible implementation manner, after the user plane function network element determines the root Kn key, it can generate the first key according to the Kn root key and the first derivative parameter. For the description of the specific generation method, please refer to the relevant description in step 204 , will not be repeated here.
进一步地,用户面功能网元可以根据额外安全上下文指示,基于第一密钥生成安全密钥。Further, the user plane function network element may generate the security key based on the first key according to the additional security context indication.
用户面功能网元可以根据第一密钥以及第三衍生参数生成安全密钥。生成安全密钥的详细描述可以参考步骤204中根据第一密钥以及第三衍生参数生成安全密钥的描述,在此不加赘述。The user plane function network element may generate the security key according to the first key and the third derived parameter. For a detailed description of generating the security key, reference may be made to the description of generating the security key according to the first key and the third derived parameter in step 204, and details are not repeated here.
608、用户面功能网元向会话管理功能网元发送额外生成指示。608. The user plane function network element sends an additional generation instruction to the session management function network element.
用户面功能网元可以向会话管理功能网元发送额外生成指示,对应地,会话管理功能网元可以接收来自用户面功能网元的额外生成指示。The user plane function network element may send an additional generation instruction to the session management function network element, and correspondingly, the session management function network element may receive the additional generation instruction from the user plane function network element.
其中,步骤608的详细描述可以参考步骤205和步骤207的描述,在此不加赘述。The detailed description of step 608 may refer to the description of step 205 and step 207, and details are not repeated here.
609、会话管理功能网元向终端设备发送会话接受消息。609. The session management function network element sends a session acceptance message to the terminal device.
会话管理功能网元接收到来自用户面功能网元的额外生成指示之后,可以将接收到的额外生成指示封装在会话接受消息中,之后可以向终端设备发送会话接受消息,对应地,终端设备可以接收来自会话管理功能网元的会话接受消息。After the session management function network element receives the additional generation instruction from the user plane function network element, it can encapsulate the received additional generation instruction in a session accept message, and then can send a session accept message to the terminal device. Correspondingly, the terminal device can A session accept message is received from the session management function network element.
需要说明的是,会话接受消息可以包括额外生成指示,额外生成指示可以包括以下的一项或多项:第一衍生参数的指示、第二衍生参数的指示和安全算法的标识。其中,第一衍生参数的指示可以来自用户面功能网元;第二衍生参数的指示可以来自会话管理功能网元;安全算法的标识可以来自用户面功能网元,也可以来自会话管理功能网元。It should be noted that the session accept message may include an additional generation indication, and the additional generation indication may include one or more of the following: an indication of the first derived parameter, an indication of the second derived parameter, and an identification of a security algorithm. The indication of the first derivative parameter may come from the user plane functional network element; the indication of the second derivative parameter may come from the session management functional network element; the identification of the security algorithm may come from the user plane functional network element or the session management functional network element .
其中,步骤609的详细描述可以参考步骤205-207的描述,在此不加赘述。The detailed description of step 609 may refer to the description of steps 205-207, which will not be repeated here.
610、终端设备根据额外生成指示生成第二安全上下文。610. The terminal device generates a second security context according to the additional generation instruction.
终端设备可以根据额外生成指示获取第二安全上下文。步骤610的详细描述可以参考步骤607和步骤208中的描述。The terminal device may acquire the second security context according to the additionally generated instruction. The detailed description of step 610 can refer to the description in step 607 and step 208 .
终端设备可以根据额外生成指示获取安全算法。额外生成指示可以包括安全算法的标识,终端设备可以根据安全算法的标识确定安全算法。详细描述可以参考步骤607和步骤208中的相关描述,在此不加赘述。The terminal device can acquire the security algorithm according to the additional generated instructions. The additional generation indication may include the identification of the security algorithm, and the terminal device may determine the security algorithm according to the identification of the security algorithm. For a detailed description, reference may be made to the relevant descriptions in step 607 and step 208, which will not be repeated here.
终端设备可以根据额外生成指示生成第一密钥。详细描述可以参考步骤607和步骤208中的相关描述,在此不加赘述。The terminal device may generate the first key according to the additional generation instruction. For a detailed description, reference may be made to the relevant descriptions in step 607 and step 208, which will not be repeated here.
终端设备可以将预配置的Kn根密钥作为第一密钥。详细描述可以参考步骤607和步骤208中的相关描述,在此不加赘述。The terminal device may use the preconfigured Kn root key as the first key. For a detailed description, reference may be made to the relevant descriptions in step 607 and step 208, which will not be repeated here.
额外生成指示可以包括第一衍生参数的指示,终端设备可以根据Kn根密钥和第一衍生参数生成第一密钥。The additional generation indication may include an indication of the first derivative parameter, and the terminal device may generate the first key according to the Kn root key and the first derivative parameter.
进一步地,终端设备可以根据额外生成指示,基于第一密钥生成安全密钥。Further, the terminal device may generate the security key based on the first key according to the additional generation instruction.
额外生成指示包括安全算法的标识时,终端设备可以根据第一密钥以及第三衍生参数生成安全密钥。生成安全密钥的详细描述可以参考步骤204、步骤208和步骤607中根据第一密钥以及第三衍生参数生成安全密钥的描述,在此不加赘述。When additionally generating the identifier including the security algorithm, the terminal device may generate the security key according to the first key and the third derived parameter. For a detailed description of generating the security key, reference may be made to the description of generating the security key according to the first key and the third derivative parameter in step 204, step 208 and step 607, which will not be repeated here.
需要说明的是,当在生成第二安全上下文时,终端设备可以生成第一密钥时,此时第一密钥可以根据终端设备配置了Kn根密钥和第一衍生参数确定。It should be noted that, when the terminal device can generate the first key when generating the second security context, the first key can be determined according to the Kn root key and the first derivative parameter configured by the terminal device at this time.
至此,终端设备可以通过第二安全上下文和第一安全上下文对用户面数据进行保护。其中,第二安全上下文是由终端设备与用户面功能网元上预配置的Kn根密钥生成的,而图5对应的方法实施例中,第一安全上下文是由终端设备与统一数据管理网元(位于公网)执行首次认证后产生的密钥生成的。这样,即使统一数据管理网元的密钥被攻击者获得,由于攻击者没有获得用户面功能网元的密钥,因此攻击者无法获取第二安全上下文的密钥,从而可以进一步实现安全隔离。此外,相比于图5对应的方法实施例,本实施例不仅可以实现上述的功能,可以进一步降低私网设备的成本。So far, the terminal device can protect the user plane data by using the second security context and the first security context. Wherein, the second security context is generated by the Kn root key preconfigured on the terminal device and the user plane functional network element, and in the method embodiment corresponding to FIG. 5 , the first security context is generated by the terminal device and the unified data management network Element (located on the public network) is generated by the key generated after the first authentication is performed. In this way, even if the key of the unified data management network element is obtained by the attacker, since the attacker does not obtain the key of the user plane function network element, the attacker cannot obtain the key of the second security context, thereby further realizing security isolation. In addition, compared with the method embodiment corresponding to FIG. 5 , this embodiment can not only implement the above-mentioned functions, but also further reduce the cost of the private network device.
应理解,本实施例的数据传输网元是用户面功能网元。It should be understood that the data transmission network element in this embodiment is a user plane functional network element.
应理解,上述安全上下文生成方法中由终端设备执行的功能也可以由终端设备中的模块(例如,芯片)来执行,由会话管理功能网元执行的功能也可以由会话管理功能网元中的模块(例如,芯片)来执行,由数据传输网元执行的功能也可以由数据传输网元中的模块(例如,芯片)来执行,由用户面功能网元执行的功能也可以由用户面功能网元中的模块(例如,芯片)来执行,由接入网设备执行的功能也可以由接入网设备中的模块(例如,芯片)来执行。It should be understood that the functions performed by the terminal device in the above security context generation method may also be performed by a module (for example, a chip) in the terminal device, and the functions performed by the session management function network element may also be performed by the session management function network element. modules (for example, chips), the functions performed by the data transmission network elements may also be performed by modules (for example, chips) in the data transmission network elements, and the functions performed by the user plane function network elements may also be performed by the user plane functions. A module (eg, a chip) in a network element is performed, and functions performed by an access network device may also be performed by a module (eg, a chip) in the access network device.
基于上述网络架构,请参阅图7,图7是本申请实施例公开的一种安全上下文生成装置的结构示意图。如图7所示,所述装置可以包括获取单元701、发送单元702和接收单元703,其中:Based on the above network architecture, please refer to FIG. 7 , which is a schematic structural diagram of an apparatus for generating a security context disclosed in an embodiment of the present application. As shown in FIG. 7 , the apparatus may include an obtaining unit 701, a sending unit 702 and a receiving unit 703, wherein:
获取单元701,用于获取第一安全上下文,所述第一安全上下文用于保护所述终端设备的第一通信业务;an obtaining unit 701, configured to obtain a first security context, where the first security context is used to protect a first communication service of the terminal device;
发送单元702,用于向会话管理功能网元发送会话请求消息,所述会话请求消息用于请求建立第二通信业务的会话,所述第二通信业务与所述第一通信业务不同;A sending unit 702, configured to send a session request message to a session management function network element, where the session request message is used to request the establishment of a session of a second communication service, where the second communication service is different from the first communication service;
接收单元703,用于接收来自所述会话管理功能网元的会话接受消息,所述会话接受消息用于完成建立所述第二通信业务的会话;a receiving unit 703, configured to receive a session acceptance message from the session management function network element, where the session acceptance message is used to complete the establishment of the session of the second communication service;
获取单元701,还用于获取额外生成指示;an obtaining unit 701, further configured to obtain additional generation instructions;
获取单元701,还用于根据所述额外生成指示获取第二安全上下文,所述第二安全上下文用于保护所述第二通信业务。The obtaining unit 701 is further configured to obtain a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service.
作为一种可能的实施方式,所述会话请求消息包括第一指示信息,所述第一指示信息用于指示所述终端设备支持生成所述第二安全上下文。As a possible implementation manner, the session request message includes first indication information, where the first indication information is used to indicate that the terminal device supports generating the second security context.
作为一种可能的实施方式,所述获取单元701根据所述额外生成指示获取第二安全上下文,所述第二安全上下文用于保护所述第二通信业务包括:As a possible implementation manner, the obtaining unit 701 obtains a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service including:
根据所述额外生成指示,基于第一密钥获取安全密钥;和/或obtaining a security key based on the first key according to the additional generation indication; and/or
根据所述额外生成指示获取安全算法。A security algorithm is obtained according to the additional generation indication.
作为一种可能的实施方式,所述获取单元701根据所述额外生成指示,基于第一密钥获取安全密钥包括:As a possible implementation manner, the obtaining unit 701 obtains the security key based on the first key according to the additional generation instruction, including:
根据所述额外生成指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥;obtaining the first key based on the AS root key of the first security context according to the additional generation instruction;
根据所述第一密钥生成所述安全密钥。The security key is generated from the first key.
作为一种可能的实施方式,所述额外生成指示包含第一衍生参数的指示,所述获取单元701根据所述额外生成指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥包括:As a possible implementation manner, the additional generation instruction includes an indication of a first derivative parameter, and the obtaining unit 701 obtains the first derived parameter based on the AS root key of the first security context according to the additional generation instruction Keys include:
根据所述第一安全上下文的AS根密钥以及所述第一衍生参数生成所述第一密钥。The first key is generated according to the AS root key of the first security context and the first derived parameter.
作为一种可能的实施方式,所述第一衍生参数为下行PDCP COUNT,所述第一衍生参数的指示为所述下行PDCP COUNT的部分比特位。As a possible implementation manner, the first derivative parameter is a downlink PDCP COUNT, and the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
作为一种可能的实施方式,所述装置还可以包括:As a possible implementation manner, the device may further include:
执行单元704,用于执行二次认证;an execution unit 704, configured to perform secondary authentication;
生成单元705,用于在执行所述二次认证过程中生成二次认证密钥;a generating unit 705, configured to generate a secondary authentication key during the execution of the secondary authentication process;
所述获取单元701根据所述额外生成指示,基于第一密钥获取安全密钥包括:The obtaining unit 701 obtaining the security key based on the first key according to the additional generation instruction includes:
根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥;obtaining the first key based on the secondary authentication key according to the additional generation instruction;
根据所述第一密钥生成安全密钥。A security key is generated from the first key.
作为一种可能的实施方式,所述额外生成指示包含第二衍生参数的指示,所述获取单元701根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥包括:As a possible implementation manner, the additional generation instruction includes an indication of a second derivative parameter, and according to the additional generation instruction, the obtaining unit 701 obtains the first key based on the secondary authentication key, including:
根据所述第二衍生参数的指示,基于所述二次认证密钥以及所述第二衍生参数生成所述第一密钥。The first key is generated based on the secondary authentication key and the second derivative parameter according to the indication of the second derivative parameter.
作为一种可能的实施方式,所述第二衍生参数为以下参数的一项或多项:下行NAS COUNT、PDU session ID、NSSAI和DNN。As a possible implementation manner, the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
作为一种可能的实施方式,所述获取单元701根据所述第一密钥生成安全密钥包括:As a possible implementation manner, the obtaining unit 701 generating a security key according to the first key includes:
根据所述第一密钥以及第三衍生参数生成所述安全密钥。The security key is generated based on the first key and the third derived parameter.
作为一种可能的实施方式,所述额外生成指示包含所述安全算法的标识,所述获取单元701根据所述第一密钥以及第三衍生参数生成所述安全密钥包括:As a possible implementation manner, the additional generation instruction includes the identifier of the security algorithm, and the acquiring unit 701 generates the security key according to the first key and the third derived parameter, including:
根据所述第一密钥以及所述安全算法的标识和类型生成所述安全密钥。The security key is generated based on the first key and the identity and type of the security algorithm.
作为一种可能的实施方式,所述额外生成指示包括所述安全算法的标识。As a possible implementation manner, the additional generation indication includes the identification of the security algorithm.
作为一种可能的实施方式,当所述第一通信业务是公网业务时,所述第二通信业务是私网业务;当所述第一通信业务是私网业务时,所述第二通信业务是公网业务。As a possible implementation manner, when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
有关上述获取单元701、发送单元702、接收单元703、执行单元704和生成单元705更详细的描述可以直接参考上述图2-图6所示的方法实施例中终端设备的相关描述直接得到,这里不加赘述。More detailed descriptions of the above obtaining unit 701 , sending unit 702 , receiving unit 703 , executing unit 704 and generating unit 705 can be obtained directly by referring to the relevant descriptions of the terminal devices in the method embodiments shown in FIG. 2 to FIG. 6 , here Without further ado.
基于上述网络架构,请参阅图8,图8是本申请实施例公开的另一种安全上下文生成装置的结构示意图。如图8所示,所述装置可以包括:Based on the above network architecture, please refer to FIG. 8 , which is a schematic structural diagram of another security context generating apparatus disclosed in an embodiment of the present application. As shown in Figure 8, the apparatus may include:
接收单元801,用于接收来自终端设备的会话请求消息,所述会话请求消息用于请求建立第二通信业务的会话;a receiving unit 801, configured to receive a session request message from a terminal device, where the session request message is used to request the establishment of a session of the second communication service;
发送单元802,用于向数据传输网元发送额外安全上下文指示,所述额外安全上下文指示用于指示生成第二安全上下文,所述第二安全上下文用于保护所述第二通信业务;A sending unit 802, configured to send an additional security context indication to a data transmission network element, where the additional security context indication is used to instruct to generate a second security context, and the second security context is used to protect the second communication service;
所述发送单元802,还用于向所述终端设备发送会话接受消息,所述会话接受消息用于完成建立所述第二通信业务的会话。The sending unit 802 is further configured to send a session acceptance message to the terminal device, where the session acceptance message is used to complete the establishment of the session of the second communication service.
作为一种可能的实施方式,所述会话请求消息包括第一指示信息,所述第一指示信息用于指示所述终端设备支持生成第二安全上下文,所述发送单元802向数据传输网元发送额外安全上下文指示包括:As a possible implementation manner, the session request message includes first indication information, where the first indication information is used to instruct the terminal device to support generating the second security context, and the sending unit 802 sends to the data transmission network element Additional security context indications include:
当所述第一指示信息指示所述终端设备支持生成所述第二安全上下文时,向所述数据传输网元发送所述额外安全上下文指示。When the first indication information indicates that the terminal device supports generating the second security context, the additional security context indication is sent to the data transmission network element.
作为一种可能的实施方式,所述发送单元802向数据传输网元发送额外安全上下文指示包括:As a possible implementation manner, the sending unit 802 sending the additional security context indication to the data transmission network element includes:
根据所述会话请求消息获取所述终端设备的签约信息;Acquire the subscription information of the terminal device according to the session request message;
当所述终端设备的签约信息指示需要生成所述第二安全上下文时,向所述数据传输网元发送所述额外安全上下文指示。When the subscription information of the terminal device indicates that the second security context needs to be generated, the additional security context indication is sent to the data transmission network element.
作为一种可能的实施方式,所述发送单元802向数据传输网元发送额外安全上下文指示包括:As a possible implementation manner, the sending unit 802 sending the additional security context indication to the data transmission network element includes:
当所述会话管理功能网元配置的本地策略指示需要生成所述第二安全上下文时,向所述数据传输网元发送所述额外安全上下文指示。When the local policy configured by the session management function network element indicates that the second security context needs to be generated, the additional security context indication is sent to the data transmission network element.
作为一种可能的实施方式,所述额外安全上下文指示包括安全算法的标识,所述装置还可以包括获取单元803,其中:As a possible implementation manner, the additional security context indication includes an identifier of a security algorithm, and the apparatus may further include an obtaining unit 803, wherein:
获取单元803,用于获取所述安全算法。The obtaining unit 803 is configured to obtain the security algorithm.
作为一种可能的实施方式,所述额外安全上下文指示包括第一密钥,所述装置还可以包括:As a possible implementation manner, the additional security context indication includes a first key, and the apparatus may further include:
触发单元804,用于触发二次认证;a triggering unit 804 for triggering secondary authentication;
所述接收单元801,还用于所述二次认证成功后,接收来自认证授权计费网元的二次认证密钥;The receiving unit 801 is further configured to receive the secondary authentication key from the authentication, authorization and accounting network element after the secondary authentication is successful;
获取单元803,还用于根据所述二次认证密钥获取所述第一密钥。The obtaining unit 803 is further configured to obtain the first key according to the secondary authentication key.
作为一种可能的实施方式,所述获取单元803根据所述二次认证密钥获取所述第一密钥包括:As a possible implementation manner, the obtaining unit 803 obtaining the first key according to the secondary authentication key includes:
根据所述二次认证密钥以及第二衍生参数获取所述第一密钥。The first key is obtained according to the secondary authentication key and the second derived parameter.
作为一种可能的实施方式,所述第二衍生参数为以下参数的一项或多项:下行NAS COUNT、PDU session ID、NSSAI和DNN。As a possible implementation manner, the second derived parameter is one or more of the following parameters: downlink NAS COUNT, PDU session ID, NSSAI, and DNN.
作为一种可能的实施方式,所述会话接受消息包含第二衍生参数的指示,所述第二衍生参数的指示用于指示根据所述二次认证密钥获取安全密钥。As a possible implementation manner, the session acceptance message includes an indication of a second derivative parameter, where the indication of the second derivative parameter is used to instruct to obtain a security key according to the secondary authentication key.
有关上述接收单元801、发送单元802、获取单元803和触发单元804更详细的描述可以直接参考上述图2-图6所示的方法实施例中会话管理功能网元的相关描述直接得到,这里不加赘述。More detailed descriptions of the above receiving unit 801, sending unit 802, obtaining unit 803, and triggering unit 804 can be obtained directly by referring to the relevant descriptions of the network elements of session management function in the method embodiments shown in FIG. 2 to FIG. Add elaboration.
基于上述网络架构,请参阅图9,图9是本申请实施例公开的又一种安全上下文生成装置的结构示意图。如图9所示,所述装置可以包括:Based on the above network architecture, please refer to FIG. 9 , which is a schematic structural diagram of another security context generating apparatus disclosed in an embodiment of the present application. As shown in Figure 9, the apparatus may include:
接收单元901,用于接收来自会话管理功能网元的额外安全上下文指示;a receiving unit 901, configured to receive an additional security context indication from a session management function network element;
获取单元902,用于根据所述额外安全上下文指示获取第二安全上下文,所述第二安全上下文用于保护第二通信业务;an obtaining unit 902, configured to obtain a second security context according to the additional security context indication, where the second security context is used to protect the second communication service;
发送单元903,用于向终端设备发送额外生成指示,所述额外生成指示用于指示生成所述第二安全上下文。The sending unit 903 is configured to send an additional generation instruction to the terminal device, where the additional generation instruction is used to instruct to generate the second security context.
作为一种可能的实施方式,所述获取单元902具体用于:As a possible implementation manner, the obtaining unit 902 is specifically configured to:
根据所述额外安全上下文指示,基于第一密钥获取安全密钥;和/或obtaining a security key based on the first key according to the additional security context indication; and/or
根据所述额外安全上下文指示获取安全算法。A security algorithm is obtained according to the additional security context indication.
作为一种可能的实施方式,所述获取单元902,还用于接收来自会话管理功能网元的额外安全上下文指示之前,获取第一安全上下文,所述第一安全上下文用于保护第一通信业务,所述第一通信业务与所述第二通信业务不同。As a possible implementation manner, the acquiring unit 902 is further configured to acquire a first security context before receiving the additional security context indication from the session management function network element, where the first security context is used to protect the first communication service , the first communication service is different from the second communication service.
作为一种可能的实施方式,所述获取单元902根据所述额外安全上下文指示,基于第一密钥生成所述安全密钥包括:As a possible implementation manner, the obtaining unit 902 generates the security key based on the first key according to the additional security context indication, including:
根据所述额外安全上下文指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥;obtaining the first key based on the AS root key of the first security context according to the additional security context indication;
根据所述第一密钥生成所述安全密钥。The security key is generated from the first key.
作为一种可能的实施方式,所述额外生成指示包含第一衍生参数的指示,所述获取单元902根据所述额外安全上下文指示,基于所述第一安全上下文的AS根密钥获取所述第一 密钥包括:As a possible implementation manner, the additional generation indication includes an indication of a first derivative parameter, and the obtaining unit 902 obtains the first derivative parameter based on the AS root key of the first security context according to the additional security context indication. A key includes:
根据所述第一安全上下文的AS根密钥以及所述第一衍生参数生成所述第一密钥。The first key is generated according to the AS root key of the first security context and the first derived parameter.
作为一种可能的实施方式,所述第一衍生参数为下行PDCP COUNT,所述第一衍生参数的指示为所述下行PDCP COUNT的部分比特位。As a possible implementation manner, the first derivative parameter is a downlink PDCP COUNT, and the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
作为一种可能的实施方式,所述额外安全上下文指示包括所述第一密钥,所述获取单元902根据所述额外安全上下文指示,基于第一密钥获取所述安全密钥包括:As a possible implementation manner, the additional security context indication includes the first key, and according to the additional security context indication, the obtaining unit 902 obtains the security key based on the first key including:
根据所述第一密钥生成所述安全密钥。The security key is generated from the first key.
作为一种可能的实施方式,所述获取单元902根据所述第一密钥生成所述安全密钥包括:As a possible implementation manner, the obtaining unit 902 generating the security key according to the first key includes:
根据所述第一密钥以及第三衍生参数生成所述安全密钥。The security key is generated based on the first key and the third derived parameter.
作为一种可能的实施方式,所述额外安全上下文指示包含安全算法的标识,所述获取单元902根据所述第一密钥以及第三衍生参数生成所述安全密钥包括:As a possible implementation manner, the additional security context indication includes an identifier of a security algorithm, and the obtaining unit 902 generates the security key according to the first key and the third derived parameter, including:
根据所述第一密钥以及所述安全算法的标识和类型生成所述安全密钥。The security key is generated based on the first key and the identity and type of the security algorithm.
作为一种可能的实施方式,所述额外生成指示包括所述安全算法的标识。As a possible implementation manner, the additional generation indication includes the identification of the security algorithm.
作为一种可能的实施方式,所述额外安全上下文指示包括所述安全算法的标识。As a possible implementation manner, the additional security context indication includes an identifier of the security algorithm.
作为一种可能的实施方式,所述获取单元902根据所述额外安全上下文指示获取安全算法包括:As a possible implementation manner, the obtaining unit 902 obtains the security algorithm according to the additional security context indication, including:
根据所述额外安全上下文指示,基于所述终端设备的安全能力和预配置的算法优先级列表获取所述安全算法,所述终端设备的安全能力用于指示所述终端设备支持的所有安全算法。According to the additional security context indication, the security algorithm is acquired based on the security capability of the terminal device and a preconfigured algorithm priority list, where the security capability of the terminal device is used to indicate all security algorithms supported by the terminal device.
作为一种可能的实施方式,当所述第一通信业务是公网业务时,所述第二通信业务是私网业务;当所述第一通信业务是私网业务时,所述第二通信业务是公网业务。As a possible implementation manner, when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service, the second communication service The business is public network business.
有关上述接收单元901、获取单元902和发送单元903更详细的描述可以直接参考上述图2-图6所示的方法实施例中数据传输网元的相关描述直接得到,这里不加赘述。More detailed descriptions of the above receiving unit 901 , acquiring unit 902 and sending unit 903 can be obtained directly by referring to the relevant descriptions of the data transmission network elements in the method embodiments shown in FIG. 2 to FIG. 6 , which will not be repeated here.
基于上述网络架构,请参阅图10,图10是本申请实施例公开的又一种安全上下文生成装置的结构示意图。如图10所示,该安全上下文生成置可以包括处理器1001、存储器1002、输入接口1003、输出接口1004和总线1005。存储器1002可以是独立存在的,可以通过总线1005与处理器1001相连接。存储器1002也可以和处理器1001集成在一起。其中,总线1005用于实现这些组件之间的连接。Based on the above network architecture, please refer to FIG. 10 . FIG. 10 is a schematic structural diagram of another security context generating apparatus disclosed in an embodiment of the present application. As shown in FIG. 10 , the security context generating device may include a processor 1001 , a memory 1002 , an input interface 1003 , an output interface 1004 and a bus 1005 . The memory 1002 may exist independently, and may be connected to the processor 1001 through the bus 1005 . The memory 1002 may also be integrated with the processor 1001 . Among them, the bus 1005 is used to realize the connection between these components.
在一个实施例中,该安全上下文生成装置可以为终端设备或者终端设备内的模块(例如,芯片),存储器1002中存储的计算机程序指令被执行时,该处理器1001用于控制发送单元702和接收单元703执行上述实施例中执行的操作,该处理器1001还用于执行获取单元701、执行单元704和生成单元705上述实施例中执行的操作,输入接口1003用于执行上述实施例中接收单元703执行的操作,输出接口1004用于执行上述实施例中发送单元702执行的操作。上述终端设备或者终端设备内的模块还可以用于执行上述图2-图6方法实施例中终端设备执行的各种方法,不再赘述。In one embodiment, the security context generating apparatus may be a terminal device or a module (eg, a chip) in the terminal device. When the computer program instructions stored in the memory 1002 are executed, the processor 1001 is configured to control the sending unit 702 and The receiving unit 703 performs the operations performed in the foregoing embodiments, the processor 1001 is further configured to perform the operations performed by the acquiring unit 701, the executing unit 704, and the generating unit 705 performed in the foregoing embodiments, and the input interface 1003 is configured to perform the receiving operations performed in the foregoing embodiments. The operation performed by the unit 703, and the output interface 1004 is used to perform the operation performed by the sending unit 702 in the foregoing embodiment. The above-mentioned terminal device or modules in the terminal device may also be used to execute various methods performed by the terminal device in the above-mentioned method embodiments of FIG. 2 to FIG.
在一个实施例中,该安全上下文生成装置可以为会话管理功能网元或者会话管理功能 网元内的模块(例如,芯片),存储器1002中存储的计算机程序指令被执行时,该处理器1001用于控制接收单元801和发送单元803执行上述实施例中执行的操作,该处理器1001还用于执行获取单元803和触发单元804上述实施例中执行的操作,输入接口1003用于执行上述实施例中接收单元801执行的操作,输出接口1004用于执行上述实施例中发送单元802执行的操作。上述会话管理功能网元或者会话管理功能网元内的模块还可以用于执行上述图2-图6方法实施例中会话管理功能网元执行的各种方法,不再赘述。In one embodiment, the security context generating apparatus may be a session management function network element or a module (eg, a chip) in the session management function network element. When the computer program instructions stored in the memory 1002 are executed, the processor 1001 uses the For controlling the receiving unit 801 and the sending unit 803 to perform the operations performed in the above embodiments, the processor 1001 is further configured to perform the operations performed by the acquiring unit 803 and the triggering unit 804 in the above embodiments, and the input interface 1003 is used to perform the above embodiments. The operation performed by the receiving unit 801 in the above-mentioned embodiment, and the output interface 1004 is used to perform the operation performed by the sending unit 802 in the above-mentioned embodiment. The above session management function network element or modules in the session management function network element can also be used to execute various methods performed by the session management function network element in the above method embodiments of FIG. 2 to FIG.
在一个实施例中,该安全上下文生成装置可以为数据传输网元或者数据传输网元内的模块(例如,芯片),存储器1002中存储的计算机程序指令被执行时,该处理器1001用于控制接收单元901和发送单元903执行上述实施例中执行的操作,该处理器1001还用于执行获取单元902上述实施例中执行的操作,输入接口1003用于执行上述实施例中接收单元901执行的操作,输出接口1004用于执行上述实施例中发送单元903执行的操作。上述数据传输网元或者数据传输网元内的模块还可以用于执行上述图2-图6方法实施例中数据传输网元执行的各种方法,不再赘述。In one embodiment, the security context generating apparatus may be a data transmission network element or a module (eg, a chip) in the data transmission network element. When the computer program instructions stored in the memory 1002 are executed, the processor 1001 is used to control the The receiving unit 901 and the sending unit 903 perform the operations performed in the foregoing embodiments, the processor 1001 is further configured to perform the operations performed by the acquiring unit 902 in the foregoing embodiments, and the input interface 1003 is configured to perform the operations performed by the receiving unit 901 in the foregoing embodiments. Operation, the output interface 1004 is used to perform the operation performed by the sending unit 903 in the above-mentioned embodiment. The foregoing data transmission network element or modules within the data transmission network element may also be used to execute various methods performed by the data transmission network element in the foregoing method embodiments of FIG. 2 to FIG. 6 , which will not be repeated.
基于上述网络架构,请参阅图11,图11是本申请实施例公开的又一种安全上下文生成装置的结构示意图。如图11所示,该安全上下文生成装置可以包括输入接口1101、逻辑电路1102和输出接口1103。输入接口1101与输出接口1103通过逻辑电路1102相连接。其中,输入接口1101用于接收来自其它装置的信息,输出接口1103用于向其它装置输出、调度或者发送信息。逻辑电路1102用于执行除输入接口1101与输出接口1103的操作之外的操作,例如实现上述实施例中处理器1001实现的功能。其中,该安全上下文生成装置可以为终端设备或者终端设备的模块,也可以为会话管理功能网元或者会话管理功能网元的模块,还可以为数据传输网元或者数据传输网元的模块。其中,有关输入接口1101、逻辑电路1102和输出接口1103更详细的描述可以直接参考上述方法实施例中终端设备、会话管理功能网元和数据传输网元的相关描述直接得到,这里不加赘述。Based on the above network architecture, please refer to FIG. 11 . FIG. 11 is a schematic structural diagram of another security context generating apparatus disclosed in an embodiment of the present application. As shown in FIG. 11 , the security context generating apparatus may include an input interface 1101 , a logic circuit 1102 and an output interface 1103 . The input interface 1101 and the output interface 1103 are connected through the logic circuit 1102 . The input interface 1101 is used for receiving information from other devices, and the output interface 1103 is used for outputting, scheduling or sending information to other devices. The logic circuit 1102 is configured to perform operations other than the operations of the input interface 1101 and the output interface 1103, for example, to implement the functions implemented by the processor 1001 in the above-mentioned embodiment. The security context generating apparatus may be a terminal device or a module of the terminal device, a session management function network element or a module of a session management function network element, or a data transmission network element or a module of the data transmission network element. The more detailed description of the input interface 1101, the logic circuit 1102 and the output interface 1103 can be obtained directly by referring to the relevant descriptions of the terminal device, the session management function network element and the data transmission network element in the above method embodiments, and will not be repeated here.
本申请实施例还公开一种计算机可读存储介质,其上存储有指令,该指令被执行时执行上述方法实施例中的方法。The embodiments of the present application further disclose a computer-readable storage medium, on which instructions are stored, and when the instructions are executed, the methods in the foregoing method embodiments are executed.
本申请实施例还公开一种包括指令的计算机程序产品,该指令被执行时执行上述方法实施例中的方法。The embodiment of the present application further discloses a computer program product including an instruction, when the instruction is executed, the method in the foregoing method embodiment is executed.
本申请实施例还公开一种通信系统,该通信系统包括终端设备、会话管理功能网元和数据传输网元,具体描述可以参考图2-图6所示的安全上下文生成方法。The embodiment of the present application also discloses a communication system, which includes a terminal device, a session management function network element, and a data transmission network element. For a specific description, reference may be made to the security context generation method shown in FIG. 2 to FIG. 6 .
以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above descriptions are only specific embodiments of the present application, and are not intended to limit the The protection scope, any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present application shall be included within the protection scope of the present application.

Claims (29)

  1. 一种安全上下文生成方法,其特征在于,包括:A method for generating a security context, comprising:
    终端设备获取第一安全上下文,所述第一安全上下文用于保护所述终端设备的第一通信业务;The terminal device acquires a first security context, where the first security context is used to protect the first communication service of the terminal device;
    所述终端设备向会话管理功能网元发送会话请求消息,所述会话请求消息用于请求建立第二通信业务的会话,所述第二通信业务与所述第一通信业务不同;sending, by the terminal device, a session request message to the session management function network element, where the session request message is used to request the establishment of a session of a second communication service, where the second communication service is different from the first communication service;
    所述终端设备接收来自所述会话管理功能网元的会话接受消息,所述会话接受消息用于完成建立所述第二通信业务的会话;receiving, by the terminal device, a session acceptance message from the session management function network element, where the session acceptance message is used to complete the establishment of the session for the second communication service;
    所述终端设备获取额外生成指示;the terminal device obtains an additional generation instruction;
    所述终端设备根据所述额外生成指示获取第二安全上下文,所述第二安全上下文用于保护所述第二通信业务。The terminal device acquires a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service.
  2. 根据权利要求1所述的方法,其特征在于,所述会话请求消息包括第一指示信息,所述第一指示信息用于指示所述终端设备支持生成所述第二安全上下文。The method according to claim 1, wherein the session request message includes first indication information, and the first indication information is used to instruct the terminal device to support generating the second security context.
  3. 根据权利要求1或2所述的方法,其特征在于,所述终端设备根据所述额外生成指示获取第二安全上下文,包括:The method according to claim 1 or 2, wherein the terminal device obtains the second security context according to the additional generation indication, comprising:
    所述终端设备根据所述额外生成指示,基于第一密钥获取安全密钥;和/或The terminal device obtains the security key based on the first key according to the additional generation instruction; and/or
    所述终端设备根据所述额外生成指示获取安全算法。The terminal device acquires a security algorithm according to the additional generation instruction.
  4. 根据权利要求3所述的方法,其特征在于,所述终端设备根据所述额外生成指示,基于第一密钥获取安全密钥,包括:The method according to claim 3, wherein the terminal device obtains the security key based on the first key according to the additional generation instruction, comprising:
    所述终端设备根据所述额外生成指示,基于所述第一安全上下文的接入层AS根密钥获取所述第一密钥;The terminal device obtains the first key based on the access stratum AS root key of the first security context according to the additional generation instruction;
    所述终端设备根据所述第一密钥生成所述安全密钥。The terminal device generates the security key according to the first key.
  5. 根据权利要求4所述的方法,其特征在于,所述额外生成指示包含第一衍生参数的指示,所述终端设备根据所述额外生成指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥,包括:The method according to claim 4, wherein the additional generation instruction includes an indication of a first derivative parameter, and the terminal device obtains the AS root key based on the first security context according to the additional generation instruction The first key includes:
    所述终端设备根据所述第一安全上下文的AS根密钥以及所述第一衍生参数生成所述第一密钥。The terminal device generates the first key according to the AS root key of the first security context and the first derived parameter.
  6. 根据权利要求5所述的方法,其特征在于,所述第一衍生参数为下行分组数据汇聚协议PDCP COUNT,所述第一衍生参数的指示为所述下行PDCP COUNT的部分比特位。The method according to claim 5, wherein the first derivative parameter is a downlink packet data convergence protocol PDCP COUNT, and the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
  7. 根据权利要求3所述的方法,其特征在于,在所述终端设备向所述会话管理功能网元发送所述会话请求消息之后,所述终端设备接收所述额外生成指示之前,所述方法还包括:The method according to claim 3, wherein after the terminal device sends the session request message to the session management function network element, and before the terminal device receives the additional generation indication, the method further comprises: include:
    所述终端设备执行二次认证;the terminal device performs secondary authentication;
    所述终端设备在执行所述二次认证过程中生成二次认证密钥;The terminal device generates a secondary authentication key during the execution of the secondary authentication process;
    所述终端设备根据所述额外生成指示,基于第一密钥获取安全密钥,包括:The terminal device obtains the security key based on the first key according to the additional generation instruction, including:
    所述终端设备根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥;The terminal device obtains the first key based on the secondary authentication key according to the additional generation instruction;
    所述终端设备根据所述第一密钥生成安全密钥。The terminal device generates a security key according to the first key.
  8. 根据权利要求7所述的方法,其特征在于,所述额外生成指示包含第二衍生参数的 指示,所述终端设备根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥,包括:The method according to claim 7, wherein the additional generation instruction includes an indication of a second derived parameter, and the terminal device obtains the first derived parameter based on the secondary authentication key according to the additional generation instruction keys, including:
    所述终端设备根据所述第二衍生参数的指示,基于所述二次认证密钥以及所述第二衍生参数生成所述第一密钥。The terminal device generates the first key based on the secondary authentication key and the second derivative parameter according to the indication of the second derivative parameter.
  9. 根据权利要求8所述的方法,其特征在于,所述第二衍生参数为以下参数的一项或多项:下行非接入层NAS COUNT、协议数据单元会话身份标识PDU session ID、网络切片选择支撑信息NSSAI和数据网络名称DNN。The method according to claim 8, wherein the second derived parameter is one or more of the following parameters: downlink non-access stratum NAS COUNT, protocol data unit session identity PDU session ID, network slice selection Support information NSSAI and data network name DNN.
  10. 根据权利要求4-9任一项所述的方法,其特征在于,所述终端设备根据所述第一密钥生成所述安全密钥,包括:The method according to any one of claims 4-9, wherein the terminal device generates the security key according to the first key, comprising:
    所述终端设备根据所述第一密钥以及第三衍生参数生成所述安全密钥。The terminal device generates the security key according to the first key and the third derived parameter.
  11. 根据权利要求10所述的方法,其特征在于,所述额外生成指示包含所述安全算法的标识,所述终端设备根据所述第一密钥以及第三衍生参数生成所述安全密钥,包括:The method according to claim 10, wherein the additional generation indication includes an identifier of the security algorithm, and the terminal device generates the security key according to the first key and a third derived parameter, comprising: :
    所述终端设备根据所述第一密钥以及所述安全算法的标识和类型生成所述安全密钥。The terminal device generates the security key according to the first key and the identity and type of the security algorithm.
  12. 根据权利要求3所述的方法,其特征在于,所述额外生成指示包括所述安全算法的标识。3. The method of claim 3, wherein the additional generation indication includes an identification of the security algorithm.
  13. 根据权利要求1-12任一项所述的方法,其特征在于,当所述第一通信业务是公网业务时,所述第二通信业务是私网业务;当所述第一通信业务是私网业务时,所述第二通信业务是公网业务。The method according to any one of claims 1-12, wherein when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service In the case of a private network service, the second communication service is a public network service.
  14. 一种安全上下文生成装置,其特征在于,所述装置为终端设备,所述装置包括:An apparatus for generating a security context, characterized in that the apparatus is a terminal device, and the apparatus includes:
    获取单元,用于获取第一安全上下文,所述第一安全上下文用于保护所述终端设备的第一通信业务;an acquiring unit, configured to acquire a first security context, where the first security context is used to protect the first communication service of the terminal device;
    发送单元,用于向会话管理功能网元发送会话请求消息,所述会话请求消息用于请求建立第二通信业务的会话,所述第二通信业务与所述第一通信业务不同;a sending unit, configured to send a session request message to the session management function network element, where the session request message is used to request the establishment of a session of a second communication service, where the second communication service is different from the first communication service;
    接收单元,用于接收来自所述会话管理功能网元的会话接受消息,所述会话接受消息用于完成建立所述第二通信业务的会话;a receiving unit, configured to receive a session acceptance message from the session management function network element, where the session acceptance message is used to complete the establishment of the session of the second communication service;
    获取单元,还用于获取额外生成指示;The obtaining unit is also used to obtain additional generation instructions;
    获取单元,还用于根据所述额外生成指示获取第二安全上下文,所述第二安全上下文用于保护所述第二通信业务。The obtaining unit is further configured to obtain a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service.
  15. 根据权利要求14所述的装置,其特征在于,所述会话请求消息包括第一指示信息,所述第一指示信息用于指示所述终端设备支持生成所述第二安全上下文。The apparatus according to claim 14, wherein the session request message includes first indication information, and the first indication information is used to instruct the terminal device to support generating the second security context.
  16. 根据权利要求14或15所述的装置,其特征在于,所述获取单元根据所述额外生成指示获取第二安全上下文,所述第二安全上下文用于保护所述第二通信业务包括:The apparatus according to claim 14 or 15, wherein the acquiring unit acquires a second security context according to the additional generation instruction, where the second security context is used to protect the second communication service comprising:
    根据所述额外生成指示,基于第一密钥获取安全密钥;和/或obtaining a security key based on the first key according to the additional generation indication; and/or
    根据所述额外生成指示获取安全算法。A security algorithm is obtained according to the additional generation indication.
  17. 根据权利要求16所述的装置,其特征在于,所述获取单元根据所述额外生成指示,基于第一密钥获取安全密钥包括:The apparatus according to claim 16, wherein the obtaining unit, according to the additional generation instruction, obtains the security key based on the first key, comprising:
    根据所述额外生成指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥;obtaining the first key based on the AS root key of the first security context according to the additional generation instruction;
    根据所述第一密钥生成所述安全密钥。The security key is generated from the first key.
  18. 根据权利要求17所述的装置,其特征在于,所述额外生成指示包含第一衍生参数的指示,所述获取单元根据所述额外生成指示,基于所述第一安全上下文的AS根密钥获取所述第一密钥包括:The apparatus according to claim 17, wherein the additional generation indication includes an indication of a first derivative parameter, and the obtaining unit obtains the AS root key based on the first security context according to the additional generation indication The first key includes:
    根据所述第一安全上下文的AS根密钥以及所述第一衍生参数生成所述第一密钥。The first key is generated according to the AS root key of the first security context and the first derived parameter.
  19. 根据权利要求18所述的装置,其特征在于,所述第一衍生参数为下行分组数据汇聚协议PDCP COUNT,所述第一衍生参数的指示为所述下行PDCP COUNT的部分比特位。The apparatus according to claim 18, wherein the first derivative parameter is a downlink packet data convergence protocol PDCP COUNT, and the indication of the first derivative parameter is part of the bits of the downlink PDCP COUNT.
  20. 根据权利要求16所述的装置,其特征在于,所述装置还包括:The apparatus of claim 16, wherein the apparatus further comprises:
    执行单元,用于执行二次认证;an execution unit for performing secondary authentication;
    生成单元,用于在执行所述二次认证过程中生成二次认证密钥;a generating unit, configured to generate a secondary authentication key during the execution of the secondary authentication process;
    所述获取单元根据所述额外生成指示,基于第一密钥获取安全密钥包括:The obtaining unit obtaining the security key based on the first key according to the additional generation instruction includes:
    根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥;obtaining the first key based on the secondary authentication key according to the additional generation instruction;
    根据所述第一密钥生成安全密钥。A security key is generated from the first key.
  21. 根据权利要求20所述的装置,其特征在于,所述额外生成指示包含第二衍生参数的指示,所述获取单元根据所述额外生成指示,基于所述二次认证密钥获取所述第一密钥包括:The apparatus according to claim 20, wherein the additional generation instruction includes an indication of a second derivative parameter, and the obtaining unit obtains the first derived parameter based on the secondary authentication key according to the additional generation instruction Keys include:
    根据所述第二衍生参数的指示,基于所述二次认证密钥以及所述第二衍生参数生成所述第一密钥。The first key is generated based on the secondary authentication key and the second derivative parameter according to the indication of the second derivative parameter.
  22. 根据权利要求21所述的装置,其特征在于,所述第二衍生参数为以下参数的一项或多项:下行非接入层NAS COUNT、协议数据单元会话身份标识PDU session ID、网络切片选择支撑信息NSSAI和数据网络名称DNN。The apparatus according to claim 21, wherein the second derived parameter is one or more of the following parameters: downlink non-access stratum NAS COUNT, protocol data unit session identity PDU session ID, network slice selection Support information NSSAI and data network name DNN.
  23. 根据权利要求17-22任一项所述的装置,其特征在于,所述获取单元根据所述第一密钥生成安全密钥包括:The device according to any one of claims 17-22, wherein the obtaining unit generating a security key according to the first key comprises:
    根据所述第一密钥以及第三衍生参数生成所述安全密钥。The security key is generated based on the first key and the third derived parameter.
  24. 根据权利要求23所述的装置,其特征在于,所述额外生成指示包含所述安全算法的标识,所述生成单元根据所述第一密钥以及第三衍生参数生成所述安全密钥包括:The apparatus according to claim 23, wherein the additional generation instruction includes an identifier of the security algorithm, and the generation unit generating the security key according to the first key and a third derivative parameter comprises:
    根据所述第一密钥以及所述安全算法的标识和类型生成所述安全密钥。The security key is generated based on the first key and the identity and type of the security algorithm.
  25. 根据权利要求16所述的装置,其特征在于,所述额外生成指示包括所述安全算法的标识。17. The apparatus of claim 16, wherein the additional generation indication includes an identification of the security algorithm.
  26. 根据权利要求16-25任一项所述的装置,其特征在于,当所述第一通信业务是公网业务时,所述第二通信业务是私网业务;当所述第一通信业务是私网业务时,所述第二通信业务是公网业务。The apparatus according to any one of claims 16-25, wherein when the first communication service is a public network service, the second communication service is a private network service; when the first communication service is a private network service In the case of a private network service, the second communication service is a public network service.
  27. 一种安全上下文生成装置,其特征在于,包括处理器、存储器、输入接口和输出接口,所述输入接口用于接收来自所述安全上下文生成装置之外的其它安全上下文生成装置的信息,所述输出接口用于向所述安全上下文生成装置之外的其它安全上下文生成装置输出信息,所述处理器调用所述存储器中存储的计算机程序实现如权利要求1-13任一项所述的方法。A security context generating device, characterized in that it comprises a processor, a memory, an input interface and an output interface, wherein the input interface is used to receive information from other security context generating devices other than the security context generating device, the The output interface is used for outputting information to other security context generating devices other than the security context generating device, and the processor invokes the computer program stored in the memory to implement the method according to any one of claims 1-13.
  28. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序或计算机指令,当所述计算机程序或计算机指令被运行时,实现如权利要求1-13任一项所述的方法。A computer-readable storage medium, characterized in that, a computer program or computer instruction is stored in the computer-readable storage medium, and when the computer program or computer instruction is executed, any one of claims 1-13 is implemented. the method described.
  29. 一种芯片,其特征在于,包括处理器,用于执行存储器中存储的程序,当所述程序被执行时,使得所述芯片执行如权利要求1-13任一项所述的方法。A chip, characterized in that it includes a processor for executing a program stored in a memory, and when the program is executed, causes the chip to execute the method according to any one of claims 1-13.
PCT/CN2020/139666 2020-12-25 2020-12-25 Method and apparatus for generating security context, and computer-readable storage medium WO2022134089A1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
PCT/CN2020/139666 WO2022134089A1 (en) 2020-12-25 2020-12-25 Method and apparatus for generating security context, and computer-readable storage medium
EP20966652.8A EP4262258A4 (en) 2020-12-25 2020-12-25 Method and apparatus for generating security context, and computer-readable storage medium
CN202080107902.9A CN116601985A (en) 2020-12-25 2020-12-25 Security context generation method, device and computer readable storage medium
US18/340,651 US20230337002A1 (en) 2020-12-25 2023-06-23 Security context generation method and apparatus, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/139666 WO2022134089A1 (en) 2020-12-25 2020-12-25 Method and apparatus for generating security context, and computer-readable storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/340,651 Continuation US20230337002A1 (en) 2020-12-25 2023-06-23 Security context generation method and apparatus, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2022134089A1 true WO2022134089A1 (en) 2022-06-30

Family

ID=82158701

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139666 WO2022134089A1 (en) 2020-12-25 2020-12-25 Method and apparatus for generating security context, and computer-readable storage medium

Country Status (4)

Country Link
US (1) US20230337002A1 (en)
EP (1) EP4262258A4 (en)
CN (1) CN116601985A (en)
WO (1) WO2022134089A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024067993A1 (en) * 2022-09-30 2024-04-04 Telefonaktiebolaget Lm Ericsson (Publ) Pdu session modification for a subscriber entity

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230224705A1 (en) * 2022-01-10 2023-07-13 Charter Communications Operating, Llc Wireless connection information generation, distribution, and use

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110673849A (en) * 2019-08-14 2020-01-10 惠州市德赛西威智能交通技术研究院有限公司 Method and device for presetting file security context in batches
CN110913389A (en) * 2018-09-15 2020-03-24 华为技术有限公司 Method and device for acquiring security context
WO2020092303A1 (en) * 2018-11-02 2020-05-07 Qualcomm Incorporated Unicast sidelink establishment
CN111133732A (en) * 2017-09-26 2020-05-08 瑞典爱立信有限公司 Managing security context and performing key derivation at handover in a wireless communication system
CN111328112A (en) * 2018-12-14 2020-06-23 华为技术有限公司 Method, device and system for isolating security context

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BR112020000932A2 (en) * 2017-07-20 2020-07-21 Huawei International Pte. Ltd. network security management method, and device
WO2019101898A1 (en) * 2017-11-24 2019-05-31 Sony Mobile Communications Inc. Transfer/cloning of security context

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111133732A (en) * 2017-09-26 2020-05-08 瑞典爱立信有限公司 Managing security context and performing key derivation at handover in a wireless communication system
CN110913389A (en) * 2018-09-15 2020-03-24 华为技术有限公司 Method and device for acquiring security context
WO2020092303A1 (en) * 2018-11-02 2020-05-07 Qualcomm Incorporated Unicast sidelink establishment
CN111328112A (en) * 2018-12-14 2020-06-23 华为技术有限公司 Method, device and system for isolating security context
CN110673849A (en) * 2019-08-14 2020-01-10 惠州市德赛西威智能交通技术研究院有限公司 Method and device for presetting file security context in batches

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
3GPP TS 33.501
3GPP TS 33.501 AND RFC 3748
See also references of EP4262258A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024067993A1 (en) * 2022-09-30 2024-04-04 Telefonaktiebolaget Lm Ericsson (Publ) Pdu session modification for a subscriber entity

Also Published As

Publication number Publication date
EP4262258A4 (en) 2024-01-24
CN116601985A (en) 2023-08-15
EP4262258A1 (en) 2023-10-18
US20230337002A1 (en) 2023-10-19

Similar Documents

Publication Publication Date Title
US11695742B2 (en) Security implementation method, device, and system
CN110830991B (en) Secure session method and device
WO2020248624A1 (en) Communication method, network device, user equipment and access network device
WO2019062996A1 (en) Method, apparatus, and system for security protection
US20210112406A1 (en) Communication method and communications apparatus
US20200228977A1 (en) Parameter Protection Method And Device, And System
JP2022502908A (en) Systems and methods for securing NAS messages
US20200344245A1 (en) Message sending method and apparatus
WO2019096075A1 (en) Method and apparatus for message protection
WO2017133021A1 (en) Security processing method and relevant device
WO2020253408A1 (en) Secondary authentication method and apparatus
JP2021503839A (en) Security protection methods and equipment
US20230337002A1 (en) Security context generation method and apparatus, and computer-readable storage medium
WO2022253083A1 (en) Isolation method, apparatus and system for public and private network services
WO2021031055A1 (en) Communication method and device
CN114600487B (en) Identity authentication method and communication device
WO2018170703A1 (en) Connection establishment method and device
US20210168614A1 (en) Data Transmission Method and Device
US20240089728A1 (en) Communication method and apparatus
CN115706973A (en) Method and device for secure communication
WO2022228455A1 (en) Communication method and related apparatus
WO2023213191A1 (en) Security protection method and communication apparatus
WO2023246457A1 (en) Security decision negotiation method and network element
US20230239689A1 (en) Key derivation method, apparatus, and system
CN114208240B (en) Data transmission method, device and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20966652

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202080107902.9

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 202317043057

Country of ref document: IN

ENP Entry into the national phase

Ref document number: 2020966652

Country of ref document: EP

Effective date: 20230711

NENP Non-entry into the national phase

Ref country code: DE