1
2
3
4#line 4 "s3_srvr_7.cil.c"
5int ssl3_accept(int initial_state )
6{ int s__info_callback ;
7 int s__in_handshake ;
8 int s__state ;
9 int s__new_session ;
10 int s__server ;
11 int s__version ;
12 int s__type ;
13 int s__init_num ;
14 int s__hit ;
15 int s__rwstate ;
16 int s__init_buf___0 ;
17 int s__debug ;
18 int s__shutdown ;
19 int s__cert ;
20 int s__options ;
21 int s__verify_mode ;
22 int s__session__peer ;
23 int s__cert__pkeys__AT0__privatekey ;
24 int s__ctx__info_callback ;
25 int s__ctx__stats__sess_accept_renegotiate ;
26 int s__ctx__stats__sess_accept ;
27 int s__ctx__stats__sess_accept_good ;
28 int s__s3__tmp__cert_request ;
29 int s__s3__tmp__reuse_message ;
30 int s__s3__tmp__use_rsa_tmp ;
31 int s__s3__tmp__new_cipher ;
32 int s__s3__tmp__new_cipher__algorithms ;
33 int s__s3__tmp__next_state___0 ;
34 int s__s3__tmp__new_cipher__algo_strength ;
35 int s__session__cipher ;
36 int buf ;
37 unsigned long l ;
38 unsigned long Time ;
39 unsigned long tmp ;
40 int cb ;
41 long num1 ;
42 int ret ;
43 int new_state ;
44 int state ;
45 int skip ;
46 int got_new_session ;
47 int tmp___1 ;
48 int tmp___2 ;
49 int tmp___3 ;
50 int tmp___4 ;
51 int tmp___5 ;
52 int tmp___6 ;
53 int tmp___7 ;
54 long tmp___8 ;
55 int tmp___9 ;
56 int tmp___10 ;
57 int blastFlag ;
58
59 int __cil_tmp55 ;
60 unsigned long __cil_tmp56 ;
61 unsigned long __cil_tmp57 ;
62 unsigned long __cil_tmp58 ;
63 unsigned long __cil_tmp59 ;
64 int __cil_tmp60 ;
65 unsigned long __cil_tmp61 ;
66
67 {
68#line 60
69;
70 s__state = initial_state;
71#line 61
72 blastFlag = 0;
73#line 62
74 tmp = __VERIFIER_nondet_int();
75#line 63
76 Time = tmp;
77#line 64
78 cb = 0;
79#line 65
80 ret = -1;
81#line 66
82 skip = 0;
83#line 67
84 got_new_session = 0;
85#line 68
86 if (s__info_callback != 0) {
87#line 69
88 cb = s__info_callback;
89 } else {
90#line 71
91 if (s__ctx__info_callback != 0) {
92#line 72
93 cb = s__ctx__info_callback;
94 }
95 }
96#line 77
97 s__in_handshake ++;
98#line 78
99 if (tmp___1 + 12288) {
100#line 79
101 if (tmp___2 + 16384) {
102
103 }
104 }
105#line 87
106 if (s__cert == 0) {
107#line 88
108 return (-1);
109 }
110 {
111#line 93
112 while (1) {
113 while_0_continue: ;
114#line 95
115 state = s__state;
116#line 96
117 if (s__state == 12292) {
118 goto switch_1_12292;
119 } else {
120#line 99
121 if (s__state == 16384) {
122 goto switch_1_16384;
123 } else {
124#line 102
125 if (s__state == 8192) {
126 goto switch_1_8192;
127 } else {
128#line 105
129 if (s__state == 24576) {
130 goto switch_1_24576;
131 } else {
132#line 108
133 if (s__state == 8195) {
134 goto switch_1_8195;
135 } else {
136#line 111
137 if (s__state == 8480) {
138 goto switch_1_8480;
139 } else {
140#line 114
141 if (s__state == 8481) {
142 goto switch_1_8481;
143 } else {
144#line 117
145 if (s__state == 8482) {
146 goto switch_1_8482;
147 } else {
148#line 120
149 if (s__state == 8464) {
150 goto switch_1_8464;
151 } else {
152#line 123
153 if (s__state == 8465) {
154 goto switch_1_8465;
155 } else {
156#line 126
157 if (s__state == 8466) {
158 goto switch_1_8466;
159 } else {
160#line 129
161 if (s__state == 8496) {
162 goto switch_1_8496;
163 } else {
164#line 132
165 if (s__state == 8497) {
166 goto switch_1_8497;
167 } else {
168#line 135
169 if (s__state == 8512) {
170 goto switch_1_8512;
171 } else {
172#line 138
173 if (s__state == 8513) {
174 goto switch_1_8513;
175 } else {
176#line 141
177 if (s__state == 8528) {
178 goto switch_1_8528;
179 } else {
180#line 144
181 if (s__state == 8529) {
182 goto switch_1_8529;
183 } else {
184#line 147
185 if (s__state == 8544) {
186 goto switch_1_8544;
187 } else {
188#line 150
189 if (s__state == 8545) {
190 goto switch_1_8545;
191 } else {
192#line 153
193 if (s__state == 8560) {
194 goto switch_1_8560;
195 } else {
196#line 156
197 if (s__state == 8561) {
198 goto switch_1_8561;
199 } else {
200#line 159
201 if (s__state == 8448) {
202 goto switch_1_8448;
203 } else {
204#line 162
205 if (s__state == 8576) {
206 goto switch_1_8576;
207 } else {
208#line 165
209 if (s__state == 8577) {
210 goto switch_1_8577;
211 } else {
212#line 168
213 if (s__state == 8592) {
214 goto switch_1_8592;
215 } else {
216#line 171
217 if (s__state == 8593) {
218 goto switch_1_8593;
219 } else {
220#line 174
221 if (s__state == 8608) {
222 goto switch_1_8608;
223 } else {
224#line 177
225 if (s__state == 8609) {
226 goto switch_1_8609;
227 } else {
228#line 180
229 if (s__state == 8640) {
230 goto switch_1_8640;
231 } else {
232#line 183
233 if (s__state == 8641) {
234 goto switch_1_8641;
235 } else {
236#line 186
237 if (s__state == 8656) {
238 goto switch_1_8656;
239 } else {
240#line 189
241 if (s__state == 8657) {
242 goto switch_1_8657;
243 } else {
244#line 192
245 if (s__state == 8672) {
246 goto switch_1_8672;
247 } else {
248#line 195
249 if (s__state == 8673) {
250 goto switch_1_8673;
251 } else {
252#line 198
253 if (s__state == 3) {
254 goto switch_1_3;
255 } else {
256 goto switch_1_default;
257#line 203
258 if (0) {
259 switch_1_12292:
260#line 205
261 s__new_session = 1;
262 switch_1_16384: ;
263 switch_1_8192: ;
264 switch_1_24576: ;
265 switch_1_8195:
266#line 210
267 s__server = 1;
268#line 211
269 if (cb != 0) {
270
271 }
272 {
273#line 216
274 __cil_tmp55 = s__version * 8;
275#line 216
276 if (__cil_tmp55 != 3) {
277#line 217
278 return (-1);
279 }
280 }
281#line 221
282 s__type = 8192;
283#line 222
284 if (s__init_buf___0 == 0) {
285#line 223
286 buf = __VERIFIER_nondet_int();
287#line 224
288 if (buf == 0) {
289#line 225
290 ret = -1;
291 goto end;
292 }
293#line 230
294 if (! tmp___3) {
295#line 231
296 ret = -1;
297 goto end;
298 }
299#line 236
300 s__init_buf___0 = buf;
301 }
302#line 240
303 if (! tmp___4) {
304#line 241
305 ret = -1;
306 goto end;
307 }
308#line 246
309 s__init_num = 0;
310#line 247
311 if (s__state != 12292) {
312#line 248
313 if (! tmp___5) {
314#line 249
315 ret = -1;
316 goto end;
317 }
318#line 254
319 s__state = 8464;
320#line 255
321 s__ctx__stats__sess_accept ++;
322 } else {
323#line 257
324 s__ctx__stats__sess_accept_renegotiate ++;
325#line 258
326 s__state = 8480;
327 }
328 goto switch_1_break;
329 switch_1_8480: ;
330 switch_1_8481:
331#line 263
332 s__shutdown = 0;
333#line 264
334 ret = __VERIFIER_nondet_int();
335#line 265
336 if (ret <= 0) {
337 goto end;
338 }
339#line 270
340 s__s3__tmp__next_state___0 = 8482;
341#line 271
342 s__state = 8448;
343#line 272
344 s__init_num = 0;
345 goto switch_1_break;
346 switch_1_8482:
347#line 275
348 s__state = 3;
349 goto switch_1_break;
350 switch_1_8464: ;
351 switch_1_8465: ;
352 switch_1_8466:
353#line 280
354 s__shutdown = 0;
355#line 281
356 ret = __VERIFIER_nondet_int();
357#line 282
358 if (blastFlag == 0) {
359#line 283
360 blastFlag = 1;
361 }
362#line 287
363 if (ret <= 0) {
364 goto end;
365 }
366#line 292
367 got_new_session = 1;
368#line 293
369 s__state = 8496;
370#line 294
371 s__init_num = 0;
372 goto switch_1_break;
373 switch_1_8496: ;
374 switch_1_8497:
375#line 298
376 ret = __VERIFIER_nondet_int();
377#line 299
378 if (blastFlag == 1) {
379#line 300
380 blastFlag = 2;
381 }
382#line 304
383 if (ret <= 0) {
384 goto end;
385 }
386#line 309
387 if (s__hit) {
388#line 310
389 s__state = 8656;
390 } else {
391#line 312
392 s__state = 8512;
393 }
394#line 314
395 s__init_num = 0;
396 goto switch_1_break;
397 switch_1_8512: ;
398 switch_1_8513: ;
399 {
400#line 318
401 __cil_tmp56 = (unsigned long )s__s3__tmp__new_cipher__algorithms;
402#line 318
403 if (__cil_tmp56 + 256UL) {
404#line 319
405 skip = 1;
406 } else {
407#line 321
408 ret = __VERIFIER_nondet_int();
409#line 322
410 if (blastFlag == 2) {
411#line 323
412 blastFlag = 6;
413 }
414#line 327
415 if (ret <= 0) {
416 goto end;
417 }
418 }
419 }
420#line 333
421 s__state = 8528;
422#line 334
423 s__init_num = 0;
424 goto switch_1_break;
425 switch_1_8528: ;
426 switch_1_8529:
427#line 338
428 l = (unsigned long )s__s3__tmp__new_cipher__algorithms;
429 {
430#line 339
431 __cil_tmp57 = (unsigned long )s__options;
432#line 339
433 if (__cil_tmp57 + 2097152UL) {
434#line 340
435 s__s3__tmp__use_rsa_tmp = 1;
436 } else {
437#line 342
438 s__s3__tmp__use_rsa_tmp = 0;
439 }
440 }
441#line 344
442 if (s__s3__tmp__use_rsa_tmp) {
443 goto _L___0;
444 } else {
445#line 347
446 if (l + 30UL) {
447 goto _L___0;
448 } else {
449#line 350
450 if (l + 1UL) {
451#line 351
452 if (s__cert__pkeys__AT0__privatekey == 0) {
453 goto _L___0;
454 } else {
455 {
456#line 354
457 __cil_tmp58 = (unsigned long )s__s3__tmp__new_cipher__algo_strength;
458#line 354
459 if (__cil_tmp58 + 2UL) {
460 {
461#line 355
462 __cil_tmp59 = (unsigned long )s__s3__tmp__new_cipher__algo_strength;
463#line 355
464 if (__cil_tmp59 + 4UL) {
465#line 356
466 tmp___7 = 512;
467 } else {
468#line 358
469 tmp___7 = 1024;
470 }
471 }
472 {
473#line 360
474 __cil_tmp60 = tmp___6 * 8;
475#line 360
476 if (__cil_tmp60 > tmp___7) {
477 _L___0:
478#line 362
479 ret = __VERIFIER_nondet_int();
480#line 363
481 if (blastFlag == 6) {
482#line 364
483 blastFlag = 7;
484 }
485#line 368
486 if (ret <= 0) {
487 goto end;
488 }
489 } else {
490#line 374
491 skip = 1;
492 }
493 }
494 } else {
495#line 377
496 skip = 1;
497 }
498 }
499 }
500 } else {
501#line 381
502 skip = 1;
503 }
504 }
505 }
506#line 385
507 s__state = 8544;
508#line 386
509 s__init_num = 0;
510 goto switch_1_break;
511 switch_1_8544: ;
512 switch_1_8545: ;
513#line 390
514 if (s__verify_mode + 1) {
515#line 391
516 if (s__session__peer != 0) {
517#line 392
518 if (s__verify_mode + 4) {
519#line 393
520 skip = 1;
521#line 394
522 s__s3__tmp__cert_request = 0;
523#line 395
524 s__state = 8560;
525 } else {
526 goto _L___2;
527 }
528 } else {
529 _L___2:
530 {
531#line 401
532 __cil_tmp61 = (unsigned long )s__s3__tmp__new_cipher__algorithms;
533#line 401
534 if (__cil_tmp61 + 256UL) {
535#line 402
536 if (s__verify_mode + 2) {
537 goto _L___1;
538 } else {
539#line 405
540 skip = 1;
541#line 406
542 s__s3__tmp__cert_request = 0;
543#line 407
544 s__state = 8560;
545 }
546 } else {
547 _L___1:
548#line 411
549 s__s3__tmp__cert_request = 1;
550#line 412
551 ret = __VERIFIER_nondet_int();
552#line 413
553 if (blastFlag == 8) {
554 goto ERROR;
555 }
556#line 418
557 if (ret <= 0) {
558 goto end;
559 }
560#line 423
561 s__state = 8448;
562#line 424
563 s__s3__tmp__next_state___0 = 8576;
564#line 425
565 s__init_num = 0;
566 }
567 }
568 }
569 } else {
570#line 429
571 skip = 1;
572#line 430
573 s__s3__tmp__cert_request = 0;
574#line 431
575 s__state = 8560;
576 }
577 goto switch_1_break;
578 switch_1_8560: ;
579 switch_1_8561:
580#line 436
581 ret = __VERIFIER_nondet_int();
582#line 437
583 if (ret <= 0) {
584 goto end;
585 }
586#line 442
587 s__s3__tmp__next_state___0 = 8576;
588#line 443
589 s__state = 8448;
590#line 444
591 s__init_num = 0;
592 goto switch_1_break;
593 switch_1_8448:
594#line 447
595 if (num1 > 0L) {
596#line 448
597 s__rwstate = 2;
598#line 449
599 num1 = tmp___8;
600#line 450
601 if (num1 <= 0L) {
602#line 451
603 ret = -1;
604 goto end;
605 }
606#line 456
607 s__rwstate = 1;
608 }
609#line 460
610 s__state = s__s3__tmp__next_state___0;
611 goto switch_1_break;
612 switch_1_8576: ;
613 switch_1_8577:
614#line 464
615 ret = __VERIFIER_nondet_int();
616#line 465
617 if (ret <= 0) {
618 goto end;
619 }
620#line 470
621 if (ret == 2) {
622#line 471
623 s__state = 8466;
624 } else {
625#line 473
626 ret = __VERIFIER_nondet_int();
627#line 474
628 if (ret <= 0) {
629 goto end;
630 }
631#line 479
632 s__init_num = 0;
633#line 480
634 s__state = 8592;
635 }
636 goto switch_1_break;
637 switch_1_8592: ;
638 switch_1_8593:
639#line 485
640 ret = __VERIFIER_nondet_int();
641#line 486
642 if (ret <= 0) {
643 goto end;
644 }
645#line 491
646 s__state = 8608;
647#line 492
648 s__init_num = 0;
649 goto switch_1_break;
650 switch_1_8608: ;
651 switch_1_8609:
652#line 496
653 ret = __VERIFIER_nondet_int();
654#line 497
655 if (ret <= 0) {
656 goto end;
657 }
658#line 502
659 s__state = 8640;
660#line 503
661 s__init_num = 0;
662 goto switch_1_break;
663 switch_1_8640: ;
664 switch_1_8641:
665#line 507
666 ret = __VERIFIER_nondet_int();
667#line 508
668 if (blastFlag == 5) {
669 goto ERROR;
670 }
671#line 513
672 if (ret <= 0) {
673 goto end;
674 }
675#line 518
676 if (s__hit) {
677#line 519
678 s__state = 3;
679 } else {
680#line 521
681 s__state = 8656;
682 }
683#line 523
684 s__init_num = 0;
685 goto switch_1_break;
686 switch_1_8656: ;
687 switch_1_8657:
688#line 527
689 s__session__cipher = s__s3__tmp__new_cipher;
690#line 528
691 if (! tmp___9) {
692#line 529
693 ret = -1;
694 goto end;
695 }
696#line 534
697 ret = __VERIFIER_nondet_int();
698#line 535
699 if (blastFlag == 2) {
700#line 536
701 blastFlag = 3;
702 } else {
703#line 538
704 if (blastFlag == 4) {
705#line 539
706 blastFlag = 5;
707 } else {
708#line 541
709 if (blastFlag == 7) {
710#line 542
711 blastFlag = 8;
712 }
713 }
714 }
715#line 548
716 if (ret <= 0) {
717 goto end;
718 }
719#line 553
720 s__state = 8672;
721#line 554
722 s__init_num = 0;
723#line 555
724 if (! tmp___10) {
725#line 556
726 ret = -1;
727 goto end;
728 }
729 goto switch_1_break;
730 switch_1_8672: ;
731 switch_1_8673:
732#line 564
733 ret = __VERIFIER_nondet_int();
734#line 565
735 if (blastFlag == 3) {
736#line 566
737 blastFlag = 4;
738 }
739#line 570
740 if (ret <= 0) {
741 goto end;
742 }
743#line 575
744 s__state = 8448;
745#line 576
746 if (s__hit) {
747#line 577
748 s__s3__tmp__next_state___0 = 8640;
749 } else {
750#line 579
751 s__s3__tmp__next_state___0 = 3;
752 }
753#line 581
754 s__init_num = 0;
755 goto switch_1_break;
756 switch_1_3:
757#line 584
758 s__init_buf___0 = 0;
759#line 585
760 s__init_num = 0;
761#line 586
762 if (got_new_session) {
763#line 587
764 s__new_session = 0;
765#line 588
766 s__ctx__stats__sess_accept_good ++;
767#line 589
768 if (cb != 0) {
769
770 }
771 }
772#line 597
773 ret = 1;
774 goto end;
775 switch_1_default:
776#line 600
777 ret = -1;
778 goto end;
779 } else {
780 switch_1_break: ;
781 }
782 }
783 }
784 }
785 }
786 }
787 }
788 }
789 }
790 }
791 }
792 }
793 }
794 }
795 }
796 }
797 }
798 }
799 }
800 }
801 }
802 }
803 }
804 }
805 }
806 }
807 }
808 }
809 }
810 }
811 }
812 }
813 }
814 }
815 }
816 }
817#line 641
818 if (! s__s3__tmp__reuse_message) {
819#line 642
820 if (! skip) {
821#line 643
822 if (s__debug) {
823#line 644
824 ret = __VERIFIER_nondet_int();
825#line 645
826 if (ret <= 0) {
827 goto end;
828 }
829 }
830#line 653
831 if (cb != 0) {
832#line 654
833 if (s__state != state) {
834#line 655
835 new_state = s__state;
836#line 656
837 s__state = state;
838#line 657
839 s__state = new_state;
840 }
841 }
842 }
843 }
844#line 670
845 skip = 0;
846 }
847 while_0_break: ;
848 }
849
850 end:
851#line 675
852 s__in_handshake --;
853#line 676
854 if (cb != 0) {
855
856 }
857#line 681
858 return (ret);
859 ERROR:
860#line 683
861 return (-1);
862}
863}
864#line 686 "s3_srvr_7.cil.c"
865int main(void)
866{ int s ;
867 int tmp ;
868
869 {
870 {
871#line 692
872 s = 8464;
873#line 693
874 tmp = ssl3_accept(s);
875 }
876#line 695
877 return (tmp);
878}
879}