-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtls.xml
More file actions
271 lines (262 loc) · 8.34 KB
/
tls.xml
File metadata and controls
271 lines (262 loc) · 8.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
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
101
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE nta PUBLIC '-//Uppaal Team//DTD Flat System 1.6//EN' 'http://www.it.uu.se/research/group/darts/uppaal/flat-1_6.dtd'>
<nta>
<declaration>// Place global declarations here.
// note the values used are for demonstration purposes
//channel
chan clientHello;
chan serverHello;
chan passed;
chan clientKeyExchange;
chan fin_tls;
chan terminate;
chan session_fin;
// client_suite
int client_suite;
// 32 random generated by the client extra layer of security
const int client_random_byte = 66;
// 32 random generated by the server extra layer of security
const int server_random_byte = 88;
// public diffy hellman
const int g = 3;
const int n = 50;
int ag;
int bg;
bool valid_certificate = true;
const int hash_fin = 2;
int[0, 2147483647] power(int base, int e) {
int[0, 2147483647] result = 1;
int i;
for(i = 0; i < e; i++) {
result = result * base;
}
return result;
}
int encrypt_fin;
</declaration>
<template>
<name x="5" y="5">Tls_client</name>
<declaration>// Place local declarations here.
// note the values used are for demonstration purposes
const int a = 5;
int client_master_key ;
int decrypted_fin;
</declaration>
<location id="id0" x="-1071" y="-204">
<name x="-1096" y="-238">CLOSED</name>
</location>
<location id="id1" x="-425" y="-204">
<name x="-476" y="-255">CLIENT_HELLO_SENT</name>
</location>
<location id="id2" x="-425" y="42">
<name x="-510" y="59">SERVER_HELLO_RECIVED</name>
</location>
<location id="id3" x="178" y="-204">
<name x="93" y="-246">CLIENT_KEY_EXCHANGE_SENT</name>
</location>
<location id="id4" x="178" y="195">
<name x="102" y="229">FIN_TLS_INTEGRITY</name>
</location>
<location id="id5" x="1096" y="204">
<name x="994" y="255">TLS_DONE_FULL_ENCRYT_MSG</name>
</location>
<init ref="id0"/>
<transition id="id6">
<source ref="id5"/>
<target ref="id0"/>
<label kind="synchronisation" x="-263" y="-807">session_fin?</label>
<nail x="1062" y="-773"/>
<nail x="-1300" y="-756"/>
<nail x="-1300" y="-204"/>
</transition>
<transition id="id7">
<source ref="id3"/>
<target ref="id4"/>
<label kind="synchronisation" x="340" y="-238">fin_tls?</label>
<label kind="assignment" x="170" y="59">decrypted_fin = encrypt_fin/client_master_key</label>
<nail x="553" y="-204"/>
<nail x="561" y="85"/>
<nail x="178" y="85"/>
</transition>
<transition id="id8">
<source ref="id1"/>
<target ref="id0"/>
<label kind="synchronisation" x="-799" y="-51">terminate?</label>
<nail x="-552" y="-25"/>
<nail x="-901" y="-17"/>
</transition>
<transition id="id9">
<source ref="id5"/>
<target ref="id0"/>
<label kind="synchronisation" x="-340" y="-552">session_fin!</label>
<nail x="289" y="-527"/>
<nail x="-799" y="-518"/>
<nail x="-1020" y="-229"/>
</transition>
<transition id="id10">
<source ref="id4"/>
<target ref="id0"/>
<label kind="guard" x="-646" y="212">!decrypted_fin == hash_fin</label>
<label kind="synchronisation" x="-578" y="170">terminate!</label>
<nail x="-603" y="204"/>
<nail x="-1062" y="212"/>
</transition>
<transition id="id11">
<source ref="id2"/>
<target ref="id0"/>
<label kind="guard" x="-824" y="51">!valid_certificate</label>
<label kind="synchronisation" x="-985" y="16">terminate!</label>
<nail x="-1003" y="42"/>
</transition>
<transition id="id12">
<source ref="id4"/>
<target ref="id5"/>
<label kind="guard" x="484" y="221">decrypted_fin == hash_fin</label>
<label kind="synchronisation" x="391" y="221">passed!</label>
</transition>
<transition id="id13">
<source ref="id2"/>
<target ref="id3"/>
<label kind="guard" x="-110" y="51">valid_certificate</label>
<label kind="synchronisation" x="-306" y="51">clientKeyExchange!</label>
<label kind="assignment" x="-374" y="-8">ag=power(g,a)%n,client_master_key=power(bg,a)%n</label>
<nail x="85" y="34"/>
<nail x="76" y="-204"/>
</transition>
<transition id="id14">
<source ref="id1"/>
<target ref="id2"/>
<label kind="synchronisation" x="-408" y="-110">serverHello?</label>
</transition>
<transition id="id15">
<source ref="id0"/>
<target ref="id1"/>
<label kind="synchronisation" x="-884" y="-195">clientHello!</label>
<label kind="assignment" x="-748" y="-195">client_suite=5</label>
</transition>
</template>
<template>
<name>Tls_server</name>
<declaration>// note the values used are for demonstration purposes
// Server's supported cipher suites
const int SERVER_SUITES[4] = {1, 2, 5, 7};
const int SERVER_SUITE_COUNT = 4;
// Helper function to check if cipher suite is supported
bool is_suite_supported(int suite) {
int i;
for(i = 0; i < SERVER_SUITE_COUNT; i++) {
if(SERVER_SUITES[i] == suite) {
return true;
}
}
return false;
}
const int b = 2;
int server_master_key ;
</declaration>
<location id="id16" x="-1156" y="-425">
<name x="-1166" y="-459">CLOSED</name>
</location>
<location id="id17" x="603" y="-153">
<name x="637" y="-162">CLIENT_HELLO_RECIVED</name>
</location>
<location id="id18" x="-289" y="-425">
<name x="-298" y="-476">SERVER_HELLO_SENT</name>
</location>
<location id="id19" x="977" y="-450">
<name x="875" y="-501">CLIENT_KEY_CHANGE_RECIVED</name>
</location>
<location id="id20" x="969" y="195">
<name x="994" y="187">FIN_TLS_INTEGRITY</name>
</location>
<location id="id21" x="969" y="314">
<name x="1003" y="306">TLS_DONE_FULL_ENCRYT_MSG</name>
</location>
<init ref="id16"/>
<transition id="id22">
<source ref="id21"/>
<target ref="id16"/>
<label kind="synchronisation" x="-212" y="416">session_fin!</label>
<nail x="969" y="450"/>
<nail x="-1215" y="442"/>
<nail x="-1215" y="-425"/>
</transition>
<transition id="id23">
<source ref="id17"/>
<target ref="id16"/>
<label kind="guard" x="-433" y="136">!is_suite_supported(client_suite)</label>
<label kind="synchronisation" x="-348" y="76">terminate!</label>
<nail x="612" y="93"/>
<nail x="-952" y="127"/>
</transition>
<transition id="id24">
<source ref="id21"/>
<target ref="id16"/>
<label kind="synchronisation" x="-238" y="289">session_fin?</label>
<nail x="952" y="314"/>
<nail x="-1122" y="323"/>
</transition>
<transition id="id25">
<source ref="id20"/>
<target ref="id16"/>
<label kind="synchronisation" x="-255" y="221">terminate?</label>
<nail x="-1054" y="212"/>
</transition>
<transition id="id26">
<source ref="id18"/>
<target ref="id16"/>
<label kind="guard" x="-705" y="-450">!valid_certificate</label>
<label kind="synchronisation" x="-731" y="-391">terminate?</label>
<nail x="-314" y="-425"/>
</transition>
<transition id="id27">
<source ref="id20"/>
<target ref="id21"/>
<label kind="synchronisation" x="977" y="246">passed?</label>
</transition>
<transition id="id28">
<source ref="id19"/>
<target ref="id20"/>
<label kind="synchronisation" x="943" y="-136">fin_tls!</label>
<label kind="assignment" x="782" y="-323">encrypt_fin=hash_fin*server_master_key</label>
</transition>
<transition id="id29">
<source ref="id18"/>
<target ref="id19"/>
<label kind="guard" x="144" y="-467">valid_certificate</label>
<label kind="synchronisation" x="144" y="-425">clientKeyExchange?</label>
<label kind="assignment" x="357" y="-433">server_master_key=power(ag,b)%50</label>
</transition>
<transition id="id30">
<source ref="id17"/>
<target ref="id18"/>
<label kind="guard" x="-76" y="-348">is_suite_supported(client_suite)</label>
<label kind="synchronisation" x="-102" y="-289">serverHello!</label>
<label kind="assignment" x="42" y="-289">bg=power(g,b)%n</label>
<nail x="603" y="-323"/>
<nail x="-289" y="-297"/>
</transition>
<transition id="id31">
<source ref="id16"/>
<target ref="id17"/>
<label kind="synchronisation" x="-433" y="-195">clientHello?</label>
<nail x="-892" y="-136"/>
<nail x="552" y="-161"/>
</transition>
</template>
<system>// Place template instantiations here.
C = Tls_client();
S = Tls_server();
// List one or more processes to be composed into a system.
system C,S;
</system>
<queries>
<query>
<formula>A[] not deadlock
// System never deadlocks</formula>
<comment/>
<result outcome="success" type="quality" timestamp="2025-11-19 17:03:27 +0100">
</result>
</query>
</queries>
</nta>