Debian Codegraph @

lib_pypy/_cffi_ssl/_cffi_src/openssl/ct.py

raw symbols SCIP
1 # This file is dual licensed under the terms of the Apache License, Version
2 # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3 # for complete details.
4
5 from __future__ import absolute_import, division, print_function
6
7 INCLUDES = """
8 #if CRYPTOGRAPHY_OPENSSL_110_OR_GREATER
9 #include <openssl/ct.h>
10
11 typedef STACK_OF(SCT) Cryptography_STACK_OF_SCT;
12 #endif
13 """
14
15 TYPES = """
16 static const long Cryptography_HAS_SCT;
17
18 typedef enum {
19 SCT_VERSION_NOT_SET,
20 SCT_VERSION_V1
21 } sct_version_t;
22
23 typedef enum {
24 CT_LOG_ENTRY_TYPE_NOT_SET,
25 CT_LOG_ENTRY_TYPE_X509,
26 CT_LOG_ENTRY_TYPE_PRECERT
27 } ct_log_entry_type_t;
28
29 typedef enum {
30 SCT_SOURCE_UNKNOWN,
31 SCT_SOURCE_TLS_EXTENSION,
32 SCT_SOURCE_X509V3_EXTENSION,
33 SCT_SOURCE_OCSP_STAPLED_RESPONSE
34 } sct_source_t;
35
36 typedef ... SCT;
37 typedef ... Cryptography_STACK_OF_SCT;
38 """
39
40 FUNCTIONS = """
41 sct_version_t SCT_get_version(const SCT *);
42
43 ct_log_entry_type_t SCT_get_log_entry_type(const SCT *);
44
45 size_t SCT_get0_log_id(const SCT *, unsigned char **);
46
47 size_t SCT_get0_signature(const SCT *, unsigned char **);
48
49 uint64_t SCT_get_timestamp(const SCT *);
50
51 int SCT_set_source(SCT *, sct_source_t);
52
53 int sk_SCT_num(const Cryptography_STACK_OF_SCT *);
54 SCT *sk_SCT_value(const Cryptography_STACK_OF_SCT *, int);
55
56 void SCT_LIST_free(Cryptography_STACK_OF_SCT *);
57
58 int sk_SCT_push(Cryptography_STACK_OF_SCT *, SCT *);
59 Cryptography_STACK_OF_SCT *sk_SCT_new_null(void);
60 SCT *SCT_new(void);
61 int SCT_set1_log_id(SCT *, unsigned char *, size_t);
62 void SCT_set_timestamp(SCT *, uint64_t);
63 int SCT_set_version(SCT *, sct_version_t);
64 int SCT_set_log_entry_type(SCT *, ct_log_entry_type_t);
65 """
66
67 CUSTOMIZATIONS = """
68 #if CRYPTOGRAPHY_OPENSSL_110_OR_GREATER
69 static const long Cryptography_HAS_SCT = 1;
70 #else
71 static const long Cryptography_HAS_SCT = 0;
72
73 typedef enum {
74 SCT_VERSION_NOT_SET,
75 SCT_VERSION_V1
76 } sct_version_t;
77 typedef enum {
78 CT_LOG_ENTRY_TYPE_NOT_SET,
79 CT_LOG_ENTRY_TYPE_X509,
80 CT_LOG_ENTRY_TYPE_PRECERT
81 } ct_log_entry_type_t;
82 typedef enum {
83 SCT_SOURCE_UNKNOWN,
84 SCT_SOURCE_TLS_EXTENSION,
85 SCT_SOURCE_X509V3_EXTENSION,
86 SCT_SOURCE_OCSP_STAPLED_RESPONSE
87 } sct_source_t;
88 typedef void SCT;
89 typedef void Cryptography_STACK_OF_SCT;
90
91 sct_version_t (*SCT_get_version)(const SCT *) = NULL;
92 ct_log_entry_type_t (*SCT_get_log_entry_type)(const SCT *) = NULL;
93 size_t (*SCT_get0_log_id)(const SCT *, unsigned char **) = NULL;
94 size_t (*SCT_get0_signature)(const SCT *, unsigned char **) = NULL;
95 uint64_t (*SCT_get_timestamp)(const SCT *) = NULL;
96
97 int (*SCT_set_source)(SCT *, sct_source_t) = NULL;
98
99 int (*sk_SCT_num)(const Cryptography_STACK_OF_SCT *) = NULL;
100 SCT *(*sk_SCT_value)(const Cryptography_STACK_OF_SCT *, int) = NULL;
101
102 void (*SCT_LIST_free)(Cryptography_STACK_OF_SCT *) = NULL;
103 int (*sk_SCT_push)(Cryptography_STACK_OF_SCT *, SCT *) = NULL;
104 Cryptography_STACK_OF_SCT *(*sk_SCT_new_null)(void) = NULL;
105 SCT *(*SCT_new)(void) = NULL;
106 int (*SCT_set1_log_id)(SCT *, unsigned char *, size_t) = NULL;
107 void (*SCT_set_timestamp)(SCT *, uint64_t) = NULL;
108 int (*SCT_set_version)(SCT *, sct_version_t) = NULL;
109 int (*SCT_set_log_entry_type)(SCT *, ct_log_entry_type_t) = NULL;
110 #endif
111 """