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