CN110768795B - Session establishment method and device - Google Patents

Session establishment method and device Download PDF

Info

Publication number
CN110768795B
CN110768795B CN201911051382.XA CN201911051382A CN110768795B CN 110768795 B CN110768795 B CN 110768795B CN 201911051382 A CN201911051382 A CN 201911051382A CN 110768795 B CN110768795 B CN 110768795B
Authority
CN
China
Prior art keywords
session
certificate
network element
digital certificate
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911051382.XA
Other languages
Chinese (zh)
Other versions
CN110768795A (en
Inventor
李文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201911051382.XA priority Critical patent/CN110768795B/en
Publication of CN110768795A publication Critical patent/CN110768795A/en
Application granted granted Critical
Publication of CN110768795B publication Critical patent/CN110768795B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to the technical field of computer networks, and provides a session establishment method and device. The session establishment method applies an SDN controller and comprises the following steps: responding to a request for establishing an encryption session between two end network element devices, respectively sending an instruction for initializing the encryption session to the two end network element devices, and indicating the two end network element devices to apply for a digital certificate to the SDN controller; receiving certificate application requests sent by network element equipment at two ends respectively, and generating a digital certificate according to the certificate application requests; and respectively sending the corresponding digital certificates to the network element equipment at the two ends, so that the network element equipment at the two ends can perform key agreement of encrypted session by exchanging the digital certificates. The method eliminates the strong dependence on CA in the process of establishing the encrypted link, and the network element equipment does not need to preset a digital certificate in the method, thereby being beneficial to avoiding resource waste and being suitable for dynamic deployment of the encrypted link.

Description

Session establishment method and device
Technical Field
The present application relates to the field of computer network technologies, and in particular, to a session establishment method and apparatus.
Background
In network communication, secure information transmission is a very important link. There are also many techniques for secure transmission, of which link encryption is one.
In a traditional encryption model, the identity authentication of the device is completed through a digital Certificate, the Certificate is issued by a Certificate Authority (CA for short), and the creation process of the link strongly depends on the CA, so that the application, distribution and use of the Certificate are inconvenient.
Disclosure of Invention
In view of the above, embodiments of the present application provide a session establishment method and apparatus to solve the above technical problems.
In order to achieve the above purpose, the present application provides the following technical solutions:
in a first aspect, an embodiment of the present application provides a session establishment method, which is applied to a Software Defined Network (SDN) controller, and the method includes: responding to a request for establishing an encryption session between two end network element devices, respectively sending an instruction for initializing the encryption session to the two end network element devices, and indicating the two end network element devices to apply for a digital certificate to the SDN controller; receiving certificate application requests sent by the two-end network element equipment respectively, and generating a digital certificate according to the certificate application requests; and respectively sending the digital certificates corresponding to the two end network element devices, so that the two end network element devices perform key agreement of encryption session by exchanging the digital certificates.
The method is applied to an SDN network environment, and the SDN controller is used for bearing the function of the CA in the certificate signing and issuing aspect, so that the strong dependence on the CA in the encryption link creating process (establishing the encryption session between network element devices at two ends is also called creating the encryption link) is eliminated, even the CA is not set, and the application, distribution and use processes of the digital certificate are simplified. In addition, the SDN controller further generates and issues the digital certificate only when receiving a request for establishing an encryption session between network element devices at two ends, and the network element devices do not need to preset the digital certificate, so that the method is beneficial to avoiding resource waste and is suitable for dynamic deployment of an encryption link.
In an implementation manner of the first aspect, the sending, to the two end network element devices, respective corresponding digital certificates respectively so that the two end network element devices perform key agreement of an encryption session by exchanging the digital certificates includes: respectively sending the digital certificates corresponding to the two terminal network element devices; and selecting one end from the two-end network element equipment, sending an instruction for establishing an encryption session to the selected network element equipment, and indicating the network element equipment as an initiator of key agreement to perform the key agreement of the encryption session with opposite-end equipment by exchanging a digital certificate.
One end of the two-end network element devices actively initiates key agreement, and undertakes responsibilities of establishing communication with the opposite-end device, generating a session key and the like, and the responsibilities are called as an initiator of the key agreement. The initiator of the key agreement may be specified by the SDN controller, for example, the SDN controller may randomly specify one of the two-end network element devices as the initiator of the key agreement.
In an implementation manner of the first aspect, before the sending, to the two-end network element devices, the instruction to initialize the encryption session, the method further includes: generating a session identifier; the instruction for initializing the encryption session carries the session identifier and the device identifier of the opposite terminal device; the certificate application request carries a device identifier of the local terminal device, a device identifier of the opposite terminal device, a public key of the local terminal device, the session identifier and a private key signature of the local terminal device; the digital certificate carries the device identifier of the local device, the device identifier of the opposite device, the certificate serial number of the local device, the certificate serial number of the opposite device, the public key of the local device, the session identifier, the validity period of the certificate, the public key of the SDN controller, and the private key signature of the SDN controller.
In the above information items, the session identifier is used to uniquely identify an encrypted session, and other information items may be used to authenticate the identity of the device during the key agreement process.
In an implementation manner of the first aspect, the digital certificate further carries a session validity period.
In this implementation, a validity period may be set for the encrypted session, and after the session exceeds the validity period, the corresponding session key, digital certificate, and the like all need to be updated. The problem that the session key is easy to crack when a long-term fixed certificate is used is avoided.
In one implementation form of the first aspect, the method further comprises: receiving an encrypted session update request sent by the network element device, where the encrypted session update request carries a digital certificate of the network element device, the session identifier, and a new session key; verifying the validity of the digital certificate, and if the verification is passed, determining the two-end network element equipment participating in the encrypted session according to the session identifier; generating new session identifiers, and respectively sending new instructions for initializing encryption sessions to the network element devices at the two ends, so that the network element devices at the two ends perform key agreement for the new encryption sessions; wherein the new encrypted session employs the new session key.
In one implementation form of the first aspect, the method further comprises: and respectively receiving encrypted session release requests sent by the network element equipment at the two ends, and releasing corresponding related information of the encrypted session according to the session identification carried in the encrypted session release requests.
After the new encryption session is established, the related information of the old encryption session can be released, the continuous occupation of computing and storage resources by the old encryption session is avoided, and the burden of an SDN controller on session maintenance is reduced.
In a second aspect, an embodiment of the present application provides a session establishment method, which is applied to a network element device, and the method includes: receiving an encryption session initialization instruction sent by an SDN controller, and sending a certificate application request to the SDN controller according to the encryption session initialization instruction; and receiving the digital certificate sent by the SDN controller, and performing key agreement of an encryption session by exchanging the digital certificate with opposite-end equipment.
In an implementation manner of the second aspect, before the sending a certificate application request to the SDN controller according to the instruction for initializing the encryption session, the method further includes: generating a public and private key pair of home terminal equipment; the certificate application request and the digital certificate both carry the public key of the local terminal device.
The public and private key pair can be used for encrypted transmission of a symmetric key (namely a session key) in a key negotiation process, so that the plaintext of the key is prevented from being leaked.
In an implementation manner of the second aspect, the key agreement for the encrypted session by exchanging a digital certificate with the peer device includes: receiving an instruction for establishing an encryption session sent by the SDN controller, sending a request for establishing communication to the opposite terminal equipment according to the instruction for establishing the encryption session, and receiving a digital certificate sent by the opposite terminal equipment; verifying the digital certificate of the opposite terminal equipment, and if the verification is passed, establishing communication with the opposite terminal equipment; generating a session key; and sending the digital certificate of the local terminal equipment and the session key encrypted by the private key of the local terminal equipment to the opposite terminal equipment.
The above implementation manner is the behavior of the network element device as the key agreement initiator in the key agreement process.
In an implementation manner of the second aspect, the key agreement for the encrypted session by exchanging a digital certificate with the peer device includes: responding to a request for establishing communication sent by the opposite terminal equipment, and sending a digital certificate of the local terminal equipment to the opposite terminal equipment; establishing communication with the opposite terminal equipment; receiving a digital certificate sent by the opposite terminal equipment and a session key encrypted by using a private key of the opposite terminal equipment; and verifying the digital certificate of the opposite terminal equipment, if the verification is passed, decrypting by using the public key of the opposite terminal equipment in the digital certificate to obtain the plaintext of the session key, and sending the session key encrypted by using the public key of the opposite terminal equipment to the opposite terminal equipment.
The above implementation manner is the behavior of the network element device as a key agreement responder in the key agreement process.
In an implementation manner of the second aspect, the digital certificate carries a device identifier of the local device, a device identifier of the peer device, a certificate serial number of the local device, a certificate serial number of the peer device, a public key of the local device, a session identifier, a certificate validity period, a public key of the SDN controller, and a private key signature of the SDN controller, and the verifying the digital certificate of the peer device includes performing at least one of the following verification items: verifying whether the certificate serial number of the local terminal equipment in the digital certificate of the opposite terminal equipment is consistent with the certificate serial number of the opposite terminal equipment in the digital certificate of the local terminal equipment; verifying whether the certificate serial number of the opposite terminal equipment in the digital certificate of the opposite terminal equipment is consistent with the certificate serial number of the local terminal equipment in the digital certificate of the local terminal equipment; checking whether the device identifier of the local device in the digital certificate of the opposite device is consistent with the device identifier of the opposite device in the digital certificate of the local device; checking whether the device identifier of the opposite terminal device in the digital certificate of the opposite terminal device is consistent with the device identifier of the local terminal device in the digital certificate of the local terminal device; checking whether the session identifier in the digital certificate of the opposite terminal equipment is consistent with the session identifier in the digital certificate of the local terminal equipment; verifying whether a signature in a digital certificate of the opposite-end device and a signature in a digital certificate of the local-end device are both private key signatures of the SDN controller; verifying whether the certificate is valid according to the certificate validity period in the digital certificate of the opposite terminal equipment; if the executed verification item results are yes, the digital certificate of the opposite terminal equipment passes verification, otherwise, the verification does not pass.
The above implementation provides a possible way of verifying a digital certificate, and it should be noted that "home terminal device" and "peer terminal device" represent opposite meanings when a network element device performing verification is respectively used as an initiator and a responder of key agreement.
The verification of the digital certificate also indicates that the identity authentication of the opposite terminal device passes, or the local terminal device confirms that the opposite terminal device is indeed the device to be communicated at this time. In the application, mutual trust is achieved between the devices by verifying the content carried in the digital certificate, and the mutual trust between the devices is achieved without the help of a trusted CA.
In an implementation manner of the second aspect, the digital certificate further carries a session validity period, and after the key agreement is completed, the method further includes: locally saving session context information, the session context information comprising: the session identifier, the digital certificate of the opposite terminal device, the session key and the session validity period.
The session context contains some information related to the encrypted session, which is used to maintain the encrypted session, and the message can be encrypted and decrypted according to the session context information, so as to implement encrypted transmission of data (see the following implementation manner).
In one implementation of the second aspect, after the locally saving session context information, the method further comprises: sending a message to the opposite terminal equipment by using the session key encryption in the session context information, wherein the message carries the session identifier; and/or receiving a message sent by the opposite terminal device, searching for the corresponding session context information according to the session identifier carried in the message, and decrypting the message according to the session key in the searched session context information.
In one implementation form of the second aspect, the method further comprises: generating a new session key when the encrypted session is determined to have expired according to the session validity period in the session context information; sending an encrypted session update request to the SDN controller, wherein the encrypted session update request carries the digital certificate of the network element device, the session identifier and the new session key; receiving a new encryption session initialization instruction sent by the SDN controller, and performing key agreement on a new encryption session with the opposite terminal device according to the new encryption session initialization instruction; wherein the new encrypted session employs the new session key; and after the key agreement of the new round is completed, the new session context information is locally saved.
In one implementation of the second aspect, after the locally saving new session context information, the method further comprises: processing a message generated after the session is updated by using the new session context information; when the expiration time of the encryption session does not reach the preset time, continuously using the session context information to decrypt the message generated before the session is updated; when the expiration duration of the encrypted session reaches a preset duration, sending an encrypted session release request to the SDN controller, wherein the encrypted session release request carries the session identifier; receiving an encrypted session release instruction sent by the SDN controller, and releasing the corresponding session context information according to the session identifier carried in the encrypted session release instruction.
For the encryption sessions which are expired, the encryption sessions can be maintained for a period of time (preset time length) and then released, so that stable switching between new encryption sessions and old encryption sessions is realized, and the influence of communication interruption on user experience is avoided. Since the session identification is set for each encryption session, the old and new encryption sessions can be easily identified, and thus different processing manners can be adopted.
In a third aspect, an embodiment of the present application provides a session establishment apparatus configured in a software defined network, SDN, controller, the apparatus including: an initialization indicating module, configured to respond to a request for establishing an encryption session between two end network element devices, send an instruction for initializing the encryption session to the two end network element devices, respectively, and instruct the two end network element devices to apply for a digital certificate to the SDN controller; the certificate generation module is used for respectively receiving the certificate application requests sent by the two-end network element equipment and generating a digital certificate according to the certificate application requests; and the certificate sending module is used for respectively sending the digital certificates corresponding to the two end network element devices so as to perform key agreement of encrypted sessions between the two end network element devices by exchanging the digital certificates.
In a fourth aspect, an embodiment of the present application provides a session establishing apparatus configured in a network element device, where the apparatus includes: the certificate application module is used for receiving an encryption session initialization instruction sent by an SDN controller and sending a certificate application request to the SDN controller according to the encryption session initialization instruction; and the key negotiation module is used for receiving the digital certificate sent by the SDN controller and carrying out key negotiation of an encryption session through exchanging the digital certificate with opposite-end equipment.
In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the computer program instructions perform a method provided by any one of possible implementation manners of the first aspect, the second aspect, or both.
In a sixth aspect, an embodiment of the present application provides a management device, including a memory and a processor, where the memory stores computer program instructions, and when the computer program instructions are read and executed by the processor, the management device executes a method provided by any one of possible implementation manners of the first aspect, the second aspect, or both aspects.
In order to make the aforementioned objects, technical solutions and advantages of the present application more comprehensible, embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 illustrates a structure diagram of an SDN network according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a session establishment method according to an embodiment of the present application;
fig. 3 shows an interaction diagram of a session establishment method provided in an embodiment of the present application;
fig. 4 is a functional block diagram of a session establishing apparatus according to an embodiment of the present application;
fig. 5 is a functional block diagram of another session establishment apparatus provided in an embodiment of the present application;
fig. 6 shows a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In contrast, in the embodiment, when a network is deployed, a network element device in the network applies for a digital certificate from a CA and configures a certificate trust chain, the certificate is generally valid for a long time (for example, one year), and is very complex to update, and a private key corresponding to the certificate is stored by a PFX (digital envelope) or an encryption card. When an encryption link needs to be established, the network element device performs negotiation of a symmetric key with the opposite terminal device through the asymmetric key corresponding to the digital certificate, and performs encryption communication with the opposite terminal device by using the negotiated symmetric key as a session key, or an encryption link is established between the local terminal device and the opposite terminal device.
The inventor researches and discovers that the above way of establishing the encrypted link has at least the following disadvantages:
(1) the digital certificate is fixed for a long time and is easy to be cracked, so that an encrypted link fails;
(2) the link establishment process strongly depends on CA, so that the application, distribution and use of the digital certificate are inconvenient;
(3) the digital certificate is preset in the network element device before the encrypted link is established, and the requirement of dynamically deploying the encrypted link cannot be well met. That is, even though an encrypted link may not need to be established between two network element devices, the digital certificate is preset, thereby causing resource waste.
In addition, the inventor also finds that in other comparison embodiments, the session key is not generated by means of key agreement, but is centrally stored and distributed to the network element devices by using the key server, and the vulnerability of the key server set in these embodiments is obvious, and once the vulnerability is broken, the security of the whole network is lost.
The above-mentioned defects existing in the comparative example are the results obtained after the inventor has practiced and studied carefully, and therefore, the discovery process of the above-mentioned problems and the solution proposed by the following embodiments of the present invention to the above-mentioned problems should be the contribution of the inventor to the present invention in the course of the present invention.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments.
Fig. 1 illustrates an SDN network to which a session establishment method provided in an embodiment of the present application is applied. Referring to fig. 1, the network includes an SDN controller 100 and a plurality of network element devices 110, wherein the SDN controller 100 may be deployed on a server different from the network element devices 110. The SDN controller 100 and the network element devices 110, and the network element devices 110 are interconnected through a network, and thus have a communication capability, for example, the communication capability may be achieved through interconnection of two-layer or three-layer networks.
The network element devices 110 support a link encryption function, that is, an encrypted link may be established between any two network element devices 110, and when fig. 3 is described later, the encrypted link is established between a device a and a device B, which are not specific to a certain network element device 110, so that the description is generic.
The network element device 110 may be, but is not limited to, a switch, a router, a device with an encryption module for creating a tunnel, and the like. The server for deploying the SDN controller 100 may be a single server, or may be a combination of multiple servers or a server cluster (the SDN controller 100 may also be deployed in a distributed manner). Also, these devices may be physical devices or virtual devices.
In the following, the network element devices of the two end points of the encrypted link may also be referred to as two-end network element devices for short, and when one of the two-end network element devices is taken as a main body for explanation, the device may be referred to as a local-end device, and the device at the other end may be referred to as an opposite-end device. For example, when a certain action of device a is explained, device a is a home device and device B is an opposite device, and when a certain action of device B is explained, device B is a home device and device a is an opposite device. The encryption link is a channel for encrypting and transmitting data interacted between network element devices at two ends, so that the data plaintext is not leaked in the transmission process. In the scheme of the application, a symmetric key is determined by the network element devices at two ends through a key negotiation process to encrypt data to be transmitted, instead of adopting some schemes of uniformly distributing keys by a key server in comparison embodiments, so that the bottleneck of security performance, called as the key server, is avoided.
It should be noted that, in particular, data is transmitted over an encrypted link, which is embodied as an encrypted session between two network element devices, that is, an encrypted session is created between two network element devices, which is equivalent to an encrypted link being created between two network element devices, and therefore, in general, the creation of the encrypted session and the creation of the encrypted link are not particularly distinguished in the following.
Fig. 2 shows a flowchart of a session establishment method according to an embodiment of the present application.
Referring to fig. 2, the method includes:
step S20: and the SDN controller responds to a request for establishing an encryption session between the network element devices at the two ends and respectively sends an instruction for initializing the encryption session to the network element devices at the two ends.
The request to establish the encrypted session may be initiated by a user, e.g., the user may access the SDN controller through the end device and initiate a request in which the user may designate two network element devices as two end network element devices of the encrypted link. Of course, the user may refer to a person or a computer program, and is not limited thereto. In response to the request for establishing the encryption session, the SDN controller sends an instruction for initializing the encryption session to the two-end network element devices specified in the request, where the instruction is used to instruct the two-end network element devices to apply for the digital certificate from the SDN controller.
Step S21: and the network element equipment sends a certificate application request to the SDN controller according to the instruction for initializing the encryption session.
The network element device (which may refer to any one of the two end network element devices) may, upon receiving an instruction sent by the SDN controller to initialize the encryption session, perform some initialization actions (e.g., creating an asymmetric key to be used in the key agreement process), and then send a certificate application request to the SDN controller, where the request is used to apply for a digital certificate for device identity authentication in the key agreement process.
Step S22: the SDN controller receives certificate application requests sent by network element devices at two ends respectively, and generates a digital certificate according to the certificate application requests.
Step S23: and the SDN controller respectively sends the digital certificates corresponding to the SDN controller to the network element devices at the two ends.
In step S21, both end network element devices send a certificate application request to the SDN controller, the SDN controller generates a digital certificate for each received certificate application request, and sends the generated digital certificate to the network element device that applies for the certificate, where the certificate may record necessary information items for verifying the identity of the device, and certainly may also include some conventional contents of the digital certificate. In the prior art, there are some standard formats of certificates, such as X509V3, etc., and the digital certificate in the present application may conform to these existing formats, or may adopt new formats, and the present application is not limited, but will give information items that the digital certificate may contain. If the digital certificate conforms to the existing format, the newly introduced information item in the scheme of the application can be added to the extended information part of the certificate, wherein the existing certificate format mostly comprises two parts, namely basic information and extended information, the basic information part fills the content specified when the certificate format is made, and the filling content of the extended information part can be decided by a user.
Step S24: the network element equipment performs key agreement of encrypted session by exchanging digital certificate with the opposite terminal equipment.
After the network element devices at the two ends obtain the digital certificate, key agreement can be performed, and the purpose of the key agreement is to determine a symmetric key as a session key. One network element device may serve as an initiator, another network element device serves as a responder, the initiator is responsible for generating a session key and securely shares the session key with the responder, and the responder confirms the session key, where the initiator device may be specified by the SDN controller. In the key agreement process, the network element devices at both ends may also exchange the digital certificates respectively applied in step S23, and each network element device may verify whether the identity information on the certificate of the opposite end device is trusted, where the trust indicates that the opposite end device is indeed the device that the local end device wants to communicate with. If the two digital certificates are verified to be qualified, the key agreement process can be successfully completed.
After the key negotiation is completed, it may be considered that the encryption session is created, and the network element devices at both ends may encrypt the message to be transmitted by using the key, and/or decrypt the message encrypted by using the key.
The method is applied to an SDN network environment, the SDN controller is used for bearing the function of CA in the certificate signing and issuing aspect, so that the strong dependence on CA in the encryption link creating process is eliminated, the application, distribution and use of the digital certificate are very simple, the authentication of the identity of the other party is completed by exchanging the digital certificate between the network element devices in the key negotiation process, the direct mutual trust between the devices is realized, the mutual trust is not achieved by a credible third party (CA), and the encryption link is originally the encryption communication between the network element devices at two ends, so the mutual trust between the devices is closer to the requirement of link creating and is safer and more reliable. Moreover, an SDN controller must be deployed in the SDN network originally, and the SDN controller is used for issuing the digital certificate, so that the functions of the SDN controller are enriched, the trouble of CA deployment is eliminated, and the implementation cost is saved. In addition, in the method, the SDN controller further executes the step of establishing the encryption session only when receiving the request of establishing the encryption session between the network element devices at two ends, namely, the network element devices do not need to preset the digital certificate and only need to apply to the SDN controller when establishing the encryption link, so that the scheme is favorable for avoiding resource waste caused by the large quantity of deployed digital certificates and is suitable for dynamic deployment of the encryption link.
Fig. 3 shows an interaction diagram of a session establishment method provided in an embodiment of the present application. Fig. 3 can be regarded as a more specific embodiment of the method in fig. 2, and in fig. 3, the network element devices at both ends are device a and device B, respectively. Steps S200 to S201 of fig. 3 may be regarded as an implementation of step S20 of fig. 2, steps S210 to S211 of fig. 3 may be regarded as an implementation of step S21 of fig. 2, step S220 of fig. 3 may be regarded as an implementation of step S22 of fig. 2, step S230 of fig. 3 may be regarded as an implementation of step S23 of fig. 2, and steps S240 to S248 of fig. 3 may be regarded as an implementation of step S24 of fig. 2.
Step S200: the SDN controller generates a session identification.
In step S20, it is mentioned that the request for establishing the encryption session may be initiated by the user, and the device a and the device B are specified in the request, so that the SDN controller can know that the encryption session is to be established between the device a and the device B after receiving the request, and the instruction issued in the subsequent step and the like are also sent to the two network element devices.
The SDN controller may then generate a session identifier for the encrypted session, which is not denoted as codeA-B-1. The session identifier is used to uniquely identify an encrypted session, i.e. to distinguish it from other sessions, but the uniqueness here may be unique within a time period, for example, after a session is released (see below for session release), it is not excluded that the session identifier thereof may be reused. The session identifier may be randomly generated, or may be distributed according to a certain rule (for example, distributed according to an integer increment), and in some implementations, the session identifier may also be calculated according to the device identifiers of the two end network element devices.
Before proceeding further, it is first pointed out that steps S201 to S230 relate only to device a, but in practice similar steps are also to be carried out for device B, which steps are not shown in fig. 3 for the sake of simplicity only, and are not specifically described in the following description, but the results of their execution are given directly in place.
Step S201: the SDN controller sends an instruction to device a to initiate an encryption session. The instruction may carry a session identifier (codeA-B-1) and a device identifier of the peer device. The device identifier is used to uniquely identify a network element device, and may be, for example, a serial number, a MAC address, and the like of the network element device. The device identifier may be generated on the network element device, and after the network is deployed, the SDN controller may collect information of the network element device, where the information may include the device identifier of the network element device. Hereafter, the device identification of device A will be referred to as DeviceA and the device identification of device B will be referred to as DeviceB. Since the device at the opposite end of the device a is the device B, the command for initializing the encryption session in step S201 may carry DeviceB.
Step S210: device a generates its own public and private key pair.
Device a generates a public-private key pair, denoted as < KpubA, KpriA >, which is a public key and a private key, to characterize its identity. The public and private key pair can be used for asymmetric encryption in subsequent key agreement, and the generation mode is not limited, and for example, the public and private key pair can be generated by using algorithms such as national secret, RSA, DSA and the like.
Similarly, a public-private key pair is also generated for device B, denoted as < KpubB, KpriB >.
Step S211: device a sends a certificate application request to the SDN controller.
After the encryption session initialization (which may include step S210) is completed, as a response to the instruction for initializing the encryption session, the device a sends a certificate application request to the SDN controller, where the content of the certificate application request may be as follows (the request is denoted as CertReqA):
CertReqA
{ device identification of home device: DeviceA
Device identification of the peer device: DeviceB
Public key of home terminal device: KpubA
And session identification: codeA-B-1
Private key signature of the local terminal equipment: SigA }
The signature object signed by the private key of the local device may be all contents except the signature itself in the request.
Similarly, device B also sends a certificate application request to the SDN controller, and the content of the certificate application request may be as follows (the request is denoted as CertReqB):
CertReqB
{ device identification of local device: DeviceB
Device identification of the peer device: DeviceA
Public key of home terminal device: KpubB
And session identification: codeA-B-1
Private key signature of the local terminal equipment: SigB }
Step S220: the SDN controller generates a digital certificate for device a.
After receiving the request, the SDN controller may verify authenticity of a signature in the request, and if the verification is passed, it indicates that the request is indeed initiated by the device a, and content of the request is also authentic and trusted, at this time, the SDN controller may generate a digital certificate for the device a, where content of the digital certificate may be as follows (the certificate is denoted as CertA):
CertA
{ basic information:
certificate serial number of home terminal equipment: a1
The validity period of the certificate: XXX
Public key of home terminal device: KpubA
Public key of SDN controller: KpubSDN
Private key signature of the SDN controller: SigSDN
And (3) expanding information:
equipment identification of the local equipment: DeviceA
Device identification of the peer device: DeviceB
And session identification: the content of the code A-B-1,
certificate serial number of peer device: b1
The session validity period is as follows: XXX }
Wherein the certificate sequence number may be assigned by the SDN controller; both the certificate validity period and the session validity period may be filled by the SDN controller, and in some implementations, the session validity period may be set to a relatively short time, e.g., 10000 (unit of seconds), so that the session key is updated in time (the update of the session is seen later); the public key of the local terminal equipment can be obtained from the certificate application request; the public and private key pair of the SDN controller characterizes the identity of the SDN controller, wherein the signature object signed by the private key of the SDN controller can be all contents except the signature itself in the digital certificate. It should be noted that the session validity period may have a flexible form, such as a duration (e.g., 10000 above), or a time (beyond which the current time is expired).
It is noted that in some implementations the digital certificate may also not contain a session validity period, indicating that the session is valid for a long period of time, or the session validity period may have been agreed upon and need not be embodied exclusively in the certificate.
Similarly, the digital certificate content of device B may be as follows (certificate CertB):
CertB
{ basic information:
certificate serial number of home terminal equipment: b1
The certificate validity period is as follows: XXX
Public key of home terminal device: KpubB
Public key of SDN controller: KpubSDN
Private key signature of the SDN controller: SigSDN
And (3) expanding information:
equipment identification of the local equipment: DeviceB
Device identification of the peer device: DeviceA
And session identification: the code A-B-1 is selected from the group,
certificate serial number of peer device: a1
The session validity period is as follows: XXX }
The session validity period in the digital certificate of device B should be the same as that in the digital certificate of device a, because the same encrypted session is to be established by device a and device B.
Step S230: the SDN controller sends a digital certificate (CertA) to device a.
After the device a receives the digital certificate, the authenticity of the signature in the certificate can be verified by using the public key of the SDN controller in the certificate, and if the verification is passed, the digital certificate is indeed signed by the SDN controller, and the content of the certificate is also authentic and trusted.
Similarly, the SDN controller sends a digital certificate (CertB) to device B.
Step S240: the SDN controller sends an instruction to device a to establish an encrypted session.
The SDN controller sends an instruction for establishing an encryption session to the device a, indicating that the device a is designated as an initiator of key agreement, although the SDN controller may also designate the device B as an initiator of key agreement. The method for designating the initiator device may be random selection or selection according to a certain rule.
The instruction for establishing the encrypted session may carry a device identifier (DeviceB) of the peer device, a communication address (IPB) of the peer device, and a session identifier (codeA-B-1), where the IPB indicates an IP address of B, and in step S241, the request may be sent to the device B by using the communication address. DeviceB, codeA-B-1, is then used to inform device a which encryption session on which network element device is to be key negotiated.
Step S241: device a sends a request to device B to establish communication.
Device a and device B may first establish communication before they share the key, at which point device a may send a request to device B indicating this intent.
Step S242: device B sends device a its digital certificate.
The communication request in step S241 may carry information such as a session identifier, so that the device B may determine which digital certificate is to be sent to the device a according to the content of the communication request. CertB to be transmitted in step S242, i.e., above.
Step S243: device a verifies the digital certificate of device B.
The device a verifies the digital certificate of the device B, i.e. the process of authenticating the identity of the device B, and if the certificate is verified, it indicates that the identity of the device B is authentic, or that the device B is indeed the device with which the device a is to communicate. After the verification is passed, the process may continue to step S244, and if the verification is not passed, the creation of the encryption session fails.
Verifying the digital certificate (CertB) of the device B, the verification item may include at least one of:
(1) and checking whether the certificate serial number of the local terminal equipment in the certB is consistent with the certificate serial number of the opposite terminal equipment in the certA. And should normally be identical and all b 1.
(2) And checking whether the certificate serial number of the opposite terminal equipment in the certB is consistent with the certificate serial number of the local terminal equipment in the certA. Should normally be consistent and all be a 1.
(3) And checking whether the equipment identifier of the local terminal equipment in the certB is consistent with the equipment identifier of the opposite terminal equipment in the certA. Should be consistent and DeviceB in normal cases.
(4) And checking whether the equipment identifier of the opposite terminal equipment in the certB is consistent with the equipment identifier of the local terminal equipment in the certA. Normally should be consistent and all DeviceA.
(5) And checking whether the session identification in the certB is consistent with the session identification in the certA. Which should be consistent and all are codeA-B-1 under normal conditions.
(6) And checking whether the signature in the certB and the signature in the certA are both private key signatures of the SDN controller. Normally should be signed by the SDN controller's private key. Whether public keys of the SDN controllers in the certB and the certA are consistent or not can be verified, if so, the public keys are used for verifying whether signatures of the two certificates are real or not, and if the signatures are real, the signatures are the private key signatures of the SDN controllers.
(7) And checking whether the certificate is valid according to the validity period of the certificate in the certB.
It will be appreciated that in some implementations, the check for CertB may also include other check items, not limited to the above seven items.
If the results of the executed verification items are yes, the digital certificate of the equipment B passes verification, and if any one of the results of the verification items is no, the digital certificate of the equipment B fails verification. It is understood that if a check item fails, the remaining check items that have not been executed may not be executed any more, because the check result is determined (failed).
Step S244: device a generates a session Key (denoted Key).
Step S245: device a sends device B its own digital certificate, and the session key encrypted with device a's private key (KpriA).
Step S246: device B verifies the digital certificate of device a.
The device B verifies the digital certificate of the device a, i.e. the process of authenticating the identity of the device a, and if the certificate is verified, it indicates that the identity of the device a is authentic, or that the device a is indeed the device with which the device B is to communicate. Since the device a has verified the digital certificate of the device B before, mutual trust is achieved between the device a and the device B if the verification is passed in step S246. After the verification is passed, the process may continue to step S247, and if the verification is not passed, the creation of the encryption session fails.
Step S246 is similar to step S243, and here, the check items that can be performed are directly written out, and will not be explained in detail:
(1) and checking whether the certificate serial number of the local terminal equipment in the certA is consistent with the certificate serial number of the opposite terminal equipment in the certB. Should normally be consistent and all be a 1.
(2) And checking whether the certificate serial number of the opposite terminal equipment in the certA is consistent with the certificate serial number of the local terminal equipment in the certB. And should normally be identical and all b 1.
(3) And checking whether the equipment identifier of the local terminal equipment in the CertA is consistent with the equipment identifier of the opposite terminal equipment in the CertB. Normally should be consistent and all DeviceA.
(4) And checking whether the equipment identifier of the opposite terminal equipment in the CertA is consistent with the equipment identifier of the local terminal equipment in the CertB. Normally should be consistent and all DeviceB.
(5) And checking whether the session identification in the certA is consistent with the session identification in the certB. Which should be consistent and all are codeA-B-1 under normal conditions.
(6) And checking whether the signature in the certA and the signature in the certB are both private key signatures of the SDN controller. Normally should be signed by the SDN controller's private key.
(7) And verifying whether the certificate is valid according to the validity period of the certificate in the certA.
Step S247: device B decrypts the session key with device a's public key (KpubA).
Since the public Key of device a is included in the digital certificate of device a, device B can decrypt the plaintext, i.e., Key, of the session Key using the public Key. Device B may store the plaintext of the session key, which has been shared between device a and device B
Step S248: device B sends device a the session key encrypted with device a's public key.
After the device a receives the encrypted session key, one possible processing method is: and decrypting by using the private key of the equipment A to obtain a plaintext of the session key, comparing whether the plaintext is consistent with the session key generated by the equipment A, and if so, confirming that the session key stored by the equipment B is consistent with the equipment B.
It is obvious that the device identity authentication in the key agreement process relies on the newly added information (such as session identifier, device identifier, etc.) in the digital certificate, and does not rely on the CA.
After the network element device completes the key negotiation, the session key can be used to encrypt the session content, i.e. the message. In one implementation, to facilitate maintaining the session, the network element device may construct session context information (which may be a data structure) and store it locally. The session context information may include: session identification, digital certificate of opposite terminal equipment, session key and session validity period.
For example, for device a, its session context information ContextA may be expressed as:
codeA-B-1:{CertB,Key,10000}
for device B, its session context information ContextB may be expressed as:
codeA-B-1:{CertA,Key,10000}
after the session context information is stored, the encryption and decryption of the message by using the session context information are more convenient. Specifically, when a message is sent to an opposite terminal device, a session key in session context information is used for encryption, and a session identifier is carried in the message; after receiving a message sent by an opposite-end device, first, corresponding session context information is searched for according to a session identifier carried in the message (because multiple sessions may be maintained on a network element device), and the message is decrypted according to a session key in the searched session context information. Of course, for a network element device, it may only send a message, or may only receive a message, or may both send and receive a message.
Furthermore, in addition to storing session context information of the encrypted session locally at the network element device, also relevant information of the encrypted session may be stored at the SDN controller, such as an identification of the session, network element devices participating in the session, session keys, etc.
The following continues with the updating and releasing of the encrypted session:
updating of the encryption session creates a new encryption session (having a different session identity than the original encryption session) to replace the expired old encryption session, the core of which is to update the session key.
After the encryption session is established, the network element devices at both ends or one end of the network element devices may start timing (one end may be timed, and the other end may be notified of the result of session expiration, etc.), and when the network element device finds that the duration time of the session has exceeded the session validity period recorded in the session context information, it may be determined that the encryption session has expired and needs to be updated.
When the network element device confirms that the session has expired, a new session key to be used for a new encrypted session may be generated. Of course, if the network element devices at both ends perform timing simultaneously, negotiation may also be performed between the network element devices at both ends, and only one of the network element devices generates a new session key.
After generating a new session key, the network element device sends an encrypted session update request to the SDN controller, where the encrypted session update request carries a digital certificate, a session identifier, and the new session key of the network element device. For example, if an encrypted session update request is sent by device a to the SDN controller, the request may be denoted as { CertA, codeA-B-1, new Key }.
After receiving the encryption session update request, the SDN controller verifies the validity of the digital certificate carried in the request, where the verified content may include a signature of the digital certificate, a certificate validity period of the digital certificate, and the like, and may also include other conventional verifications of the digital certificate. If the check is passed, the SDN controller may determine, according to the session identifier carried in the request, an encryption session to be updated, and further obtain information of network element devices at both ends associated with the session (for example, may obtain information about the aforementioned encryption session). Then, the SDN controller generates a new session identifier and sends a new instruction for initializing the encryption session to the previously determined two-end network element device, and the two-end network element device performs key agreement on the new encryption session, which is similar to steps S20 to S24 and will not be described in detail. However, it should be noted that, since a new session key is already generated before the key agreement is started, the key agreement may be performed only based on the new session key.
After the new round of key agreement is completed, the network element device may construct and locally store new session context information, and then process a packet generated after session update using the new session context information.
In the embodiment of the application, the validity period is set for the encryption session in the digital certificate issued by the SDN controller, so that the encryption session can be updated conveniently, the session identifier, the digital certificate and the session key can be regenerated in the session updating process, and the problem that the session key is easy to break when a long-term fixed certificate is used is avoided.
After the new encryption session is established, resources occupied by the old encryption session can be released in time, resource waste is avoided, and the burden of maintaining the session by the network element equipment and the SDN controller is reduced. However, considering that part of messages transmitted in the network are still encrypted by using the session key of the old encryption session, in an implementation manner, for the encryption session that has expired, the encryption session can be continuously maintained for a period of time (preset duration) and then released, so that the part of messages remaining in the network can be processed as much as possible, the stable switching between the new encryption session and the old encryption session is realized, and the influence of communication interruption on user experience is avoided.
Specifically, when the network element device confirms that the session is expired, but the expired duration does not reach the preset duration (which may be arbitrarily specified, for example, 2 minutes, 5 minutes, and the like), the message generated before the session update may be decrypted by using the old session context information. The messages carry session identifiers of old encrypted sessions, so that the network element equipment receiving the messages can find old session context information according to the session identifiers and further obtain an old session key for decryption. Certainly, now that a new encrypted session is already established, there may also be messages encrypted by using a new session key in the network, and these messages carry the session identifier of the new encrypted session, so the network element device receiving the messages can find out new session context information according to the session identifier, and further obtain the new session key for decryption. In short, through the distinguishing effect of the session identifier on the encryption sessions, new and old encryption sessions can be maintained simultaneously within a preset time period, and no conflict is generated.
When the network element equipment confirms that the session is expired and the expired duration reaches the preset duration, the release process of the encryption session can be started to release the old encryption session. The network element equipment sends an encrypted session release request to the SDN controller, wherein the encrypted session release request carries a session identifier of an encrypted session to be released. For the network element devices at both ends, respective encrypted session release requests are sent.
After receiving the encryption session release request, the SDN controller may determine an encryption session to be released according to a session identifier carried in the request, and then release information related to the encryption session corresponding to the session identifier, where the release form may be to clear the information, or to make the information in an invalid state, or the like. Because the SDN controller receives two encrypted session release requests from the two end network element devices, the SDN controller may first confirm the request content (for example, compare whether session identifiers carried in the requests are consistent), and if it is confirmed that both the two end network element devices require release of the same encrypted session, then execute a release process of the encrypted session according to the request content.
After the SDN controller completes the release of the session, the SDN controller respectively sends an encryption session release instruction to the two-end network element devices, the instruction carries a session identifier of the encryption session to be released, and after the network element devices receive the instruction, the encryption session to be released can be determined according to the session identifier carried in the instruction, and then session context information (stored locally in the network element devices) corresponding to the session is released, wherein the release form can be information clearing, or information in an invalid state and the like.
Fig. 4 shows a functional block diagram of a session setup apparatus 300 according to an embodiment of the present application. The apparatus is configured in an SDN controller, and includes: an initialization indicating module 310, configured to respond to a request for establishing an encryption session between two end network element devices, send an instruction for initializing the encryption session to the two end network element devices, respectively, and instruct the two end network element devices to apply for a digital certificate to the SDN controller; a certificate generating module 320, configured to receive certificate application requests sent by the two-end network element devices, respectively, and generate a digital certificate according to the certificate application requests; a certificate sending module 330, configured to send respective corresponding digital certificates to the two end network element devices, so that the two end network element devices perform key agreement of an encrypted session through exchanging digital certificates.
In an implementation manner of the session establishing apparatus 300, the certificate sending module 330 sends respective corresponding digital certificates to the two end network element devices, so that the two end network element devices perform key agreement of an encrypted session by exchanging the digital certificates, including: respectively sending the digital certificates corresponding to the two terminal network element devices; and selecting one end from the two-end network element equipment, sending an instruction for establishing an encryption session to the selected network element equipment, and indicating the network element equipment as an initiator of key agreement to perform the key agreement of the encryption session with opposite-end equipment by exchanging a digital certificate.
In an implementation manner of the session establishing apparatus 300, the initialization indicating module 310 is further configured to generate session identifiers before the instruction for initializing the encrypted sessions is sent to the two end network element devices, respectively; the session identifier and the device identifier of the opposite terminal device are carried in the instruction for initializing the encrypted session; the certificate application request carries a device identifier of the local device, a device identifier of the opposite device, a public key of the local device, the session identifier and a private key signature of the local device; the digital certificate carries a device identifier of the home device, a device identifier of the opposite-end device, a certificate serial number of the home device, a certificate serial number of the opposite-end device, a public key of the home device, the session identifier, a certificate validity period, a public key of the SDN controller, and a private key signature of the SDN controller.
In one implementation of the session establishing apparatus 300, the digital certificate further carries a session validity period.
In one implementation manner of the session establishing apparatus 300, the apparatus further includes: a session update request processing module, configured to receive an encrypted session update request sent by the network element device, where the encrypted session update request carries a digital certificate of the network element device, the session identifier, and a new session key; the equipment determining module is used for verifying the validity of the digital certificate, and if the verification is passed, determining the two-end network element equipment participating in the encrypted session according to the session identifier; the initialization indicating module 310 is further configured to generate a new session identifier, and send a new instruction for initializing an encryption session to the two end network element devices, respectively, so that the two end network element devices perform key agreement on the new encryption session; wherein the new encrypted session employs the new session key.
In one implementation of the session establishing apparatus 300, the apparatus further includes: and the session release request processing module is used for respectively receiving encrypted session release requests sent by the two-end network element equipment and releasing corresponding related information of the encrypted session according to the session identification carried in the encrypted session release requests.
The implementation principle and the resulting technical effect of the session establishing apparatus 300 provided in the embodiment of the present application have been introduced in the foregoing method embodiment, and for the sake of brief description, no part of the embodiment of the apparatus is mentioned, and reference may be made to the corresponding contents in the foregoing method embodiment.
Fig. 5 shows a functional block diagram of a session setup apparatus 400 according to an embodiment of the present application. The device is configured in network element equipment, and comprises: a certificate application module 410, configured to receive an instruction for initializing an encryption session sent by an SDN controller, and send a certificate application request to the SDN controller according to the instruction for initializing the encryption session; a key agreement module 420, configured to receive the digital certificate sent by the SDN controller, and perform key agreement of an encryption session through exchanging the digital certificate with an opposite device.
In an implementation manner of the session establishing apparatus 400, the certificate application module 410 is further configured to generate a public-private key pair of a home device before sending a certificate application request to the SDN controller according to the instruction for initializing the encryption session; the certificate application request and the digital certificate both carry the public key of the local terminal device.
In one implementation manner of the session establishing apparatus 400, the key agreement module 420 performs key agreement of an encrypted session by exchanging a digital certificate with a peer device, including: receiving an instruction for establishing an encryption session sent by the SDN controller, sending a request for establishing communication to the opposite terminal equipment according to the instruction for establishing the encryption session, and receiving a digital certificate sent by the opposite terminal equipment; verifying the digital certificate of the opposite terminal equipment, and if the verification is passed, establishing communication with the opposite terminal equipment; generating a session key; and sending the digital certificate of the local terminal equipment and the session key encrypted by the private key of the local terminal equipment to the opposite terminal equipment.
In one implementation manner of the session establishing apparatus 400, the key agreement module 420 performs key agreement of an encrypted session by exchanging a digital certificate with a peer device, including: responding to a request for establishing communication sent by the opposite terminal equipment, and sending the digital certificate of the local terminal equipment to the opposite terminal equipment; establishing communication with the opposite terminal equipment; receiving a digital certificate sent by the opposite terminal equipment and a session key encrypted by using a private key of the opposite terminal equipment; and verifying the digital certificate of the opposite terminal equipment, if the verification is passed, decrypting by using the public key of the opposite terminal equipment in the digital certificate to obtain the plaintext of the session key, and sending the session key encrypted by using the public key of the opposite terminal equipment to the opposite terminal equipment.
In an implementation manner of the session establishing apparatus 400, the digital certificate carries a device identifier of the local device, a device identifier of the peer device, a certificate serial number of the local device, a certificate serial number of the peer device, a public key of the local device, a session identifier, a certificate validity period, a public key of the SDN controller, and a private key signature of the SDN controller, and the key negotiation module 420 verifies the digital certificate of the peer device, including performing at least one of the following verification items: verifying whether the certificate serial number of the local terminal equipment in the digital certificate of the opposite terminal equipment is consistent with the certificate serial number of the opposite terminal equipment in the digital certificate of the local terminal equipment; verifying whether the certificate serial number of the opposite terminal equipment in the digital certificate of the opposite terminal equipment is consistent with the certificate serial number of the local terminal equipment in the digital certificate of the local terminal equipment; checking whether the device identifier of the local device in the digital certificate of the opposite device is consistent with the device identifier of the opposite device in the digital certificate of the local device; checking whether the device identifier of the opposite terminal device in the digital certificate of the opposite terminal device is consistent with the device identifier of the local terminal device in the digital certificate of the local terminal device; checking whether the session identifier in the digital certificate of the opposite terminal equipment is consistent with the session identifier in the digital certificate of the local terminal equipment; verifying whether the signature in the digital certificate of the opposite terminal device and the signature in the digital certificate of the local terminal device are both private key signatures of the SDN controller; verifying whether the certificate is valid according to the certificate validity period in the digital certificate of the opposite terminal equipment; and if the executed verification item results are yes, the digital certificate of the opposite terminal equipment passes verification, otherwise, the verification does not pass.
In one implementation manner of the session establishing apparatus 400, the digital certificate further carries a session validity period, and the apparatus further includes: a session maintenance module, configured to locally store session context information after key agreement is completed, where the session context information includes: the session identifier, the digital certificate of the opposite terminal device, the session key and the session validity period.
In an implementation manner of the session establishing apparatus 400, the session maintenance module is further configured to, after the session context information is locally stored, encrypt, by using the session key in the session context information, a packet sent to the peer device, and carry the session identifier in the packet; and/or receiving a message sent by the opposite terminal device, searching for the corresponding session context information according to the session identifier carried in the message, and decrypting the message according to the session key in the searched session context information.
In one implementation of the session establishing apparatus 400, the key agreement module 420 is further configured to generate a new session key when it is determined that the encryption session has expired according to the session validity period in the session context information; the device further comprises: a session update request module, configured to send an encrypted session update request to the SDN controller, where the encrypted session update request carries the digital certificate of the network element device, the session identifier, and the new session key; the certificate application module 410 is further configured to receive a new encryption session initialization instruction sent by the SDN controller, and perform key agreement with the peer device for a new encryption session according to the new encryption session initialization instruction; wherein the new encrypted session employs the new session key; the session maintenance module is further configured to locally save new session context information after a new round of key agreement is completed.
In an implementation manner of the session establishing apparatus 400, the session maintenance module is further configured to, after the new session context information is locally stored, process a packet generated after a session is updated by using the new session context information; when the expiration time of the encryption session does not reach the preset time, continuously using the session context information to decrypt a message generated before session updating; the device further comprises: a session release request module, configured to send an encrypted session release request to the SDN controller when the encrypted session expiration time reaches a preset time, where the encrypted session release request carries the session identifier; and the session release response module is used for receiving an encrypted session release instruction sent by the SDN controller and releasing the corresponding session context information according to the session identifier carried in the encrypted session release instruction.
The implementation principle and the resulting technical effect of the session establishing apparatus 400 provided in the embodiment of the present application have been introduced in the foregoing method embodiments, and for the sake of brief description, reference may be made to corresponding contents in the foregoing method embodiments where no part of the apparatus embodiments is mentioned.
Fig. 6 shows a possible structure of an electronic device 500 provided in an embodiment of the present application. Referring to fig. 6, the electronic device 500 includes: a processor 510, a memory 520, and a communication interface 530, which are interconnected and in communication with each other via a communication bus 540 and/or other form of connection mechanism (not shown).
It will be appreciated that the configuration shown in FIG. 6 is merely illustrative and that electronic device 500 may include more or fewer components than shown in FIG. 6 or have a different configuration than shown in FIG. 6. The components shown in fig. 6 may be implemented in hardware, software, or a combination thereof. In an embodiment of the present application, the electronic device 500 may be the device in fig. 1 that deploys the SDN controller 100 and/or the network element device 110.
The embodiments of the present application further provide a computer-readable storage medium, where computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are read and executed by a processor, the steps of the session establishment method provided in the embodiments of the present application are executed. For example, the computer-readable storage medium may be, but is not limited to, the memory 520 of the electronic device 500 of FIG. 6.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A session establishment method applied to a Software Defined Network (SDN) controller, the method comprising:
responding to a request for establishing an encryption session between network element devices at two ends in an SDN, respectively sending an instruction for initializing the encryption session to the network element devices at the two ends, and indicating the network element devices at the two ends to apply for a digital certificate to the SDN controller;
receiving certificate application requests sent by the two-end network element equipment respectively, and generating a digital certificate according to the certificate application requests;
and respectively sending the digital certificates corresponding to the two end network element devices, so that the two end network element devices perform key agreement of the encryption session by exchanging the digital certificates.
2. The method according to claim 1, wherein the sending the digital certificates corresponding to the two end network element devices respectively to enable the two end network element devices to perform key agreement of the encrypted session by exchanging the digital certificates includes:
respectively sending the digital certificates corresponding to the two terminal network element devices;
and selecting one end from the two-end network element equipment, sending an instruction for establishing an encryption session to the selected network element equipment, and indicating the network element equipment as an initiator of key agreement to perform the key agreement of the encryption session with opposite-end equipment by exchanging a digital certificate.
3. The session establishing method according to claim 1 or 2, wherein before the sending the instruction for initializing the encrypted session to the two-end network element device, respectively, the method further comprises:
generating a session identifier;
the instruction for initializing the encryption session carries the session identifier and the device identifier of the opposite terminal device;
the certificate application request carries a device identifier of the local terminal device, a device identifier of the opposite terminal device, a public key of the local terminal device, the session identifier and a private key signature of the local terminal device;
the digital certificate carries the device identifier of the local device, the device identifier of the opposite device, the certificate serial number of the local device, the certificate serial number of the opposite device, the public key of the local device, the session identifier, the validity period of the certificate, the public key of the SDN controller, and the private key signature of the SDN controller.
4. The session establishment method according to claim 3, wherein the method further comprises:
receiving an encrypted session update request sent by the network element device, where the encrypted session update request carries a digital certificate of the network element device, the session identifier, and a new session key;
verifying the validity of the digital certificate, and if the verification is passed, determining the two-end network element equipment participating in the encrypted session according to the session identifier;
generating new session identifiers, and respectively sending new instructions for initializing encryption sessions to the network element devices at the two ends, so that the network element devices at the two ends perform key agreement for the new encryption sessions; wherein the new encrypted session employs the new session key.
5. A session establishment method applied to a network element device in an SDN network, the method comprising:
receiving an encryption session initialization instruction sent by an SDN controller, and sending a certificate application request to the SDN controller according to the encryption session initialization instruction;
and receiving the digital certificate sent by the SDN controller, and performing key agreement of an encryption session by exchanging the digital certificate with opposite-end equipment.
6. The session establishment method according to claim 5, wherein, before the sending a certificate application request to the SDN controller according to the instruction for initializing an encryption session, the method further comprises:
generating a public and private key pair of local terminal equipment; the certificate application request and the digital certificate both carry the public key of the local terminal device.
7. The session establishment method according to claim 6, wherein the key agreement for the encrypted session through exchanging a digital certificate with the peer device comprises:
receiving an instruction for establishing an encryption session sent by the SDN controller, sending a request for establishing communication to the opposite terminal equipment according to the instruction for establishing the encryption session, and receiving a digital certificate sent by the opposite terminal equipment;
verifying the digital certificate of the opposite terminal equipment, and if the verification is passed, establishing communication with the opposite terminal equipment;
generating a session key;
and sending the digital certificate of the local terminal equipment and the session key encrypted by the private key of the local terminal equipment to the opposite terminal equipment.
8. The session establishment method according to claim 6, wherein the key agreement for the encrypted session through exchanging a digital certificate with the peer device comprises:
responding to a request for establishing communication sent by the opposite terminal equipment, and sending the digital certificate of the local terminal equipment to the opposite terminal equipment;
establishing communication with the opposite terminal equipment;
receiving a digital certificate sent by the opposite terminal equipment and a session key encrypted by using a private key of the opposite terminal equipment;
and verifying the digital certificate of the opposite terminal equipment, if the verification is passed, decrypting by using the public key of the opposite terminal equipment in the digital certificate to obtain the plaintext of the session key, and sending the session key encrypted by using the public key of the opposite terminal equipment to the opposite terminal equipment.
9. The session establishment method according to claim 7 or 8, wherein the digital certificate carries a device identifier of the local device, a device identifier of the peer device, a certificate serial number of the local device, a certificate serial number of the peer device, a public key of the local device, a session identifier, a certificate validity period, a public key of the SDN controller, and a private key signature of the SDN controller, and the verifying the digital certificate of the peer device includes performing at least one of the following verification items:
verifying whether the certificate serial number of the local terminal equipment in the digital certificate of the opposite terminal equipment is consistent with the certificate serial number of the opposite terminal equipment in the digital certificate of the local terminal equipment;
verifying whether the certificate serial number of the opposite terminal equipment in the digital certificate of the opposite terminal equipment is consistent with the certificate serial number of the local terminal equipment in the digital certificate of the local terminal equipment;
verifying whether the device identifier of the local device in the digital certificate of the opposite-end device is consistent with the device identifier of the opposite-end device in the digital certificate of the local device;
checking whether the device identifier of the opposite terminal device in the digital certificate of the opposite terminal device is consistent with the device identifier of the local terminal device in the digital certificate of the local terminal device;
checking whether the session identifier in the digital certificate of the opposite terminal equipment is consistent with the session identifier in the digital certificate of the local terminal equipment;
verifying whether the signature in the digital certificate of the opposite terminal device and the signature in the digital certificate of the local terminal device are both private key signatures of the SDN controller;
verifying whether the certificate is valid according to the certificate validity period in the digital certificate of the opposite terminal equipment;
and if the executed verification item results are yes, the digital certificate of the opposite terminal equipment passes verification, otherwise, the verification fails.
10. The method according to claim 9, wherein the digital certificate further carries a session validity period, and after the key agreement is completed, the method further comprises:
locally saving session context information, the session context information comprising: the session identifier, the digital certificate of the opposite terminal device, the session key and the session validity period.
11. The session establishment method of claim 10, wherein after the locally saving session context information, the method further comprises:
sending a message to the opposite terminal equipment by using the session key encryption in the session context information, wherein the message carries the session identifier;
and/or the presence of a gas in the gas,
receiving a message sent by the opposite-end device, searching for the corresponding session context information according to the session identifier carried in the message, and decrypting the message according to the session key in the searched session context information.
12. The session establishment method according to claim 10, wherein the method further comprises:
generating a new session key when the encrypted session is determined to have expired according to the session validity period in the session context information;
sending an encrypted session update request to the SDN controller, wherein the encrypted session update request carries the digital certificate of the network element device, the session identifier and the new session key;
receiving a new encryption session initialization instruction sent by the SDN controller, and performing key agreement on a new encryption session with the opposite terminal device according to the new encryption session initialization instruction; wherein the new encrypted session employs the new session key;
after the new round of key agreement is completed, the new session context information is saved locally.
13. The session establishment method of claim 12, wherein after the locally saving new session context information, the method further comprises:
processing a message generated after the session is updated by using the new session context information;
when the expiration time of the encryption session does not reach the preset time, continuously using the session context information to decrypt the message generated before the session is updated;
when the expiration duration of the encrypted session reaches a preset duration, sending an encrypted session release request to the SDN controller, wherein the encrypted session release request carries the session identifier;
receiving an encrypted session release instruction sent by the SDN controller, and releasing the corresponding session context information according to the session identifier carried in the encrypted session release instruction.
14. A session establishment apparatus configured at a software defined network, SDN, controller, the apparatus comprising:
an initialization indicating module, configured to respond to a request for establishing an encryption session between two end network element devices in an SDN network, send an instruction for initializing the encryption session to the two end network element devices, respectively, and indicate the two end network element devices to apply for a digital certificate to the SDN controller;
the certificate generating module is used for respectively receiving the certificate application requests sent by the two-end network element equipment and generating a digital certificate according to the certificate application requests;
and the certificate sending module is used for respectively sending the digital certificates corresponding to the two end network element devices so as to perform key agreement of encrypted sessions between the two end network element devices by exchanging the digital certificates.
15. A session establishment apparatus configured in a network element device in an SDN network, the apparatus comprising:
the certificate application module is used for receiving an encryption session initialization instruction sent by an SDN controller and sending a certificate application request to the SDN controller according to the encryption session initialization instruction;
and the key negotiation module is used for receiving the digital certificate sent by the SDN controller and carrying out key negotiation of an encryption session through exchanging the digital certificate with opposite-end equipment.
CN201911051382.XA 2019-10-30 2019-10-30 Session establishment method and device Active CN110768795B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911051382.XA CN110768795B (en) 2019-10-30 2019-10-30 Session establishment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911051382.XA CN110768795B (en) 2019-10-30 2019-10-30 Session establishment method and device

Publications (2)

Publication Number Publication Date
CN110768795A CN110768795A (en) 2020-02-07
CN110768795B true CN110768795B (en) 2022-09-13

Family

ID=69335251

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911051382.XA Active CN110768795B (en) 2019-10-30 2019-10-30 Session establishment method and device

Country Status (1)

Country Link
CN (1) CN110768795B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113194472B (en) * 2021-03-31 2023-03-31 新华三技术有限公司成都分公司 AGV wireless access method, vehicle-mounted equipment, network equipment and storage medium
CN113364571B (en) * 2021-05-11 2022-07-12 国网浙江省电力有限公司电力科学研究院 Transformer substation digital certificate management method based on IEC61850 trusted chain model
CN115942305A (en) * 2021-08-08 2023-04-07 华为技术有限公司 Session establishment method and related device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106559408A (en) * 2015-11-27 2017-04-05 国网智能电网研究院 A kind of SDN authentication methods based on trust management

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582906B (en) * 2009-06-23 2012-04-18 中国人民解放军信息工程大学 Key agreement method and device
CN103856477B (en) * 2012-12-06 2018-01-02 阿里巴巴集团控股有限公司 A kind of credible accounting system and corresponding authentication method and equipment
CN103415008A (en) * 2013-07-24 2013-11-27 牟大同 Encryption communication method and encryption communication system
CN106453330B (en) * 2016-10-18 2019-11-12 深圳市金立通信设备有限公司 A kind of identity authentication method and system
CN108667781A (en) * 2017-04-01 2018-10-16 西安西电捷通无线网络通信股份有限公司 A kind of digital certificate management method and equipment
CN108924147B (en) * 2018-07-17 2021-10-26 中国联合网络通信集团有限公司 Communication terminal digital certificate issuing method, server and communication terminal
CN109462476B (en) * 2018-11-23 2021-10-08 成都卫士通信息产业股份有限公司 Key agreement method, device, terminal and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106559408A (en) * 2015-11-27 2017-04-05 国网智能电网研究院 A kind of SDN authentication methods based on trust management

Also Published As

Publication number Publication date
CN110768795A (en) 2020-02-07

Similar Documents

Publication Publication Date Title
JP6684930B2 (en) Blockchain-based identity authentication method, device, node and system
CN110677240B (en) Method, apparatus and medium for providing highly available computing services through certificate issuance
CN110535628B (en) Method and device for performing multi-party security calculation through certificate signing and issuing
US8418242B2 (en) Method, system, and device for negotiating SA on IPv6 network
JP2020080530A (en) Data processing method, device, terminal, and access point computer
CN110768795B (en) Session establishment method and device
JP6896940B2 (en) Symmetrical mutual authentication method between the first application and the second application
CN111064569B (en) Cluster key obtaining method and device of trusted computing cluster
US8650397B2 (en) Key distribution to a set of routers
CN106790261B (en) Distributed file system and method for authenticating communication between its interior joint
JP2008545353A (en) Establishing a reliable relationship between unknown communicating parties
CN107396350B (en) SDN-5G network architecture-based security protection method between SDN components
CN112351037B (en) Information processing method and device for secure communication
Liou et al. T-auth: A novel authentication mechanism for the IoT based on smart contracts and PUFs
US11595218B2 (en) Authorization delegation
CN111404884B (en) Secure communication method, client and non-public server
CN110771087B (en) Private key update
CN112600831A (en) Network client identity authentication system and method
CN114598455A (en) Method, device, terminal entity and system for signing and issuing digital certificate
CN112261103A (en) Node access method and related equipment
CN108932425B (en) Offline identity authentication method, authentication system and authentication equipment
KR101256114B1 (en) Message authentication code test method and system of many mac testserver
US20210111906A1 (en) Pseudonym credential configuration method and apparatus
CN115913521A (en) Method for identity authentication based on quantum key
JP2004274134A (en) Communication method, communication system using the communication method, server and client

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant