Newer
Older
/**
* @author ETSI / STF481
* @version $URL$
* $Id$
* @desc Module containing functions for Security Protocol
*
*/
module LibItsSecurity_Functions {
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// group configurationFunctions {
//
// /**
// * @desc
// */
// function f_cf01Up() runs on ItsGnSecurity {
//
// // Map
// map(self:acPort, system:acPort);
// map(self:utPort, system:utPort);
// map(self:gnSecurityPort, system:gnSecurityPort);
//
// // Connect
// f_connect4SelfOrClientSync();
// activate(a_cf01Down());
//
// // Initialze the IUT/DUT
// f_initialState();
//
// } // End of function f_cf01Up
//
// function f_cf01Down() runs on ItsGnSecurity {
//
// // Unmap
// unmap(self:acPort, system:acPort);
// unmap(self:utPort, system:utPort);
// unmap(self:gnSecurityPort, system:gnSecurityPort);
//
// // Disconnect
// f_disconnect4SelfOrClientSync();
// } // End of function f_cf01Down
//
// } // End of group configurationFunctions
//
// group preambles {
//
// /**
// * @desc Brings the IUT into an initial state.
// */
// function f_initialState() runs on ItsBaseGnSecurity {
// // TODO
// }
//
// } // End of group preambles
//
// group postambles {
//
// } // End of group postambles
//
// group securityAltsteps {
//
// /**
// * @desc The base default behavior.
// */
// altstep a_default() runs on ItsGnSecurity {
// [] gnSecurityPort.receive(mw_gnSecurityInd(?)) {
// log("*** a_default: WARNING: Received an unexpected message ***");
// repeat;
// }
// [] gnSecurityPort.receive {
// log("*** a_default: WARNING: Received an unexpected message ***");
// repeat;
// }
// [] tc_wait.timeout {
// log("*** a_default: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
// f_selfOrClientSyncAndVerdict("error", e_timeout);
// }
// [] tc_ac.timeout {
// log("*** a_default: ERROR: Timeout while awaiting the reception of a message ***");
// f_selfOrClientSyncAndVerdict("error", e_timeout);
// }
// [] a_shutdown() {
// log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
// stop;
// }
// } // End of 'altstep' statement
//
// altstep a_cf01Down() runs on ItsGnSecurity {
// [] a_shutdown() {
// f_cf01Down();
// log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
// stop;
// }
// } // End of 'altstep' statement
//
// } // End of group securityAltsteps
//
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/**
* @desc Produces a 256-bit (32-byte) hash value
* @param TODO
* @return TODO
*/
function f_hashWithSha256(in octetstring p_toBeHashedData) {
}
/**
* @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee
* @param TODO
* @return TODO
*/
function f_signWithEcdsaNistp256WithSha256() {
}
/**
* @desc Verify the signature of the specified data
* @param TODO
* @return true on success, false otherwise
*/
function f_verifyWithEcdsaNistp256WithSha256() return boolean {
return false;
}
/**
* @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm
* @param TODO
* @return true on success, false otherwise
*/
function f_generateKeyPair() return boolean {
return false;
}
} // End of group helpersFunctions
group externalFunctions {
/**
* @desc Produces a 256-bit (32-byte) hash value
* @param p_toBeHashedData Data to be used to calculate the hash value
* @return The hash value
*/
external function fx_hashWithSha256(in octetstring p_toBeHashedData) return octetstring;
/**
* @desc Produces a Elliptic Curve Digital Signature Algorithm (ECDSA) signaturee
* @param p_toBeSignedData The data to be signed
* @param p_privateKey The private key
* @return The signature value
*/
external function fx_signWithEcdsaNistp256WithSha256(in octetstring p_toBeSignedData, in octetstring/*UInt64*/ p_privateKey) return octetstring;
/**
* @desc Verify the signature of the specified data
* @param p_toBeVerifiedData The data to be verified
* @param p_signature The signature
* @param p_ecdsaNistp256PublicKeyX The public key (x coordinate)
* @param p_ecdsaNistp256PublicKeyY The public key (y coordinate)
* @return true on success, false otherwise
*/
external function fx_verifyWithEcdsaNistp256WithSha256(in octetstring p_toBeVerifiedData, in octetstring p_signature, in octetstring p_ecdsaNistp256PublicKeyX, in octetstring p_ecdsaNistp256PublicKeyY) return boolean;
/**
* @desc Produce a new public/private key pair based on Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm
* @param p_privateKey The new private key value
* @param p_publicKeyX The new public key value (x coordinate)
* @param p_publicKeyX The new public key value (y coordinate)
* @return true on success, false otherwise
*/
external function fx_generateKeyPair(out octetstring/*UInt64*/ p_privateKey, out octetstring p_publicKeyX, out octetstring p_publicKeyY) return boolean;
} // End of group externalFunctions