Summary of the invention
The invention provides a kind of secure communication protocols method of testing based on state model and system, by agreement is mapped as state model, and introduce illegal state to state model, judge this secure communication protocols whether safety, thus low cost, achieve the test of secure communication protocols efficiently.
According to above-mentioned purpose, the invention provides a kind of secure communication protocols method of testing based on state model, it is characterized in that, described method comprises:
S1, encapsulates described secure communication protocols, realizes the protocol specification described by described secure communication protocols;
S2, is mapped as multiple state model by the secure communication protocols after described encapsulation;
S3, the testing software corresponding according to described state model design;
S4, introduces non-secure states and illegal state by described testing software respectively to described state model, judges whether described secure communication protocols enters corresponding state model, if so, then judges described secure communication protocols safety, otherwise dangerous.
Wherein, the injecting by injecting the mode of fault of described illegal state.
Wherein, described illegal state is the safety failure corresponding with the secure communication protocols realized.
According to another aspect of the present invention, provide a kind of secure communication protocols test macro based on state model, it is characterized in that, described system comprises:
Encapsulation unit, for encapsulating described secure communication protocols, realizes the protocol specification described by described secure communication protocols;
Map unit, for being mapped as multiple state model by described secure communication protocols;
Testing software design cell, for the testing software corresponding according to described state model design;
Analysis unit, for introducing non-secure states and illegal state by described testing software respectively to described state model, judge whether described secure communication protocols enters corresponding state model, if, then judge described secure communication protocols safety, otherwise dangerous.
Secure communication protocols method of testing based on state model of the present invention and system, by by secure communication protocols realize based on protocol specification be mapped as state model, and introduce the illegal state corresponding with the safety failure described in protocol realization to state model, as time delay, out of order, frame losing, wrong frame, network interruption etc., observe whether the state model introducing communication protocol guiding after illegal state is the safe condition expected, thus low cost and realize the confirmatory test of secure communication protocols efficiently.
Embodiment
Below in conjunction with accompanying drawing, embodiments of the present invention is described in detail.
Fig. 1 shows the process flow diagram of the secure communication protocols method of testing based on state model of the present invention.
With reference to Fig. 1, the secure communication protocols method of testing based on state model of embodiments of the invention comprises step:
S1, encapsulates described secure communication protocols, realizes the protocol specification described by described secure communication protocols;
S2, is mapped as multiple state model by the secure communication protocols after encapsulation;
S3, the testing software corresponding according to described state model design;
S4, introduces non-secure states and illegal state by described testing software respectively to described state model, judges whether described secure communication protocols enters corresponding state model, if so, then judges described secure communication protocols safety, otherwise dangerous.
In the present embodiment, the injection of illegal state is introduced by the mode injecting fault, and this illegal state is the safety failure corresponding with the secure communication protocols realized.
Below for FSFB/2 agreement, specifically describe the method for testing of secure communication protocols FSFB/2 agreement, the process of the method is specific as follows:
1) encapsulate FSFB/2 agreement, realize the protocol specification that FSFB/2 agreement describes;
2) mapping FSFB/2 agreement is SSE sequence calibration request, state model such as the calibration of SSR sequence response, BTD, EBT, ABT acknowledgement frame etc.;
3) according to above-mentioned state model, the testing software that design is corresponding, and provide friendly interface environment, based on MFC framework, realizes step 2) described in state model;
4) non-secure states is introduced by testing software to state model, realize step 2) described in the State Transferring of state model, judge whether FSFB/2 agreement enters corresponding state model, if, then judge described secure communication protocols safety, otherwise dangerous.
5) illegal state corresponding with FSFB/2 protocol realization and safety failure is introduced to state model to inject failure mode, the states such as such as time delay, out of order, frame losing, wrong frame, network interruption, judge whether FSFB/2 agreement enters corresponding state model, if, then judge described secure communication protocols safety, otherwise dangerous.
In the present embodiment, FSFB/2 agreement is the secure communication protocols in open communication system.FSFB/2 agreement ensures that between TCC equipment and LEU equipment, data carry out safe transmission, when communication port is in unsafe condition, can inform safety equipment so that carry out security protection process.
During TCC and LEU communicates, there are two kinds of different transmission modes, be respectively TSD and BTM, content, flow process and reception, transmit leg that two kinds of modes are transmitted are not identical.
TSD pattern is the general modfel of TCC to LEU transponder beacon message, this pattern is initiated by LEU (data receiver), SSE (sequence calibration request) is sent to TCC (data receiver), TCC will respond SSR (sequence calibration response) to complete handshake procedure, after handshake procedure completes, if do not go out active to exceed the situation such as the frame number of allowable value, three timestamp comparation mistakes, time-out, TCC by continue to LEU transponder beacon message.
When BTM pattern is TCC inquiry LEU state, the communication pattern that both sides adopt, this pattern is initiated by TCC, sends SBT (buffer memory transmission starts), through a series of comparatively complicated reciprocal process, complete the inquiry of LEU state to LEU.In the process, TCC is take over party's (command transfer stage) and transmit leg (other two stages) simultaneously, otherwise LEU then.This pattern is clocked flip, completes once every the specific time (15s or 30s).
The above-mentioned protocol mode of comprehensive analysis, is mapped as ABT, BTD, EBT, SSE, SSR five kinds of state models by FSFB/2 agreement.
In another aspect of the present invention, provide a kind of secure communication protocols test macro based on state model.
Fig. 2 shows the structured flowchart of the secure communication protocols test macro based on state model of the present invention.
With reference to Fig. 2, this system comprises:
Encapsulation unit 10, for encapsulating described secure communication protocols, realizes the protocol specification described by described secure communication protocols;
Map unit 20, for being mapped as multiple state model by described secure communication protocols;
Testing software design cell 30, for the testing software corresponding according to described state model design;
Analysis unit 40, for introducing non-secure states and illegal state by described testing software respectively to described state model, judge whether described secure communication protocols enters corresponding state model, if, then judge described secure communication protocols safety, otherwise dangerous.
Secure communication protocols method of testing based on state model of the present invention and system, by by secure communication protocols realize based on protocol specification be mapped as state model, and introduce the illegal state corresponding with the safety failure described in protocol realization to state model, as time delay, out of order, frame losing, wrong frame, network interruption etc., observe whether the state model introducing communication protocol guiding after illegal state is the safe condition expected, thus low cost and realize the confirmatory test of secure communication protocols efficiently.
Although describe embodiments of the present invention by reference to the accompanying drawings, but those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, such amendment and modification all fall into by within claims limited range.