forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinfinite_recursion.py
More file actions
2669 lines (2664 loc) · 90.9 KB
/
infinite_recursion.py
File metadata and controls
2669 lines (2664 loc) · 90.9 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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
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
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is used to verify that 2to3 falls back to a slower, iterative pattern matching
# scheme in the event that the faster recursive system fails due to infinite recursion.
from ctypes import *
STRING = c_char_p
OSUnknownByteOrder = 0
UIT_PROMPT = 1
P_PGID = 2
P_PID = 1
UIT_ERROR = 5
UIT_INFO = 4
UIT_NONE = 0
P_ALL = 0
UIT_VERIFY = 2
OSBigEndian = 2
UIT_BOOLEAN = 3
OSLittleEndian = 1
__darwin_nl_item = c_int
__darwin_wctrans_t = c_int
__darwin_wctype_t = c_ulong
__int8_t = c_byte
__uint8_t = c_ubyte
__int16_t = c_short
__uint16_t = c_ushort
__int32_t = c_int
__uint32_t = c_uint
__int64_t = c_longlong
__uint64_t = c_ulonglong
__darwin_intptr_t = c_long
__darwin_natural_t = c_uint
__darwin_ct_rune_t = c_int
class __mbstate_t(Union):
pass
__mbstate_t._pack_ = 4
__mbstate_t._fields_ = [
('__mbstate8', c_char * 128),
('_mbstateL', c_longlong),
]
assert sizeof(__mbstate_t) == 128, sizeof(__mbstate_t)
assert alignment(__mbstate_t) == 4, alignment(__mbstate_t)
__darwin_mbstate_t = __mbstate_t
__darwin_ptrdiff_t = c_int
__darwin_size_t = c_ulong
__darwin_va_list = STRING
__darwin_wchar_t = c_int
__darwin_rune_t = __darwin_wchar_t
__darwin_wint_t = c_int
__darwin_clock_t = c_ulong
__darwin_socklen_t = __uint32_t
__darwin_ssize_t = c_long
__darwin_time_t = c_long
sig_atomic_t = c_int
class sigcontext(Structure):
pass
sigcontext._fields_ = [
('sc_onstack', c_int),
('sc_mask', c_int),
('sc_eax', c_uint),
('sc_ebx', c_uint),
('sc_ecx', c_uint),
('sc_edx', c_uint),
('sc_edi', c_uint),
('sc_esi', c_uint),
('sc_ebp', c_uint),
('sc_esp', c_uint),
('sc_ss', c_uint),
('sc_eflags', c_uint),
('sc_eip', c_uint),
('sc_cs', c_uint),
('sc_ds', c_uint),
('sc_es', c_uint),
('sc_fs', c_uint),
('sc_gs', c_uint),
]
assert sizeof(sigcontext) == 72, sizeof(sigcontext)
assert alignment(sigcontext) == 4, alignment(sigcontext)
u_int8_t = c_ubyte
u_int16_t = c_ushort
u_int32_t = c_uint
u_int64_t = c_ulonglong
int32_t = c_int
register_t = int32_t
user_addr_t = u_int64_t
user_size_t = u_int64_t
int64_t = c_longlong
user_ssize_t = int64_t
user_long_t = int64_t
user_ulong_t = u_int64_t
user_time_t = int64_t
syscall_arg_t = u_int64_t
# values for unnamed enumeration
class aes_key_st(Structure):
pass
aes_key_st._fields_ = [
('rd_key', c_ulong * 60),
('rounds', c_int),
]
assert sizeof(aes_key_st) == 244, sizeof(aes_key_st)
assert alignment(aes_key_st) == 4, alignment(aes_key_st)
AES_KEY = aes_key_st
class asn1_ctx_st(Structure):
pass
asn1_ctx_st._fields_ = [
('p', POINTER(c_ubyte)),
('eos', c_int),
('error', c_int),
('inf', c_int),
('tag', c_int),
('xclass', c_int),
('slen', c_long),
('max', POINTER(c_ubyte)),
('q', POINTER(c_ubyte)),
('pp', POINTER(POINTER(c_ubyte))),
('line', c_int),
]
assert sizeof(asn1_ctx_st) == 44, sizeof(asn1_ctx_st)
assert alignment(asn1_ctx_st) == 4, alignment(asn1_ctx_st)
ASN1_CTX = asn1_ctx_st
class asn1_object_st(Structure):
pass
asn1_object_st._fields_ = [
('sn', STRING),
('ln', STRING),
('nid', c_int),
('length', c_int),
('data', POINTER(c_ubyte)),
('flags', c_int),
]
assert sizeof(asn1_object_st) == 24, sizeof(asn1_object_st)
assert alignment(asn1_object_st) == 4, alignment(asn1_object_st)
ASN1_OBJECT = asn1_object_st
class asn1_string_st(Structure):
pass
asn1_string_st._fields_ = [
('length', c_int),
('type', c_int),
('data', POINTER(c_ubyte)),
('flags', c_long),
]
assert sizeof(asn1_string_st) == 16, sizeof(asn1_string_st)
assert alignment(asn1_string_st) == 4, alignment(asn1_string_st)
ASN1_STRING = asn1_string_st
class ASN1_ENCODING_st(Structure):
pass
ASN1_ENCODING_st._fields_ = [
('enc', POINTER(c_ubyte)),
('len', c_long),
('modified', c_int),
]
assert sizeof(ASN1_ENCODING_st) == 12, sizeof(ASN1_ENCODING_st)
assert alignment(ASN1_ENCODING_st) == 4, alignment(ASN1_ENCODING_st)
ASN1_ENCODING = ASN1_ENCODING_st
class asn1_string_table_st(Structure):
pass
asn1_string_table_st._fields_ = [
('nid', c_int),
('minsize', c_long),
('maxsize', c_long),
('mask', c_ulong),
('flags', c_ulong),
]
assert sizeof(asn1_string_table_st) == 20, sizeof(asn1_string_table_st)
assert alignment(asn1_string_table_st) == 4, alignment(asn1_string_table_st)
ASN1_STRING_TABLE = asn1_string_table_st
class ASN1_TEMPLATE_st(Structure):
pass
ASN1_TEMPLATE_st._fields_ = [
]
ASN1_TEMPLATE = ASN1_TEMPLATE_st
class ASN1_ITEM_st(Structure):
pass
ASN1_ITEM = ASN1_ITEM_st
ASN1_ITEM_st._fields_ = [
]
class ASN1_TLC_st(Structure):
pass
ASN1_TLC = ASN1_TLC_st
ASN1_TLC_st._fields_ = [
]
class ASN1_VALUE_st(Structure):
pass
ASN1_VALUE_st._fields_ = [
]
ASN1_VALUE = ASN1_VALUE_st
ASN1_ITEM_EXP = ASN1_ITEM
class asn1_type_st(Structure):
pass
class N12asn1_type_st4DOLLAR_11E(Union):
pass
ASN1_BOOLEAN = c_int
ASN1_INTEGER = asn1_string_st
ASN1_ENUMERATED = asn1_string_st
ASN1_BIT_STRING = asn1_string_st
ASN1_OCTET_STRING = asn1_string_st
ASN1_PRINTABLESTRING = asn1_string_st
ASN1_T61STRING = asn1_string_st
ASN1_IA5STRING = asn1_string_st
ASN1_GENERALSTRING = asn1_string_st
ASN1_BMPSTRING = asn1_string_st
ASN1_UNIVERSALSTRING = asn1_string_st
ASN1_UTCTIME = asn1_string_st
ASN1_GENERALIZEDTIME = asn1_string_st
ASN1_VISIBLESTRING = asn1_string_st
ASN1_UTF8STRING = asn1_string_st
N12asn1_type_st4DOLLAR_11E._fields_ = [
('ptr', STRING),
('boolean', ASN1_BOOLEAN),
('asn1_string', POINTER(ASN1_STRING)),
('object', POINTER(ASN1_OBJECT)),
('integer', POINTER(ASN1_INTEGER)),
('enumerated', POINTER(ASN1_ENUMERATED)),
('bit_string', POINTER(ASN1_BIT_STRING)),
('octet_string', POINTER(ASN1_OCTET_STRING)),
('printablestring', POINTER(ASN1_PRINTABLESTRING)),
('t61string', POINTER(ASN1_T61STRING)),
('ia5string', POINTER(ASN1_IA5STRING)),
('generalstring', POINTER(ASN1_GENERALSTRING)),
('bmpstring', POINTER(ASN1_BMPSTRING)),
('universalstring', POINTER(ASN1_UNIVERSALSTRING)),
('utctime', POINTER(ASN1_UTCTIME)),
('generalizedtime', POINTER(ASN1_GENERALIZEDTIME)),
('visiblestring', POINTER(ASN1_VISIBLESTRING)),
('utf8string', POINTER(ASN1_UTF8STRING)),
('set', POINTER(ASN1_STRING)),
('sequence', POINTER(ASN1_STRING)),
]
assert sizeof(N12asn1_type_st4DOLLAR_11E) == 4, sizeof(N12asn1_type_st4DOLLAR_11E)
assert alignment(N12asn1_type_st4DOLLAR_11E) == 4, alignment(N12asn1_type_st4DOLLAR_11E)
asn1_type_st._fields_ = [
('type', c_int),
('value', N12asn1_type_st4DOLLAR_11E),
]
assert sizeof(asn1_type_st) == 8, sizeof(asn1_type_st)
assert alignment(asn1_type_st) == 4, alignment(asn1_type_st)
ASN1_TYPE = asn1_type_st
class asn1_method_st(Structure):
pass
asn1_method_st._fields_ = [
('i2d', CFUNCTYPE(c_int)),
('d2i', CFUNCTYPE(STRING)),
('create', CFUNCTYPE(STRING)),
('destroy', CFUNCTYPE(None)),
]
assert sizeof(asn1_method_st) == 16, sizeof(asn1_method_st)
assert alignment(asn1_method_st) == 4, alignment(asn1_method_st)
ASN1_METHOD = asn1_method_st
class asn1_header_st(Structure):
pass
asn1_header_st._fields_ = [
('header', POINTER(ASN1_OCTET_STRING)),
('data', STRING),
('meth', POINTER(ASN1_METHOD)),
]
assert sizeof(asn1_header_st) == 12, sizeof(asn1_header_st)
assert alignment(asn1_header_st) == 4, alignment(asn1_header_st)
ASN1_HEADER = asn1_header_st
class BIT_STRING_BITNAME_st(Structure):
pass
BIT_STRING_BITNAME_st._fields_ = [
('bitnum', c_int),
('lname', STRING),
('sname', STRING),
]
assert sizeof(BIT_STRING_BITNAME_st) == 12, sizeof(BIT_STRING_BITNAME_st)
assert alignment(BIT_STRING_BITNAME_st) == 4, alignment(BIT_STRING_BITNAME_st)
BIT_STRING_BITNAME = BIT_STRING_BITNAME_st
class bio_st(Structure):
pass
BIO = bio_st
bio_info_cb = CFUNCTYPE(None, POINTER(bio_st), c_int, STRING, c_int, c_long, c_long)
class bio_method_st(Structure):
pass
bio_method_st._fields_ = [
('type', c_int),
('name', STRING),
('bwrite', CFUNCTYPE(c_int, POINTER(BIO), STRING, c_int)),
('bread', CFUNCTYPE(c_int, POINTER(BIO), STRING, c_int)),
('bputs', CFUNCTYPE(c_int, POINTER(BIO), STRING)),
('bgets', CFUNCTYPE(c_int, POINTER(BIO), STRING, c_int)),
('ctrl', CFUNCTYPE(c_long, POINTER(BIO), c_int, c_long, c_void_p)),
('create', CFUNCTYPE(c_int, POINTER(BIO))),
('destroy', CFUNCTYPE(c_int, POINTER(BIO))),
('callback_ctrl', CFUNCTYPE(c_long, POINTER(BIO), c_int, POINTER(bio_info_cb))),
]
assert sizeof(bio_method_st) == 40, sizeof(bio_method_st)
assert alignment(bio_method_st) == 4, alignment(bio_method_st)
BIO_METHOD = bio_method_st
class crypto_ex_data_st(Structure):
pass
class stack_st(Structure):
pass
STACK = stack_st
crypto_ex_data_st._fields_ = [
('sk', POINTER(STACK)),
('dummy', c_int),
]
assert sizeof(crypto_ex_data_st) == 8, sizeof(crypto_ex_data_st)
assert alignment(crypto_ex_data_st) == 4, alignment(crypto_ex_data_st)
CRYPTO_EX_DATA = crypto_ex_data_st
bio_st._fields_ = [
('method', POINTER(BIO_METHOD)),
('callback', CFUNCTYPE(c_long, POINTER(bio_st), c_int, STRING, c_int, c_long, c_long)),
('cb_arg', STRING),
('init', c_int),
('shutdown', c_int),
('flags', c_int),
('retry_reason', c_int),
('num', c_int),
('ptr', c_void_p),
('next_bio', POINTER(bio_st)),
('prev_bio', POINTER(bio_st)),
('references', c_int),
('num_read', c_ulong),
('num_write', c_ulong),
('ex_data', CRYPTO_EX_DATA),
]
assert sizeof(bio_st) == 64, sizeof(bio_st)
assert alignment(bio_st) == 4, alignment(bio_st)
class bio_f_buffer_ctx_struct(Structure):
pass
bio_f_buffer_ctx_struct._fields_ = [
('ibuf_size', c_int),
('obuf_size', c_int),
('ibuf', STRING),
('ibuf_len', c_int),
('ibuf_off', c_int),
('obuf', STRING),
('obuf_len', c_int),
('obuf_off', c_int),
]
assert sizeof(bio_f_buffer_ctx_struct) == 32, sizeof(bio_f_buffer_ctx_struct)
assert alignment(bio_f_buffer_ctx_struct) == 4, alignment(bio_f_buffer_ctx_struct)
BIO_F_BUFFER_CTX = bio_f_buffer_ctx_struct
class hostent(Structure):
pass
hostent._fields_ = [
]
class bf_key_st(Structure):
pass
bf_key_st._fields_ = [
('P', c_uint * 18),
('S', c_uint * 1024),
]
assert sizeof(bf_key_st) == 4168, sizeof(bf_key_st)
assert alignment(bf_key_st) == 4, alignment(bf_key_st)
BF_KEY = bf_key_st
class bignum_st(Structure):
pass
bignum_st._fields_ = [
('d', POINTER(c_ulong)),
('top', c_int),
('dmax', c_int),
('neg', c_int),
('flags', c_int),
]
assert sizeof(bignum_st) == 20, sizeof(bignum_st)
assert alignment(bignum_st) == 4, alignment(bignum_st)
BIGNUM = bignum_st
class bignum_ctx(Structure):
pass
bignum_ctx._fields_ = [
]
BN_CTX = bignum_ctx
class bn_blinding_st(Structure):
pass
bn_blinding_st._fields_ = [
('init', c_int),
('A', POINTER(BIGNUM)),
('Ai', POINTER(BIGNUM)),
('mod', POINTER(BIGNUM)),
('thread_id', c_ulong),
]
assert sizeof(bn_blinding_st) == 20, sizeof(bn_blinding_st)
assert alignment(bn_blinding_st) == 4, alignment(bn_blinding_st)
BN_BLINDING = bn_blinding_st
class bn_mont_ctx_st(Structure):
pass
bn_mont_ctx_st._fields_ = [
('ri', c_int),
('RR', BIGNUM),
('N', BIGNUM),
('Ni', BIGNUM),
('n0', c_ulong),
('flags', c_int),
]
assert sizeof(bn_mont_ctx_st) == 72, sizeof(bn_mont_ctx_st)
assert alignment(bn_mont_ctx_st) == 4, alignment(bn_mont_ctx_st)
BN_MONT_CTX = bn_mont_ctx_st
class bn_recp_ctx_st(Structure):
pass
bn_recp_ctx_st._fields_ = [
('N', BIGNUM),
('Nr', BIGNUM),
('num_bits', c_int),
('shift', c_int),
('flags', c_int),
]
assert sizeof(bn_recp_ctx_st) == 52, sizeof(bn_recp_ctx_st)
assert alignment(bn_recp_ctx_st) == 4, alignment(bn_recp_ctx_st)
BN_RECP_CTX = bn_recp_ctx_st
class buf_mem_st(Structure):
pass
buf_mem_st._fields_ = [
('length', c_int),
('data', STRING),
('max', c_int),
]
assert sizeof(buf_mem_st) == 12, sizeof(buf_mem_st)
assert alignment(buf_mem_st) == 4, alignment(buf_mem_st)
BUF_MEM = buf_mem_st
class cast_key_st(Structure):
pass
cast_key_st._fields_ = [
('data', c_ulong * 32),
('short_key', c_int),
]
assert sizeof(cast_key_st) == 132, sizeof(cast_key_st)
assert alignment(cast_key_st) == 4, alignment(cast_key_st)
CAST_KEY = cast_key_st
class comp_method_st(Structure):
pass
comp_method_st._fields_ = [
('type', c_int),
('name', STRING),
('init', CFUNCTYPE(c_int)),
('finish', CFUNCTYPE(None)),
('compress', CFUNCTYPE(c_int)),
('expand', CFUNCTYPE(c_int)),
('ctrl', CFUNCTYPE(c_long)),
('callback_ctrl', CFUNCTYPE(c_long)),
]
assert sizeof(comp_method_st) == 32, sizeof(comp_method_st)
assert alignment(comp_method_st) == 4, alignment(comp_method_st)
COMP_METHOD = comp_method_st
class comp_ctx_st(Structure):
pass
comp_ctx_st._fields_ = [
('meth', POINTER(COMP_METHOD)),
('compress_in', c_ulong),
('compress_out', c_ulong),
('expand_in', c_ulong),
('expand_out', c_ulong),
('ex_data', CRYPTO_EX_DATA),
]
assert sizeof(comp_ctx_st) == 28, sizeof(comp_ctx_st)
assert alignment(comp_ctx_st) == 4, alignment(comp_ctx_st)
COMP_CTX = comp_ctx_st
class CRYPTO_dynlock_value(Structure):
pass
CRYPTO_dynlock_value._fields_ = [
]
class CRYPTO_dynlock(Structure):
pass
CRYPTO_dynlock._fields_ = [
('references', c_int),
('data', POINTER(CRYPTO_dynlock_value)),
]
assert sizeof(CRYPTO_dynlock) == 8, sizeof(CRYPTO_dynlock)
assert alignment(CRYPTO_dynlock) == 4, alignment(CRYPTO_dynlock)
BIO_dummy = bio_st
CRYPTO_EX_new = CFUNCTYPE(c_int, c_void_p, c_void_p, POINTER(CRYPTO_EX_DATA), c_int, c_long, c_void_p)
CRYPTO_EX_free = CFUNCTYPE(None, c_void_p, c_void_p, POINTER(CRYPTO_EX_DATA), c_int, c_long, c_void_p)
CRYPTO_EX_dup = CFUNCTYPE(c_int, POINTER(CRYPTO_EX_DATA), POINTER(CRYPTO_EX_DATA), c_void_p, c_int, c_long, c_void_p)
class crypto_ex_data_func_st(Structure):
pass
crypto_ex_data_func_st._fields_ = [
('argl', c_long),
('argp', c_void_p),
('new_func', POINTER(CRYPTO_EX_new)),
('free_func', POINTER(CRYPTO_EX_free)),
('dup_func', POINTER(CRYPTO_EX_dup)),
]
assert sizeof(crypto_ex_data_func_st) == 20, sizeof(crypto_ex_data_func_st)
assert alignment(crypto_ex_data_func_st) == 4, alignment(crypto_ex_data_func_st)
CRYPTO_EX_DATA_FUNCS = crypto_ex_data_func_st
class st_CRYPTO_EX_DATA_IMPL(Structure):
pass
CRYPTO_EX_DATA_IMPL = st_CRYPTO_EX_DATA_IMPL
st_CRYPTO_EX_DATA_IMPL._fields_ = [
]
CRYPTO_MEM_LEAK_CB = CFUNCTYPE(c_void_p, c_ulong, STRING, c_int, c_int, c_void_p)
DES_cblock = c_ubyte * 8
const_DES_cblock = c_ubyte * 8
class DES_ks(Structure):
pass
class N6DES_ks3DOLLAR_9E(Union):
pass
N6DES_ks3DOLLAR_9E._fields_ = [
('cblock', DES_cblock),
('deslong', c_ulong * 2),
]
assert sizeof(N6DES_ks3DOLLAR_9E) == 8, sizeof(N6DES_ks3DOLLAR_9E)
assert alignment(N6DES_ks3DOLLAR_9E) == 4, alignment(N6DES_ks3DOLLAR_9E)
DES_ks._fields_ = [
('ks', N6DES_ks3DOLLAR_9E * 16),
]
assert sizeof(DES_ks) == 128, sizeof(DES_ks)
assert alignment(DES_ks) == 4, alignment(DES_ks)
DES_key_schedule = DES_ks
_ossl_old_des_cblock = c_ubyte * 8
class _ossl_old_des_ks_struct(Structure):
pass
class N23_ossl_old_des_ks_struct4DOLLAR_10E(Union):
pass
N23_ossl_old_des_ks_struct4DOLLAR_10E._fields_ = [
('_', _ossl_old_des_cblock),
('pad', c_ulong * 2),
]
assert sizeof(N23_ossl_old_des_ks_struct4DOLLAR_10E) == 8, sizeof(N23_ossl_old_des_ks_struct4DOLLAR_10E)
assert alignment(N23_ossl_old_des_ks_struct4DOLLAR_10E) == 4, alignment(N23_ossl_old_des_ks_struct4DOLLAR_10E)
_ossl_old_des_ks_struct._fields_ = [
('ks', N23_ossl_old_des_ks_struct4DOLLAR_10E),
]
assert sizeof(_ossl_old_des_ks_struct) == 8, sizeof(_ossl_old_des_ks_struct)
assert alignment(_ossl_old_des_ks_struct) == 4, alignment(_ossl_old_des_ks_struct)
_ossl_old_des_key_schedule = _ossl_old_des_ks_struct * 16
class dh_st(Structure):
pass
DH = dh_st
class dh_method(Structure):
pass
dh_method._fields_ = [
('name', STRING),
('generate_key', CFUNCTYPE(c_int, POINTER(DH))),
('compute_key', CFUNCTYPE(c_int, POINTER(c_ubyte), POINTER(BIGNUM), POINTER(DH))),
('bn_mod_exp', CFUNCTYPE(c_int, POINTER(DH), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BN_CTX), POINTER(BN_MONT_CTX))),
('init', CFUNCTYPE(c_int, POINTER(DH))),
('finish', CFUNCTYPE(c_int, POINTER(DH))),
('flags', c_int),
('app_data', STRING),
]
assert sizeof(dh_method) == 32, sizeof(dh_method)
assert alignment(dh_method) == 4, alignment(dh_method)
DH_METHOD = dh_method
class engine_st(Structure):
pass
ENGINE = engine_st
dh_st._fields_ = [
('pad', c_int),
('version', c_int),
('p', POINTER(BIGNUM)),
('g', POINTER(BIGNUM)),
('length', c_long),
('pub_key', POINTER(BIGNUM)),
('priv_key', POINTER(BIGNUM)),
('flags', c_int),
('method_mont_p', STRING),
('q', POINTER(BIGNUM)),
('j', POINTER(BIGNUM)),
('seed', POINTER(c_ubyte)),
('seedlen', c_int),
('counter', POINTER(BIGNUM)),
('references', c_int),
('ex_data', CRYPTO_EX_DATA),
('meth', POINTER(DH_METHOD)),
('engine', POINTER(ENGINE)),
]
assert sizeof(dh_st) == 76, sizeof(dh_st)
assert alignment(dh_st) == 4, alignment(dh_st)
class dsa_st(Structure):
pass
DSA = dsa_st
class DSA_SIG_st(Structure):
pass
DSA_SIG_st._fields_ = [
('r', POINTER(BIGNUM)),
('s', POINTER(BIGNUM)),
]
assert sizeof(DSA_SIG_st) == 8, sizeof(DSA_SIG_st)
assert alignment(DSA_SIG_st) == 4, alignment(DSA_SIG_st)
DSA_SIG = DSA_SIG_st
class dsa_method(Structure):
pass
dsa_method._fields_ = [
('name', STRING),
('dsa_do_sign', CFUNCTYPE(POINTER(DSA_SIG), POINTER(c_ubyte), c_int, POINTER(DSA))),
('dsa_sign_setup', CFUNCTYPE(c_int, POINTER(DSA), POINTER(BN_CTX), POINTER(POINTER(BIGNUM)), POINTER(POINTER(BIGNUM)))),
('dsa_do_verify', CFUNCTYPE(c_int, POINTER(c_ubyte), c_int, POINTER(DSA_SIG), POINTER(DSA))),
('dsa_mod_exp', CFUNCTYPE(c_int, POINTER(DSA), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BN_CTX), POINTER(BN_MONT_CTX))),
('bn_mod_exp', CFUNCTYPE(c_int, POINTER(DSA), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BIGNUM), POINTER(BN_CTX), POINTER(BN_MONT_CTX))),
('init', CFUNCTYPE(c_int, POINTER(DSA))),
('finish', CFUNCTYPE(c_int, POINTER(DSA))),
('flags', c_int),
('app_data', STRING),
]
assert sizeof(dsa_method) == 40, sizeof(dsa_method)
assert alignment(dsa_method) == 4, alignment(dsa_method)
DSA_METHOD = dsa_method
dsa_st._fields_ = [
('pad', c_int),
('version', c_long),
('write_params', c_int),
('p', POINTER(BIGNUM)),
('q', POINTER(BIGNUM)),
('g', POINTER(BIGNUM)),
('pub_key', POINTER(BIGNUM)),
('priv_key', POINTER(BIGNUM)),
('kinv', POINTER(BIGNUM)),
('r', POINTER(BIGNUM)),
('flags', c_int),
('method_mont_p', STRING),
('references', c_int),
('ex_data', CRYPTO_EX_DATA),
('meth', POINTER(DSA_METHOD)),
('engine', POINTER(ENGINE)),
]
assert sizeof(dsa_st) == 68, sizeof(dsa_st)
assert alignment(dsa_st) == 4, alignment(dsa_st)
class evp_pkey_st(Structure):
pass
class N11evp_pkey_st4DOLLAR_12E(Union):
pass
class rsa_st(Structure):
pass
N11evp_pkey_st4DOLLAR_12E._fields_ = [
('ptr', STRING),
('rsa', POINTER(rsa_st)),
('dsa', POINTER(dsa_st)),
('dh', POINTER(dh_st)),
]
assert sizeof(N11evp_pkey_st4DOLLAR_12E) == 4, sizeof(N11evp_pkey_st4DOLLAR_12E)
assert alignment(N11evp_pkey_st4DOLLAR_12E) == 4, alignment(N11evp_pkey_st4DOLLAR_12E)
evp_pkey_st._fields_ = [
('type', c_int),
('save_type', c_int),
('references', c_int),
('pkey', N11evp_pkey_st4DOLLAR_12E),
('save_parameters', c_int),
('attributes', POINTER(STACK)),
]
assert sizeof(evp_pkey_st) == 24, sizeof(evp_pkey_st)
assert alignment(evp_pkey_st) == 4, alignment(evp_pkey_st)
class env_md_st(Structure):
pass
class env_md_ctx_st(Structure):
pass
EVP_MD_CTX = env_md_ctx_st
env_md_st._fields_ = [
('type', c_int),
('pkey_type', c_int),
('md_size', c_int),
('flags', c_ulong),
('init', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX))),
('update', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX), c_void_p, c_ulong)),
('final', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX), POINTER(c_ubyte))),
('copy', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX), POINTER(EVP_MD_CTX))),
('cleanup', CFUNCTYPE(c_int, POINTER(EVP_MD_CTX))),
('sign', CFUNCTYPE(c_int)),
('verify', CFUNCTYPE(c_int)),
('required_pkey_type', c_int * 5),
('block_size', c_int),
('ctx_size', c_int),
]
assert sizeof(env_md_st) == 72, sizeof(env_md_st)
assert alignment(env_md_st) == 4, alignment(env_md_st)
EVP_MD = env_md_st
env_md_ctx_st._fields_ = [
('digest', POINTER(EVP_MD)),
('engine', POINTER(ENGINE)),
('flags', c_ulong),
('md_data', c_void_p),
]
assert sizeof(env_md_ctx_st) == 16, sizeof(env_md_ctx_st)
assert alignment(env_md_ctx_st) == 4, alignment(env_md_ctx_st)
class evp_cipher_st(Structure):
pass
class evp_cipher_ctx_st(Structure):
pass
EVP_CIPHER_CTX = evp_cipher_ctx_st
evp_cipher_st._fields_ = [
('nid', c_int),
('block_size', c_int),
('key_len', c_int),
('iv_len', c_int),
('flags', c_ulong),
('init', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), POINTER(c_ubyte), POINTER(c_ubyte), c_int)),
('do_cipher', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), POINTER(c_ubyte), POINTER(c_ubyte), c_uint)),
('cleanup', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX))),
('ctx_size', c_int),
('set_asn1_parameters', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), POINTER(ASN1_TYPE))),
('get_asn1_parameters', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), POINTER(ASN1_TYPE))),
('ctrl', CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), c_int, c_int, c_void_p)),
('app_data', c_void_p),
]
assert sizeof(evp_cipher_st) == 52, sizeof(evp_cipher_st)
assert alignment(evp_cipher_st) == 4, alignment(evp_cipher_st)
class evp_cipher_info_st(Structure):
pass
EVP_CIPHER = evp_cipher_st
evp_cipher_info_st._fields_ = [
('cipher', POINTER(EVP_CIPHER)),
('iv', c_ubyte * 16),
]
assert sizeof(evp_cipher_info_st) == 20, sizeof(evp_cipher_info_st)
assert alignment(evp_cipher_info_st) == 4, alignment(evp_cipher_info_st)
EVP_CIPHER_INFO = evp_cipher_info_st
evp_cipher_ctx_st._fields_ = [
('cipher', POINTER(EVP_CIPHER)),
('engine', POINTER(ENGINE)),
('encrypt', c_int),
('buf_len', c_int),
('oiv', c_ubyte * 16),
('iv', c_ubyte * 16),
('buf', c_ubyte * 32),
('num', c_int),
('app_data', c_void_p),
('key_len', c_int),
('flags', c_ulong),
('cipher_data', c_void_p),
('final_used', c_int),
('block_mask', c_int),
('final', c_ubyte * 32),
]
assert sizeof(evp_cipher_ctx_st) == 140, sizeof(evp_cipher_ctx_st)
assert alignment(evp_cipher_ctx_st) == 4, alignment(evp_cipher_ctx_st)
class evp_Encode_Ctx_st(Structure):
pass
evp_Encode_Ctx_st._fields_ = [
('num', c_int),
('length', c_int),
('enc_data', c_ubyte * 80),
('line_num', c_int),
('expect_nl', c_int),
]
assert sizeof(evp_Encode_Ctx_st) == 96, sizeof(evp_Encode_Ctx_st)
assert alignment(evp_Encode_Ctx_st) == 4, alignment(evp_Encode_Ctx_st)
EVP_ENCODE_CTX = evp_Encode_Ctx_st
EVP_PBE_KEYGEN = CFUNCTYPE(c_int, POINTER(EVP_CIPHER_CTX), STRING, c_int, POINTER(ASN1_TYPE), POINTER(EVP_CIPHER), POINTER(EVP_MD), c_int)
class lhash_node_st(Structure):
pass
lhash_node_st._fields_ = [
('data', c_void_p),
('next', POINTER(lhash_node_st)),
('hash', c_ulong),
]
assert sizeof(lhash_node_st) == 12, sizeof(lhash_node_st)
assert alignment(lhash_node_st) == 4, alignment(lhash_node_st)
LHASH_NODE = lhash_node_st
LHASH_COMP_FN_TYPE = CFUNCTYPE(c_int, c_void_p, c_void_p)
LHASH_HASH_FN_TYPE = CFUNCTYPE(c_ulong, c_void_p)
LHASH_DOALL_FN_TYPE = CFUNCTYPE(None, c_void_p)
LHASH_DOALL_ARG_FN_TYPE = CFUNCTYPE(None, c_void_p, c_void_p)
class lhash_st(Structure):
pass
lhash_st._fields_ = [
('b', POINTER(POINTER(LHASH_NODE))),
('comp', LHASH_COMP_FN_TYPE),
('hash', LHASH_HASH_FN_TYPE),
('num_nodes', c_uint),
('num_alloc_nodes', c_uint),
('p', c_uint),
('pmax', c_uint),
('up_load', c_ulong),
('down_load', c_ulong),
('num_items', c_ulong),
('num_expands', c_ulong),
('num_expand_reallocs', c_ulong),
('num_contracts', c_ulong),
('num_contract_reallocs', c_ulong),
('num_hash_calls', c_ulong),
('num_comp_calls', c_ulong),
('num_insert', c_ulong),
('num_replace', c_ulong),
('num_delete', c_ulong),
('num_no_delete', c_ulong),
('num_retrieve', c_ulong),
('num_retrieve_miss', c_ulong),
('num_hash_comps', c_ulong),
('error', c_int),
]
assert sizeof(lhash_st) == 96, sizeof(lhash_st)
assert alignment(lhash_st) == 4, alignment(lhash_st)
LHASH = lhash_st
class MD2state_st(Structure):
pass
MD2state_st._fields_ = [
('num', c_int),
('data', c_ubyte * 16),
('cksm', c_uint * 16),
('state', c_uint * 16),
]
assert sizeof(MD2state_st) == 148, sizeof(MD2state_st)
assert alignment(MD2state_st) == 4, alignment(MD2state_st)
MD2_CTX = MD2state_st
class MD4state_st(Structure):
pass
MD4state_st._fields_ = [
('A', c_uint),
('B', c_uint),
('C', c_uint),
('D', c_uint),
('Nl', c_uint),
('Nh', c_uint),
('data', c_uint * 16),
('num', c_int),
]
assert sizeof(MD4state_st) == 92, sizeof(MD4state_st)
assert alignment(MD4state_st) == 4, alignment(MD4state_st)
MD4_CTX = MD4state_st
class MD5state_st(Structure):
pass
MD5state_st._fields_ = [
('A', c_uint),
('B', c_uint),
('C', c_uint),
('D', c_uint),
('Nl', c_uint),
('Nh', c_uint),
('data', c_uint * 16),
('num', c_int),
]
assert sizeof(MD5state_st) == 92, sizeof(MD5state_st)
assert alignment(MD5state_st) == 4, alignment(MD5state_st)
MD5_CTX = MD5state_st
class mdc2_ctx_st(Structure):
pass
mdc2_ctx_st._fields_ = [
('num', c_int),
('data', c_ubyte * 8),
('h', DES_cblock),
('hh', DES_cblock),
('pad_type', c_int),
]
assert sizeof(mdc2_ctx_st) == 32, sizeof(mdc2_ctx_st)
assert alignment(mdc2_ctx_st) == 4, alignment(mdc2_ctx_st)
MDC2_CTX = mdc2_ctx_st
class obj_name_st(Structure):
pass
obj_name_st._fields_ = [
('type', c_int),
('alias', c_int),
('name', STRING),
('data', STRING),
]
assert sizeof(obj_name_st) == 16, sizeof(obj_name_st)
assert alignment(obj_name_st) == 4, alignment(obj_name_st)
OBJ_NAME = obj_name_st
ASN1_TIME = asn1_string_st
ASN1_NULL = c_int
EVP_PKEY = evp_pkey_st
class x509_st(Structure):
pass
X509 = x509_st
class X509_algor_st(Structure):
pass
X509_ALGOR = X509_algor_st
class X509_crl_st(Structure):
pass
X509_CRL = X509_crl_st
class X509_name_st(Structure):
pass
X509_NAME = X509_name_st
class x509_store_st(Structure):
pass
X509_STORE = x509_store_st
class x509_store_ctx_st(Structure):
pass
X509_STORE_CTX = x509_store_ctx_st
engine_st._fields_ = [
]
class PEM_Encode_Seal_st(Structure):
pass
PEM_Encode_Seal_st._fields_ = [
('encode', EVP_ENCODE_CTX),
('md', EVP_MD_CTX),
('cipher', EVP_CIPHER_CTX),
]
assert sizeof(PEM_Encode_Seal_st) == 252, sizeof(PEM_Encode_Seal_st)
assert alignment(PEM_Encode_Seal_st) == 4, alignment(PEM_Encode_Seal_st)
PEM_ENCODE_SEAL_CTX = PEM_Encode_Seal_st
class pem_recip_st(Structure):
pass
pem_recip_st._fields_ = [
('name', STRING),
('dn', POINTER(X509_NAME)),
('cipher', c_int),
('key_enc', c_int),
]
assert sizeof(pem_recip_st) == 16, sizeof(pem_recip_st)
assert alignment(pem_recip_st) == 4, alignment(pem_recip_st)
PEM_USER = pem_recip_st
class pem_ctx_st(Structure):
pass
class N10pem_ctx_st4DOLLAR_16E(Structure):
pass
N10pem_ctx_st4DOLLAR_16E._fields_ = [
('version', c_int),
('mode', c_int),
]
assert sizeof(N10pem_ctx_st4DOLLAR_16E) == 8, sizeof(N10pem_ctx_st4DOLLAR_16E)
assert alignment(N10pem_ctx_st4DOLLAR_16E) == 4, alignment(N10pem_ctx_st4DOLLAR_16E)
class N10pem_ctx_st4DOLLAR_17E(Structure):
pass
N10pem_ctx_st4DOLLAR_17E._fields_ = [
('cipher', c_int),
]
assert sizeof(N10pem_ctx_st4DOLLAR_17E) == 4, sizeof(N10pem_ctx_st4DOLLAR_17E)
assert alignment(N10pem_ctx_st4DOLLAR_17E) == 4, alignment(N10pem_ctx_st4DOLLAR_17E)
pem_ctx_st._fields_ = [
('type', c_int),
('proc_type', N10pem_ctx_st4DOLLAR_16E),
('domain', STRING),
('DEK_info', N10pem_ctx_st4DOLLAR_17E),
('originator', POINTER(PEM_USER)),
('num_recipient', c_int),
('recipient', POINTER(POINTER(PEM_USER))),
('x509_chain', POINTER(STACK)),
('md', POINTER(EVP_MD)),
('md_enc', c_int),
('md_len', c_int),
('md_data', STRING),
('dec', POINTER(EVP_CIPHER)),
('key_len', c_int),
('key', POINTER(c_ubyte)),
('data_enc', c_int),
('data_len', c_int),
('data', POINTER(c_ubyte)),
]
assert sizeof(pem_ctx_st) == 76, sizeof(pem_ctx_st)
assert alignment(pem_ctx_st) == 4, alignment(pem_ctx_st)
PEM_CTX = pem_ctx_st
pem_password_cb = CFUNCTYPE(c_int, STRING, c_int, c_int, c_void_p)
class pkcs7_issuer_and_serial_st(Structure):
pass
pkcs7_issuer_and_serial_st._fields_ = [
('issuer', POINTER(X509_NAME)),
('serial', POINTER(ASN1_INTEGER)),
]
assert sizeof(pkcs7_issuer_and_serial_st) == 8, sizeof(pkcs7_issuer_and_serial_st)
assert alignment(pkcs7_issuer_and_serial_st) == 4, alignment(pkcs7_issuer_and_serial_st)
PKCS7_ISSUER_AND_SERIAL = pkcs7_issuer_and_serial_st
class pkcs7_signer_info_st(Structure):
pass
pkcs7_signer_info_st._fields_ = [
('version', POINTER(ASN1_INTEGER)),
('issuer_and_serial', POINTER(PKCS7_ISSUER_AND_SERIAL)),
('digest_alg', POINTER(X509_ALGOR)),
('auth_attr', POINTER(STACK)),
('digest_enc_alg', POINTER(X509_ALGOR)),
('enc_digest', POINTER(ASN1_OCTET_STRING)),
('unauth_attr', POINTER(STACK)),
('pkey', POINTER(EVP_PKEY)),
]
assert sizeof(pkcs7_signer_info_st) == 32, sizeof(pkcs7_signer_info_st)
assert alignment(pkcs7_signer_info_st) == 4, alignment(pkcs7_signer_info_st)
PKCS7_SIGNER_INFO = pkcs7_signer_info_st
class pkcs7_recip_info_st(Structure):
pass
pkcs7_recip_info_st._fields_ = [
('version', POINTER(ASN1_INTEGER)),
('issuer_and_serial', POINTER(PKCS7_ISSUER_AND_SERIAL)),
('key_enc_algor', POINTER(X509_ALGOR)),
('enc_key', POINTER(ASN1_OCTET_STRING)),
('cert', POINTER(X509)),
]
assert sizeof(pkcs7_recip_info_st) == 20, sizeof(pkcs7_recip_info_st)
assert alignment(pkcs7_recip_info_st) == 4, alignment(pkcs7_recip_info_st)
PKCS7_RECIP_INFO = pkcs7_recip_info_st
class pkcs7_signed_st(Structure):
pass
class pkcs7_st(Structure):
pass
pkcs7_signed_st._fields_ = [
('version', POINTER(ASN1_INTEGER)),
('md_algs', POINTER(STACK)),
('cert', POINTER(STACK)),
('crl', POINTER(STACK)),
('signer_info', POINTER(STACK)),
('contents', POINTER(pkcs7_st)),
]
assert sizeof(pkcs7_signed_st) == 24, sizeof(pkcs7_signed_st)
assert alignment(pkcs7_signed_st) == 4, alignment(pkcs7_signed_st)
PKCS7_SIGNED = pkcs7_signed_st
class pkcs7_enc_content_st(Structure):
pass
pkcs7_enc_content_st._fields_ = [
('content_type', POINTER(ASN1_OBJECT)),
('algorithm', POINTER(X509_ALGOR)),
('enc_data', POINTER(ASN1_OCTET_STRING)),
('cipher', POINTER(EVP_CIPHER)),
]
assert sizeof(pkcs7_enc_content_st) == 16, sizeof(pkcs7_enc_content_st)
assert alignment(pkcs7_enc_content_st) == 4, alignment(pkcs7_enc_content_st)
PKCS7_ENC_CONTENT = pkcs7_enc_content_st
class pkcs7_enveloped_st(Structure):
pass
pkcs7_enveloped_st._fields_ = [
('version', POINTER(ASN1_INTEGER)),
('recipientinfo', POINTER(STACK)),
('enc_data', POINTER(PKCS7_ENC_CONTENT)),
]
assert sizeof(pkcs7_enveloped_st) == 12, sizeof(pkcs7_enveloped_st)
assert alignment(pkcs7_enveloped_st) == 4, alignment(pkcs7_enveloped_st)
PKCS7_ENVELOPE = pkcs7_enveloped_st
class pkcs7_signedandenveloped_st(Structure):
pass
pkcs7_signedandenveloped_st._fields_ = [
('version', POINTER(ASN1_INTEGER)),