Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- data_prepare/node-v24.12.0-linux-x64/include/node/common.gypi +770 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/config.gypi +490 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/allocation.h +308 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/common.h +28 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/custom-space.h +97 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/default-platform.h +68 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap-consistency.h +309 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap-state.h +82 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap-statistics.h +122 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap.h +202 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/macros.h +56 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/member.h +663 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/name-provider.h +75 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/persistent.h +377 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/platform.h +174 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/testing.h +106 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/js_native_api.h +618 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/js_native_api_types.h +227 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/node.h +1627 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/node_api.h +265 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/node_api_types.h +56 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/node_buffer.h +92 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/node_object_wrap.h +132 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/node_version.h +110 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/asn1.h +1134 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/asn1t.h +946 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/cmp.h +727 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/cms.h +511 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/comp.h +98 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/conf.h +214 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/configuration.h +185 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/core_names.h +575 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/crmf.h +278 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/ct.h +573 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/err.h +512 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/ess.h +128 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/fipskey.h +41 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/lhash.h +398 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/ocsp.h +483 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslv.h +109 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/pkcs12.h +366 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/pkcs7.h +430 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/safestack.h +297 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/srp.h +285 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/ui.h +407 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/x509.h +1303 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/x509_acert.h +294 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/x509_vfy.h +903 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/x509v3.h +0 -0
- data_prepare/node-v24.12.0-linux-x64/include/node/uv.h +1990 -0
data_prepare/node-v24.12.0-linux-x64/include/node/common.gypi
ADDED
|
@@ -0,0 +1,770 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
'variables': {
|
| 3 |
+
'configuring_node%': 0,
|
| 4 |
+
'asan%': 0,
|
| 5 |
+
'ubsan%': 0,
|
| 6 |
+
'visibility%': 'hidden', # V8's visibility setting
|
| 7 |
+
'target_arch%': 'ia32', # set v8's target architecture
|
| 8 |
+
'host_arch%': 'ia32', # set v8's host architecture
|
| 9 |
+
'want_separate_host_toolset%': 0, # V8 should not build target and host
|
| 10 |
+
'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
|
| 11 |
+
'component%': 'static_library', # NB. these names match with what V8 expects
|
| 12 |
+
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
|
| 13 |
+
'enable_pgo_generate%': '0',
|
| 14 |
+
'enable_pgo_use%': '0',
|
| 15 |
+
'python%': 'python',
|
| 16 |
+
|
| 17 |
+
'node_shared%': 'false',
|
| 18 |
+
'force_dynamic_crt%': 0,
|
| 19 |
+
'node_use_v8_platform%': 'true',
|
| 20 |
+
'node_use_bundled_v8%': 'true',
|
| 21 |
+
'node_module_version%': '',
|
| 22 |
+
'node_with_ltcg%': '',
|
| 23 |
+
'node_shared_openssl%': 'false',
|
| 24 |
+
|
| 25 |
+
'node_tag%': '',
|
| 26 |
+
'uv_library%': 'static_library',
|
| 27 |
+
|
| 28 |
+
'clang%': 0,
|
| 29 |
+
'error_on_warn%': 'false',
|
| 30 |
+
'suppress_all_error_on_warn%': 'false',
|
| 31 |
+
'control_flow_guard%': 'false',
|
| 32 |
+
|
| 33 |
+
'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)',
|
| 34 |
+
'openssl_no_asm%': 0,
|
| 35 |
+
|
| 36 |
+
# Don't use ICU data file (icudtl.dat) from V8, we use our own.
|
| 37 |
+
'icu_use_data_file_flag%': 0,
|
| 38 |
+
|
| 39 |
+
# Reset this number to 0 on major V8 upgrades.
|
| 40 |
+
# Increment by one for each non-official patch applied to deps/v8.
|
| 41 |
+
'v8_embedder_string': '-node.37',
|
| 42 |
+
|
| 43 |
+
##### V8 defaults for Node.js #####
|
| 44 |
+
|
| 45 |
+
# Turn on SipHash for hash seed generation, addresses HashWick
|
| 46 |
+
'v8_use_siphash': 'true',
|
| 47 |
+
|
| 48 |
+
# These are more relevant for V8 internal development.
|
| 49 |
+
# Refs: https://github.com/nodejs/node/issues/23122
|
| 50 |
+
# Refs: https://github.com/nodejs/node/issues/23167
|
| 51 |
+
# Enable compiler warnings when using V8_DEPRECATED apis from V8 code.
|
| 52 |
+
'v8_deprecation_warnings': 0,
|
| 53 |
+
# Enable compiler warnings when using V8_DEPRECATE_SOON apis from V8 code.
|
| 54 |
+
'v8_imminent_deprecation_warnings': 0,
|
| 55 |
+
|
| 56 |
+
# Enable disassembler for `--print-code` v8 options
|
| 57 |
+
'v8_enable_disassembler': 1,
|
| 58 |
+
|
| 59 |
+
# Sets -dOBJECT_PRINT.
|
| 60 |
+
'v8_enable_object_print%': 1,
|
| 61 |
+
|
| 62 |
+
# https://github.com/nodejs/node/pull/22920/files#r222779926
|
| 63 |
+
'v8_enable_handle_zapping': 0,
|
| 64 |
+
|
| 65 |
+
# Disable pointer compression. Can be enabled at build time via configure
|
| 66 |
+
# options but default values are required here as this file is also used by
|
| 67 |
+
# node-gyp to build addons.
|
| 68 |
+
'v8_enable_pointer_compression%': 0,
|
| 69 |
+
'v8_enable_31bit_smis_on_64bit_arch%': 0,
|
| 70 |
+
|
| 71 |
+
# Disable v8 hugepage by default.
|
| 72 |
+
'v8_enable_hugepage%': 0,
|
| 73 |
+
|
| 74 |
+
# This is more of a V8 dev setting
|
| 75 |
+
# https://github.com/nodejs/node/pull/22920/files#r222779926
|
| 76 |
+
'v8_enable_fast_mksnapshot': 0,
|
| 77 |
+
|
| 78 |
+
'v8_win64_unwinding_info': 1,
|
| 79 |
+
|
| 80 |
+
# Variables controlling external defines exposed in public headers.
|
| 81 |
+
'v8_enable_conservative_stack_scanning%': 0,
|
| 82 |
+
'v8_enable_direct_local%': 0,
|
| 83 |
+
'v8_enable_map_packing%': 0,
|
| 84 |
+
'v8_enable_pointer_compression_shared_cage%': 0,
|
| 85 |
+
'v8_enable_external_code_space%': 0,
|
| 86 |
+
'v8_enable_sandbox%': 0,
|
| 87 |
+
'v8_enable_v8_checks%': 0,
|
| 88 |
+
'v8_enable_zone_compression%': 0,
|
| 89 |
+
'v8_use_perfetto': 0,
|
| 90 |
+
'tsan%': 0,
|
| 91 |
+
|
| 92 |
+
##### end V8 defaults #####
|
| 93 |
+
|
| 94 |
+
'conditions': [
|
| 95 |
+
['OS == "win"', {
|
| 96 |
+
'os_posix': 0,
|
| 97 |
+
'v8_postmortem_support%': 0,
|
| 98 |
+
'obj_dir': '<(PRODUCT_DIR)/obj',
|
| 99 |
+
'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a',
|
| 100 |
+
}, {
|
| 101 |
+
'os_posix': 1,
|
| 102 |
+
'v8_postmortem_support%': 1,
|
| 103 |
+
}],
|
| 104 |
+
['GENERATOR == "ninja"', {
|
| 105 |
+
'obj_dir': '<(PRODUCT_DIR)/obj',
|
| 106 |
+
'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a',
|
| 107 |
+
}, {
|
| 108 |
+
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
|
| 109 |
+
'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a',
|
| 110 |
+
}],
|
| 111 |
+
['OS=="mac"', {
|
| 112 |
+
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
|
| 113 |
+
'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
|
| 114 |
+
}],
|
| 115 |
+
# V8 pointer compression only supports 64bit architectures.
|
| 116 |
+
['target_arch in "arm ia32 mips mipsel"', {
|
| 117 |
+
'v8_enable_pointer_compression': 0,
|
| 118 |
+
'v8_enable_pointer_compression_shared_cage': 0,
|
| 119 |
+
'v8_enable_31bit_smis_on_64bit_arch': 0,
|
| 120 |
+
'v8_enable_external_code_space': 0,
|
| 121 |
+
'v8_enable_sandbox': 0
|
| 122 |
+
}],
|
| 123 |
+
['target_arch in "ppc64 s390x"', {
|
| 124 |
+
'v8_enable_backtrace': 1,
|
| 125 |
+
}],
|
| 126 |
+
['OS=="linux" or OS=="openharmony"', {
|
| 127 |
+
'node_section_ordering_info%': ''
|
| 128 |
+
}],
|
| 129 |
+
['OS == "zos"', {
|
| 130 |
+
# use ICU data file on z/OS
|
| 131 |
+
'icu_use_data_file_flag%': 1
|
| 132 |
+
}]
|
| 133 |
+
],
|
| 134 |
+
},
|
| 135 |
+
|
| 136 |
+
'target_defaults': {
|
| 137 |
+
'default_configuration': 'Release',
|
| 138 |
+
'configurations': {
|
| 139 |
+
'Debug': {
|
| 140 |
+
'variables': {
|
| 141 |
+
'v8_enable_handle_zapping': 1,
|
| 142 |
+
'conditions': [
|
| 143 |
+
['node_shared != "true"', {
|
| 144 |
+
'MSVC_runtimeType': 1, # MultiThreadedDebug (/MTd)
|
| 145 |
+
}, {
|
| 146 |
+
'MSVC_runtimeType': 3, # MultiThreadedDebugDLL (/MDd)
|
| 147 |
+
}],
|
| 148 |
+
],
|
| 149 |
+
},
|
| 150 |
+
'defines': [ 'DEBUG', '_DEBUG' ],
|
| 151 |
+
'cflags': [ '-g', '-O0' ],
|
| 152 |
+
'conditions': [
|
| 153 |
+
['OS in "aix os400"', {
|
| 154 |
+
'cflags': [ '-gxcoff' ],
|
| 155 |
+
'ldflags': [ '-Wl,-bbigtoc' ],
|
| 156 |
+
}],
|
| 157 |
+
['OS == "android"', {
|
| 158 |
+
'cflags': [ '-fPIC' ],
|
| 159 |
+
'ldflags': [ '-fPIC' ]
|
| 160 |
+
}],
|
| 161 |
+
['clang==1', {
|
| 162 |
+
'msbuild_toolset': 'ClangCL',
|
| 163 |
+
}],
|
| 164 |
+
],
|
| 165 |
+
'msvs_settings': {
|
| 166 |
+
'VCCLCompilerTool': {
|
| 167 |
+
'BasicRuntimeChecks': 3, # /RTC1
|
| 168 |
+
'MinimalRebuild': 'false',
|
| 169 |
+
'OmitFramePointers': 'false',
|
| 170 |
+
'Optimization': 0, # /Od, no optimization
|
| 171 |
+
'RuntimeLibrary': '<(MSVC_runtimeType)',
|
| 172 |
+
},
|
| 173 |
+
'VCLinkerTool': {
|
| 174 |
+
'LinkIncremental': 2, # enable incremental linking
|
| 175 |
+
},
|
| 176 |
+
},
|
| 177 |
+
'xcode_settings': {
|
| 178 |
+
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
|
| 179 |
+
},
|
| 180 |
+
},
|
| 181 |
+
'Release': {
|
| 182 |
+
'variables': {
|
| 183 |
+
'v8_enable_handle_zapping': 0,
|
| 184 |
+
'pgo_generate': ' -fprofile-generate ',
|
| 185 |
+
'pgo_use': ' -fprofile-use -fprofile-correction ',
|
| 186 |
+
'conditions': [
|
| 187 |
+
['node_shared != "true"', {
|
| 188 |
+
'MSVC_runtimeType': 0 # MultiThreaded (/MT)
|
| 189 |
+
}, {
|
| 190 |
+
'MSVC_runtimeType': 2 # MultiThreadedDLL (/MD)
|
| 191 |
+
}],
|
| 192 |
+
['clang==1', {
|
| 193 |
+
'lto': ' -flto ', # Clang
|
| 194 |
+
}, {
|
| 195 |
+
'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC
|
| 196 |
+
}],
|
| 197 |
+
],
|
| 198 |
+
},
|
| 199 |
+
'cflags': [ '-O3' ],
|
| 200 |
+
'conditions': [
|
| 201 |
+
['enable_lto=="true"', {
|
| 202 |
+
'cflags': ['<(lto)'],
|
| 203 |
+
'ldflags': ['<(lto)'],
|
| 204 |
+
'xcode_settings': {
|
| 205 |
+
'LLVM_LTO': 'YES',
|
| 206 |
+
},
|
| 207 |
+
}],
|
| 208 |
+
['OS=="linux" or OS=="openharmony"', {
|
| 209 |
+
'conditions': [
|
| 210 |
+
['node_section_ordering_info!=""', {
|
| 211 |
+
'cflags': [
|
| 212 |
+
'-fuse-ld=gold',
|
| 213 |
+
'-ffunction-sections',
|
| 214 |
+
],
|
| 215 |
+
'ldflags': [
|
| 216 |
+
'-fuse-ld=gold',
|
| 217 |
+
'-Wl,--section-ordering-file=<(node_section_ordering_info)',
|
| 218 |
+
],
|
| 219 |
+
}],
|
| 220 |
+
],
|
| 221 |
+
}],
|
| 222 |
+
['OS=="solaris"', {
|
| 223 |
+
# pull in V8's postmortem metadata
|
| 224 |
+
'ldflags': [ '-Wl,-z,allextract' ]
|
| 225 |
+
}],
|
| 226 |
+
['OS=="zos"', {
|
| 227 |
+
# increase performance, number from experimentation
|
| 228 |
+
'cflags': [ '-qINLINE=::150:100000' ]
|
| 229 |
+
}],
|
| 230 |
+
['OS!="mac" and OS!="win" and OS!="zos"', {
|
| 231 |
+
# -fno-omit-frame-pointer is necessary for the --perf_basic_prof
|
| 232 |
+
# flag to work correctly. perf(1) gets confused about JS stack
|
| 233 |
+
# frames otherwise, even with --call-graph dwarf.
|
| 234 |
+
'cflags': [ '-fno-omit-frame-pointer' ],
|
| 235 |
+
}],
|
| 236 |
+
['OS=="linux" or OS=="openharmony"', {
|
| 237 |
+
'conditions': [
|
| 238 |
+
['enable_pgo_generate=="true"', {
|
| 239 |
+
'cflags': ['<(pgo_generate)'],
|
| 240 |
+
'ldflags': ['<(pgo_generate)'],
|
| 241 |
+
},],
|
| 242 |
+
['enable_pgo_use=="true"', {
|
| 243 |
+
'cflags': ['<(pgo_use)'],
|
| 244 |
+
'ldflags': ['<(pgo_use)'],
|
| 245 |
+
},],
|
| 246 |
+
],
|
| 247 |
+
},],
|
| 248 |
+
['OS == "android"', {
|
| 249 |
+
'cflags': [ '-fPIC', '-I<(android_ndk_path)/sources/android/cpufeatures' ],
|
| 250 |
+
'ldflags': [ '-fPIC' ]
|
| 251 |
+
}],
|
| 252 |
+
['clang==1', {
|
| 253 |
+
'msbuild_toolset': 'ClangCL',
|
| 254 |
+
}],
|
| 255 |
+
],
|
| 256 |
+
'msvs_settings': {
|
| 257 |
+
'VCCLCompilerTool': {
|
| 258 |
+
'conditions': [
|
| 259 |
+
['target_arch=="arm64"', {
|
| 260 |
+
'FloatingPointModel': 1 # /fp:strict
|
| 261 |
+
}]
|
| 262 |
+
],
|
| 263 |
+
'EnableFunctionLevelLinking': 'true',
|
| 264 |
+
'EnableIntrinsicFunctions': 'true',
|
| 265 |
+
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
|
| 266 |
+
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
|
| 267 |
+
'OmitFramePointers': 'true',
|
| 268 |
+
'Optimization': 3, # /Ox, full optimization
|
| 269 |
+
'RuntimeLibrary': '<(MSVC_runtimeType)',
|
| 270 |
+
'RuntimeTypeInfo': 'false',
|
| 271 |
+
}
|
| 272 |
+
},
|
| 273 |
+
'xcode_settings': {
|
| 274 |
+
'GCC_OPTIMIZATION_LEVEL': '3', # stop gyp from defaulting to -Os
|
| 275 |
+
},
|
| 276 |
+
}
|
| 277 |
+
},
|
| 278 |
+
|
| 279 |
+
# Defines these mostly for node-gyp to pickup.
|
| 280 |
+
'defines': [
|
| 281 |
+
'_GLIBCXX_USE_CXX11_ABI=1',
|
| 282 |
+
# This help forks when building Node.js on a 32-bit arch as
|
| 283 |
+
# libuv is always compiled with _FILE_OFFSET_BITS=64
|
| 284 |
+
'_FILE_OFFSET_BITS=64'
|
| 285 |
+
],
|
| 286 |
+
|
| 287 |
+
# Forcibly disable -Werror. We support a wide range of compilers, it's
|
| 288 |
+
# simply not feasible to squelch all warnings, never mind that the
|
| 289 |
+
# libraries in deps/ are not under our control.
|
| 290 |
+
'conditions': [
|
| 291 |
+
[ 'error_on_warn=="false"', {
|
| 292 |
+
'cflags!': ['-Werror'],
|
| 293 |
+
}, '(_target_name!="<(node_lib_target_name)" or '
|
| 294 |
+
'_target_name!="<(node_core_target_name)")', {
|
| 295 |
+
'cflags!': ['-Werror'],
|
| 296 |
+
}],
|
| 297 |
+
],
|
| 298 |
+
'msvs_settings': {
|
| 299 |
+
'VCCLCompilerTool': {
|
| 300 |
+
# TODO(targos): Remove condition and always use LanguageStandard options
|
| 301 |
+
# once node-gyp supports them.
|
| 302 |
+
'conditions': [
|
| 303 |
+
['clang==1', {
|
| 304 |
+
'LanguageStandard': 'stdcpp20',
|
| 305 |
+
'LanguageStandard_C': 'stdc11',
|
| 306 |
+
'AdditionalOptions': [
|
| 307 |
+
'/Zc:__cplusplus',
|
| 308 |
+
# The following option reduces the "error C1060: compiler is out of heap space"
|
| 309 |
+
'/Zm2000',
|
| 310 |
+
],
|
| 311 |
+
}, {
|
| 312 |
+
'AdditionalOptions': [
|
| 313 |
+
'/Zc:__cplusplus',
|
| 314 |
+
# The following option enables c++20 on Windows. This is needed for V8 v12.4+
|
| 315 |
+
'-std:c++20',
|
| 316 |
+
# The following option reduces the "error C1060: compiler is out of heap space"
|
| 317 |
+
'/Zm2000',
|
| 318 |
+
],
|
| 319 |
+
}],
|
| 320 |
+
['control_flow_guard=="true"', {
|
| 321 |
+
'AdditionalOptions': [
|
| 322 |
+
'/guard:cf', # Control Flow Guard
|
| 323 |
+
],
|
| 324 |
+
}],
|
| 325 |
+
],
|
| 326 |
+
'BufferSecurityCheck': 'true',
|
| 327 |
+
'DebugInformationFormat': 1, # /Z7 embed info in .obj files
|
| 328 |
+
'ExceptionHandling': 0, # /EHsc
|
| 329 |
+
'MultiProcessorCompilation': 'true',
|
| 330 |
+
'StringPooling': 'true', # pool string literals
|
| 331 |
+
'SuppressStartupBanner': 'true',
|
| 332 |
+
'WarnAsError': 'false',
|
| 333 |
+
'WarningLevel': 3, # /W3
|
| 334 |
+
},
|
| 335 |
+
'VCLinkerTool': {
|
| 336 |
+
'target_conditions': [
|
| 337 |
+
['_type=="executable"', {
|
| 338 |
+
'SubSystem': 1, # /SUBSYSTEM:CONSOLE
|
| 339 |
+
}],
|
| 340 |
+
],
|
| 341 |
+
'conditions': [
|
| 342 |
+
['target_arch=="ia32"', {
|
| 343 |
+
'TargetMachine' : 1, # /MACHINE:X86
|
| 344 |
+
}],
|
| 345 |
+
['target_arch=="x64"', {
|
| 346 |
+
'TargetMachine' : 17, # /MACHINE:X64
|
| 347 |
+
}],
|
| 348 |
+
['target_arch=="arm64"', {
|
| 349 |
+
'TargetMachine' : 0, # NotSet. MACHINE:ARM64 is inferred from the input files.
|
| 350 |
+
}],
|
| 351 |
+
['control_flow_guard=="true"', {
|
| 352 |
+
'AdditionalOptions': [
|
| 353 |
+
'/guard:cf', # Control Flow Guard
|
| 354 |
+
],
|
| 355 |
+
}],
|
| 356 |
+
],
|
| 357 |
+
'GenerateDebugInformation': 'true',
|
| 358 |
+
'SuppressStartupBanner': 'true',
|
| 359 |
+
},
|
| 360 |
+
},
|
| 361 |
+
# Disable warnings:
|
| 362 |
+
# - "C4251: class needs to have dll-interface"
|
| 363 |
+
# - "C4275: non-DLL-interface used as base for DLL-interface"
|
| 364 |
+
# Over 10k of these warnings are generated when compiling node,
|
| 365 |
+
# originating from v8.h. Most of them are false positives.
|
| 366 |
+
# See also: https://github.com/nodejs/node/pull/15570
|
| 367 |
+
# TODO: re-enable when Visual Studio fixes these upstream.
|
| 368 |
+
#
|
| 369 |
+
# - "C4267: conversion from 'size_t' to 'int'"
|
| 370 |
+
# Many any originate from our dependencies, and their sheer number
|
| 371 |
+
# drowns out other, more legitimate warnings.
|
| 372 |
+
# - "C4244: conversion from 'type1' to 'type2', possible loss of data"
|
| 373 |
+
# Ususaly safe. Disable for `dep`, enable for `src`
|
| 374 |
+
'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267],
|
| 375 |
+
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
|
| 376 |
+
|
| 377 |
+
'conditions': [
|
| 378 |
+
[ 'configuring_node', {
|
| 379 |
+
'msvs_configuration_attributes': {
|
| 380 |
+
'OutputDirectory': '<(DEPTH)/out/$(Configuration)/',
|
| 381 |
+
'IntermediateDirectory': '$(OutDir)obj/$(ProjectName)/'
|
| 382 |
+
},
|
| 383 |
+
}],
|
| 384 |
+
[ 'target_arch=="x64"', {
|
| 385 |
+
'msvs_configuration_platform': 'x64',
|
| 386 |
+
}],
|
| 387 |
+
[ 'target_arch=="arm64"', {
|
| 388 |
+
'msvs_configuration_platform': 'arm64',
|
| 389 |
+
}],
|
| 390 |
+
['asan == 1 and OS != "mac" and OS != "zos"', {
|
| 391 |
+
'cflags+': [
|
| 392 |
+
'-fno-omit-frame-pointer',
|
| 393 |
+
'-fsanitize=address',
|
| 394 |
+
'-fsanitize-address-use-after-scope',
|
| 395 |
+
],
|
| 396 |
+
'defines': [ 'LEAK_SANITIZER', 'V8_USE_ADDRESS_SANITIZER' ],
|
| 397 |
+
'cflags!': [ '-fomit-frame-pointer' ],
|
| 398 |
+
'ldflags': [ '-fsanitize=address' ],
|
| 399 |
+
}],
|
| 400 |
+
['asan == 1 and OS == "mac"', {
|
| 401 |
+
'xcode_settings': {
|
| 402 |
+
'OTHER_CFLAGS+': [
|
| 403 |
+
'-fno-omit-frame-pointer',
|
| 404 |
+
'-gline-tables-only',
|
| 405 |
+
'-fsanitize=address',
|
| 406 |
+
'-DLEAK_SANITIZER'
|
| 407 |
+
],
|
| 408 |
+
'OTHER_CFLAGS!': [
|
| 409 |
+
'-fomit-frame-pointer',
|
| 410 |
+
],
|
| 411 |
+
},
|
| 412 |
+
'target_conditions': [
|
| 413 |
+
['_type!="static_library"', {
|
| 414 |
+
'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
|
| 415 |
+
}],
|
| 416 |
+
],
|
| 417 |
+
}],
|
| 418 |
+
['ubsan == 1 and OS != "mac" and OS != "zos"', {
|
| 419 |
+
'cflags+': [
|
| 420 |
+
'-fno-omit-frame-pointer',
|
| 421 |
+
'-fsanitize=undefined',
|
| 422 |
+
],
|
| 423 |
+
'defines': [ 'UNDEFINED_SANITIZER'],
|
| 424 |
+
'cflags!': [ '-fno-omit-frame-pointer' ],
|
| 425 |
+
'ldflags': [ '-fsanitize=undefined' ],
|
| 426 |
+
}],
|
| 427 |
+
['ubsan == 1 and OS == "mac"', {
|
| 428 |
+
'xcode_settings': {
|
| 429 |
+
'OTHER_CFLAGS+': [
|
| 430 |
+
'-fno-omit-frame-pointer',
|
| 431 |
+
'-fsanitize=undefined',
|
| 432 |
+
'-DUNDEFINED_SANITIZER'
|
| 433 |
+
],
|
| 434 |
+
},
|
| 435 |
+
'target_conditions': [
|
| 436 |
+
['_type!="static_library"', {
|
| 437 |
+
'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=undefined']},
|
| 438 |
+
}],
|
| 439 |
+
],
|
| 440 |
+
}],
|
| 441 |
+
# The defines bellow must include all things from the external_v8_defines
|
| 442 |
+
# list in v8/BUILD.gn.
|
| 443 |
+
['v8_enable_v8_checks == 1', {
|
| 444 |
+
'defines': ['V8_ENABLE_CHECKS'],
|
| 445 |
+
}],
|
| 446 |
+
['v8_enable_pointer_compression == 1', {
|
| 447 |
+
'defines': ['V8_COMPRESS_POINTERS'],
|
| 448 |
+
}],
|
| 449 |
+
['v8_enable_pointer_compression == 1 and v8_enable_pointer_compression_shared_cage != 1', {
|
| 450 |
+
'defines': ['V8_COMPRESS_POINTERS_IN_MULTIPLE_CAGES'],
|
| 451 |
+
}],
|
| 452 |
+
['v8_enable_pointer_compression_shared_cage == 1', {
|
| 453 |
+
'defines': ['V8_COMPRESS_POINTERS_IN_SHARED_CAGE'],
|
| 454 |
+
}],
|
| 455 |
+
['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
|
| 456 |
+
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
|
| 457 |
+
}],
|
| 458 |
+
['v8_enable_zone_compression == 1', {
|
| 459 |
+
'defines': ['V8_COMPRESS_ZONES',],
|
| 460 |
+
}],
|
| 461 |
+
['v8_enable_sandbox == 1', {
|
| 462 |
+
'defines': ['V8_ENABLE_SANDBOX',],
|
| 463 |
+
}],
|
| 464 |
+
['v8_enable_external_code_space == 1', {
|
| 465 |
+
'defines': ['V8_EXTERNAL_CODE_SPACE',],
|
| 466 |
+
}],
|
| 467 |
+
['v8_deprecation_warnings == 1', {
|
| 468 |
+
'defines': ['V8_DEPRECATION_WARNINGS',],
|
| 469 |
+
}],
|
| 470 |
+
['v8_imminent_deprecation_warnings == 1', {
|
| 471 |
+
'defines': ['V8_IMMINENT_DEPRECATION_WARNINGS',],
|
| 472 |
+
}],
|
| 473 |
+
['v8_use_perfetto == 1', {
|
| 474 |
+
'defines': ['V8_USE_PERFETTO',],
|
| 475 |
+
}],
|
| 476 |
+
['v8_enable_map_packing == 1', {
|
| 477 |
+
'defines': ['V8_MAP_PACKING',],
|
| 478 |
+
}],
|
| 479 |
+
['tsan == 1', {
|
| 480 |
+
'defines': ['V8_IS_TSAN',],
|
| 481 |
+
}],
|
| 482 |
+
['v8_enable_conservative_stack_scanning == 1', {
|
| 483 |
+
'defines': ['V8_ENABLE_CONSERVATIVE_STACK_SCANNING',],
|
| 484 |
+
}],
|
| 485 |
+
['v8_enable_direct_local == 1', {
|
| 486 |
+
'defines': ['V8_ENABLE_DIRECT_LOCAL',],
|
| 487 |
+
}],
|
| 488 |
+
['OS == "win"', {
|
| 489 |
+
'defines': [
|
| 490 |
+
'WIN32',
|
| 491 |
+
# we don't really want VC++ warning us about
|
| 492 |
+
# how dangerous C functions are...
|
| 493 |
+
'_CRT_SECURE_NO_DEPRECATE',
|
| 494 |
+
# ... or that C implementations shouldn't use
|
| 495 |
+
# POSIX names
|
| 496 |
+
'_CRT_NONSTDC_NO_DEPRECATE',
|
| 497 |
+
# Make sure the STL doesn't try to use exceptions
|
| 498 |
+
'_HAS_EXCEPTIONS=0',
|
| 499 |
+
'BUILDING_V8_SHARED=1',
|
| 500 |
+
'BUILDING_UV_SHARED=1',
|
| 501 |
+
# Stop <windows.h> from defining macros that conflict with
|
| 502 |
+
# std::min() and std::max(). We don't use <windows.h> (much)
|
| 503 |
+
# but we still inherit it from uv.h.
|
| 504 |
+
'NOMINMAX',
|
| 505 |
+
],
|
| 506 |
+
}],
|
| 507 |
+
[ 'OS in "linux freebsd openbsd solaris aix os400 openharmony"', {
|
| 508 |
+
'cflags': [ '-pthread' ],
|
| 509 |
+
'ldflags': [ '-pthread' ],
|
| 510 |
+
}],
|
| 511 |
+
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi openharmony"', {
|
| 512 |
+
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
|
| 513 |
+
'cflags_cc': [
|
| 514 |
+
'-fno-rtti',
|
| 515 |
+
'-fno-exceptions',
|
| 516 |
+
'-fno-strict-aliasing',
|
| 517 |
+
'-std=gnu++20',
|
| 518 |
+
],
|
| 519 |
+
'defines': [ '__STDC_FORMAT_MACROS' ],
|
| 520 |
+
'ldflags': [ '-rdynamic' ],
|
| 521 |
+
'target_conditions': [
|
| 522 |
+
# The 1990s toolchain on SmartOS can't handle thin archives.
|
| 523 |
+
['_type=="static_library" and OS=="solaris"', {
|
| 524 |
+
'standalone_static_library': 1,
|
| 525 |
+
}],
|
| 526 |
+
['OS=="openbsd"', {
|
| 527 |
+
'cflags': [ '-I/usr/local/include' ],
|
| 528 |
+
'ldflags': [ '-Wl,-z,wxneeded' ],
|
| 529 |
+
}],
|
| 530 |
+
['_toolset=="host"', {
|
| 531 |
+
'conditions': [
|
| 532 |
+
[ 'host_arch=="ia32"', {
|
| 533 |
+
'cflags': [ '-m32' ],
|
| 534 |
+
'ldflags': [ '-m32' ],
|
| 535 |
+
}],
|
| 536 |
+
[ 'host_arch=="x64"', {
|
| 537 |
+
'cflags': [ '-m64' ],
|
| 538 |
+
'ldflags': [ '-m64' ],
|
| 539 |
+
}],
|
| 540 |
+
[ 'host_arch=="ppc64" and OS not in "aix os400"', {
|
| 541 |
+
'conditions': [
|
| 542 |
+
[ 'clang==0', {
|
| 543 |
+
'cflags': [ '-mminimal-toc' ],
|
| 544 |
+
}],
|
| 545 |
+
],
|
| 546 |
+
'cflags': [ '-m64' ],
|
| 547 |
+
'ldflags': [ '-m64' ],
|
| 548 |
+
}],
|
| 549 |
+
[ 'host_arch=="s390x" and OS=="linux"', {
|
| 550 |
+
'cflags': [ '-m64', '-march=z196' ],
|
| 551 |
+
'ldflags': [ '-m64', '-march=z196' ],
|
| 552 |
+
}],
|
| 553 |
+
],
|
| 554 |
+
}],
|
| 555 |
+
['_toolset=="target"', {
|
| 556 |
+
'conditions': [
|
| 557 |
+
[ 'target_arch=="ia32"', {
|
| 558 |
+
'cflags': [ '-m32' ],
|
| 559 |
+
'ldflags': [ '-m32' ],
|
| 560 |
+
}],
|
| 561 |
+
[ 'target_arch=="x64"', {
|
| 562 |
+
'cflags': [ '-m64' ],
|
| 563 |
+
'ldflags': [ '-m64' ],
|
| 564 |
+
}],
|
| 565 |
+
[ 'target_arch=="ppc64" and OS not in "aix os400"', {
|
| 566 |
+
'conditions': [
|
| 567 |
+
[ 'clang==0', {
|
| 568 |
+
'cflags': [ '-mminimal-toc' ],
|
| 569 |
+
}],
|
| 570 |
+
],
|
| 571 |
+
'cflags': [ '-m64' ],
|
| 572 |
+
'ldflags': [ '-m64' ],
|
| 573 |
+
}],
|
| 574 |
+
[ 'target_arch=="s390x" and OS=="linux"', {
|
| 575 |
+
'cflags': [ '-m64', '-march=z196' ],
|
| 576 |
+
'ldflags': [ '-m64', '-march=z196' ],
|
| 577 |
+
}],
|
| 578 |
+
],
|
| 579 |
+
}],
|
| 580 |
+
],
|
| 581 |
+
'conditions': [
|
| 582 |
+
[ 'OS=="solaris"', {
|
| 583 |
+
'cflags': [ '-pthreads' ],
|
| 584 |
+
'ldflags': [ '-pthreads' ],
|
| 585 |
+
'cflags!': [ '-pthread' ],
|
| 586 |
+
'ldflags!': [ '-pthread' ],
|
| 587 |
+
}],
|
| 588 |
+
[ 'node_shared=="true"', {
|
| 589 |
+
'cflags': [ '-fPIC' ],
|
| 590 |
+
'ldflags': [ '-fPIC' ],
|
| 591 |
+
}],
|
| 592 |
+
],
|
| 593 |
+
}],
|
| 594 |
+
[ 'OS in "aix os400"', {
|
| 595 |
+
'variables': {
|
| 596 |
+
# Used to differentiate `AIX` and `OS400`(IBM i).
|
| 597 |
+
'aix_variant_name': '<!(uname -s)',
|
| 598 |
+
},
|
| 599 |
+
'cflags': [ '-maix64', ],
|
| 600 |
+
'ldflags!': [ '-rdynamic', ],
|
| 601 |
+
'ldflags': [
|
| 602 |
+
'-Wl,-bbigtoc',
|
| 603 |
+
'-maix64',
|
| 604 |
+
],
|
| 605 |
+
'conditions': [
|
| 606 |
+
[ '"<(aix_variant_name)"=="OS400"', { # a.k.a. `IBM i`
|
| 607 |
+
'ldflags': [
|
| 608 |
+
'-Wl,-blibpath:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib',
|
| 609 |
+
'-Wl,-brtl',
|
| 610 |
+
],
|
| 611 |
+
}, { # else it's `AIX`
|
| 612 |
+
'variables': {
|
| 613 |
+
'gcc_major': '<!(<(python) -c "import os; import subprocess; CXX=os.environ.get(\'CXX\', \'g++\'); subprocess.run([CXX, \'-dumpversion\'])")'
|
| 614 |
+
},
|
| 615 |
+
# Disable the following compiler warning:
|
| 616 |
+
#
|
| 617 |
+
# warning: visibility attribute not supported in this
|
| 618 |
+
# configuration; ignored [-Wattributes]
|
| 619 |
+
#
|
| 620 |
+
# This is gcc complaining about __attribute((visibility("default"))
|
| 621 |
+
# in static library builds. Legitimate but harmless and it drowns
|
| 622 |
+
# out more relevant warnings.
|
| 623 |
+
'cflags': [ '-Wno-attributes' ],
|
| 624 |
+
'ldflags': [
|
| 625 |
+
'-Wl,-blibpath:/usr/lib:/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/>(gcc_major)/pthread/ppc64:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/>(gcc_major)/pthread/ppc64:/opt/freeware/lib/pthread/ppc64',
|
| 626 |
+
],
|
| 627 |
+
}],
|
| 628 |
+
],
|
| 629 |
+
}],
|
| 630 |
+
['OS=="android"', {
|
| 631 |
+
'target_conditions': [
|
| 632 |
+
['_toolset=="target"', {
|
| 633 |
+
'defines': [ '_GLIBCXX_USE_C99_MATH' ],
|
| 634 |
+
'libraries': [ '-llog' ],
|
| 635 |
+
}],
|
| 636 |
+
['_toolset=="host"', {
|
| 637 |
+
'cflags': [ '-pthread' ],
|
| 638 |
+
'ldflags': [ '-pthread' ],
|
| 639 |
+
}],
|
| 640 |
+
],
|
| 641 |
+
}],
|
| 642 |
+
['OS=="mac"', {
|
| 643 |
+
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
|
| 644 |
+
'xcode_settings': {
|
| 645 |
+
'ALWAYS_SEARCH_USER_PATHS': 'NO',
|
| 646 |
+
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
|
| 647 |
+
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
|
| 648 |
+
# (Equivalent to -fPIC)
|
| 649 |
+
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
|
| 650 |
+
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
|
| 651 |
+
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
|
| 652 |
+
'GCC_STRICT_ALIASING': 'NO', # -fno-strict-aliasing
|
| 653 |
+
'PREBINDING': 'NO', # No -Wl,-prebind
|
| 654 |
+
'MACOSX_DEPLOYMENT_TARGET': '13.5', # -mmacosx-version-min=13.5
|
| 655 |
+
'USE_HEADERMAP': 'NO',
|
| 656 |
+
'WARNING_CFLAGS': [
|
| 657 |
+
'-Wall',
|
| 658 |
+
'-Wendif-labels',
|
| 659 |
+
'-W',
|
| 660 |
+
'-Wno-unused-parameter',
|
| 661 |
+
],
|
| 662 |
+
},
|
| 663 |
+
'target_conditions': [
|
| 664 |
+
['_type!="static_library"', {
|
| 665 |
+
'xcode_settings': {
|
| 666 |
+
'OTHER_LDFLAGS': [
|
| 667 |
+
'-Wl,-search_paths_first'
|
| 668 |
+
],
|
| 669 |
+
},
|
| 670 |
+
}],
|
| 671 |
+
],
|
| 672 |
+
'conditions': [
|
| 673 |
+
['target_arch=="ia32"', {
|
| 674 |
+
'xcode_settings': {'ARCHS': ['i386']},
|
| 675 |
+
}],
|
| 676 |
+
['target_arch=="x64"', {
|
| 677 |
+
'xcode_settings': {'ARCHS': ['x86_64']},
|
| 678 |
+
}],
|
| 679 |
+
['target_arch=="arm64"', {
|
| 680 |
+
'xcode_settings': {
|
| 681 |
+
'ARCHS': ['arm64'],
|
| 682 |
+
'OTHER_LDFLAGS!': [
|
| 683 |
+
'-Wl,-no_pie',
|
| 684 |
+
],
|
| 685 |
+
},
|
| 686 |
+
}],
|
| 687 |
+
['clang==1', {
|
| 688 |
+
'xcode_settings': {
|
| 689 |
+
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
|
| 690 |
+
'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++20', # -std=gnu++20
|
| 691 |
+
'CLANG_CXX_LIBRARY': 'libc++',
|
| 692 |
+
},
|
| 693 |
+
}],
|
| 694 |
+
],
|
| 695 |
+
}],
|
| 696 |
+
['OS=="freebsd"', {
|
| 697 |
+
'ldflags': [
|
| 698 |
+
'-Wl,--export-dynamic',
|
| 699 |
+
],
|
| 700 |
+
}],
|
| 701 |
+
# if node is built as an executable,
|
| 702 |
+
# the openssl mechanism for keeping itself "dload"-ed to ensure proper
|
| 703 |
+
# atexit cleanup does not apply
|
| 704 |
+
['node_shared_openssl!="true" and node_shared!="true"', {
|
| 705 |
+
'defines': [
|
| 706 |
+
# `OPENSSL_NO_PINSHARED` prevents openssl from dload
|
| 707 |
+
# current node executable,
|
| 708 |
+
# see https://github.com/nodejs/node/pull/21848
|
| 709 |
+
# or https://github.com/nodejs/node/issues/27925
|
| 710 |
+
'OPENSSL_NO_PINSHARED'
|
| 711 |
+
],
|
| 712 |
+
}],
|
| 713 |
+
['node_shared_openssl!="true"', {
|
| 714 |
+
# `OPENSSL_THREADS` is defined via GYP for openSSL for all architectures.
|
| 715 |
+
'defines': [
|
| 716 |
+
'OPENSSL_THREADS',
|
| 717 |
+
],
|
| 718 |
+
}],
|
| 719 |
+
['node_shared_openssl!="true" and openssl_no_asm==1', {
|
| 720 |
+
'defines': [
|
| 721 |
+
'OPENSSL_NO_ASM',
|
| 722 |
+
],
|
| 723 |
+
}],
|
| 724 |
+
['OS == "zos"', {
|
| 725 |
+
'defines': [
|
| 726 |
+
'_XOPEN_SOURCE_EXTENDED',
|
| 727 |
+
'_XOPEN_SOURCE=600',
|
| 728 |
+
'_UNIX03_THREADS',
|
| 729 |
+
'_UNIX03_WITHDRAWN',
|
| 730 |
+
'_UNIX03_SOURCE',
|
| 731 |
+
'_OPEN_SYS_SOCK_IPV6',
|
| 732 |
+
'_OPEN_SYS_FILE_EXT=1',
|
| 733 |
+
'_POSIX_SOURCE',
|
| 734 |
+
'_OPEN_SYS',
|
| 735 |
+
'_OPEN_SYS_IF_EXT',
|
| 736 |
+
'_OPEN_SYS_SOCK_IPV6',
|
| 737 |
+
'_OPEN_MSGQ_EXT',
|
| 738 |
+
'_LARGE_TIME_API',
|
| 739 |
+
'_ALL_SOURCE',
|
| 740 |
+
'_AE_BIMODAL=1',
|
| 741 |
+
'__IBMCPP_TR1__',
|
| 742 |
+
'NODE_PLATFORM="os390"',
|
| 743 |
+
'PATH_MAX=1024',
|
| 744 |
+
'_ENHANCED_ASCII_EXT=0xFFFFFFFF',
|
| 745 |
+
'_Export=extern',
|
| 746 |
+
'__static_assert=static_assert',
|
| 747 |
+
],
|
| 748 |
+
'cflags': [
|
| 749 |
+
'-q64',
|
| 750 |
+
'-Wc,DLL',
|
| 751 |
+
'-Wa,GOFF',
|
| 752 |
+
'-qARCH=10',
|
| 753 |
+
'-qASCII',
|
| 754 |
+
'-qTUNE=12',
|
| 755 |
+
'-qENUM=INT',
|
| 756 |
+
'-qEXPORTALL',
|
| 757 |
+
'-qASM',
|
| 758 |
+
],
|
| 759 |
+
'cflags_cc': [
|
| 760 |
+
'-qxclang=-std=c++14',
|
| 761 |
+
],
|
| 762 |
+
'ldflags': [
|
| 763 |
+
'-q64',
|
| 764 |
+
],
|
| 765 |
+
# for addons due to v8config.h include of "zos-base.h":
|
| 766 |
+
'include_dirs': ['<(zoslib_include_dir)'],
|
| 767 |
+
}],
|
| 768 |
+
],
|
| 769 |
+
}
|
| 770 |
+
}
|
data_prepare/node-v24.12.0-linux-x64/include/node/config.gypi
ADDED
|
@@ -0,0 +1,490 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Do not edit. Generated by the configure script.
|
| 2 |
+
{ 'target_defaults': { 'cflags': [],
|
| 3 |
+
'configurations': { 'Debug': {'v8_enable_v8_checks': 0, 'variables': {}},
|
| 4 |
+
'Release': {'v8_enable_v8_checks': 1, 'variables': {}}},
|
| 5 |
+
'default_configuration': 'Release',
|
| 6 |
+
'defines': ['NODE_OPENSSL_CONF_NAME=nodejs_conf', 'ICU_NO_USER_DATA_OVERRIDE'],
|
| 7 |
+
'include_dirs': [],
|
| 8 |
+
'libraries': []},
|
| 9 |
+
'variables': { 'asan': 0,
|
| 10 |
+
'clang': 0,
|
| 11 |
+
'control_flow_guard': 'false',
|
| 12 |
+
'coverage': 'false',
|
| 13 |
+
'dcheck_always_on': 0,
|
| 14 |
+
'debug_nghttp2': 'false',
|
| 15 |
+
'debug_node': 'false',
|
| 16 |
+
'enable_lto': 'false',
|
| 17 |
+
'enable_pgo_generate': 'false',
|
| 18 |
+
'enable_pgo_use': 'false',
|
| 19 |
+
'error_on_warn': 'false',
|
| 20 |
+
'force_dynamic_crt': 0,
|
| 21 |
+
'gas_version': '2.38',
|
| 22 |
+
'host_arch': 'x64',
|
| 23 |
+
'icu_data_in': '../../deps/icu-tmp/icudt77l.dat',
|
| 24 |
+
'icu_endianness': 'l',
|
| 25 |
+
'icu_gyp_path': 'tools/icu/icu-generic.gyp',
|
| 26 |
+
'icu_path': 'deps/icu-small',
|
| 27 |
+
'icu_small': 'false',
|
| 28 |
+
'icu_ver_major': '77',
|
| 29 |
+
'libdir': 'lib',
|
| 30 |
+
'llvm_version': '0.0',
|
| 31 |
+
'napi_build_version': '10',
|
| 32 |
+
'node_builtin_shareable_builtins': [ 'deps/cjs-module-lexer/lexer.js',
|
| 33 |
+
'deps/cjs-module-lexer/dist/lexer.js',
|
| 34 |
+
'deps/undici/undici.js',
|
| 35 |
+
'deps/amaro/dist/index.js'],
|
| 36 |
+
'node_byteorder': 'little',
|
| 37 |
+
'node_cctest_sources': [ 'src/node_snapshot_stub.cc',
|
| 38 |
+
'test/cctest/inspector/test_network_requests_buffer.cc',
|
| 39 |
+
'test/cctest/inspector/test_node_protocol.cc',
|
| 40 |
+
'test/cctest/node_test_fixture.cc',
|
| 41 |
+
'test/cctest/test_aliased_buffer.cc',
|
| 42 |
+
'test/cctest/test_base64.cc',
|
| 43 |
+
'test/cctest/test_base_object_ptr.cc',
|
| 44 |
+
'test/cctest/test_cppgc.cc',
|
| 45 |
+
'test/cctest/test_crypto_clienthello.cc',
|
| 46 |
+
'test/cctest/test_dataqueue.cc',
|
| 47 |
+
'test/cctest/test_environment.cc',
|
| 48 |
+
'test/cctest/test_inspector_socket.cc',
|
| 49 |
+
'test/cctest/test_inspector_socket_server.cc',
|
| 50 |
+
'test/cctest/test_json_utils.cc',
|
| 51 |
+
'test/cctest/test_linked_binding.cc',
|
| 52 |
+
'test/cctest/test_lru_cache.cc',
|
| 53 |
+
'test/cctest/test_node_api.cc',
|
| 54 |
+
'test/cctest/test_node_crypto.cc',
|
| 55 |
+
'test/cctest/test_node_crypto_env.cc',
|
| 56 |
+
'test/cctest/test_node_postmortem_metadata.cc',
|
| 57 |
+
'test/cctest/test_node_task_runner.cc',
|
| 58 |
+
'test/cctest/test_path.cc',
|
| 59 |
+
'test/cctest/test_per_process.cc',
|
| 60 |
+
'test/cctest/test_platform.cc',
|
| 61 |
+
'test/cctest/test_quic_cid.cc',
|
| 62 |
+
'test/cctest/test_quic_error.cc',
|
| 63 |
+
'test/cctest/test_quic_tokens.cc',
|
| 64 |
+
'test/cctest/test_report.cc',
|
| 65 |
+
'test/cctest/test_sockaddr.cc',
|
| 66 |
+
'test/cctest/test_string_bytes.cc',
|
| 67 |
+
'test/cctest/test_traced_value.cc',
|
| 68 |
+
'test/cctest/test_util.cc',
|
| 69 |
+
'test/cctest/node_test_fixture.h'],
|
| 70 |
+
'node_debug_lib': 'false',
|
| 71 |
+
'node_enable_d8': 'false',
|
| 72 |
+
'node_enable_v8_vtunejit': 'false',
|
| 73 |
+
'node_enable_v8windbg': 'false',
|
| 74 |
+
'node_fipsinstall': 'false',
|
| 75 |
+
'node_install_corepack': 'true',
|
| 76 |
+
'node_install_npm': 'true',
|
| 77 |
+
'node_library_files': [ 'lib/_http_agent.js',
|
| 78 |
+
'lib/_http_client.js',
|
| 79 |
+
'lib/_http_common.js',
|
| 80 |
+
'lib/_http_incoming.js',
|
| 81 |
+
'lib/_http_outgoing.js',
|
| 82 |
+
'lib/_http_server.js',
|
| 83 |
+
'lib/_stream_duplex.js',
|
| 84 |
+
'lib/_stream_passthrough.js',
|
| 85 |
+
'lib/_stream_readable.js',
|
| 86 |
+
'lib/_stream_transform.js',
|
| 87 |
+
'lib/_stream_wrap.js',
|
| 88 |
+
'lib/_stream_writable.js',
|
| 89 |
+
'lib/_tls_common.js',
|
| 90 |
+
'lib/_tls_wrap.js',
|
| 91 |
+
'lib/assert.js',
|
| 92 |
+
'lib/assert/strict.js',
|
| 93 |
+
'lib/async_hooks.js',
|
| 94 |
+
'lib/buffer.js',
|
| 95 |
+
'lib/child_process.js',
|
| 96 |
+
'lib/cluster.js',
|
| 97 |
+
'lib/console.js',
|
| 98 |
+
'lib/constants.js',
|
| 99 |
+
'lib/crypto.js',
|
| 100 |
+
'lib/dgram.js',
|
| 101 |
+
'lib/diagnostics_channel.js',
|
| 102 |
+
'lib/dns.js',
|
| 103 |
+
'lib/dns/promises.js',
|
| 104 |
+
'lib/domain.js',
|
| 105 |
+
'lib/events.js',
|
| 106 |
+
'lib/fs.js',
|
| 107 |
+
'lib/fs/promises.js',
|
| 108 |
+
'lib/http.js',
|
| 109 |
+
'lib/http2.js',
|
| 110 |
+
'lib/https.js',
|
| 111 |
+
'lib/inspector.js',
|
| 112 |
+
'lib/inspector/promises.js',
|
| 113 |
+
'lib/internal/abort_controller.js',
|
| 114 |
+
'lib/internal/assert.js',
|
| 115 |
+
'lib/internal/assert/assertion_error.js',
|
| 116 |
+
'lib/internal/assert/calltracker.js',
|
| 117 |
+
'lib/internal/assert/myers_diff.js',
|
| 118 |
+
'lib/internal/assert/utils.js',
|
| 119 |
+
'lib/internal/async_context_frame.js',
|
| 120 |
+
'lib/internal/async_hooks.js',
|
| 121 |
+
'lib/internal/async_local_storage/async_context_frame.js',
|
| 122 |
+
'lib/internal/async_local_storage/async_hooks.js',
|
| 123 |
+
'lib/internal/blob.js',
|
| 124 |
+
'lib/internal/blocklist.js',
|
| 125 |
+
'lib/internal/bootstrap/node.js',
|
| 126 |
+
'lib/internal/bootstrap/realm.js',
|
| 127 |
+
'lib/internal/bootstrap/shadow_realm.js',
|
| 128 |
+
'lib/internal/bootstrap/switches/does_not_own_process_state.js',
|
| 129 |
+
'lib/internal/bootstrap/switches/does_own_process_state.js',
|
| 130 |
+
'lib/internal/bootstrap/switches/is_main_thread.js',
|
| 131 |
+
'lib/internal/bootstrap/switches/is_not_main_thread.js',
|
| 132 |
+
'lib/internal/bootstrap/web/exposed-wildcard.js',
|
| 133 |
+
'lib/internal/bootstrap/web/exposed-window-or-worker.js',
|
| 134 |
+
'lib/internal/buffer.js',
|
| 135 |
+
'lib/internal/child_process.js',
|
| 136 |
+
'lib/internal/child_process/serialization.js',
|
| 137 |
+
'lib/internal/cli_table.js',
|
| 138 |
+
'lib/internal/cluster/child.js',
|
| 139 |
+
'lib/internal/cluster/primary.js',
|
| 140 |
+
'lib/internal/cluster/round_robin_handle.js',
|
| 141 |
+
'lib/internal/cluster/shared_handle.js',
|
| 142 |
+
'lib/internal/cluster/utils.js',
|
| 143 |
+
'lib/internal/cluster/worker.js',
|
| 144 |
+
'lib/internal/console/constructor.js',
|
| 145 |
+
'lib/internal/console/global.js',
|
| 146 |
+
'lib/internal/constants.js',
|
| 147 |
+
'lib/internal/crypto/aes.js',
|
| 148 |
+
'lib/internal/crypto/argon2.js',
|
| 149 |
+
'lib/internal/crypto/certificate.js',
|
| 150 |
+
'lib/internal/crypto/cfrg.js',
|
| 151 |
+
'lib/internal/crypto/chacha20_poly1305.js',
|
| 152 |
+
'lib/internal/crypto/cipher.js',
|
| 153 |
+
'lib/internal/crypto/diffiehellman.js',
|
| 154 |
+
'lib/internal/crypto/ec.js',
|
| 155 |
+
'lib/internal/crypto/hash.js',
|
| 156 |
+
'lib/internal/crypto/hashnames.js',
|
| 157 |
+
'lib/internal/crypto/hkdf.js',
|
| 158 |
+
'lib/internal/crypto/kem.js',
|
| 159 |
+
'lib/internal/crypto/keygen.js',
|
| 160 |
+
'lib/internal/crypto/keys.js',
|
| 161 |
+
'lib/internal/crypto/mac.js',
|
| 162 |
+
'lib/internal/crypto/ml_dsa.js',
|
| 163 |
+
'lib/internal/crypto/ml_kem.js',
|
| 164 |
+
'lib/internal/crypto/pbkdf2.js',
|
| 165 |
+
'lib/internal/crypto/random.js',
|
| 166 |
+
'lib/internal/crypto/rsa.js',
|
| 167 |
+
'lib/internal/crypto/scrypt.js',
|
| 168 |
+
'lib/internal/crypto/sig.js',
|
| 169 |
+
'lib/internal/crypto/util.js',
|
| 170 |
+
'lib/internal/crypto/webcrypto.js',
|
| 171 |
+
'lib/internal/crypto/webidl.js',
|
| 172 |
+
'lib/internal/crypto/x509.js',
|
| 173 |
+
'lib/internal/data_url.js',
|
| 174 |
+
'lib/internal/debugger/inspect.js',
|
| 175 |
+
'lib/internal/debugger/inspect_client.js',
|
| 176 |
+
'lib/internal/debugger/inspect_repl.js',
|
| 177 |
+
'lib/internal/dgram.js',
|
| 178 |
+
'lib/internal/dns/callback_resolver.js',
|
| 179 |
+
'lib/internal/dns/promises.js',
|
| 180 |
+
'lib/internal/dns/utils.js',
|
| 181 |
+
'lib/internal/encoding.js',
|
| 182 |
+
'lib/internal/error_serdes.js',
|
| 183 |
+
'lib/internal/errors.js',
|
| 184 |
+
'lib/internal/errors/error_source.js',
|
| 185 |
+
'lib/internal/event_target.js',
|
| 186 |
+
'lib/internal/events/abort_listener.js',
|
| 187 |
+
'lib/internal/events/symbols.js',
|
| 188 |
+
'lib/internal/file.js',
|
| 189 |
+
'lib/internal/fixed_queue.js',
|
| 190 |
+
'lib/internal/freelist.js',
|
| 191 |
+
'lib/internal/freeze_intrinsics.js',
|
| 192 |
+
'lib/internal/fs/cp/cp-sync.js',
|
| 193 |
+
'lib/internal/fs/cp/cp.js',
|
| 194 |
+
'lib/internal/fs/dir.js',
|
| 195 |
+
'lib/internal/fs/glob.js',
|
| 196 |
+
'lib/internal/fs/promises.js',
|
| 197 |
+
'lib/internal/fs/read/context.js',
|
| 198 |
+
'lib/internal/fs/recursive_watch.js',
|
| 199 |
+
'lib/internal/fs/rimraf.js',
|
| 200 |
+
'lib/internal/fs/streams.js',
|
| 201 |
+
'lib/internal/fs/sync_write_stream.js',
|
| 202 |
+
'lib/internal/fs/utils.js',
|
| 203 |
+
'lib/internal/fs/watchers.js',
|
| 204 |
+
'lib/internal/heap_utils.js',
|
| 205 |
+
'lib/internal/histogram.js',
|
| 206 |
+
'lib/internal/http.js',
|
| 207 |
+
'lib/internal/http2/compat.js',
|
| 208 |
+
'lib/internal/http2/core.js',
|
| 209 |
+
'lib/internal/http2/util.js',
|
| 210 |
+
'lib/internal/inspector/network.js',
|
| 211 |
+
'lib/internal/inspector/network_http.js',
|
| 212 |
+
'lib/internal/inspector/network_http2.js',
|
| 213 |
+
'lib/internal/inspector/network_resources.js',
|
| 214 |
+
'lib/internal/inspector/network_undici.js',
|
| 215 |
+
'lib/internal/inspector_async_hook.js',
|
| 216 |
+
'lib/internal/inspector_network_tracking.js',
|
| 217 |
+
'lib/internal/js_stream_socket.js',
|
| 218 |
+
'lib/internal/legacy/processbinding.js',
|
| 219 |
+
'lib/internal/linkedlist.js',
|
| 220 |
+
'lib/internal/locks.js',
|
| 221 |
+
'lib/internal/main/check_syntax.js',
|
| 222 |
+
'lib/internal/main/embedding.js',
|
| 223 |
+
'lib/internal/main/eval_stdin.js',
|
| 224 |
+
'lib/internal/main/eval_string.js',
|
| 225 |
+
'lib/internal/main/inspect.js',
|
| 226 |
+
'lib/internal/main/mksnapshot.js',
|
| 227 |
+
'lib/internal/main/print_help.js',
|
| 228 |
+
'lib/internal/main/prof_process.js',
|
| 229 |
+
'lib/internal/main/repl.js',
|
| 230 |
+
'lib/internal/main/run_main_module.js',
|
| 231 |
+
'lib/internal/main/test_runner.js',
|
| 232 |
+
'lib/internal/main/watch_mode.js',
|
| 233 |
+
'lib/internal/main/worker_thread.js',
|
| 234 |
+
'lib/internal/mime.js',
|
| 235 |
+
'lib/internal/modules/cjs/loader.js',
|
| 236 |
+
'lib/internal/modules/customization_hooks.js',
|
| 237 |
+
'lib/internal/modules/esm/assert.js',
|
| 238 |
+
'lib/internal/modules/esm/create_dynamic_module.js',
|
| 239 |
+
'lib/internal/modules/esm/formats.js',
|
| 240 |
+
'lib/internal/modules/esm/get_format.js',
|
| 241 |
+
'lib/internal/modules/esm/hooks.js',
|
| 242 |
+
'lib/internal/modules/esm/initialize_import_meta.js',
|
| 243 |
+
'lib/internal/modules/esm/load.js',
|
| 244 |
+
'lib/internal/modules/esm/loader.js',
|
| 245 |
+
'lib/internal/modules/esm/module_job.js',
|
| 246 |
+
'lib/internal/modules/esm/module_map.js',
|
| 247 |
+
'lib/internal/modules/esm/resolve.js',
|
| 248 |
+
'lib/internal/modules/esm/shared_constants.js',
|
| 249 |
+
'lib/internal/modules/esm/translators.js',
|
| 250 |
+
'lib/internal/modules/esm/utils.js',
|
| 251 |
+
'lib/internal/modules/esm/worker.js',
|
| 252 |
+
'lib/internal/modules/helpers.js',
|
| 253 |
+
'lib/internal/modules/package_json_reader.js',
|
| 254 |
+
'lib/internal/modules/run_main.js',
|
| 255 |
+
'lib/internal/modules/typescript.js',
|
| 256 |
+
'lib/internal/navigator.js',
|
| 257 |
+
'lib/internal/net.js',
|
| 258 |
+
'lib/internal/options.js',
|
| 259 |
+
'lib/internal/per_context/domexception.js',
|
| 260 |
+
'lib/internal/per_context/messageport.js',
|
| 261 |
+
'lib/internal/per_context/primordials.js',
|
| 262 |
+
'lib/internal/perf/event_loop_delay.js',
|
| 263 |
+
'lib/internal/perf/event_loop_utilization.js',
|
| 264 |
+
'lib/internal/perf/nodetiming.js',
|
| 265 |
+
'lib/internal/perf/observe.js',
|
| 266 |
+
'lib/internal/perf/performance.js',
|
| 267 |
+
'lib/internal/perf/performance_entry.js',
|
| 268 |
+
'lib/internal/perf/resource_timing.js',
|
| 269 |
+
'lib/internal/perf/timerify.js',
|
| 270 |
+
'lib/internal/perf/usertiming.js',
|
| 271 |
+
'lib/internal/perf/utils.js',
|
| 272 |
+
'lib/internal/priority_queue.js',
|
| 273 |
+
'lib/internal/process/execution.js',
|
| 274 |
+
'lib/internal/process/finalization.js',
|
| 275 |
+
'lib/internal/process/per_thread.js',
|
| 276 |
+
'lib/internal/process/permission.js',
|
| 277 |
+
'lib/internal/process/pre_execution.js',
|
| 278 |
+
'lib/internal/process/promises.js',
|
| 279 |
+
'lib/internal/process/report.js',
|
| 280 |
+
'lib/internal/process/signal.js',
|
| 281 |
+
'lib/internal/process/task_queues.js',
|
| 282 |
+
'lib/internal/process/warning.js',
|
| 283 |
+
'lib/internal/process/worker_thread_only.js',
|
| 284 |
+
'lib/internal/promise_hooks.js',
|
| 285 |
+
'lib/internal/querystring.js',
|
| 286 |
+
'lib/internal/quic/quic.js',
|
| 287 |
+
'lib/internal/quic/state.js',
|
| 288 |
+
'lib/internal/quic/stats.js',
|
| 289 |
+
'lib/internal/quic/symbols.js',
|
| 290 |
+
'lib/internal/readline/callbacks.js',
|
| 291 |
+
'lib/internal/readline/emitKeypressEvents.js',
|
| 292 |
+
'lib/internal/readline/interface.js',
|
| 293 |
+
'lib/internal/readline/promises.js',
|
| 294 |
+
'lib/internal/readline/utils.js',
|
| 295 |
+
'lib/internal/repl.js',
|
| 296 |
+
'lib/internal/repl/await.js',
|
| 297 |
+
'lib/internal/repl/history.js',
|
| 298 |
+
'lib/internal/repl/utils.js',
|
| 299 |
+
'lib/internal/socket_list.js',
|
| 300 |
+
'lib/internal/socketaddress.js',
|
| 301 |
+
'lib/internal/source_map/prepare_stack_trace.js',
|
| 302 |
+
'lib/internal/source_map/source_map.js',
|
| 303 |
+
'lib/internal/source_map/source_map_cache.js',
|
| 304 |
+
'lib/internal/source_map/source_map_cache_map.js',
|
| 305 |
+
'lib/internal/stream_base_commons.js',
|
| 306 |
+
'lib/internal/streams/add-abort-signal.js',
|
| 307 |
+
'lib/internal/streams/compose.js',
|
| 308 |
+
'lib/internal/streams/destroy.js',
|
| 309 |
+
'lib/internal/streams/duplex.js',
|
| 310 |
+
'lib/internal/streams/duplexify.js',
|
| 311 |
+
'lib/internal/streams/duplexpair.js',
|
| 312 |
+
'lib/internal/streams/end-of-stream.js',
|
| 313 |
+
'lib/internal/streams/fast-utf8-stream.js',
|
| 314 |
+
'lib/internal/streams/from.js',
|
| 315 |
+
'lib/internal/streams/lazy_transform.js',
|
| 316 |
+
'lib/internal/streams/legacy.js',
|
| 317 |
+
'lib/internal/streams/operators.js',
|
| 318 |
+
'lib/internal/streams/passthrough.js',
|
| 319 |
+
'lib/internal/streams/pipeline.js',
|
| 320 |
+
'lib/internal/streams/readable.js',
|
| 321 |
+
'lib/internal/streams/state.js',
|
| 322 |
+
'lib/internal/streams/transform.js',
|
| 323 |
+
'lib/internal/streams/utils.js',
|
| 324 |
+
'lib/internal/streams/writable.js',
|
| 325 |
+
'lib/internal/test/binding.js',
|
| 326 |
+
'lib/internal/test/transfer.js',
|
| 327 |
+
'lib/internal/test_runner/assert.js',
|
| 328 |
+
'lib/internal/test_runner/coverage.js',
|
| 329 |
+
'lib/internal/test_runner/harness.js',
|
| 330 |
+
'lib/internal/test_runner/mock/loader.js',
|
| 331 |
+
'lib/internal/test_runner/mock/mock.js',
|
| 332 |
+
'lib/internal/test_runner/mock/mock_timers.js',
|
| 333 |
+
'lib/internal/test_runner/reporter/dot.js',
|
| 334 |
+
'lib/internal/test_runner/reporter/junit.js',
|
| 335 |
+
'lib/internal/test_runner/reporter/lcov.js',
|
| 336 |
+
'lib/internal/test_runner/reporter/rerun.js',
|
| 337 |
+
'lib/internal/test_runner/reporter/spec.js',
|
| 338 |
+
'lib/internal/test_runner/reporter/tap.js',
|
| 339 |
+
'lib/internal/test_runner/reporter/utils.js',
|
| 340 |
+
'lib/internal/test_runner/reporter/v8-serializer.js',
|
| 341 |
+
'lib/internal/test_runner/runner.js',
|
| 342 |
+
'lib/internal/test_runner/snapshot.js',
|
| 343 |
+
'lib/internal/test_runner/test.js',
|
| 344 |
+
'lib/internal/test_runner/tests_stream.js',
|
| 345 |
+
'lib/internal/test_runner/utils.js',
|
| 346 |
+
'lib/internal/timers.js',
|
| 347 |
+
'lib/internal/tls/secure-context.js',
|
| 348 |
+
'lib/internal/trace_events_async_hooks.js',
|
| 349 |
+
'lib/internal/tty.js',
|
| 350 |
+
'lib/internal/url.js',
|
| 351 |
+
'lib/internal/util.js',
|
| 352 |
+
'lib/internal/util/colors.js',
|
| 353 |
+
'lib/internal/util/comparisons.js',
|
| 354 |
+
'lib/internal/util/debuglog.js',
|
| 355 |
+
'lib/internal/util/diff.js',
|
| 356 |
+
'lib/internal/util/inspect.js',
|
| 357 |
+
'lib/internal/util/inspector.js',
|
| 358 |
+
'lib/internal/util/parse_args/parse_args.js',
|
| 359 |
+
'lib/internal/util/parse_args/utils.js',
|
| 360 |
+
'lib/internal/util/trace_sigint.js',
|
| 361 |
+
'lib/internal/util/types.js',
|
| 362 |
+
'lib/internal/v8/startup_snapshot.js',
|
| 363 |
+
'lib/internal/v8_prof_polyfill.js',
|
| 364 |
+
'lib/internal/v8_prof_processor.js',
|
| 365 |
+
'lib/internal/validators.js',
|
| 366 |
+
'lib/internal/vm.js',
|
| 367 |
+
'lib/internal/vm/module.js',
|
| 368 |
+
'lib/internal/wasm_web_api.js',
|
| 369 |
+
'lib/internal/watch_mode/files_watcher.js',
|
| 370 |
+
'lib/internal/watchdog.js',
|
| 371 |
+
'lib/internal/webidl.js',
|
| 372 |
+
'lib/internal/webstorage.js',
|
| 373 |
+
'lib/internal/webstreams/adapters.js',
|
| 374 |
+
'lib/internal/webstreams/compression.js',
|
| 375 |
+
'lib/internal/webstreams/encoding.js',
|
| 376 |
+
'lib/internal/webstreams/queuingstrategies.js',
|
| 377 |
+
'lib/internal/webstreams/readablestream.js',
|
| 378 |
+
'lib/internal/webstreams/transfer.js',
|
| 379 |
+
'lib/internal/webstreams/transformstream.js',
|
| 380 |
+
'lib/internal/webstreams/util.js',
|
| 381 |
+
'lib/internal/webstreams/writablestream.js',
|
| 382 |
+
'lib/internal/worker.js',
|
| 383 |
+
'lib/internal/worker/clone_dom_exception.js',
|
| 384 |
+
'lib/internal/worker/io.js',
|
| 385 |
+
'lib/internal/worker/js_transferable.js',
|
| 386 |
+
'lib/internal/worker/messaging.js',
|
| 387 |
+
'lib/module.js',
|
| 388 |
+
'lib/net.js',
|
| 389 |
+
'lib/os.js',
|
| 390 |
+
'lib/path.js',
|
| 391 |
+
'lib/path/posix.js',
|
| 392 |
+
'lib/path/win32.js',
|
| 393 |
+
'lib/perf_hooks.js',
|
| 394 |
+
'lib/process.js',
|
| 395 |
+
'lib/punycode.js',
|
| 396 |
+
'lib/querystring.js',
|
| 397 |
+
'lib/quic.js',
|
| 398 |
+
'lib/readline.js',
|
| 399 |
+
'lib/readline/promises.js',
|
| 400 |
+
'lib/repl.js',
|
| 401 |
+
'lib/sea.js',
|
| 402 |
+
'lib/sqlite.js',
|
| 403 |
+
'lib/stream.js',
|
| 404 |
+
'lib/stream/consumers.js',
|
| 405 |
+
'lib/stream/promises.js',
|
| 406 |
+
'lib/stream/web.js',
|
| 407 |
+
'lib/string_decoder.js',
|
| 408 |
+
'lib/sys.js',
|
| 409 |
+
'lib/test.js',
|
| 410 |
+
'lib/test/reporters.js',
|
| 411 |
+
'lib/timers.js',
|
| 412 |
+
'lib/timers/promises.js',
|
| 413 |
+
'lib/tls.js',
|
| 414 |
+
'lib/trace_events.js',
|
| 415 |
+
'lib/tty.js',
|
| 416 |
+
'lib/url.js',
|
| 417 |
+
'lib/util.js',
|
| 418 |
+
'lib/util/types.js',
|
| 419 |
+
'lib/v8.js',
|
| 420 |
+
'lib/vm.js',
|
| 421 |
+
'lib/wasi.js',
|
| 422 |
+
'lib/worker_threads.js',
|
| 423 |
+
'lib/zlib.js'],
|
| 424 |
+
'node_module_version': 137,
|
| 425 |
+
'node_no_browser_globals': 'false',
|
| 426 |
+
'node_prefix': '/',
|
| 427 |
+
'node_quic': 'false',
|
| 428 |
+
'node_release_urlbase': 'https://nodejs.org/download/release/',
|
| 429 |
+
'node_section_ordering_info': '',
|
| 430 |
+
'node_shared': 'false',
|
| 431 |
+
'node_shared_ada': 'false',
|
| 432 |
+
'node_shared_brotli': 'false',
|
| 433 |
+
'node_shared_cares': 'false',
|
| 434 |
+
'node_shared_http_parser': 'false',
|
| 435 |
+
'node_shared_libuv': 'false',
|
| 436 |
+
'node_shared_nghttp2': 'false',
|
| 437 |
+
'node_shared_nghttp3': 'false',
|
| 438 |
+
'node_shared_ngtcp2': 'false',
|
| 439 |
+
'node_shared_openssl': 'false',
|
| 440 |
+
'node_shared_simdjson': 'false',
|
| 441 |
+
'node_shared_simdutf': 'false',
|
| 442 |
+
'node_shared_sqlite': 'false',
|
| 443 |
+
'node_shared_uvwasi': 'false',
|
| 444 |
+
'node_shared_zlib': 'false',
|
| 445 |
+
'node_shared_zstd': 'false',
|
| 446 |
+
'node_tag': '',
|
| 447 |
+
'node_target_type': 'executable',
|
| 448 |
+
'node_use_amaro': 'true',
|
| 449 |
+
'node_use_bundled_v8': 'true',
|
| 450 |
+
'node_use_node_code_cache': 'true',
|
| 451 |
+
'node_use_node_snapshot': 'true',
|
| 452 |
+
'node_use_openssl': 'true',
|
| 453 |
+
'node_use_sqlite': 'true',
|
| 454 |
+
'node_use_v8_platform': 'true',
|
| 455 |
+
'node_with_ltcg': 'false',
|
| 456 |
+
'node_without_node_options': 'false',
|
| 457 |
+
'node_write_snapshot_as_array_literals': 'false',
|
| 458 |
+
'openssl_is_fips': 'false',
|
| 459 |
+
'openssl_quic': 'false',
|
| 460 |
+
'ossfuzz': 'false',
|
| 461 |
+
'shlib_suffix': 'so.137',
|
| 462 |
+
'single_executable_application': 'true',
|
| 463 |
+
'suppress_all_error_on_warn': 'false',
|
| 464 |
+
'target_arch': 'x64',
|
| 465 |
+
'ubsan': 0,
|
| 466 |
+
'use_ccache_win': 0,
|
| 467 |
+
'use_prefix_to_find_headers': 'false',
|
| 468 |
+
'v8_enable_31bit_smis_on_64bit_arch': 0,
|
| 469 |
+
'v8_enable_extensible_ro_snapshot': 0,
|
| 470 |
+
'v8_enable_external_code_space': 0,
|
| 471 |
+
'v8_enable_gdbjit': 0,
|
| 472 |
+
'v8_enable_hugepage': 0,
|
| 473 |
+
'v8_enable_i18n_support': 1,
|
| 474 |
+
'v8_enable_inspector': 1,
|
| 475 |
+
'v8_enable_javascript_promise_hooks': 1,
|
| 476 |
+
'v8_enable_lite_mode': 0,
|
| 477 |
+
'v8_enable_maglev': 1,
|
| 478 |
+
'v8_enable_object_print': 1,
|
| 479 |
+
'v8_enable_pointer_compression': 0,
|
| 480 |
+
'v8_enable_pointer_compression_shared_cage': 0,
|
| 481 |
+
'v8_enable_sandbox': 0,
|
| 482 |
+
'v8_enable_short_builtin_calls': 1,
|
| 483 |
+
'v8_enable_wasm_simd256_revec': 1,
|
| 484 |
+
'v8_enable_webassembly': 1,
|
| 485 |
+
'v8_optimized_debug': 1,
|
| 486 |
+
'v8_promise_internal_field_count': 1,
|
| 487 |
+
'v8_random_seed': 0,
|
| 488 |
+
'v8_trace_maps': 0,
|
| 489 |
+
'v8_use_siphash': 1,
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_ALLOCATION_H_
|
| 6 |
+
#define INCLUDE_CPPGC_ALLOCATION_H_
|
| 7 |
+
|
| 8 |
+
#include <atomic>
|
| 9 |
+
#include <cstddef>
|
| 10 |
+
#include <cstdint>
|
| 11 |
+
#include <new>
|
| 12 |
+
#include <type_traits>
|
| 13 |
+
#include <utility>
|
| 14 |
+
|
| 15 |
+
#include "cppgc/custom-space.h"
|
| 16 |
+
#include "cppgc/internal/api-constants.h"
|
| 17 |
+
#include "cppgc/internal/gc-info.h"
|
| 18 |
+
#include "cppgc/type-traits.h"
|
| 19 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 20 |
+
|
| 21 |
+
#if defined(__has_attribute)
|
| 22 |
+
#if __has_attribute(assume_aligned)
|
| 23 |
+
#define CPPGC_DEFAULT_ALIGNED \
|
| 24 |
+
__attribute__((assume_aligned(api_constants::kDefaultAlignment)))
|
| 25 |
+
#define CPPGC_DOUBLE_WORD_ALIGNED \
|
| 26 |
+
__attribute__((assume_aligned(2 * api_constants::kDefaultAlignment)))
|
| 27 |
+
#endif // __has_attribute(assume_aligned)
|
| 28 |
+
#endif // defined(__has_attribute)
|
| 29 |
+
|
| 30 |
+
#if !defined(CPPGC_DEFAULT_ALIGNED)
|
| 31 |
+
#define CPPGC_DEFAULT_ALIGNED
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
#if !defined(CPPGC_DOUBLE_WORD_ALIGNED)
|
| 35 |
+
#define CPPGC_DOUBLE_WORD_ALIGNED
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
namespace cppgc {
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* AllocationHandle is used to allocate garbage-collected objects.
|
| 42 |
+
*/
|
| 43 |
+
class AllocationHandle;
|
| 44 |
+
|
| 45 |
+
namespace internal {
|
| 46 |
+
|
| 47 |
+
using AlignVal = std::align_val_t;
|
| 48 |
+
|
| 49 |
+
class MakeGarbageCollectedTraitInternal {
|
| 50 |
+
protected:
|
| 51 |
+
static inline void MarkObjectAsFullyConstructed(const void* payload) {
|
| 52 |
+
// See api_constants for an explanation of the constants.
|
| 53 |
+
std::atomic<uint16_t>* atomic_mutable_bitfield =
|
| 54 |
+
reinterpret_cast<std::atomic<uint16_t>*>(
|
| 55 |
+
const_cast<uint16_t*>(reinterpret_cast<const uint16_t*>(
|
| 56 |
+
reinterpret_cast<const uint8_t*>(payload) -
|
| 57 |
+
api_constants::kFullyConstructedBitFieldOffsetFromPayload)));
|
| 58 |
+
// It's safe to split use load+store here (instead of a read-modify-write
|
| 59 |
+
// operation), since it's guaranteed that this 16-bit bitfield is only
|
| 60 |
+
// modified by a single thread. This is cheaper in terms of code bloat (on
|
| 61 |
+
// ARM) and performance.
|
| 62 |
+
uint16_t value = atomic_mutable_bitfield->load(std::memory_order_relaxed);
|
| 63 |
+
value |= api_constants::kFullyConstructedBitMask;
|
| 64 |
+
atomic_mutable_bitfield->store(value, std::memory_order_release);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
// Dispatch based on compile-time information.
|
| 68 |
+
//
|
| 69 |
+
// Default implementation is for a custom space with >`kDefaultAlignment` byte
|
| 70 |
+
// alignment.
|
| 71 |
+
template <typename GCInfoType, typename CustomSpace, size_t alignment>
|
| 72 |
+
struct AllocationDispatcher final {
|
| 73 |
+
static void* Invoke(AllocationHandle& handle, size_t size) {
|
| 74 |
+
static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
|
| 75 |
+
"Custom space must inherit from CustomSpaceBase.");
|
| 76 |
+
static_assert(
|
| 77 |
+
!CustomSpace::kSupportsCompaction,
|
| 78 |
+
"Custom spaces that support compaction do not support allocating "
|
| 79 |
+
"objects with non-default (i.e. word-sized) alignment.");
|
| 80 |
+
return MakeGarbageCollectedTraitInternal::Allocate(
|
| 81 |
+
handle, size, static_cast<AlignVal>(alignment),
|
| 82 |
+
internal::GCInfoTrait<GCInfoType>::Index(), CustomSpace::kSpaceIndex);
|
| 83 |
+
}
|
| 84 |
+
};
|
| 85 |
+
|
| 86 |
+
// Fast path for regular allocations for the default space with
|
| 87 |
+
// `kDefaultAlignment` byte alignment.
|
| 88 |
+
template <typename GCInfoType>
|
| 89 |
+
struct AllocationDispatcher<GCInfoType, void,
|
| 90 |
+
api_constants::kDefaultAlignment>
|
| 91 |
+
final {
|
| 92 |
+
static void* Invoke(AllocationHandle& handle, size_t size) {
|
| 93 |
+
return MakeGarbageCollectedTraitInternal::Allocate(
|
| 94 |
+
handle, size, internal::GCInfoTrait<GCInfoType>::Index());
|
| 95 |
+
}
|
| 96 |
+
};
|
| 97 |
+
|
| 98 |
+
// Default space with >`kDefaultAlignment` byte alignment.
|
| 99 |
+
template <typename GCInfoType, size_t alignment>
|
| 100 |
+
struct AllocationDispatcher<GCInfoType, void, alignment> final {
|
| 101 |
+
static void* Invoke(AllocationHandle& handle, size_t size) {
|
| 102 |
+
return MakeGarbageCollectedTraitInternal::Allocate(
|
| 103 |
+
handle, size, static_cast<AlignVal>(alignment),
|
| 104 |
+
internal::GCInfoTrait<GCInfoType>::Index());
|
| 105 |
+
}
|
| 106 |
+
};
|
| 107 |
+
|
| 108 |
+
// Custom space with `kDefaultAlignment` byte alignment.
|
| 109 |
+
template <typename GCInfoType, typename CustomSpace>
|
| 110 |
+
struct AllocationDispatcher<GCInfoType, CustomSpace,
|
| 111 |
+
api_constants::kDefaultAlignment>
|
| 112 |
+
final {
|
| 113 |
+
static void* Invoke(AllocationHandle& handle, size_t size) {
|
| 114 |
+
static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
|
| 115 |
+
"Custom space must inherit from CustomSpaceBase.");
|
| 116 |
+
return MakeGarbageCollectedTraitInternal::Allocate(
|
| 117 |
+
handle, size, internal::GCInfoTrait<GCInfoType>::Index(),
|
| 118 |
+
CustomSpace::kSpaceIndex);
|
| 119 |
+
}
|
| 120 |
+
};
|
| 121 |
+
|
| 122 |
+
private:
|
| 123 |
+
V8_EXPORT static void* CPPGC_DEFAULT_ALIGNED
|
| 124 |
+
Allocate(cppgc::AllocationHandle&, size_t, GCInfoIndex);
|
| 125 |
+
V8_EXPORT static void* CPPGC_DOUBLE_WORD_ALIGNED
|
| 126 |
+
Allocate(cppgc::AllocationHandle&, size_t, AlignVal, GCInfoIndex);
|
| 127 |
+
V8_EXPORT static void* CPPGC_DEFAULT_ALIGNED
|
| 128 |
+
Allocate(cppgc::AllocationHandle&, size_t, GCInfoIndex, CustomSpaceIndex);
|
| 129 |
+
V8_EXPORT static void* CPPGC_DOUBLE_WORD_ALIGNED
|
| 130 |
+
Allocate(cppgc::AllocationHandle&, size_t, AlignVal, GCInfoIndex,
|
| 131 |
+
CustomSpaceIndex);
|
| 132 |
+
|
| 133 |
+
friend class HeapObjectHeader;
|
| 134 |
+
};
|
| 135 |
+
|
| 136 |
+
} // namespace internal
|
| 137 |
+
|
| 138 |
+
/**
|
| 139 |
+
* Base trait that provides utilities for advancers users that have custom
|
| 140 |
+
* allocation needs (e.g., overriding size). It's expected that users override
|
| 141 |
+
* MakeGarbageCollectedTrait (see below) and inherit from
|
| 142 |
+
* MakeGarbageCollectedTraitBase and make use of the low-level primitives
|
| 143 |
+
* offered to allocate and construct an object.
|
| 144 |
+
*/
|
| 145 |
+
template <typename T>
|
| 146 |
+
class MakeGarbageCollectedTraitBase
|
| 147 |
+
: private internal::MakeGarbageCollectedTraitInternal {
|
| 148 |
+
private:
|
| 149 |
+
static_assert(internal::IsGarbageCollectedType<T>::value,
|
| 150 |
+
"T needs to be a garbage collected object");
|
| 151 |
+
static_assert(!IsGarbageCollectedWithMixinTypeV<T> ||
|
| 152 |
+
sizeof(T) <=
|
| 153 |
+
internal::api_constants::kLargeObjectSizeThreshold,
|
| 154 |
+
"GarbageCollectedMixin may not be a large object");
|
| 155 |
+
|
| 156 |
+
protected:
|
| 157 |
+
/**
|
| 158 |
+
* Allocates memory for an object of type T.
|
| 159 |
+
*
|
| 160 |
+
* \param handle AllocationHandle identifying the heap to allocate the object
|
| 161 |
+
* on.
|
| 162 |
+
* \param size The size that should be reserved for the object.
|
| 163 |
+
* \returns the memory to construct an object of type T on.
|
| 164 |
+
*/
|
| 165 |
+
V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) {
|
| 166 |
+
static_assert(
|
| 167 |
+
std::is_base_of<typename T::ParentMostGarbageCollectedType, T>::value,
|
| 168 |
+
"U of GarbageCollected<U> must be a base of T. Check "
|
| 169 |
+
"GarbageCollected<T> base class inheritance.");
|
| 170 |
+
static constexpr size_t kWantedAlignment =
|
| 171 |
+
alignof(T) < internal::api_constants::kDefaultAlignment
|
| 172 |
+
? internal::api_constants::kDefaultAlignment
|
| 173 |
+
: alignof(T);
|
| 174 |
+
static_assert(
|
| 175 |
+
kWantedAlignment <= internal::api_constants::kMaxSupportedAlignment,
|
| 176 |
+
"Requested alignment larger than alignof(std::max_align_t) bytes. "
|
| 177 |
+
"Please file a bug to possibly get this restriction lifted.");
|
| 178 |
+
return AllocationDispatcher<
|
| 179 |
+
typename internal::GCInfoFolding<
|
| 180 |
+
T, typename T::ParentMostGarbageCollectedType>::ResultType,
|
| 181 |
+
typename SpaceTrait<T>::Space, kWantedAlignment>::Invoke(handle, size);
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
/**
|
| 185 |
+
* Marks an object as fully constructed, resulting in precise handling by the
|
| 186 |
+
* garbage collector.
|
| 187 |
+
*
|
| 188 |
+
* \param payload The base pointer the object is allocated at.
|
| 189 |
+
*/
|
| 190 |
+
V8_INLINE static void MarkObjectAsFullyConstructed(const void* payload) {
|
| 191 |
+
internal::MakeGarbageCollectedTraitInternal::MarkObjectAsFullyConstructed(
|
| 192 |
+
payload);
|
| 193 |
+
}
|
| 194 |
+
};
|
| 195 |
+
|
| 196 |
+
/**
|
| 197 |
+
* Passed to MakeGarbageCollected to specify how many bytes should be appended
|
| 198 |
+
* to the allocated object.
|
| 199 |
+
*
|
| 200 |
+
* Example:
|
| 201 |
+
* \code
|
| 202 |
+
* class InlinedArray final : public GarbageCollected<InlinedArray> {
|
| 203 |
+
* public:
|
| 204 |
+
* explicit InlinedArray(size_t bytes) : size(bytes), byte_array(this + 1) {}
|
| 205 |
+
* void Trace(Visitor*) const {}
|
| 206 |
+
|
| 207 |
+
* size_t size;
|
| 208 |
+
* char* byte_array;
|
| 209 |
+
* };
|
| 210 |
+
*
|
| 211 |
+
* auto* inlined_array = MakeGarbageCollected<InlinedArray(
|
| 212 |
+
* GetAllocationHandle(), AdditionalBytes(4), 4);
|
| 213 |
+
* for (size_t i = 0; i < 4; i++) {
|
| 214 |
+
* Process(inlined_array->byte_array[i]);
|
| 215 |
+
* }
|
| 216 |
+
* \endcode
|
| 217 |
+
*/
|
| 218 |
+
struct AdditionalBytes {
|
| 219 |
+
constexpr explicit AdditionalBytes(size_t bytes) : value(bytes) {}
|
| 220 |
+
const size_t value;
|
| 221 |
+
};
|
| 222 |
+
|
| 223 |
+
/**
|
| 224 |
+
* Default trait class that specifies how to construct an object of type T.
|
| 225 |
+
* Advanced users may override how an object is constructed using the utilities
|
| 226 |
+
* that are provided through MakeGarbageCollectedTraitBase.
|
| 227 |
+
*
|
| 228 |
+
* Any trait overriding construction must
|
| 229 |
+
* - allocate through `MakeGarbageCollectedTraitBase<T>::Allocate`;
|
| 230 |
+
* - mark the object as fully constructed using
|
| 231 |
+
* `MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed`;
|
| 232 |
+
*/
|
| 233 |
+
template <typename T>
|
| 234 |
+
class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase<T> {
|
| 235 |
+
public:
|
| 236 |
+
template <typename... Args>
|
| 237 |
+
static T* Call(AllocationHandle& handle, Args&&... args) {
|
| 238 |
+
void* memory =
|
| 239 |
+
MakeGarbageCollectedTraitBase<T>::Allocate(handle, sizeof(T));
|
| 240 |
+
T* object = ::new (memory) T(std::forward<Args>(args)...);
|
| 241 |
+
MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
|
| 242 |
+
return object;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
template <typename... Args>
|
| 246 |
+
static T* Call(AllocationHandle& handle, AdditionalBytes additional_bytes,
|
| 247 |
+
Args&&... args) {
|
| 248 |
+
void* memory = MakeGarbageCollectedTraitBase<T>::Allocate(
|
| 249 |
+
handle, sizeof(T) + additional_bytes.value);
|
| 250 |
+
T* object = ::new (memory) T(std::forward<Args>(args)...);
|
| 251 |
+
MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
|
| 252 |
+
return object;
|
| 253 |
+
}
|
| 254 |
+
};
|
| 255 |
+
|
| 256 |
+
/**
|
| 257 |
+
* Allows users to specify a post-construction callback for specific types. The
|
| 258 |
+
* callback is invoked on the instance of type T right after it has been
|
| 259 |
+
* constructed. This can be useful when the callback requires a
|
| 260 |
+
* fully-constructed object to be able to dispatch to virtual methods.
|
| 261 |
+
*/
|
| 262 |
+
template <typename T, typename = void>
|
| 263 |
+
struct PostConstructionCallbackTrait {
|
| 264 |
+
static void Call(T*) {}
|
| 265 |
+
};
|
| 266 |
+
|
| 267 |
+
/**
|
| 268 |
+
* Constructs a managed object of type T where T transitively inherits from
|
| 269 |
+
* GarbageCollected.
|
| 270 |
+
*
|
| 271 |
+
* \param args List of arguments with which an instance of T will be
|
| 272 |
+
* constructed.
|
| 273 |
+
* \returns an instance of type T.
|
| 274 |
+
*/
|
| 275 |
+
template <typename T, typename... Args>
|
| 276 |
+
V8_INLINE T* MakeGarbageCollected(AllocationHandle& handle, Args&&... args) {
|
| 277 |
+
T* object =
|
| 278 |
+
MakeGarbageCollectedTrait<T>::Call(handle, std::forward<Args>(args)...);
|
| 279 |
+
PostConstructionCallbackTrait<T>::Call(object);
|
| 280 |
+
return object;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
/**
|
| 284 |
+
* Constructs a managed object of type T where T transitively inherits from
|
| 285 |
+
* GarbageCollected. Created objects will have additional bytes appended to
|
| 286 |
+
* it. Allocated memory would suffice for `sizeof(T) + additional_bytes`.
|
| 287 |
+
*
|
| 288 |
+
* \param additional_bytes Denotes how many bytes to append to T.
|
| 289 |
+
* \param args List of arguments with which an instance of T will be
|
| 290 |
+
* constructed.
|
| 291 |
+
* \returns an instance of type T.
|
| 292 |
+
*/
|
| 293 |
+
template <typename T, typename... Args>
|
| 294 |
+
V8_INLINE T* MakeGarbageCollected(AllocationHandle& handle,
|
| 295 |
+
AdditionalBytes additional_bytes,
|
| 296 |
+
Args&&... args) {
|
| 297 |
+
T* object = MakeGarbageCollectedTrait<T>::Call(handle, additional_bytes,
|
| 298 |
+
std::forward<Args>(args)...);
|
| 299 |
+
PostConstructionCallbackTrait<T>::Call(object);
|
| 300 |
+
return object;
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
} // namespace cppgc
|
| 304 |
+
|
| 305 |
+
#undef CPPGC_DEFAULT_ALIGNED
|
| 306 |
+
#undef CPPGC_DOUBLE_WORD_ALIGNED
|
| 307 |
+
|
| 308 |
+
#endif // INCLUDE_CPPGC_ALLOCATION_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/common.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_COMMON_H_
|
| 6 |
+
#define INCLUDE_CPPGC_COMMON_H_
|
| 7 |
+
|
| 8 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 9 |
+
|
| 10 |
+
namespace cppgc {
|
| 11 |
+
|
| 12 |
+
/**
|
| 13 |
+
* Indicator for the stack state of the embedder.
|
| 14 |
+
*/
|
| 15 |
+
enum class EmbedderStackState {
|
| 16 |
+
/**
|
| 17 |
+
* Stack may contain interesting heap pointers.
|
| 18 |
+
*/
|
| 19 |
+
kMayContainHeapPointers,
|
| 20 |
+
/**
|
| 21 |
+
* Stack does not contain any interesting heap pointers.
|
| 22 |
+
*/
|
| 23 |
+
kNoHeapPointers,
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
} // namespace cppgc
|
| 27 |
+
|
| 28 |
+
#endif // INCLUDE_CPPGC_COMMON_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/custom-space.h
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_CUSTOM_SPACE_H_
|
| 6 |
+
#define INCLUDE_CPPGC_CUSTOM_SPACE_H_
|
| 7 |
+
|
| 8 |
+
#include <stddef.h>
|
| 9 |
+
|
| 10 |
+
namespace cppgc {
|
| 11 |
+
|
| 12 |
+
/**
|
| 13 |
+
* Index identifying a custom space.
|
| 14 |
+
*/
|
| 15 |
+
struct CustomSpaceIndex {
|
| 16 |
+
constexpr CustomSpaceIndex(size_t value) : value(value) {} // NOLINT
|
| 17 |
+
size_t value;
|
| 18 |
+
};
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Top-level base class for custom spaces. Users must inherit from CustomSpace
|
| 22 |
+
* below.
|
| 23 |
+
*/
|
| 24 |
+
class CustomSpaceBase {
|
| 25 |
+
public:
|
| 26 |
+
virtual ~CustomSpaceBase() = default;
|
| 27 |
+
virtual CustomSpaceIndex GetCustomSpaceIndex() const = 0;
|
| 28 |
+
virtual bool IsCompactable() const = 0;
|
| 29 |
+
};
|
| 30 |
+
|
| 31 |
+
/**
|
| 32 |
+
* Base class custom spaces should directly inherit from. The class inheriting
|
| 33 |
+
* from `CustomSpace` must define `kSpaceIndex` as unique space index. These
|
| 34 |
+
* indices need for form a sequence starting at 0.
|
| 35 |
+
*
|
| 36 |
+
* Example:
|
| 37 |
+
* \code
|
| 38 |
+
* class CustomSpace1 : public CustomSpace<CustomSpace1> {
|
| 39 |
+
* public:
|
| 40 |
+
* static constexpr CustomSpaceIndex kSpaceIndex = 0;
|
| 41 |
+
* };
|
| 42 |
+
* class CustomSpace2 : public CustomSpace<CustomSpace2> {
|
| 43 |
+
* public:
|
| 44 |
+
* static constexpr CustomSpaceIndex kSpaceIndex = 1;
|
| 45 |
+
* };
|
| 46 |
+
* \endcode
|
| 47 |
+
*/
|
| 48 |
+
template <typename ConcreteCustomSpace>
|
| 49 |
+
class CustomSpace : public CustomSpaceBase {
|
| 50 |
+
public:
|
| 51 |
+
/**
|
| 52 |
+
* Compaction is only supported on spaces that manually manage slots
|
| 53 |
+
* recording.
|
| 54 |
+
*/
|
| 55 |
+
static constexpr bool kSupportsCompaction = false;
|
| 56 |
+
|
| 57 |
+
CustomSpaceIndex GetCustomSpaceIndex() const final {
|
| 58 |
+
return ConcreteCustomSpace::kSpaceIndex;
|
| 59 |
+
}
|
| 60 |
+
bool IsCompactable() const final {
|
| 61 |
+
return ConcreteCustomSpace::kSupportsCompaction;
|
| 62 |
+
}
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
/**
|
| 66 |
+
* User-overridable trait that allows pinning types to custom spaces.
|
| 67 |
+
*/
|
| 68 |
+
template <typename T, typename = void>
|
| 69 |
+
struct SpaceTrait {
|
| 70 |
+
using Space = void;
|
| 71 |
+
};
|
| 72 |
+
|
| 73 |
+
namespace internal {
|
| 74 |
+
|
| 75 |
+
template <typename CustomSpace>
|
| 76 |
+
struct IsAllocatedOnCompactableSpaceImpl {
|
| 77 |
+
static constexpr bool value = CustomSpace::kSupportsCompaction;
|
| 78 |
+
};
|
| 79 |
+
|
| 80 |
+
template <>
|
| 81 |
+
struct IsAllocatedOnCompactableSpaceImpl<void> {
|
| 82 |
+
// Non-custom spaces are by default not compactable.
|
| 83 |
+
static constexpr bool value = false;
|
| 84 |
+
};
|
| 85 |
+
|
| 86 |
+
template <typename T>
|
| 87 |
+
struct IsAllocatedOnCompactableSpace {
|
| 88 |
+
public:
|
| 89 |
+
static constexpr bool value =
|
| 90 |
+
IsAllocatedOnCompactableSpaceImpl<typename SpaceTrait<T>::Space>::value;
|
| 91 |
+
};
|
| 92 |
+
|
| 93 |
+
} // namespace internal
|
| 94 |
+
|
| 95 |
+
} // namespace cppgc
|
| 96 |
+
|
| 97 |
+
#endif // INCLUDE_CPPGC_CUSTOM_SPACE_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/default-platform.h
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_DEFAULT_PLATFORM_H_
|
| 6 |
+
#define INCLUDE_CPPGC_DEFAULT_PLATFORM_H_
|
| 7 |
+
|
| 8 |
+
#include <memory>
|
| 9 |
+
|
| 10 |
+
#include "cppgc/platform.h"
|
| 11 |
+
#include "libplatform/libplatform.h"
|
| 12 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 13 |
+
|
| 14 |
+
namespace cppgc {
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Platform provided by cppgc. Uses V8's DefaultPlatform provided by
|
| 18 |
+
* libplatform internally. Exception: `GetForegroundTaskRunner()`, see below.
|
| 19 |
+
*/
|
| 20 |
+
class V8_EXPORT DefaultPlatform : public Platform {
|
| 21 |
+
public:
|
| 22 |
+
using IdleTaskSupport = v8::platform::IdleTaskSupport;
|
| 23 |
+
explicit DefaultPlatform(
|
| 24 |
+
int thread_pool_size = 0,
|
| 25 |
+
IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
|
| 26 |
+
std::unique_ptr<TracingController> tracing_controller = {})
|
| 27 |
+
: v8_platform_(v8::platform::NewDefaultPlatform(
|
| 28 |
+
thread_pool_size, idle_task_support,
|
| 29 |
+
v8::platform::InProcessStackDumping::kDisabled,
|
| 30 |
+
std::move(tracing_controller))) {}
|
| 31 |
+
|
| 32 |
+
cppgc::PageAllocator* GetPageAllocator() override {
|
| 33 |
+
return v8_platform_->GetPageAllocator();
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
double MonotonicallyIncreasingTime() override {
|
| 37 |
+
return v8_platform_->MonotonicallyIncreasingTime();
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
std::shared_ptr<cppgc::TaskRunner> GetForegroundTaskRunner(
|
| 41 |
+
TaskPriority priority) override {
|
| 42 |
+
// V8's default platform creates a new task runner when passed the
|
| 43 |
+
// `v8::Isolate` pointer the first time. For non-default platforms this will
|
| 44 |
+
// require getting the appropriate task runner.
|
| 45 |
+
return v8_platform_->GetForegroundTaskRunner(kNoIsolate, priority);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
std::unique_ptr<cppgc::JobHandle> PostJob(
|
| 49 |
+
cppgc::TaskPriority priority,
|
| 50 |
+
std::unique_ptr<cppgc::JobTask> job_task) override {
|
| 51 |
+
return v8_platform_->PostJob(priority, std::move(job_task));
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
TracingController* GetTracingController() override {
|
| 55 |
+
return v8_platform_->GetTracingController();
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
v8::Platform* GetV8Platform() const { return v8_platform_.get(); }
|
| 59 |
+
|
| 60 |
+
protected:
|
| 61 |
+
static constexpr v8::Isolate* kNoIsolate = nullptr;
|
| 62 |
+
|
| 63 |
+
std::unique_ptr<v8::Platform> v8_platform_;
|
| 64 |
+
};
|
| 65 |
+
|
| 66 |
+
} // namespace cppgc
|
| 67 |
+
|
| 68 |
+
#endif // INCLUDE_CPPGC_DEF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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_HEAP_CONSISTENCY_H_
|
| 6 |
+
#define INCLUDE_CPPGC_HEAP_CONSISTENCY_H_
|
| 7 |
+
|
| 8 |
+
#include <cstddef>
|
| 9 |
+
|
| 10 |
+
#include "cppgc/internal/write-barrier.h"
|
| 11 |
+
#include "cppgc/macros.h"
|
| 12 |
+
#include "cppgc/member.h"
|
| 13 |
+
#include "cppgc/trace-trait.h"
|
| 14 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 15 |
+
|
| 16 |
+
namespace cppgc {
|
| 17 |
+
|
| 18 |
+
class HeapHandle;
|
| 19 |
+
|
| 20 |
+
namespace subtle {
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* **DO NOT USE: Use the appropriate managed types.**
|
| 24 |
+
*
|
| 25 |
+
* Consistency helpers that aid in maintaining a consistent internal state of
|
| 26 |
+
* the garbage collector.
|
| 27 |
+
*/
|
| 28 |
+
class HeapConsistency final {
|
| 29 |
+
public:
|
| 30 |
+
using WriteBarrierParams = internal::WriteBarrier::Params;
|
| 31 |
+
using WriteBarrierType = internal::WriteBarrier::Type;
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Gets the required write barrier type for a specific write.
|
| 35 |
+
*
|
| 36 |
+
* \param slot Slot containing the pointer to the object. The slot itself
|
| 37 |
+
* must reside in an object that has been allocated using
|
| 38 |
+
* `MakeGarbageCollected()`.
|
| 39 |
+
* \param value The pointer to the object. May be an interior pointer to an
|
| 40 |
+
* interface of the actual object.
|
| 41 |
+
* \param params Parameters that may be used for actual write barrier calls.
|
| 42 |
+
* Only filled if return value indicates that a write barrier is needed. The
|
| 43 |
+
* contents of the `params` are an implementation detail.
|
| 44 |
+
* \returns whether a write barrier is needed and which barrier to invoke.
|
| 45 |
+
*/
|
| 46 |
+
static V8_INLINE WriteBarrierType GetWriteBarrierType(
|
| 47 |
+
const void* slot, const void* value, WriteBarrierParams& params) {
|
| 48 |
+
return internal::WriteBarrier::GetWriteBarrierType(slot, value, params);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Gets the required write barrier type for a specific write. This override is
|
| 53 |
+
* only used for all the BasicMember types.
|
| 54 |
+
*
|
| 55 |
+
* \param slot Slot containing the pointer to the object. The slot itself
|
| 56 |
+
* must reside in an object that has been allocated using
|
| 57 |
+
* `MakeGarbageCollected()`.
|
| 58 |
+
* \param value The pointer to the object held via `BasicMember`.
|
| 59 |
+
* \param params Parameters that may be used for actual write barrier calls.
|
| 60 |
+
* Only filled if return value indicates that a write barrier is needed. The
|
| 61 |
+
* contents of the `params` are an implementation detail.
|
| 62 |
+
* \returns whether a write barrier is needed and which barrier to invoke.
|
| 63 |
+
*/
|
| 64 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 65 |
+
typename CheckingPolicy, typename StorageType>
|
| 66 |
+
static V8_INLINE WriteBarrierType GetWriteBarrierType(
|
| 67 |
+
const internal::BasicMember<T, WeaknessTag, WriteBarrierPolicy,
|
| 68 |
+
CheckingPolicy, StorageType>& value,
|
| 69 |
+
WriteBarrierParams& params) {
|
| 70 |
+
return internal::WriteBarrier::GetWriteBarrierType(
|
| 71 |
+
value.GetRawSlot(), value.GetRawStorage(), params);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* Gets the required write barrier type for a specific write.
|
| 76 |
+
*
|
| 77 |
+
* \param slot Slot to some part of an object. The object must not necessarily
|
| 78 |
+
have been allocated using `MakeGarbageCollected()` but can also live
|
| 79 |
+
off-heap or on stack.
|
| 80 |
+
* \param params Parameters that may be used for actual write barrier calls.
|
| 81 |
+
* Only filled if return value indicates that a write barrier is needed. The
|
| 82 |
+
* contents of the `params` are an implementation detail.
|
| 83 |
+
* \param callback Callback returning the corresponding heap handle. The
|
| 84 |
+
* callback is only invoked if the heap cannot otherwise be figured out. The
|
| 85 |
+
* callback must not allocate.
|
| 86 |
+
* \returns whether a write barrier is needed and which barrier to invoke.
|
| 87 |
+
*/
|
| 88 |
+
template <typename HeapHandleCallback>
|
| 89 |
+
static V8_INLINE WriteBarrierType
|
| 90 |
+
GetWriteBarrierType(const void* slot, WriteBarrierParams& params,
|
| 91 |
+
HeapHandleCallback callback) {
|
| 92 |
+
return internal::WriteBarrier::GetWriteBarrierType(slot, params, callback);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* Gets the required write barrier type for a specific write.
|
| 97 |
+
* This version is meant to be used in conjunction with with a marking write
|
| 98 |
+
* barrier barrier which doesn't consider the slot.
|
| 99 |
+
*
|
| 100 |
+
* \param value The pointer to the object. May be an interior pointer to an
|
| 101 |
+
* interface of the actual object.
|
| 102 |
+
* \param params Parameters that may be used for actual write barrier calls.
|
| 103 |
+
* Only filled if return value indicates that a write barrier is needed. The
|
| 104 |
+
* contents of the `params` are an implementation detail.
|
| 105 |
+
* \returns whether a write barrier is needed and which barrier to invoke.
|
| 106 |
+
*/
|
| 107 |
+
static V8_INLINE WriteBarrierType
|
| 108 |
+
GetWriteBarrierType(const void* value, WriteBarrierParams& params) {
|
| 109 |
+
return internal::WriteBarrier::GetWriteBarrierType(value, params);
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
/**
|
| 113 |
+
* Conservative Dijkstra-style write barrier that processes an object if it
|
| 114 |
+
* has not yet been processed.
|
| 115 |
+
*
|
| 116 |
+
* \param params The parameters retrieved from `GetWriteBarrierType()`.
|
| 117 |
+
* \param object The pointer to the object. May be an interior pointer to
|
| 118 |
+
* an interface of the actual object.
|
| 119 |
+
*/
|
| 120 |
+
static V8_INLINE void DijkstraWriteBarrier(const WriteBarrierParams& params,
|
| 121 |
+
const void* object) {
|
| 122 |
+
internal::WriteBarrier::DijkstraMarkingBarrier(params, object);
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
/**
|
| 126 |
+
* Conservative Dijkstra-style write barrier that processes a range of
|
| 127 |
+
* elements if they have not yet been processed.
|
| 128 |
+
*
|
| 129 |
+
* \param params The parameters retrieved from `GetWriteBarrierType()`.
|
| 130 |
+
* \param first_element Pointer to the first element that should be processed.
|
| 131 |
+
* The slot itself must reside in an object that has been allocated using
|
| 132 |
+
* `MakeGarbageCollected()`.
|
| 133 |
+
* \param element_size Size of the element in bytes.
|
| 134 |
+
* \param number_of_elements Number of elements that should be processed,
|
| 135 |
+
* starting with `first_element`.
|
| 136 |
+
* \param trace_callback The trace callback that should be invoked for each
|
| 137 |
+
* element if necessary.
|
| 138 |
+
*/
|
| 139 |
+
static V8_INLINE void DijkstraWriteBarrierRange(
|
| 140 |
+
const WriteBarrierParams& params, const void* first_element,
|
| 141 |
+
size_t element_size, size_t number_of_elements,
|
| 142 |
+
TraceCallback trace_callback) {
|
| 143 |
+
internal::WriteBarrier::DijkstraMarkingBarrierRange(
|
| 144 |
+
params, first_element, element_size, number_of_elements,
|
| 145 |
+
trace_callback);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
/**
|
| 149 |
+
* Steele-style write barrier that re-processes an object if it has already
|
| 150 |
+
* been processed.
|
| 151 |
+
*
|
| 152 |
+
* \param params The parameters retrieved from `GetWriteBarrierType()`.
|
| 153 |
+
* \param object The pointer to the object which must point to an object that
|
| 154 |
+
* has been allocated using `MakeGarbageCollected()`. Interior pointers are
|
| 155 |
+
* not supported.
|
| 156 |
+
*/
|
| 157 |
+
static V8_INLINE void SteeleWriteBarrier(const WriteBarrierParams& params,
|
| 158 |
+
const void* object) {
|
| 159 |
+
internal::WriteBarrier::SteeleMarkingBarrier(params, object);
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
/**
|
| 163 |
+
* Generational barrier for maintaining consistency when running with multiple
|
| 164 |
+
* generations.
|
| 165 |
+
*
|
| 166 |
+
* \param params The parameters retrieved from `GetWriteBarrierType()`.
|
| 167 |
+
* \param slot Slot containing the pointer to the object. The slot itself
|
| 168 |
+
* must reside in an object that has been allocated using
|
| 169 |
+
* `MakeGarbageCollected()`.
|
| 170 |
+
*/
|
| 171 |
+
static V8_INLINE void GenerationalBarrier(const WriteBarrierParams& params,
|
| 172 |
+
const void* slot) {
|
| 173 |
+
internal::WriteBarrier::GenerationalBarrier<
|
| 174 |
+
internal::WriteBarrier::GenerationalBarrierType::kPreciseSlot>(params,
|
| 175 |
+
slot);
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
/**
|
| 179 |
+
* Generational barrier for maintaining consistency when running with multiple
|
| 180 |
+
* generations. This version is used when slot contains uncompressed pointer.
|
| 181 |
+
*
|
| 182 |
+
* \param params The parameters retrieved from `GetWriteBarrierType()`.
|
| 183 |
+
* \param slot Uncompressed slot containing the direct pointer to the object.
|
| 184 |
+
* The slot itself must reside in an object that has been allocated using
|
| 185 |
+
* `MakeGarbageCollected()`.
|
| 186 |
+
*/
|
| 187 |
+
static V8_INLINE void GenerationalBarrierForUncompressedSlot(
|
| 188 |
+
const WriteBarrierParams& params, const void* uncompressed_slot) {
|
| 189 |
+
internal::WriteBarrier::GenerationalBarrier<
|
| 190 |
+
internal::WriteBarrier::GenerationalBarrierType::
|
| 191 |
+
kPreciseUncompressedSlot>(params, uncompressed_slot);
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
/**
|
| 195 |
+
* Generational barrier for source object that may contain outgoing pointers
|
| 196 |
+
* to objects in young generation.
|
| 197 |
+
*
|
| 198 |
+
* \param params The parameters retrieved from `GetWriteBarrierType()`.
|
| 199 |
+
* \param inner_pointer Pointer to the source object.
|
| 200 |
+
*/
|
| 201 |
+
static V8_INLINE void GenerationalBarrierForSourceObject(
|
| 202 |
+
const WriteBarrierParams& params, const void* inner_pointer) {
|
| 203 |
+
internal::WriteBarrier::GenerationalBarrier<
|
| 204 |
+
internal::WriteBarrier::GenerationalBarrierType::kImpreciseSlot>(
|
| 205 |
+
params, inner_pointer);
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
private:
|
| 209 |
+
HeapConsistency() = delete;
|
| 210 |
+
};
|
| 211 |
+
|
| 212 |
+
/**
|
| 213 |
+
* Disallows garbage collection finalizations. Any garbage collection triggers
|
| 214 |
+
* result in a crash when in this scope.
|
| 215 |
+
*
|
| 216 |
+
* Note that the garbage collector already covers paths that can lead to garbage
|
| 217 |
+
* collections, so user code does not require checking
|
| 218 |
+
* `IsGarbageCollectionAllowed()` before allocations.
|
| 219 |
+
*/
|
| 220 |
+
class V8_EXPORT V8_NODISCARD DisallowGarbageCollectionScope final {
|
| 221 |
+
CPPGC_STACK_ALLOCATED();
|
| 222 |
+
|
| 223 |
+
public:
|
| 224 |
+
/**
|
| 225 |
+
* \returns whether garbage collections are currently allowed.
|
| 226 |
+
*/
|
| 227 |
+
static bool IsGarbageCollectionAllowed(HeapHandle& heap_handle);
|
| 228 |
+
|
| 229 |
+
/**
|
| 230 |
+
* Enters a disallow garbage collection scope. Must be paired with `Leave()`.
|
| 231 |
+
* Prefer a scope instance of `DisallowGarbageCollectionScope`.
|
| 232 |
+
*
|
| 233 |
+
* \param heap_handle The corresponding heap.
|
| 234 |
+
*/
|
| 235 |
+
static void Enter(HeapHandle& heap_handle);
|
| 236 |
+
|
| 237 |
+
/**
|
| 238 |
+
* Leaves a disallow garbage collection scope. Must be paired with `Enter()`.
|
| 239 |
+
* Prefer a scope instance of `DisallowGarbageCollectionScope`.
|
| 240 |
+
*
|
| 241 |
+
* \param heap_handle The corresponding heap.
|
| 242 |
+
*/
|
| 243 |
+
static void Leave(HeapHandle& heap_handle);
|
| 244 |
+
|
| 245 |
+
/**
|
| 246 |
+
* Constructs a scoped object that automatically enters and leaves a disallow
|
| 247 |
+
* garbage collection scope based on its lifetime.
|
| 248 |
+
*
|
| 249 |
+
* \param heap_handle The corresponding heap.
|
| 250 |
+
*/
|
| 251 |
+
explicit DisallowGarbageCollectionScope(HeapHandle& heap_handle);
|
| 252 |
+
~DisallowGarbageCollectionScope();
|
| 253 |
+
|
| 254 |
+
DisallowGarbageCollectionScope(const DisallowGarbageCollectionScope&) =
|
| 255 |
+
delete;
|
| 256 |
+
DisallowGarbageCollectionScope& operator=(
|
| 257 |
+
const DisallowGarbageCollectionScope&) = delete;
|
| 258 |
+
|
| 259 |
+
private:
|
| 260 |
+
HeapHandle& heap_handle_;
|
| 261 |
+
};
|
| 262 |
+
|
| 263 |
+
/**
|
| 264 |
+
* Avoids invoking garbage collection finalizations. Already running garbage
|
| 265 |
+
* collection phase are unaffected by this scope.
|
| 266 |
+
*
|
| 267 |
+
* Should only be used temporarily as the scope has an impact on memory usage
|
| 268 |
+
* and follow up garbage collections.
|
| 269 |
+
*/
|
| 270 |
+
class V8_EXPORT V8_NODISCARD NoGarbageCollectionScope final {
|
| 271 |
+
CPPGC_STACK_ALLOCATED();
|
| 272 |
+
|
| 273 |
+
public:
|
| 274 |
+
/**
|
| 275 |
+
* Enters a no garbage collection scope. Must be paired with `Leave()`. Prefer
|
| 276 |
+
* a scope instance of `NoGarbageCollectionScope`.
|
| 277 |
+
*
|
| 278 |
+
* \param heap_handle The corresponding heap.
|
| 279 |
+
*/
|
| 280 |
+
static void Enter(HeapHandle& heap_handle);
|
| 281 |
+
|
| 282 |
+
/**
|
| 283 |
+
* Leaves a no garbage collection scope. Must be paired with `Enter()`. Prefer
|
| 284 |
+
* a scope instance of `NoGarbageCollectionScope`.
|
| 285 |
+
*
|
| 286 |
+
* \param heap_handle The corresponding heap.
|
| 287 |
+
*/
|
| 288 |
+
static void Leave(HeapHandle& heap_handle);
|
| 289 |
+
|
| 290 |
+
/**
|
| 291 |
+
* Constructs a scoped object that automatically enters and leaves a no
|
| 292 |
+
* garbage collection scope based on its lifetime.
|
| 293 |
+
*
|
| 294 |
+
* \param heap_handle The corresponding heap.
|
| 295 |
+
*/
|
| 296 |
+
explicit NoGarbageCollectionScope(HeapHandle& heap_handle);
|
| 297 |
+
~NoGarbageCollectionScope();
|
| 298 |
+
|
| 299 |
+
NoGarbageCollectionScope(const NoGarbageCollectionScope&) = delete;
|
| 300 |
+
NoGarbageCollectionScope& operator=(const NoGarbageCollectionScope&) = delete;
|
| 301 |
+
|
| 302 |
+
private:
|
| 303 |
+
HeapHandle& heap_handle_;
|
| 304 |
+
};
|
| 305 |
+
|
| 306 |
+
} // namespace subtle
|
| 307 |
+
} // namespace cppgc
|
| 308 |
+
|
| 309 |
+
#endif // INCLUDE_CPPGC_HEAP_CONSISTENCY_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap-state.h
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2021 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_HEAP_STATE_H_
|
| 6 |
+
#define INCLUDE_CPPGC_HEAP_STATE_H_
|
| 7 |
+
|
| 8 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 9 |
+
|
| 10 |
+
namespace cppgc {
|
| 11 |
+
|
| 12 |
+
class HeapHandle;
|
| 13 |
+
|
| 14 |
+
namespace subtle {
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Helpers to peek into heap-internal state.
|
| 18 |
+
*/
|
| 19 |
+
class V8_EXPORT HeapState final {
|
| 20 |
+
public:
|
| 21 |
+
/**
|
| 22 |
+
* Returns whether the garbage collector is marking. This API is experimental
|
| 23 |
+
* and is expected to be removed in future.
|
| 24 |
+
*
|
| 25 |
+
* \param heap_handle The corresponding heap.
|
| 26 |
+
* \returns true if the garbage collector is currently marking, and false
|
| 27 |
+
* otherwise.
|
| 28 |
+
*/
|
| 29 |
+
static bool IsMarking(const HeapHandle& heap_handle);
|
| 30 |
+
|
| 31 |
+
/*
|
| 32 |
+
* Returns whether the garbage collector is sweeping. This API is experimental
|
| 33 |
+
* and is expected to be removed in future.
|
| 34 |
+
*
|
| 35 |
+
* \param heap_handle The corresponding heap.
|
| 36 |
+
* \returns true if the garbage collector is currently sweeping, and false
|
| 37 |
+
* otherwise.
|
| 38 |
+
*/
|
| 39 |
+
static bool IsSweeping(const HeapHandle& heap_handle);
|
| 40 |
+
|
| 41 |
+
/*
|
| 42 |
+
* Returns whether the garbage collector is currently sweeping on the thread
|
| 43 |
+
* owning this heap. This API allows the caller to determine whether it has
|
| 44 |
+
* been called from a destructor of a managed object. This API is experimental
|
| 45 |
+
* and may be removed in future.
|
| 46 |
+
*
|
| 47 |
+
* \param heap_handle The corresponding heap.
|
| 48 |
+
* \returns true if the garbage collector is currently sweeping on this
|
| 49 |
+
* thread, and false otherwise.
|
| 50 |
+
*/
|
| 51 |
+
static bool IsSweepingOnOwningThread(const HeapHandle& heap_handle);
|
| 52 |
+
|
| 53 |
+
/**
|
| 54 |
+
* Returns whether the garbage collector is in the atomic pause, i.e., the
|
| 55 |
+
* mutator is stopped from running. This API is experimental and is expected
|
| 56 |
+
* to be removed in future.
|
| 57 |
+
*
|
| 58 |
+
* \param heap_handle The corresponding heap.
|
| 59 |
+
* \returns true if the garbage collector is currently in the atomic pause,
|
| 60 |
+
* and false otherwise.
|
| 61 |
+
*/
|
| 62 |
+
static bool IsInAtomicPause(const HeapHandle& heap_handle);
|
| 63 |
+
|
| 64 |
+
/**
|
| 65 |
+
* Returns whether the last garbage collection was finalized conservatively
|
| 66 |
+
* (i.e., with a non-empty stack). This API is experimental and is expected to
|
| 67 |
+
* be removed in future.
|
| 68 |
+
*
|
| 69 |
+
* \param heap_handle The corresponding heap.
|
| 70 |
+
* \returns true if the last garbage collection was finalized conservatively,
|
| 71 |
+
* and false otherwise.
|
| 72 |
+
*/
|
| 73 |
+
static bool PreviousGCWasConservative(const HeapHandle& heap_handle);
|
| 74 |
+
|
| 75 |
+
private:
|
| 76 |
+
HeapState() = delete;
|
| 77 |
+
};
|
| 78 |
+
|
| 79 |
+
} // namespace subtle
|
| 80 |
+
} // namespace cppgc
|
| 81 |
+
|
| 82 |
+
#endif // INCLUDE_CPPGC_HEAP_STATE_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap-statistics.h
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2021 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_HEAP_STATISTICS_H_
|
| 6 |
+
#define INCLUDE_CPPGC_HEAP_STATISTICS_H_
|
| 7 |
+
|
| 8 |
+
#include <cstddef>
|
| 9 |
+
#include <cstdint>
|
| 10 |
+
#include <string>
|
| 11 |
+
#include <vector>
|
| 12 |
+
|
| 13 |
+
namespace cppgc {
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* `HeapStatistics` contains memory consumption and utilization statistics for a
|
| 17 |
+
* cppgc heap.
|
| 18 |
+
*/
|
| 19 |
+
struct HeapStatistics final {
|
| 20 |
+
/**
|
| 21 |
+
* Specifies the detail level of the heap statistics. Brief statistics contain
|
| 22 |
+
* only the top-level allocated and used memory statistics for the entire
|
| 23 |
+
* heap. Detailed statistics also contain a break down per space and page, as
|
| 24 |
+
* well as freelist statistics and object type histograms. Note that used
|
| 25 |
+
* memory reported by brief statistics and detailed statistics might differ
|
| 26 |
+
* slightly.
|
| 27 |
+
*/
|
| 28 |
+
enum DetailLevel : uint8_t {
|
| 29 |
+
kBrief,
|
| 30 |
+
kDetailed,
|
| 31 |
+
};
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Object statistics for a single type.
|
| 35 |
+
*/
|
| 36 |
+
struct ObjectStatsEntry {
|
| 37 |
+
/**
|
| 38 |
+
* Number of allocated bytes.
|
| 39 |
+
*/
|
| 40 |
+
size_t allocated_bytes;
|
| 41 |
+
/**
|
| 42 |
+
* Number of allocated objects.
|
| 43 |
+
*/
|
| 44 |
+
size_t object_count;
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* Page granularity statistics. For each page the statistics record the
|
| 49 |
+
* allocated memory size and overall used memory size for the page.
|
| 50 |
+
*/
|
| 51 |
+
struct PageStatistics {
|
| 52 |
+
/** Overall committed amount of memory for the page. */
|
| 53 |
+
size_t committed_size_bytes = 0;
|
| 54 |
+
/** Resident amount of memory held by the page. */
|
| 55 |
+
size_t resident_size_bytes = 0;
|
| 56 |
+
/** Amount of memory actually used on the page. */
|
| 57 |
+
size_t used_size_bytes = 0;
|
| 58 |
+
/** Statistics for object allocated on the page. Filled only when
|
| 59 |
+
* NameProvider::SupportsCppClassNamesAsObjectNames() is true. */
|
| 60 |
+
std::vector<ObjectStatsEntry> object_statistics;
|
| 61 |
+
};
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* Statistics of the freelist (used only in non-large object spaces). For
|
| 65 |
+
* each bucket in the freelist the statistics record the bucket size, the
|
| 66 |
+
* number of freelist entries in the bucket, and the overall allocated memory
|
| 67 |
+
* consumed by these freelist entries.
|
| 68 |
+
*/
|
| 69 |
+
struct FreeListStatistics {
|
| 70 |
+
/** bucket sizes in the freelist. */
|
| 71 |
+
std::vector<size_t> bucket_size;
|
| 72 |
+
/** number of freelist entries per bucket. */
|
| 73 |
+
std::vector<size_t> free_count;
|
| 74 |
+
/** memory size consumed by freelist entries per size. */
|
| 75 |
+
std::vector<size_t> free_size;
|
| 76 |
+
};
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* Space granularity statistics. For each space the statistics record the
|
| 80 |
+
* space name, the amount of allocated memory and overall used memory for the
|
| 81 |
+
* space. The statistics also contain statistics for each of the space's
|
| 82 |
+
* pages, its freelist and the objects allocated on the space.
|
| 83 |
+
*/
|
| 84 |
+
struct SpaceStatistics {
|
| 85 |
+
/** The space name */
|
| 86 |
+
std::string name;
|
| 87 |
+
/** Overall committed amount of memory for the heap. */
|
| 88 |
+
size_t committed_size_bytes = 0;
|
| 89 |
+
/** Resident amount of memory held by the heap. */
|
| 90 |
+
size_t resident_size_bytes = 0;
|
| 91 |
+
/** Amount of memory actually used on the space. */
|
| 92 |
+
size_t used_size_bytes = 0;
|
| 93 |
+
/** Statistics for each of the pages in the space. */
|
| 94 |
+
std::vector<PageStatistics> page_stats;
|
| 95 |
+
/** Statistics for the freelist of the space. */
|
| 96 |
+
FreeListStatistics free_list_stats;
|
| 97 |
+
};
|
| 98 |
+
|
| 99 |
+
/** Overall committed amount of memory for the heap. */
|
| 100 |
+
size_t committed_size_bytes = 0;
|
| 101 |
+
/** Resident amount of memory held by the heap. */
|
| 102 |
+
size_t resident_size_bytes = 0;
|
| 103 |
+
/** Amount of memory actually used on the heap. */
|
| 104 |
+
size_t used_size_bytes = 0;
|
| 105 |
+
/** Memory retained in the page pool, not used directly by the heap. */
|
| 106 |
+
size_t pooled_memory_size_bytes = 0;
|
| 107 |
+
/** Detail level of this HeapStatistics. */
|
| 108 |
+
DetailLevel detail_level;
|
| 109 |
+
|
| 110 |
+
/** Statistics for each of the spaces in the heap. Filled only when
|
| 111 |
+
* `detail_level` is `DetailLevel::kDetailed`. */
|
| 112 |
+
std::vector<SpaceStatistics> space_stats;
|
| 113 |
+
|
| 114 |
+
/**
|
| 115 |
+
* Vector of `cppgc::GarbageCollected` type names.
|
| 116 |
+
*/
|
| 117 |
+
std::vector<std::string> type_names;
|
| 118 |
+
};
|
| 119 |
+
|
| 120 |
+
} // namespace cppgc
|
| 121 |
+
|
| 122 |
+
#endif // INCLUDE_CPPGC_HEAP_STATISTICS_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap.h
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_HEAP_H_
|
| 6 |
+
#define INCLUDE_CPPGC_HEAP_H_
|
| 7 |
+
|
| 8 |
+
#include <cstddef>
|
| 9 |
+
#include <cstdint>
|
| 10 |
+
#include <memory>
|
| 11 |
+
#include <vector>
|
| 12 |
+
|
| 13 |
+
#include "cppgc/common.h"
|
| 14 |
+
#include "cppgc/custom-space.h"
|
| 15 |
+
#include "cppgc/platform.h"
|
| 16 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 17 |
+
|
| 18 |
+
/**
|
| 19 |
+
* cppgc - A C++ garbage collection library.
|
| 20 |
+
*/
|
| 21 |
+
namespace cppgc {
|
| 22 |
+
|
| 23 |
+
class AllocationHandle;
|
| 24 |
+
class HeapHandle;
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* Implementation details of cppgc. Those details are considered internal and
|
| 28 |
+
* may change at any point in time without notice. Users should never rely on
|
| 29 |
+
* the contents of this namespace.
|
| 30 |
+
*/
|
| 31 |
+
namespace internal {
|
| 32 |
+
class Heap;
|
| 33 |
+
} // namespace internal
|
| 34 |
+
|
| 35 |
+
class V8_EXPORT Heap {
|
| 36 |
+
public:
|
| 37 |
+
/**
|
| 38 |
+
* Specifies the stack state the embedder is in.
|
| 39 |
+
*/
|
| 40 |
+
using StackState = EmbedderStackState;
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* Specifies whether conservative stack scanning is supported.
|
| 44 |
+
*/
|
| 45 |
+
enum class StackSupport : uint8_t {
|
| 46 |
+
/**
|
| 47 |
+
* Conservative stack scan is supported.
|
| 48 |
+
*/
|
| 49 |
+
kSupportsConservativeStackScan,
|
| 50 |
+
/**
|
| 51 |
+
* Conservative stack scan is not supported. Embedders may use this option
|
| 52 |
+
* when using custom infrastructure that is unsupported by the library.
|
| 53 |
+
*/
|
| 54 |
+
kNoConservativeStackScan,
|
| 55 |
+
};
|
| 56 |
+
|
| 57 |
+
/**
|
| 58 |
+
* Specifies supported marking types.
|
| 59 |
+
*/
|
| 60 |
+
enum class MarkingType : uint8_t {
|
| 61 |
+
/**
|
| 62 |
+
* Atomic stop-the-world marking. This option does not require any write
|
| 63 |
+
* barriers but is the most intrusive in terms of jank.
|
| 64 |
+
*/
|
| 65 |
+
kAtomic,
|
| 66 |
+
/**
|
| 67 |
+
* Incremental marking interleaves marking with the rest of the application
|
| 68 |
+
* workload on the same thread.
|
| 69 |
+
*/
|
| 70 |
+
kIncremental,
|
| 71 |
+
/**
|
| 72 |
+
* Incremental and concurrent marking.
|
| 73 |
+
*/
|
| 74 |
+
kIncrementalAndConcurrent
|
| 75 |
+
};
|
| 76 |
+
|
| 77 |
+
/**
|
| 78 |
+
* Specifies supported sweeping types.
|
| 79 |
+
*/
|
| 80 |
+
enum class SweepingType : uint8_t {
|
| 81 |
+
/**
|
| 82 |
+
* Atomic stop-the-world sweeping. All of sweeping is performed at once.
|
| 83 |
+
*/
|
| 84 |
+
kAtomic,
|
| 85 |
+
/**
|
| 86 |
+
* Incremental sweeping interleaves sweeping with the rest of the
|
| 87 |
+
* application workload on the same thread.
|
| 88 |
+
*/
|
| 89 |
+
kIncremental,
|
| 90 |
+
/**
|
| 91 |
+
* Incremental and concurrent sweeping. Sweeping is split and interleaved
|
| 92 |
+
* with the rest of the application.
|
| 93 |
+
*/
|
| 94 |
+
kIncrementalAndConcurrent
|
| 95 |
+
};
|
| 96 |
+
|
| 97 |
+
/**
|
| 98 |
+
* Constraints for a Heap setup.
|
| 99 |
+
*/
|
| 100 |
+
struct ResourceConstraints {
|
| 101 |
+
/**
|
| 102 |
+
* Allows the heap to grow to some initial size in bytes before triggering
|
| 103 |
+
* garbage collections. This is useful when it is known that applications
|
| 104 |
+
* need a certain minimum heap to run to avoid repeatedly invoking the
|
| 105 |
+
* garbage collector when growing the heap.
|
| 106 |
+
*/
|
| 107 |
+
size_t initial_heap_size_bytes = 0;
|
| 108 |
+
};
|
| 109 |
+
|
| 110 |
+
/**
|
| 111 |
+
* Options specifying Heap properties (e.g. custom spaces) when initializing a
|
| 112 |
+
* heap through `Heap::Create()`.
|
| 113 |
+
*/
|
| 114 |
+
struct HeapOptions {
|
| 115 |
+
/**
|
| 116 |
+
* Creates reasonable defaults for instantiating a Heap.
|
| 117 |
+
*
|
| 118 |
+
* \returns the HeapOptions that can be passed to `Heap::Create()`.
|
| 119 |
+
*/
|
| 120 |
+
static HeapOptions Default() { return {}; }
|
| 121 |
+
|
| 122 |
+
/**
|
| 123 |
+
* Custom spaces added to heap are required to have indices forming a
|
| 124 |
+
* numbered sequence starting at 0, i.e., their `kSpaceIndex` must
|
| 125 |
+
* correspond to the index they reside in the vector.
|
| 126 |
+
*/
|
| 127 |
+
std::vector<std::unique_ptr<CustomSpaceBase>> custom_spaces;
|
| 128 |
+
|
| 129 |
+
/**
|
| 130 |
+
* Specifies whether conservative stack scan is supported. When conservative
|
| 131 |
+
* stack scan is not supported, the collector may try to invoke
|
| 132 |
+
* garbage collections using non-nestable task, which are guaranteed to have
|
| 133 |
+
* no interesting stack, through the provided Platform. If such tasks are
|
| 134 |
+
* not supported by the Platform, the embedder must take care of invoking
|
| 135 |
+
* the GC through `ForceGarbageCollectionSlow()`.
|
| 136 |
+
*/
|
| 137 |
+
StackSupport stack_support = StackSupport::kSupportsConservativeStackScan;
|
| 138 |
+
|
| 139 |
+
/**
|
| 140 |
+
* Specifies which types of marking are supported by the heap.
|
| 141 |
+
*/
|
| 142 |
+
MarkingType marking_support = MarkingType::kIncrementalAndConcurrent;
|
| 143 |
+
|
| 144 |
+
/**
|
| 145 |
+
* Specifies which types of sweeping are supported by the heap.
|
| 146 |
+
*/
|
| 147 |
+
SweepingType sweeping_support = SweepingType::kIncrementalAndConcurrent;
|
| 148 |
+
|
| 149 |
+
/**
|
| 150 |
+
* Resource constraints specifying various properties that the internal
|
| 151 |
+
* GC scheduler follows.
|
| 152 |
+
*/
|
| 153 |
+
ResourceConstraints resource_constraints;
|
| 154 |
+
};
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* Creates a new heap that can be used for object allocation.
|
| 158 |
+
*
|
| 159 |
+
* \param platform implemented and provided by the embedder.
|
| 160 |
+
* \param options HeapOptions specifying various properties for the Heap.
|
| 161 |
+
* \returns a new Heap instance.
|
| 162 |
+
*/
|
| 163 |
+
static std::unique_ptr<Heap> Create(
|
| 164 |
+
std::shared_ptr<Platform> platform,
|
| 165 |
+
HeapOptions options = HeapOptions::Default());
|
| 166 |
+
|
| 167 |
+
virtual ~Heap() = default;
|
| 168 |
+
|
| 169 |
+
/**
|
| 170 |
+
* Forces garbage collection.
|
| 171 |
+
*
|
| 172 |
+
* \param source String specifying the source (or caller) triggering a
|
| 173 |
+
* forced garbage collection.
|
| 174 |
+
* \param reason String specifying the reason for the forced garbage
|
| 175 |
+
* collection.
|
| 176 |
+
* \param stack_state The embedder stack state, see StackState.
|
| 177 |
+
*/
|
| 178 |
+
void ForceGarbageCollectionSlow(
|
| 179 |
+
const char* source, const char* reason,
|
| 180 |
+
StackState stack_state = StackState::kMayContainHeapPointers);
|
| 181 |
+
|
| 182 |
+
/**
|
| 183 |
+
* \returns the opaque handle for allocating objects using
|
| 184 |
+
* `MakeGarbageCollected()`.
|
| 185 |
+
*/
|
| 186 |
+
AllocationHandle& GetAllocationHandle();
|
| 187 |
+
|
| 188 |
+
/**
|
| 189 |
+
* \returns the opaque heap handle which may be used to refer to this heap in
|
| 190 |
+
* other APIs. Valid as long as the underlying `Heap` is alive.
|
| 191 |
+
*/
|
| 192 |
+
HeapHandle& GetHeapHandle();
|
| 193 |
+
|
| 194 |
+
private:
|
| 195 |
+
Heap() = default;
|
| 196 |
+
|
| 197 |
+
friend class internal::Heap;
|
| 198 |
+
};
|
| 199 |
+
|
| 200 |
+
} // namespace cppgc
|
| 201 |
+
|
| 202 |
+
#endif // INCLUDE_CPPGC_HEAP_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/macros.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_MACROS_H_
|
| 6 |
+
#define INCLUDE_CPPGC_MACROS_H_
|
| 7 |
+
|
| 8 |
+
#include <cstddef>
|
| 9 |
+
|
| 10 |
+
#include "cppgc/internal/compiler-specific.h"
|
| 11 |
+
|
| 12 |
+
namespace cppgc {
|
| 13 |
+
|
| 14 |
+
#define CPPGC_DISALLOW_NEW() \
|
| 15 |
+
public: \
|
| 16 |
+
using IsDisallowNewMarker CPPGC_UNUSED = int; \
|
| 17 |
+
void* operator new(size_t, void* location) { return location; } \
|
| 18 |
+
void* operator new(size_t) = delete; \
|
| 19 |
+
static_assert(true, "Force semicolon.")
|
| 20 |
+
|
| 21 |
+
// Use CPPGC_STACK_ALLOCATED if the object is only stack allocated.
|
| 22 |
+
// Add the CPPGC_STACK_ALLOCATED_IGNORE annotation on a case-by-case basis when
|
| 23 |
+
// enforcement of CPPGC_STACK_ALLOCATED should be suppressed.
|
| 24 |
+
#if defined(__clang__)
|
| 25 |
+
|
| 26 |
+
#define CPPGC_STACK_ALLOCATED() \
|
| 27 |
+
public: \
|
| 28 |
+
using IsStackAllocatedTypeMarker CPPGC_UNUSED = int; \
|
| 29 |
+
\
|
| 30 |
+
private: \
|
| 31 |
+
void* operator new(size_t) = delete; \
|
| 32 |
+
void* operator new(size_t, void*) = delete; \
|
| 33 |
+
static_assert(true, "Force semicolon.")
|
| 34 |
+
|
| 35 |
+
#define CPPGC_STACK_ALLOCATED_IGNORE(bug_or_reason) \
|
| 36 |
+
__attribute__((annotate("stack_allocated_ignore")))
|
| 37 |
+
|
| 38 |
+
#define CPPGC_PLUGIN_IGNORE(bug_or_reason) \
|
| 39 |
+
__attribute__((annotate("blink_gc_plugin_ignore"), \
|
| 40 |
+
annotate("stack_allocated_ignore")))
|
| 41 |
+
|
| 42 |
+
#else // !defined(__clang__)
|
| 43 |
+
|
| 44 |
+
#define CPPGC_STACK_ALLOCATED() static_assert(true, "Force semicolon.")
|
| 45 |
+
#define CPPGC_STACK_ALLOCATED_IGNORE(bug_or_reason)
|
| 46 |
+
#define CPPGC_PLUGIN_IGNORE(bug_or_reason)
|
| 47 |
+
|
| 48 |
+
#endif // !defined(__clang__)
|
| 49 |
+
|
| 50 |
+
template <typename T>
|
| 51 |
+
concept IsStackAllocatedType =
|
| 52 |
+
requires { typename T::IsStackAllocatedTypeMarker; };
|
| 53 |
+
|
| 54 |
+
} // namespace cppgc
|
| 55 |
+
|
| 56 |
+
#endif // INCLUDE_CPPGC_MACROS_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/member.h
ADDED
|
@@ -0,0 +1,663 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_MEMBER_H_
|
| 6 |
+
#define INCLUDE_CPPGC_MEMBER_H_
|
| 7 |
+
|
| 8 |
+
#include <atomic>
|
| 9 |
+
#include <cstddef>
|
| 10 |
+
#include <type_traits>
|
| 11 |
+
|
| 12 |
+
#include "cppgc/internal/api-constants.h"
|
| 13 |
+
#include "cppgc/internal/member-storage.h"
|
| 14 |
+
#include "cppgc/internal/pointer-policies.h"
|
| 15 |
+
#include "cppgc/sentinel-pointer.h"
|
| 16 |
+
#include "cppgc/type-traits.h"
|
| 17 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 18 |
+
|
| 19 |
+
namespace cppgc {
|
| 20 |
+
|
| 21 |
+
namespace subtle {
|
| 22 |
+
class HeapConsistency;
|
| 23 |
+
} // namespace subtle
|
| 24 |
+
|
| 25 |
+
class Visitor;
|
| 26 |
+
|
| 27 |
+
namespace internal {
|
| 28 |
+
|
| 29 |
+
// MemberBase always refers to the object as const object and defers to
|
| 30 |
+
// BasicMember on casting to the right type as needed.
|
| 31 |
+
template <typename StorageType>
|
| 32 |
+
class V8_TRIVIAL_ABI MemberBase {
|
| 33 |
+
public:
|
| 34 |
+
using RawStorage = StorageType;
|
| 35 |
+
|
| 36 |
+
protected:
|
| 37 |
+
struct AtomicInitializerTag {};
|
| 38 |
+
|
| 39 |
+
V8_INLINE MemberBase() = default;
|
| 40 |
+
V8_INLINE explicit MemberBase(const void* value) : raw_(value) {}
|
| 41 |
+
V8_INLINE MemberBase(const void* value, AtomicInitializerTag)
|
| 42 |
+
: raw_(value, typename RawStorage::AtomicInitializerTag{}) {}
|
| 43 |
+
|
| 44 |
+
V8_INLINE explicit MemberBase(RawStorage raw) : raw_(raw) {}
|
| 45 |
+
V8_INLINE explicit MemberBase(std::nullptr_t) : raw_(nullptr) {}
|
| 46 |
+
V8_INLINE explicit MemberBase(SentinelPointer s) : raw_(s) {}
|
| 47 |
+
|
| 48 |
+
V8_INLINE const void** GetRawSlot() const {
|
| 49 |
+
return reinterpret_cast<const void**>(const_cast<MemberBase*>(this));
|
| 50 |
+
}
|
| 51 |
+
V8_INLINE const void* GetRaw() const { return raw_.Load(); }
|
| 52 |
+
V8_INLINE void SetRaw(void* value) { raw_.Store(value); }
|
| 53 |
+
|
| 54 |
+
V8_INLINE const void* GetRawAtomic() const { return raw_.LoadAtomic(); }
|
| 55 |
+
V8_INLINE void SetRawAtomic(const void* value) { raw_.StoreAtomic(value); }
|
| 56 |
+
|
| 57 |
+
V8_INLINE RawStorage GetRawStorage() const { return raw_; }
|
| 58 |
+
V8_INLINE void SetRawStorageAtomic(RawStorage other) {
|
| 59 |
+
reinterpret_cast<std::atomic<RawStorage>&>(raw_).store(
|
| 60 |
+
other, std::memory_order_relaxed);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
V8_INLINE bool IsCleared() const { return raw_.IsCleared(); }
|
| 64 |
+
|
| 65 |
+
V8_INLINE void ClearFromGC() const { raw_.Clear(); }
|
| 66 |
+
|
| 67 |
+
private:
|
| 68 |
+
friend class MemberDebugHelper;
|
| 69 |
+
|
| 70 |
+
mutable RawStorage raw_;
|
| 71 |
+
};
|
| 72 |
+
|
| 73 |
+
// The basic class from which all Member classes are 'generated'.
|
| 74 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 75 |
+
typename CheckingPolicy, typename StorageType>
|
| 76 |
+
class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
|
| 77 |
+
private CheckingPolicy {
|
| 78 |
+
using Base = MemberBase<StorageType>;
|
| 79 |
+
|
| 80 |
+
public:
|
| 81 |
+
using PointeeType = T;
|
| 82 |
+
using RawStorage = typename Base::RawStorage;
|
| 83 |
+
|
| 84 |
+
V8_INLINE constexpr BasicMember() = default;
|
| 85 |
+
V8_INLINE constexpr BasicMember(std::nullptr_t) {} // NOLINT
|
| 86 |
+
V8_INLINE BasicMember(SentinelPointer s) : Base(s) {} // NOLINT
|
| 87 |
+
V8_INLINE BasicMember(T* raw) : Base(raw) { // NOLINT
|
| 88 |
+
InitializingWriteBarrier(raw);
|
| 89 |
+
CheckPointer(raw);
|
| 90 |
+
}
|
| 91 |
+
V8_INLINE BasicMember(T& raw) // NOLINT
|
| 92 |
+
: BasicMember(&raw) {}
|
| 93 |
+
|
| 94 |
+
// Atomic ctor. Using the AtomicInitializerTag forces BasicMember to
|
| 95 |
+
// initialize using atomic assignments. This is required for preventing
|
| 96 |
+
// data races with concurrent marking.
|
| 97 |
+
using AtomicInitializerTag = typename Base::AtomicInitializerTag;
|
| 98 |
+
V8_INLINE BasicMember(std::nullptr_t, AtomicInitializerTag atomic)
|
| 99 |
+
: Base(nullptr, atomic) {}
|
| 100 |
+
V8_INLINE BasicMember(SentinelPointer s, AtomicInitializerTag atomic)
|
| 101 |
+
: Base(s, atomic) {}
|
| 102 |
+
V8_INLINE BasicMember(T* raw, AtomicInitializerTag atomic)
|
| 103 |
+
: Base(raw, atomic) {
|
| 104 |
+
InitializingWriteBarrier(raw);
|
| 105 |
+
CheckPointer(raw);
|
| 106 |
+
}
|
| 107 |
+
V8_INLINE BasicMember(T& raw, AtomicInitializerTag atomic)
|
| 108 |
+
: BasicMember(&raw, atomic) {}
|
| 109 |
+
|
| 110 |
+
// Copy ctor.
|
| 111 |
+
V8_INLINE BasicMember(const BasicMember& other)
|
| 112 |
+
: BasicMember(other.GetRawStorage()) {}
|
| 113 |
+
|
| 114 |
+
// Heterogeneous copy constructors. When the source pointer have a different
|
| 115 |
+
// type, perform a compress-decompress round, because the source pointer may
|
| 116 |
+
// need to be adjusted.
|
| 117 |
+
template <typename U, typename OtherBarrierPolicy, typename OtherWeaknessTag,
|
| 118 |
+
typename OtherCheckingPolicy,
|
| 119 |
+
std::enable_if_t<IsDecayedSameV<T, U>>* = nullptr>
|
| 120 |
+
V8_INLINE BasicMember( // NOLINT
|
| 121 |
+
const BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy,
|
| 122 |
+
OtherCheckingPolicy, StorageType>& other)
|
| 123 |
+
: BasicMember(other.GetRawStorage()) {}
|
| 124 |
+
|
| 125 |
+
template <typename U, typename OtherBarrierPolicy, typename OtherWeaknessTag,
|
| 126 |
+
typename OtherCheckingPolicy,
|
| 127 |
+
std::enable_if_t<IsStrictlyBaseOfV<T, U>>* = nullptr>
|
| 128 |
+
V8_INLINE BasicMember( // NOLINT
|
| 129 |
+
const BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy,
|
| 130 |
+
OtherCheckingPolicy, StorageType>& other)
|
| 131 |
+
: BasicMember(other.Get()) {}
|
| 132 |
+
|
| 133 |
+
// Move ctor.
|
| 134 |
+
V8_INLINE BasicMember(BasicMember&& other) noexcept
|
| 135 |
+
: BasicMember(other.GetRawStorage()) {
|
| 136 |
+
other.Clear();
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
// Heterogeneous move constructors. When the source pointer have a different
|
| 140 |
+
// type, perform a compress-decompress round, because the source pointer may
|
| 141 |
+
// need to be adjusted.
|
| 142 |
+
template <typename U, typename OtherBarrierPolicy, typename OtherWeaknessTag,
|
| 143 |
+
typename OtherCheckingPolicy,
|
| 144 |
+
std::enable_if_t<IsDecayedSameV<T, U>>* = nullptr>
|
| 145 |
+
V8_INLINE BasicMember(
|
| 146 |
+
BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy,
|
| 147 |
+
StorageType>&& other) noexcept
|
| 148 |
+
: BasicMember(other.GetRawStorage()) {
|
| 149 |
+
other.Clear();
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
template <typename U, typename OtherBarrierPolicy, typename OtherWeaknessTag,
|
| 153 |
+
typename OtherCheckingPolicy,
|
| 154 |
+
std::enable_if_t<IsStrictlyBaseOfV<T, U>>* = nullptr>
|
| 155 |
+
V8_INLINE BasicMember(
|
| 156 |
+
BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy,
|
| 157 |
+
StorageType>&& other) noexcept
|
| 158 |
+
: BasicMember(other.Get()) {
|
| 159 |
+
other.Clear();
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
// Construction from Persistent.
|
| 163 |
+
template <typename U, typename PersistentWeaknessPolicy,
|
| 164 |
+
typename PersistentLocationPolicy,
|
| 165 |
+
typename PersistentCheckingPolicy,
|
| 166 |
+
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
|
| 167 |
+
V8_INLINE BasicMember(const BasicPersistent<U, PersistentWeaknessPolicy,
|
| 168 |
+
PersistentLocationPolicy,
|
| 169 |
+
PersistentCheckingPolicy>& p)
|
| 170 |
+
: BasicMember(p.Get()) {}
|
| 171 |
+
|
| 172 |
+
// Copy assignment.
|
| 173 |
+
V8_INLINE BasicMember& operator=(const BasicMember& other) {
|
| 174 |
+
return operator=(other.GetRawStorage());
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
// Heterogeneous copy assignment. When the source pointer have a different
|
| 178 |
+
// type, perform a compress-decompress round, because the source pointer may
|
| 179 |
+
// need to be adjusted.
|
| 180 |
+
template <typename U, typename OtherWeaknessTag, typename OtherBarrierPolicy,
|
| 181 |
+
typename OtherCheckingPolicy>
|
| 182 |
+
V8_INLINE BasicMember& operator=(
|
| 183 |
+
const BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy,
|
| 184 |
+
OtherCheckingPolicy, StorageType>& other) {
|
| 185 |
+
if constexpr (IsDecayedSameV<T, U>) {
|
| 186 |
+
return operator=(other.GetRawStorage());
|
| 187 |
+
} else {
|
| 188 |
+
static_assert(IsStrictlyBaseOfV<T, U>);
|
| 189 |
+
return operator=(other.Get());
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
// Move assignment.
|
| 194 |
+
V8_INLINE BasicMember& operator=(BasicMember&& other) noexcept {
|
| 195 |
+
operator=(other.GetRawStorage());
|
| 196 |
+
other.Clear();
|
| 197 |
+
return *this;
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
// Heterogeneous move assignment. When the source pointer have a different
|
| 201 |
+
// type, perform a compress-decompress round, because the source pointer may
|
| 202 |
+
// need to be adjusted.
|
| 203 |
+
template <typename U, typename OtherWeaknessTag, typename OtherBarrierPolicy,
|
| 204 |
+
typename OtherCheckingPolicy>
|
| 205 |
+
V8_INLINE BasicMember& operator=(
|
| 206 |
+
BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy,
|
| 207 |
+
StorageType>&& other) noexcept {
|
| 208 |
+
if constexpr (IsDecayedSameV<T, U>) {
|
| 209 |
+
operator=(other.GetRawStorage());
|
| 210 |
+
} else {
|
| 211 |
+
static_assert(IsStrictlyBaseOfV<T, U>);
|
| 212 |
+
operator=(other.Get());
|
| 213 |
+
}
|
| 214 |
+
other.Clear();
|
| 215 |
+
return *this;
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
// Assignment from Persistent.
|
| 219 |
+
template <typename U, typename PersistentWeaknessPolicy,
|
| 220 |
+
typename PersistentLocationPolicy,
|
| 221 |
+
typename PersistentCheckingPolicy,
|
| 222 |
+
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
|
| 223 |
+
V8_INLINE BasicMember& operator=(
|
| 224 |
+
const BasicPersistent<U, PersistentWeaknessPolicy,
|
| 225 |
+
PersistentLocationPolicy, PersistentCheckingPolicy>&
|
| 226 |
+
other) {
|
| 227 |
+
return operator=(other.Get());
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
V8_INLINE BasicMember& operator=(T* other) {
|
| 231 |
+
Base::SetRawAtomic(other);
|
| 232 |
+
AssigningWriteBarrier(other);
|
| 233 |
+
CheckPointer(other);
|
| 234 |
+
return *this;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
V8_INLINE BasicMember& operator=(std::nullptr_t) {
|
| 238 |
+
Clear();
|
| 239 |
+
return *this;
|
| 240 |
+
}
|
| 241 |
+
V8_INLINE BasicMember& operator=(SentinelPointer s) {
|
| 242 |
+
Base::SetRawAtomic(s);
|
| 243 |
+
return *this;
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
template <typename OtherWeaknessTag, typename OtherBarrierPolicy,
|
| 247 |
+
typename OtherCheckingPolicy>
|
| 248 |
+
V8_INLINE void Swap(BasicMember<T, OtherWeaknessTag, OtherBarrierPolicy,
|
| 249 |
+
OtherCheckingPolicy, StorageType>& other) {
|
| 250 |
+
auto tmp = GetRawStorage();
|
| 251 |
+
*this = other;
|
| 252 |
+
other = tmp;
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
V8_INLINE explicit operator bool() const { return !Base::IsCleared(); }
|
| 256 |
+
V8_INLINE operator T*() const { return Get(); }
|
| 257 |
+
V8_INLINE T* operator->() const { return Get(); }
|
| 258 |
+
V8_INLINE T& operator*() const { return *Get(); }
|
| 259 |
+
|
| 260 |
+
// CFI cast exemption to allow passing SentinelPointer through T* and support
|
| 261 |
+
// heterogeneous assignments between different Member and Persistent handles
|
| 262 |
+
// based on their actual types.
|
| 263 |
+
V8_INLINE V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const {
|
| 264 |
+
// Executed by the mutator, hence non atomic load.
|
| 265 |
+
//
|
| 266 |
+
// The const_cast below removes the constness from MemberBase storage. The
|
| 267 |
+
// following static_cast re-adds any constness if specified through the
|
| 268 |
+
// user-visible template parameter T.
|
| 269 |
+
return static_cast<T*>(const_cast<void*>(Base::GetRaw()));
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
V8_INLINE void Clear() { Base::SetRawStorageAtomic(RawStorage{}); }
|
| 273 |
+
|
| 274 |
+
V8_INLINE T* Release() {
|
| 275 |
+
T* result = Get();
|
| 276 |
+
Clear();
|
| 277 |
+
return result;
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
V8_INLINE const T** GetSlotForTesting() const {
|
| 281 |
+
return reinterpret_cast<const T**>(Base::GetRawSlot());
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
V8_INLINE RawStorage GetRawStorage() const { return Base::GetRawStorage(); }
|
| 285 |
+
|
| 286 |
+
private:
|
| 287 |
+
V8_INLINE explicit BasicMember(RawStorage raw) : Base(raw) {
|
| 288 |
+
InitializingWriteBarrier();
|
| 289 |
+
CheckPointer();
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
V8_INLINE BasicMember& operator=(RawStorage other) {
|
| 293 |
+
Base::SetRawStorageAtomic(other);
|
| 294 |
+
AssigningWriteBarrier();
|
| 295 |
+
CheckPointer();
|
| 296 |
+
return *this;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
V8_INLINE const T* GetRawAtomic() const {
|
| 300 |
+
return static_cast<const T*>(Base::GetRawAtomic());
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
V8_INLINE void InitializingWriteBarrier(T* value) const {
|
| 304 |
+
WriteBarrierPolicy::InitializingBarrier(Base::GetRawSlot(), value);
|
| 305 |
+
}
|
| 306 |
+
V8_INLINE void InitializingWriteBarrier() const {
|
| 307 |
+
WriteBarrierPolicy::InitializingBarrier(Base::GetRawSlot(),
|
| 308 |
+
Base::GetRawStorage());
|
| 309 |
+
}
|
| 310 |
+
V8_INLINE void AssigningWriteBarrier(T* value) const {
|
| 311 |
+
WriteBarrierPolicy::template AssigningBarrier<
|
| 312 |
+
StorageType::kWriteBarrierSlotType>(Base::GetRawSlot(), value);
|
| 313 |
+
}
|
| 314 |
+
V8_INLINE void AssigningWriteBarrier() const {
|
| 315 |
+
WriteBarrierPolicy::template AssigningBarrier<
|
| 316 |
+
StorageType::kWriteBarrierSlotType>(Base::GetRawSlot(),
|
| 317 |
+
Base::GetRawStorage());
|
| 318 |
+
}
|
| 319 |
+
V8_INLINE void CheckPointer(T* value) {
|
| 320 |
+
CheckingPolicy::template CheckPointer<T>(value);
|
| 321 |
+
}
|
| 322 |
+
V8_INLINE void CheckPointer() {
|
| 323 |
+
CheckingPolicy::template CheckPointer<T>(Base::GetRawStorage());
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
V8_INLINE void ClearFromGC() const { Base::ClearFromGC(); }
|
| 327 |
+
|
| 328 |
+
V8_INLINE T* GetFromGC() const { return Get(); }
|
| 329 |
+
|
| 330 |
+
friend class cppgc::subtle::HeapConsistency;
|
| 331 |
+
friend class cppgc::Visitor;
|
| 332 |
+
template <typename U>
|
| 333 |
+
friend struct cppgc::TraceTrait;
|
| 334 |
+
template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
|
| 335 |
+
typename CheckingPolicy1, typename StorageType1>
|
| 336 |
+
friend class BasicMember;
|
| 337 |
+
};
|
| 338 |
+
|
| 339 |
+
// Member equality operators.
|
| 340 |
+
template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
|
| 341 |
+
typename CheckingPolicy1, typename T2, typename WeaknessTag2,
|
| 342 |
+
typename WriteBarrierPolicy2, typename CheckingPolicy2,
|
| 343 |
+
typename StorageType>
|
| 344 |
+
V8_INLINE bool operator==(
|
| 345 |
+
const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
|
| 346 |
+
StorageType>& member1,
|
| 347 |
+
const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
|
| 348 |
+
StorageType>& member2) {
|
| 349 |
+
if constexpr (IsDecayedSameV<T1, T2>) {
|
| 350 |
+
// Check compressed pointers if types are the same.
|
| 351 |
+
return member1.GetRawStorage() == member2.GetRawStorage();
|
| 352 |
+
} else {
|
| 353 |
+
static_assert(IsStrictlyBaseOfV<T1, T2> || IsStrictlyBaseOfV<T2, T1>);
|
| 354 |
+
// Otherwise, check decompressed pointers.
|
| 355 |
+
return member1.Get() == member2.Get();
|
| 356 |
+
}
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
|
| 360 |
+
typename CheckingPolicy1, typename T2, typename WeaknessTag2,
|
| 361 |
+
typename WriteBarrierPolicy2, typename CheckingPolicy2,
|
| 362 |
+
typename StorageType>
|
| 363 |
+
V8_INLINE bool operator!=(
|
| 364 |
+
const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
|
| 365 |
+
StorageType>& member1,
|
| 366 |
+
const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
|
| 367 |
+
StorageType>& member2) {
|
| 368 |
+
return !(member1 == member2);
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
// Equality with raw pointers.
|
| 372 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 373 |
+
typename CheckingPolicy, typename StorageType, typename U>
|
| 374 |
+
V8_INLINE bool operator==(
|
| 375 |
+
const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
|
| 376 |
+
StorageType>& member,
|
| 377 |
+
U* raw) {
|
| 378 |
+
// Never allow comparison with erased pointers.
|
| 379 |
+
static_assert(!IsDecayedSameV<void, U>);
|
| 380 |
+
|
| 381 |
+
if constexpr (IsDecayedSameV<T, U>) {
|
| 382 |
+
// Check compressed pointers if types are the same.
|
| 383 |
+
return member.GetRawStorage() == StorageType(raw);
|
| 384 |
+
} else if constexpr (IsStrictlyBaseOfV<T, U>) {
|
| 385 |
+
// Cast the raw pointer to T, which may adjust the pointer.
|
| 386 |
+
return member.GetRawStorage() == StorageType(static_cast<T*>(raw));
|
| 387 |
+
} else {
|
| 388 |
+
// Otherwise, decompressed the member.
|
| 389 |
+
return member.Get() == raw;
|
| 390 |
+
}
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 394 |
+
typename CheckingPolicy, typename StorageType, typename U>
|
| 395 |
+
V8_INLINE bool operator!=(
|
| 396 |
+
const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
|
| 397 |
+
StorageType>& member,
|
| 398 |
+
U* raw) {
|
| 399 |
+
return !(member == raw);
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
template <typename T, typename U, typename WeaknessTag,
|
| 403 |
+
typename WriteBarrierPolicy, typename CheckingPolicy,
|
| 404 |
+
typename StorageType>
|
| 405 |
+
V8_INLINE bool operator==(
|
| 406 |
+
T* raw, const BasicMember<U, WeaknessTag, WriteBarrierPolicy,
|
| 407 |
+
CheckingPolicy, StorageType>& member) {
|
| 408 |
+
return member == raw;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
template <typename T, typename U, typename WeaknessTag,
|
| 412 |
+
typename WriteBarrierPolicy, typename CheckingPolicy,
|
| 413 |
+
typename StorageType>
|
| 414 |
+
V8_INLINE bool operator!=(
|
| 415 |
+
T* raw, const BasicMember<U, WeaknessTag, WriteBarrierPolicy,
|
| 416 |
+
CheckingPolicy, StorageType>& member) {
|
| 417 |
+
return !(raw == member);
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
// Equality with sentinel.
|
| 421 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 422 |
+
typename CheckingPolicy, typename StorageType>
|
| 423 |
+
V8_INLINE bool operator==(
|
| 424 |
+
const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
|
| 425 |
+
StorageType>& member,
|
| 426 |
+
SentinelPointer) {
|
| 427 |
+
return member.GetRawStorage().IsSentinel();
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 431 |
+
typename CheckingPolicy, typename StorageType>
|
| 432 |
+
V8_INLINE bool operator!=(
|
| 433 |
+
const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
|
| 434 |
+
StorageType>& member,
|
| 435 |
+
SentinelPointer s) {
|
| 436 |
+
return !(member == s);
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 440 |
+
typename CheckingPolicy, typename StorageType>
|
| 441 |
+
V8_INLINE bool operator==(
|
| 442 |
+
SentinelPointer s, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
|
| 443 |
+
CheckingPolicy, StorageType>& member) {
|
| 444 |
+
return member == s;
|
| 445 |
+
}
|
| 446 |
+
|
| 447 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 448 |
+
typename CheckingPolicy, typename StorageType>
|
| 449 |
+
V8_INLINE bool operator!=(
|
| 450 |
+
SentinelPointer s, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
|
| 451 |
+
CheckingPolicy, StorageType>& member) {
|
| 452 |
+
return !(s == member);
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
// Equality with nullptr.
|
| 456 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 457 |
+
typename CheckingPolicy, typename StorageType>
|
| 458 |
+
V8_INLINE bool operator==(
|
| 459 |
+
const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
|
| 460 |
+
StorageType>& member,
|
| 461 |
+
std::nullptr_t) {
|
| 462 |
+
return !static_cast<bool>(member);
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 466 |
+
typename CheckingPolicy, typename StorageType>
|
| 467 |
+
V8_INLINE bool operator!=(
|
| 468 |
+
const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
|
| 469 |
+
StorageType>& member,
|
| 470 |
+
std::nullptr_t n) {
|
| 471 |
+
return !(member == n);
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 475 |
+
typename CheckingPolicy, typename StorageType>
|
| 476 |
+
V8_INLINE bool operator==(
|
| 477 |
+
std::nullptr_t n, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
|
| 478 |
+
CheckingPolicy, StorageType>& member) {
|
| 479 |
+
return member == n;
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 483 |
+
typename CheckingPolicy, typename StorageType>
|
| 484 |
+
V8_INLINE bool operator!=(
|
| 485 |
+
std::nullptr_t n, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
|
| 486 |
+
CheckingPolicy, StorageType>& member) {
|
| 487 |
+
return !(n == member);
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
// Relational operators.
|
| 491 |
+
template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
|
| 492 |
+
typename CheckingPolicy1, typename T2, typename WeaknessTag2,
|
| 493 |
+
typename WriteBarrierPolicy2, typename CheckingPolicy2,
|
| 494 |
+
typename StorageType>
|
| 495 |
+
V8_INLINE bool operator<(
|
| 496 |
+
const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
|
| 497 |
+
StorageType>& member1,
|
| 498 |
+
const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
|
| 499 |
+
StorageType>& member2) {
|
| 500 |
+
static_assert(
|
| 501 |
+
IsDecayedSameV<T1, T2>,
|
| 502 |
+
"Comparison works only for same pointer type modulo cv-qualifiers");
|
| 503 |
+
return member1.GetRawStorage() < member2.GetRawStorage();
|
| 504 |
+
}
|
| 505 |
+
|
| 506 |
+
template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
|
| 507 |
+
typename CheckingPolicy1, typename T2, typename WeaknessTag2,
|
| 508 |
+
typename WriteBarrierPolicy2, typename CheckingPolicy2,
|
| 509 |
+
typename StorageType>
|
| 510 |
+
V8_INLINE bool operator<=(
|
| 511 |
+
const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
|
| 512 |
+
StorageType>& member1,
|
| 513 |
+
const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
|
| 514 |
+
StorageType>& member2) {
|
| 515 |
+
static_assert(
|
| 516 |
+
IsDecayedSameV<T1, T2>,
|
| 517 |
+
"Comparison works only for same pointer type modulo cv-qualifiers");
|
| 518 |
+
return member1.GetRawStorage() <= member2.GetRawStorage();
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
|
| 522 |
+
typename CheckingPolicy1, typename T2, typename WeaknessTag2,
|
| 523 |
+
typename WriteBarrierPolicy2, typename CheckingPolicy2,
|
| 524 |
+
typename StorageType>
|
| 525 |
+
V8_INLINE bool operator>(
|
| 526 |
+
const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
|
| 527 |
+
StorageType>& member1,
|
| 528 |
+
const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
|
| 529 |
+
StorageType>& member2) {
|
| 530 |
+
static_assert(
|
| 531 |
+
IsDecayedSameV<T1, T2>,
|
| 532 |
+
"Comparison works only for same pointer type modulo cv-qualifiers");
|
| 533 |
+
return member1.GetRawStorage() > member2.GetRawStorage();
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
|
| 537 |
+
typename CheckingPolicy1, typename T2, typename WeaknessTag2,
|
| 538 |
+
typename WriteBarrierPolicy2, typename CheckingPolicy2,
|
| 539 |
+
typename StorageType>
|
| 540 |
+
V8_INLINE bool operator>=(
|
| 541 |
+
const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
|
| 542 |
+
StorageType>& member1,
|
| 543 |
+
const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
|
| 544 |
+
StorageType>& member2) {
|
| 545 |
+
static_assert(
|
| 546 |
+
IsDecayedSameV<T1, T2>,
|
| 547 |
+
"Comparison works only for same pointer type modulo cv-qualifiers");
|
| 548 |
+
return member1.GetRawStorage() >= member2.GetRawStorage();
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
template <typename T, typename WriteBarrierPolicy, typename CheckingPolicy,
|
| 552 |
+
typename StorageType>
|
| 553 |
+
struct IsWeak<BasicMember<T, WeakMemberTag, WriteBarrierPolicy, CheckingPolicy,
|
| 554 |
+
StorageType>> : std::true_type {};
|
| 555 |
+
|
| 556 |
+
} // namespace internal
|
| 557 |
+
|
| 558 |
+
/**
|
| 559 |
+
* Members are used in classes to contain strong pointers to other garbage
|
| 560 |
+
* collected objects. All Member fields of a class must be traced in the class'
|
| 561 |
+
* trace method.
|
| 562 |
+
*/
|
| 563 |
+
template <typename T>
|
| 564 |
+
using Member = internal::BasicMember<
|
| 565 |
+
T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
|
| 566 |
+
internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage>;
|
| 567 |
+
|
| 568 |
+
/**
|
| 569 |
+
* WeakMember is similar to Member in that it is used to point to other garbage
|
| 570 |
+
* collected objects. However instead of creating a strong pointer to the
|
| 571 |
+
* object, the WeakMember creates a weak pointer, which does not keep the
|
| 572 |
+
* pointee alive. Hence if all pointers to to a heap allocated object are weak
|
| 573 |
+
* the object will be garbage collected. At the time of GC the weak pointers
|
| 574 |
+
* will automatically be set to null.
|
| 575 |
+
*/
|
| 576 |
+
template <typename T>
|
| 577 |
+
using WeakMember = internal::BasicMember<
|
| 578 |
+
T, internal::WeakMemberTag, internal::DijkstraWriteBarrierPolicy,
|
| 579 |
+
internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage>;
|
| 580 |
+
|
| 581 |
+
/**
|
| 582 |
+
* UntracedMember is a pointer to an on-heap object that is not traced for some
|
| 583 |
+
* reason. Do not use this unless you know what you are doing. Keeping raw
|
| 584 |
+
* pointers to on-heap objects is prohibited unless used from stack. Pointee
|
| 585 |
+
* must be kept alive through other means.
|
| 586 |
+
*/
|
| 587 |
+
template <typename T>
|
| 588 |
+
using UntracedMember = internal::BasicMember<
|
| 589 |
+
T, internal::UntracedMemberTag, internal::NoWriteBarrierPolicy,
|
| 590 |
+
internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage>;
|
| 591 |
+
|
| 592 |
+
namespace subtle {
|
| 593 |
+
|
| 594 |
+
/**
|
| 595 |
+
* UncompressedMember. Use with care in hot paths that would otherwise cause
|
| 596 |
+
* many decompression cycles.
|
| 597 |
+
*/
|
| 598 |
+
template <typename T>
|
| 599 |
+
using UncompressedMember = internal::BasicMember<
|
| 600 |
+
T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
|
| 601 |
+
internal::DefaultMemberCheckingPolicy, internal::RawPointer>;
|
| 602 |
+
|
| 603 |
+
#if defined(CPPGC_POINTER_COMPRESSION)
|
| 604 |
+
/**
|
| 605 |
+
* CompressedMember. Default implementation of cppgc::Member on builds with
|
| 606 |
+
* pointer compression.
|
| 607 |
+
*/
|
| 608 |
+
template <typename T>
|
| 609 |
+
using CompressedMember = internal::BasicMember<
|
| 610 |
+
T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
|
| 611 |
+
internal::DefaultMemberCheckingPolicy, internal::CompressedPointer>;
|
| 612 |
+
#endif // defined(CPPGC_POINTER_COMPRESSION)
|
| 613 |
+
|
| 614 |
+
} // namespace subtle
|
| 615 |
+
|
| 616 |
+
namespace internal {
|
| 617 |
+
|
| 618 |
+
struct Dummy;
|
| 619 |
+
|
| 620 |
+
static constexpr size_t kSizeOfMember = sizeof(Member<Dummy>);
|
| 621 |
+
static constexpr size_t kSizeOfUncompressedMember =
|
| 622 |
+
sizeof(subtle::UncompressedMember<Dummy>);
|
| 623 |
+
#if defined(CPPGC_POINTER_COMPRESSION)
|
| 624 |
+
static constexpr size_t kSizeofCompressedMember =
|
| 625 |
+
sizeof(subtle::CompressedMember<Dummy>);
|
| 626 |
+
#endif // defined(CPPGC_POINTER_COMPRESSION)
|
| 627 |
+
|
| 628 |
+
} // namespace internal
|
| 629 |
+
|
| 630 |
+
} // namespace cppgc
|
| 631 |
+
|
| 632 |
+
// Mark `BasicMember<T>` and `T*` as having a common reference type of `T*` (the
|
| 633 |
+
// type to which both can be converted or bound). This makes them satisfy
|
| 634 |
+
// `std::equality_comparable`, which allows usage like the following:
|
| 635 |
+
// ```
|
| 636 |
+
// HeapVector<Member<T>> v;
|
| 637 |
+
// T* e;
|
| 638 |
+
// auto it = std::ranges::find(v, e);
|
| 639 |
+
// ```
|
| 640 |
+
// Without this, the `find()` call above would fail to compile with an error
|
| 641 |
+
// about being unable to invoke `std::ranges::equal_to()`.
|
| 642 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 643 |
+
typename CheckingPolicy, typename StorageType,
|
| 644 |
+
template <typename> typename TQ, template <typename> typename UQ>
|
| 645 |
+
struct std::basic_common_reference<
|
| 646 |
+
cppgc::internal::BasicMember<T, WeaknessTag, WriteBarrierPolicy,
|
| 647 |
+
CheckingPolicy, StorageType>,
|
| 648 |
+
T*, TQ, UQ> {
|
| 649 |
+
using type = T*;
|
| 650 |
+
};
|
| 651 |
+
|
| 652 |
+
template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
|
| 653 |
+
typename CheckingPolicy, typename StorageType,
|
| 654 |
+
template <typename> typename TQ, template <typename> typename UQ>
|
| 655 |
+
struct std::basic_common_reference<
|
| 656 |
+
T*,
|
| 657 |
+
cppgc::internal::BasicMember<T, WeaknessTag, WriteBarrierPolicy,
|
| 658 |
+
CheckingPolicy, StorageType>,
|
| 659 |
+
TQ, UQ> {
|
| 660 |
+
using type = T*;
|
| 661 |
+
};
|
| 662 |
+
|
| 663 |
+
#endif // INCLUDE_CPPGC_MEMBER_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/name-provider.h
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_NAME_PROVIDER_H_
|
| 6 |
+
#define INCLUDE_CPPGC_NAME_PROVIDER_H_
|
| 7 |
+
|
| 8 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 9 |
+
|
| 10 |
+
namespace cppgc {
|
| 11 |
+
|
| 12 |
+
/**
|
| 13 |
+
* NameProvider allows for providing a human-readable name for garbage-collected
|
| 14 |
+
* objects.
|
| 15 |
+
*
|
| 16 |
+
* There's two cases of names to distinguish:
|
| 17 |
+
* a. Explicitly specified names via using NameProvider. Such names are always
|
| 18 |
+
* preserved in the system.
|
| 19 |
+
* b. Internal names that Oilpan infers from a C++ type on the class hierarchy
|
| 20 |
+
* of the object. This is not necessarily the type of the actually
|
| 21 |
+
* instantiated object.
|
| 22 |
+
*
|
| 23 |
+
* Depending on the build configuration, Oilpan may hide names, i.e., represent
|
| 24 |
+
* them with kHiddenName, of case b. to avoid exposing internal details.
|
| 25 |
+
*/
|
| 26 |
+
class V8_EXPORT NameProvider {
|
| 27 |
+
public:
|
| 28 |
+
/**
|
| 29 |
+
* Name that is used when hiding internals.
|
| 30 |
+
*/
|
| 31 |
+
static constexpr const char kHiddenName[] = "InternalNode";
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Name that is used in case compiler support is missing for composing a name
|
| 35 |
+
* from C++ types.
|
| 36 |
+
*/
|
| 37 |
+
static constexpr const char kNoNameDeducible[] = "<No name>";
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* Indicating whether the build supports extracting C++ names as object names.
|
| 41 |
+
*
|
| 42 |
+
* @returns true if C++ names should be hidden and represented by kHiddenName.
|
| 43 |
+
*/
|
| 44 |
+
static constexpr bool SupportsCppClassNamesAsObjectNames() {
|
| 45 |
+
#if CPPGC_SUPPORTS_OBJECT_NAMES
|
| 46 |
+
return true;
|
| 47 |
+
#else // !CPPGC_SUPPORTS_OBJECT_NAMES
|
| 48 |
+
return false;
|
| 49 |
+
#endif // !CPPGC_SUPPORTS_OBJECT_NAMES
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
virtual ~NameProvider() = default;
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Specifies a name for the garbage-collected object. Such names will never
|
| 56 |
+
* be hidden, as they are explicitly specified by the user of this API.
|
| 57 |
+
*
|
| 58 |
+
* Implementations of this function must not allocate garbage-collected
|
| 59 |
+
* objects or otherwise modify the cppgc heap.
|
| 60 |
+
*
|
| 61 |
+
* V8 may call this function while generating a heap snapshot or at other
|
| 62 |
+
* times. If V8 is currently generating a heap snapshot (according to
|
| 63 |
+
* HeapProfiler::IsTakingSnapshot), then the returned string must stay alive
|
| 64 |
+
* until the snapshot generation has completed. Otherwise, the returned string
|
| 65 |
+
* must stay alive forever. If you need a place to store a temporary string
|
| 66 |
+
* during snapshot generation, use HeapProfiler::CopyNameForHeapSnapshot.
|
| 67 |
+
*
|
| 68 |
+
* @returns a human readable name for the object.
|
| 69 |
+
*/
|
| 70 |
+
virtual const char* GetHumanReadableName() const = 0;
|
| 71 |
+
};
|
| 72 |
+
|
| 73 |
+
} // namespace cppgc
|
| 74 |
+
|
| 75 |
+
#endif // INCLUDE_CPPGC_NAME_PROVIDER_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/persistent.h
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_PERSISTENT_H_
|
| 6 |
+
#define INCLUDE_CPPGC_PERSISTENT_H_
|
| 7 |
+
|
| 8 |
+
#include <type_traits>
|
| 9 |
+
|
| 10 |
+
#include "cppgc/internal/persistent-node.h"
|
| 11 |
+
#include "cppgc/internal/pointer-policies.h"
|
| 12 |
+
#include "cppgc/sentinel-pointer.h"
|
| 13 |
+
#include "cppgc/source-location.h"
|
| 14 |
+
#include "cppgc/type-traits.h"
|
| 15 |
+
#include "cppgc/visitor.h"
|
| 16 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 17 |
+
|
| 18 |
+
namespace cppgc {
|
| 19 |
+
namespace internal {
|
| 20 |
+
|
| 21 |
+
// PersistentBase always refers to the object as const object and defers to
|
| 22 |
+
// BasicPersistent on casting to the right type as needed.
|
| 23 |
+
class PersistentBase {
|
| 24 |
+
protected:
|
| 25 |
+
PersistentBase() = default;
|
| 26 |
+
explicit PersistentBase(const void* raw) : raw_(raw) {}
|
| 27 |
+
|
| 28 |
+
const void* GetValue() const { return raw_; }
|
| 29 |
+
void SetValue(const void* value) { raw_ = value; }
|
| 30 |
+
|
| 31 |
+
PersistentNode* GetNode() const { return node_; }
|
| 32 |
+
void SetNode(PersistentNode* node) { node_ = node; }
|
| 33 |
+
|
| 34 |
+
// Performs a shallow clear which assumes that internal persistent nodes are
|
| 35 |
+
// destroyed elsewhere.
|
| 36 |
+
void ClearFromGC() const {
|
| 37 |
+
raw_ = nullptr;
|
| 38 |
+
node_ = nullptr;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
protected:
|
| 42 |
+
mutable const void* raw_ = nullptr;
|
| 43 |
+
mutable PersistentNode* node_ = nullptr;
|
| 44 |
+
|
| 45 |
+
friend class PersistentRegionBase;
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
// The basic class from which all Persistent classes are generated.
|
| 49 |
+
template <typename T, typename WeaknessPolicy, typename LocationPolicy,
|
| 50 |
+
typename CheckingPolicy>
|
| 51 |
+
class BasicPersistent final : public PersistentBase,
|
| 52 |
+
public LocationPolicy,
|
| 53 |
+
private WeaknessPolicy,
|
| 54 |
+
private CheckingPolicy {
|
| 55 |
+
public:
|
| 56 |
+
using typename WeaknessPolicy::IsStrongPersistent;
|
| 57 |
+
using PointeeType = T;
|
| 58 |
+
|
| 59 |
+
// Null-state/sentinel constructors.
|
| 60 |
+
BasicPersistent( // NOLINT
|
| 61 |
+
const SourceLocation& loc = SourceLocation::Current())
|
| 62 |
+
: LocationPolicy(loc) {}
|
| 63 |
+
|
| 64 |
+
BasicPersistent(std::nullptr_t, // NOLINT
|
| 65 |
+
const SourceLocation& loc = SourceLocation::Current())
|
| 66 |
+
: LocationPolicy(loc) {}
|
| 67 |
+
|
| 68 |
+
BasicPersistent( // NOLINT
|
| 69 |
+
SentinelPointer s, const SourceLocation& loc = SourceLocation::Current())
|
| 70 |
+
: PersistentBase(s), LocationPolicy(loc) {}
|
| 71 |
+
|
| 72 |
+
// Raw value constructors.
|
| 73 |
+
BasicPersistent(T* raw, // NOLINT
|
| 74 |
+
const SourceLocation& loc = SourceLocation::Current())
|
| 75 |
+
: PersistentBase(raw), LocationPolicy(loc) {
|
| 76 |
+
if (!IsValid()) return;
|
| 77 |
+
SetNode(WeaknessPolicy::GetPersistentRegion(GetValue())
|
| 78 |
+
.AllocateNode(this, &TraceAsRoot));
|
| 79 |
+
this->CheckPointer(Get());
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
BasicPersistent(T& raw, // NOLINT
|
| 83 |
+
const SourceLocation& loc = SourceLocation::Current())
|
| 84 |
+
: BasicPersistent(&raw, loc) {}
|
| 85 |
+
|
| 86 |
+
// Copy ctor.
|
| 87 |
+
BasicPersistent(const BasicPersistent& other,
|
| 88 |
+
const SourceLocation& loc = SourceLocation::Current())
|
| 89 |
+
: BasicPersistent(other.Get(), loc) {}
|
| 90 |
+
|
| 91 |
+
// Heterogeneous ctor.
|
| 92 |
+
template <typename U, typename OtherWeaknessPolicy,
|
| 93 |
+
typename OtherLocationPolicy, typename OtherCheckingPolicy,
|
| 94 |
+
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
|
| 95 |
+
// NOLINTNEXTLINE
|
| 96 |
+
BasicPersistent(
|
| 97 |
+
const BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
|
| 98 |
+
OtherCheckingPolicy>& other,
|
| 99 |
+
const SourceLocation& loc = SourceLocation::Current())
|
| 100 |
+
: BasicPersistent(other.Get(), loc) {}
|
| 101 |
+
|
| 102 |
+
// Move ctor. The heterogeneous move ctor is not supported since e.g.
|
| 103 |
+
// persistent can't reuse persistent node from weak persistent.
|
| 104 |
+
BasicPersistent(
|
| 105 |
+
BasicPersistent&& other,
|
| 106 |
+
const SourceLocation& loc = SourceLocation::Current()) noexcept
|
| 107 |
+
: PersistentBase(std::move(other)), LocationPolicy(std::move(other)) {
|
| 108 |
+
if (!IsValid()) return;
|
| 109 |
+
GetNode()->UpdateOwner(this);
|
| 110 |
+
other.SetValue(nullptr);
|
| 111 |
+
other.SetNode(nullptr);
|
| 112 |
+
this->CheckPointer(Get());
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
// Constructor from member.
|
| 116 |
+
template <typename U, typename MemberBarrierPolicy,
|
| 117 |
+
typename MemberWeaknessTag, typename MemberCheckingPolicy,
|
| 118 |
+
typename MemberStorageType,
|
| 119 |
+
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
|
| 120 |
+
// NOLINTNEXTLINE
|
| 121 |
+
BasicPersistent(const internal::BasicMember<
|
| 122 |
+
U, MemberBarrierPolicy, MemberWeaknessTag,
|
| 123 |
+
MemberCheckingPolicy, MemberStorageType>& member,
|
| 124 |
+
const SourceLocation& loc = SourceLocation::Current())
|
| 125 |
+
: BasicPersistent(member.Get(), loc) {}
|
| 126 |
+
|
| 127 |
+
~BasicPersistent() { Clear(); }
|
| 128 |
+
|
| 129 |
+
// Copy assignment.
|
| 130 |
+
BasicPersistent& operator=(const BasicPersistent& other) {
|
| 131 |
+
return operator=(other.Get());
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
template <typename U, typename OtherWeaknessPolicy,
|
| 135 |
+
typename OtherLocationPolicy, typename OtherCheckingPolicy,
|
| 136 |
+
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
|
| 137 |
+
BasicPersistent& operator=(
|
| 138 |
+
const BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
|
| 139 |
+
OtherCheckingPolicy>& other) {
|
| 140 |
+
return operator=(other.Get());
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
// Move assignment.
|
| 144 |
+
BasicPersistent& operator=(BasicPersistent&& other) noexcept {
|
| 145 |
+
if (this == &other) return *this;
|
| 146 |
+
Clear();
|
| 147 |
+
PersistentBase::operator=(std::move(other));
|
| 148 |
+
LocationPolicy::operator=(std::move(other));
|
| 149 |
+
if (!IsValid()) return *this;
|
| 150 |
+
GetNode()->UpdateOwner(this);
|
| 151 |
+
other.SetValue(nullptr);
|
| 152 |
+
other.SetNode(nullptr);
|
| 153 |
+
this->CheckPointer(Get());
|
| 154 |
+
return *this;
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
// Assignment from member.
|
| 158 |
+
template <typename U, typename MemberBarrierPolicy,
|
| 159 |
+
typename MemberWeaknessTag, typename MemberCheckingPolicy,
|
| 160 |
+
typename MemberStorageType,
|
| 161 |
+
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
|
| 162 |
+
BasicPersistent& operator=(
|
| 163 |
+
const internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
|
| 164 |
+
MemberCheckingPolicy, MemberStorageType>&
|
| 165 |
+
member) {
|
| 166 |
+
return operator=(member.Get());
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
BasicPersistent& operator=(T* other) {
|
| 170 |
+
Assign(other);
|
| 171 |
+
return *this;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
BasicPersistent& operator=(std::nullptr_t) {
|
| 175 |
+
Clear();
|
| 176 |
+
return *this;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
BasicPersistent& operator=(SentinelPointer s) {
|
| 180 |
+
Assign(s);
|
| 181 |
+
return *this;
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
explicit operator bool() const { return Get(); }
|
| 185 |
+
// Historically we allow implicit conversions to T*.
|
| 186 |
+
// NOLINTNEXTLINE
|
| 187 |
+
operator T*() const { return Get(); }
|
| 188 |
+
T* operator->() const { return Get(); }
|
| 189 |
+
T& operator*() const { return *Get(); }
|
| 190 |
+
|
| 191 |
+
// CFI cast exemption to allow passing SentinelPointer through T* and support
|
| 192 |
+
// heterogeneous assignments between different Member and Persistent handles
|
| 193 |
+
// based on their actual types.
|
| 194 |
+
V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const {
|
| 195 |
+
// The const_cast below removes the constness from PersistentBase storage.
|
| 196 |
+
// The following static_cast re-adds any constness if specified through the
|
| 197 |
+
// user-visible template parameter T.
|
| 198 |
+
return static_cast<T*>(const_cast<void*>(GetValue()));
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
void Clear() {
|
| 202 |
+
// Simplified version of `Assign()` to allow calling without a complete type
|
| 203 |
+
// `T`.
|
| 204 |
+
if (IsValid()) {
|
| 205 |
+
WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode());
|
| 206 |
+
SetNode(nullptr);
|
| 207 |
+
}
|
| 208 |
+
SetValue(nullptr);
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
T* Release() {
|
| 212 |
+
T* result = Get();
|
| 213 |
+
Clear();
|
| 214 |
+
return result;
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
template <typename U, typename OtherWeaknessPolicy = WeaknessPolicy,
|
| 218 |
+
typename OtherLocationPolicy = LocationPolicy,
|
| 219 |
+
typename OtherCheckingPolicy = CheckingPolicy>
|
| 220 |
+
BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
|
| 221 |
+
OtherCheckingPolicy>
|
| 222 |
+
To() const {
|
| 223 |
+
return BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
|
| 224 |
+
OtherCheckingPolicy>(static_cast<U*>(Get()));
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
private:
|
| 228 |
+
static void TraceAsRoot(RootVisitor& root_visitor, const void* ptr) {
|
| 229 |
+
root_visitor.Trace(*static_cast<const BasicPersistent*>(ptr));
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
bool IsValid() const {
|
| 233 |
+
// Ideally, handling kSentinelPointer would be done by the embedder. On the
|
| 234 |
+
// other hand, having Persistent aware of it is beneficial since no node
|
| 235 |
+
// gets wasted.
|
| 236 |
+
return GetValue() != nullptr && GetValue() != kSentinelPointer;
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
void Assign(T* ptr) {
|
| 240 |
+
if (IsValid()) {
|
| 241 |
+
if (ptr && ptr != kSentinelPointer) {
|
| 242 |
+
// Simply assign the pointer reusing the existing node.
|
| 243 |
+
SetValue(ptr);
|
| 244 |
+
this->CheckPointer(ptr);
|
| 245 |
+
return;
|
| 246 |
+
}
|
| 247 |
+
WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode());
|
| 248 |
+
SetNode(nullptr);
|
| 249 |
+
}
|
| 250 |
+
SetValue(ptr);
|
| 251 |
+
if (!IsValid()) return;
|
| 252 |
+
SetNode(WeaknessPolicy::GetPersistentRegion(GetValue())
|
| 253 |
+
.AllocateNode(this, &TraceAsRoot));
|
| 254 |
+
this->CheckPointer(Get());
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
void ClearFromGC() const {
|
| 258 |
+
if (IsValid()) {
|
| 259 |
+
WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode());
|
| 260 |
+
PersistentBase::ClearFromGC();
|
| 261 |
+
}
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
// Set Get() for details.
|
| 265 |
+
V8_CLANG_NO_SANITIZE("cfi-unrelated-cast")
|
| 266 |
+
T* GetFromGC() const {
|
| 267 |
+
return static_cast<T*>(const_cast<void*>(GetValue()));
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
friend class internal::RootVisitor;
|
| 271 |
+
};
|
| 272 |
+
|
| 273 |
+
template <typename T1, typename WeaknessPolicy1, typename LocationPolicy1,
|
| 274 |
+
typename CheckingPolicy1, typename T2, typename WeaknessPolicy2,
|
| 275 |
+
typename LocationPolicy2, typename CheckingPolicy2>
|
| 276 |
+
bool operator==(const BasicPersistent<T1, WeaknessPolicy1, LocationPolicy1,
|
| 277 |
+
CheckingPolicy1>& p1,
|
| 278 |
+
const BasicPersistent<T2, WeaknessPolicy2, LocationPolicy2,
|
| 279 |
+
CheckingPolicy2>& p2) {
|
| 280 |
+
return p1.Get() == p2.Get();
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
template <typename T1, typename WeaknessPolicy1, typename LocationPolicy1,
|
| 284 |
+
typename CheckingPolicy1, typename T2, typename WeaknessPolicy2,
|
| 285 |
+
typename LocationPolicy2, typename CheckingPolicy2>
|
| 286 |
+
bool operator!=(const BasicPersistent<T1, WeaknessPolicy1, LocationPolicy1,
|
| 287 |
+
CheckingPolicy1>& p1,
|
| 288 |
+
const BasicPersistent<T2, WeaknessPolicy2, LocationPolicy2,
|
| 289 |
+
CheckingPolicy2>& p2) {
|
| 290 |
+
return !(p1 == p2);
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
template <typename T1, typename PersistentWeaknessPolicy,
|
| 294 |
+
typename PersistentLocationPolicy, typename PersistentCheckingPolicy,
|
| 295 |
+
typename T2, typename MemberWriteBarrierPolicy,
|
| 296 |
+
typename MemberWeaknessTag, typename MemberCheckingPolicy,
|
| 297 |
+
typename MemberStorageType>
|
| 298 |
+
bool operator==(
|
| 299 |
+
const BasicPersistent<T1, PersistentWeaknessPolicy,
|
| 300 |
+
PersistentLocationPolicy, PersistentCheckingPolicy>&
|
| 301 |
+
p,
|
| 302 |
+
const BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy,
|
| 303 |
+
MemberCheckingPolicy, MemberStorageType>& m) {
|
| 304 |
+
return p.Get() == m.Get();
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
template <typename T1, typename PersistentWeaknessPolicy,
|
| 308 |
+
typename PersistentLocationPolicy, typename PersistentCheckingPolicy,
|
| 309 |
+
typename T2, typename MemberWriteBarrierPolicy,
|
| 310 |
+
typename MemberWeaknessTag, typename MemberCheckingPolicy,
|
| 311 |
+
typename MemberStorageType>
|
| 312 |
+
bool operator!=(
|
| 313 |
+
const BasicPersistent<T1, PersistentWeaknessPolicy,
|
| 314 |
+
PersistentLocationPolicy, PersistentCheckingPolicy>&
|
| 315 |
+
p,
|
| 316 |
+
const BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy,
|
| 317 |
+
MemberCheckingPolicy, MemberStorageType>& m) {
|
| 318 |
+
return !(p == m);
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
template <typename T1, typename MemberWriteBarrierPolicy,
|
| 322 |
+
typename MemberWeaknessTag, typename MemberCheckingPolicy,
|
| 323 |
+
typename MemberStorageType, typename T2,
|
| 324 |
+
typename PersistentWeaknessPolicy, typename PersistentLocationPolicy,
|
| 325 |
+
typename PersistentCheckingPolicy>
|
| 326 |
+
bool operator==(
|
| 327 |
+
const BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy,
|
| 328 |
+
MemberCheckingPolicy, MemberStorageType>& m,
|
| 329 |
+
const BasicPersistent<T1, PersistentWeaknessPolicy,
|
| 330 |
+
PersistentLocationPolicy, PersistentCheckingPolicy>&
|
| 331 |
+
p) {
|
| 332 |
+
return m.Get() == p.Get();
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
template <typename T1, typename MemberWriteBarrierPolicy,
|
| 336 |
+
typename MemberWeaknessTag, typename MemberCheckingPolicy,
|
| 337 |
+
typename MemberStorageType, typename T2,
|
| 338 |
+
typename PersistentWeaknessPolicy, typename PersistentLocationPolicy,
|
| 339 |
+
typename PersistentCheckingPolicy>
|
| 340 |
+
bool operator!=(
|
| 341 |
+
const BasicMember<T2, MemberWeaknessTag, MemberWriteBarrierPolicy,
|
| 342 |
+
MemberCheckingPolicy, MemberStorageType>& m,
|
| 343 |
+
const BasicPersistent<T1, PersistentWeaknessPolicy,
|
| 344 |
+
PersistentLocationPolicy, PersistentCheckingPolicy>&
|
| 345 |
+
p) {
|
| 346 |
+
return !(m == p);
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
template <typename T, typename LocationPolicy, typename CheckingPolicy>
|
| 350 |
+
struct IsWeak<BasicPersistent<T, internal::WeakPersistentPolicy, LocationPolicy,
|
| 351 |
+
CheckingPolicy>> : std::true_type {};
|
| 352 |
+
} // namespace internal
|
| 353 |
+
|
| 354 |
+
/**
|
| 355 |
+
* Persistent is a way to create a strong pointer from an off-heap object to
|
| 356 |
+
* another on-heap object. As long as the Persistent handle is alive the GC will
|
| 357 |
+
* keep the object pointed to alive. The Persistent handle is always a GC root
|
| 358 |
+
* from the point of view of the GC. Persistent must be constructed and
|
| 359 |
+
* destructed in the same thread.
|
| 360 |
+
*/
|
| 361 |
+
template <typename T>
|
| 362 |
+
using Persistent =
|
| 363 |
+
internal::BasicPersistent<T, internal::StrongPersistentPolicy>;
|
| 364 |
+
|
| 365 |
+
/**
|
| 366 |
+
* WeakPersistent is a way to create a weak pointer from an off-heap object to
|
| 367 |
+
* an on-heap object. The pointer is automatically cleared when the pointee gets
|
| 368 |
+
* collected. WeakPersistent must be constructed and destructed in the same
|
| 369 |
+
* thread.
|
| 370 |
+
*/
|
| 371 |
+
template <typename T>
|
| 372 |
+
using WeakPersistent =
|
| 373 |
+
internal::BasicPersistent<T, internal::WeakPersistentPolicy>;
|
| 374 |
+
|
| 375 |
+
} // namespace cppgc
|
| 376 |
+
|
| 377 |
+
#endif // INCLUDE_CPPGC_PERSISTENT_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/platform.h
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_PLATFORM_H_
|
| 6 |
+
#define INCLUDE_CPPGC_PLATFORM_H_
|
| 7 |
+
|
| 8 |
+
#include <memory>
|
| 9 |
+
|
| 10 |
+
#include "cppgc/source-location.h"
|
| 11 |
+
#include "v8-platform.h" // NOLINT(build/include_directory)
|
| 12 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 13 |
+
|
| 14 |
+
namespace cppgc {
|
| 15 |
+
|
| 16 |
+
// TODO(v8:10346): Create separate includes for concepts that are not
|
| 17 |
+
// V8-specific.
|
| 18 |
+
using IdleTask = v8::IdleTask;
|
| 19 |
+
using JobHandle = v8::JobHandle;
|
| 20 |
+
using JobDelegate = v8::JobDelegate;
|
| 21 |
+
using JobTask = v8::JobTask;
|
| 22 |
+
using PageAllocator = v8::PageAllocator;
|
| 23 |
+
using Task = v8::Task;
|
| 24 |
+
using TaskPriority = v8::TaskPriority;
|
| 25 |
+
using TaskRunner = v8::TaskRunner;
|
| 26 |
+
using TracingController = v8::TracingController;
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Platform interface used by Heap. Contains allocators and executors.
|
| 30 |
+
*/
|
| 31 |
+
class V8_EXPORT Platform {
|
| 32 |
+
public:
|
| 33 |
+
virtual ~Platform() = default;
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* \returns the allocator used by cppgc to allocate its heap and various
|
| 37 |
+
* support structures. Returning nullptr results in using the `PageAllocator`
|
| 38 |
+
* provided by `cppgc::InitializeProcess()` instead.
|
| 39 |
+
*/
|
| 40 |
+
virtual PageAllocator* GetPageAllocator() = 0;
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* Monotonically increasing time in seconds from an arbitrary fixed point in
|
| 44 |
+
* the past. This function is expected to return at least
|
| 45 |
+
* millisecond-precision values. For this reason,
|
| 46 |
+
* it is recommended that the fixed point be no further in the past than
|
| 47 |
+
* the epoch.
|
| 48 |
+
**/
|
| 49 |
+
virtual double MonotonicallyIncreasingTime() = 0;
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Foreground task runner that should be used by a Heap.
|
| 53 |
+
*/
|
| 54 |
+
virtual std::shared_ptr<TaskRunner> GetForegroundTaskRunner() {
|
| 55 |
+
return GetForegroundTaskRunner(TaskPriority::kUserBlocking);
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* Returns a TaskRunner with a specific |priority| which can be used to post a
|
| 60 |
+
* task on the foreground thread.
|
| 61 |
+
*/
|
| 62 |
+
virtual std::shared_ptr<TaskRunner> GetForegroundTaskRunner(
|
| 63 |
+
TaskPriority priority) {
|
| 64 |
+
return nullptr;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
/**
|
| 68 |
+
* Posts `job_task` to run in parallel. Returns a `JobHandle` associated with
|
| 69 |
+
* the `Job`, which can be joined or canceled.
|
| 70 |
+
* This avoids degenerate cases:
|
| 71 |
+
* - Calling `CallOnWorkerThread()` for each work item, causing significant
|
| 72 |
+
* overhead.
|
| 73 |
+
* - Fixed number of `CallOnWorkerThread()` calls that split the work and
|
| 74 |
+
* might run for a long time. This is problematic when many components post
|
| 75 |
+
* "num cores" tasks and all expect to use all the cores. In these cases,
|
| 76 |
+
* the scheduler lacks context to be fair to multiple same-priority requests
|
| 77 |
+
* and/or ability to request lower priority work to yield when high priority
|
| 78 |
+
* work comes in.
|
| 79 |
+
* A canonical implementation of `job_task` looks like:
|
| 80 |
+
* \code
|
| 81 |
+
* class MyJobTask : public JobTask {
|
| 82 |
+
* public:
|
| 83 |
+
* MyJobTask(...) : worker_queue_(...) {}
|
| 84 |
+
* // JobTask implementation.
|
| 85 |
+
* void Run(JobDelegate* delegate) override {
|
| 86 |
+
* while (!delegate->ShouldYield()) {
|
| 87 |
+
* // Smallest unit of work.
|
| 88 |
+
* auto work_item = worker_queue_.TakeWorkItem(); // Thread safe.
|
| 89 |
+
* if (!work_item) return;
|
| 90 |
+
* ProcessWork(work_item);
|
| 91 |
+
* }
|
| 92 |
+
* }
|
| 93 |
+
*
|
| 94 |
+
* size_t GetMaxConcurrency() const override {
|
| 95 |
+
* return worker_queue_.GetSize(); // Thread safe.
|
| 96 |
+
* }
|
| 97 |
+
* };
|
| 98 |
+
*
|
| 99 |
+
* // ...
|
| 100 |
+
* auto handle = PostJob(TaskPriority::kUserVisible,
|
| 101 |
+
* std::make_unique<MyJobTask>(...));
|
| 102 |
+
* handle->Join();
|
| 103 |
+
* \endcode
|
| 104 |
+
*
|
| 105 |
+
* `PostJob()` and methods of the returned JobHandle/JobDelegate, must never
|
| 106 |
+
* be called while holding a lock that could be acquired by `JobTask::Run()`
|
| 107 |
+
* or `JobTask::GetMaxConcurrency()` -- that could result in a deadlock. This
|
| 108 |
+
* is because (1) `JobTask::GetMaxConcurrency()` may be invoked while holding
|
| 109 |
+
* internal lock (A), hence `JobTask::GetMaxConcurrency()` can only use a lock
|
| 110 |
+
* (B) if that lock is *never* held while calling back into `JobHandle` from
|
| 111 |
+
* any thread (A=>B/B=>A deadlock) and (2) `JobTask::Run()` or
|
| 112 |
+
* `JobTask::GetMaxConcurrency()` may be invoked synchronously from
|
| 113 |
+
* `JobHandle` (B=>JobHandle::foo=>B deadlock).
|
| 114 |
+
*
|
| 115 |
+
* A sufficient `PostJob()` implementation that uses the default Job provided
|
| 116 |
+
* in libplatform looks like:
|
| 117 |
+
* \code
|
| 118 |
+
* std::unique_ptr<JobHandle> PostJob(
|
| 119 |
+
* TaskPriority priority, std::unique_ptr<JobTask> job_task) override {
|
| 120 |
+
* return std::make_unique<DefaultJobHandle>(
|
| 121 |
+
* std::make_shared<DefaultJobState>(
|
| 122 |
+
* this, std::move(job_task), kNumThreads));
|
| 123 |
+
* }
|
| 124 |
+
* \endcode
|
| 125 |
+
*/
|
| 126 |
+
virtual std::unique_ptr<JobHandle> PostJob(
|
| 127 |
+
TaskPriority priority, std::unique_ptr<JobTask> job_task) {
|
| 128 |
+
return nullptr;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
/**
|
| 132 |
+
* Returns an instance of a `TracingController`. This must be non-nullptr. The
|
| 133 |
+
* default implementation returns an empty `TracingController` that consumes
|
| 134 |
+
* trace data without effect.
|
| 135 |
+
*/
|
| 136 |
+
virtual TracingController* GetTracingController();
|
| 137 |
+
};
|
| 138 |
+
|
| 139 |
+
V8_EXPORT bool IsInitialized();
|
| 140 |
+
|
| 141 |
+
/**
|
| 142 |
+
* Process-global initialization of the garbage collector. Must be called before
|
| 143 |
+
* creating a Heap.
|
| 144 |
+
*
|
| 145 |
+
* Can be called multiple times when paired with `ShutdownProcess()`.
|
| 146 |
+
*
|
| 147 |
+
* \param page_allocator The allocator used for maintaining meta data. Must stay
|
| 148 |
+
* always alive and not change between multiple calls to InitializeProcess. If
|
| 149 |
+
* no allocator is provided, a default internal version will be used.
|
| 150 |
+
* \param desired_heap_size Desired amount of virtual address space to reserve
|
| 151 |
+
* for the heap, in bytes. Actual size will be clamped to minimum and maximum
|
| 152 |
+
* values based on compile-time settings and may be rounded up. If this
|
| 153 |
+
* parameter is zero, a default value will be used.
|
| 154 |
+
*/
|
| 155 |
+
V8_EXPORT void InitializeProcess(PageAllocator* page_allocator = nullptr,
|
| 156 |
+
size_t desired_heap_size = 0);
|
| 157 |
+
|
| 158 |
+
/**
|
| 159 |
+
* Must be called after destroying the last used heap. Some process-global
|
| 160 |
+
* metadata may not be returned and reused upon a subsequent
|
| 161 |
+
* `InitializeProcess()` call.
|
| 162 |
+
*/
|
| 163 |
+
V8_EXPORT void ShutdownProcess();
|
| 164 |
+
|
| 165 |
+
namespace internal {
|
| 166 |
+
|
| 167 |
+
V8_EXPORT void Fatal(const std::string& reason = std::string(),
|
| 168 |
+
const SourceLocation& = SourceLocation::Current());
|
| 169 |
+
|
| 170 |
+
} // namespace internal
|
| 171 |
+
|
| 172 |
+
} // namespace cppgc
|
| 173 |
+
|
| 174 |
+
#endif // INCLUDE_CPPGC_PLATFORM_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/testing.h
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2021 the V8 project authors. All rights reserved.
|
| 2 |
+
// Use of this source code is governed by a BSD-style license that can be
|
| 3 |
+
// found in the LICENSE file.
|
| 4 |
+
|
| 5 |
+
#ifndef INCLUDE_CPPGC_TESTING_H_
|
| 6 |
+
#define INCLUDE_CPPGC_TESTING_H_
|
| 7 |
+
|
| 8 |
+
#include "cppgc/common.h"
|
| 9 |
+
#include "cppgc/macros.h"
|
| 10 |
+
#include "v8config.h" // NOLINT(build/include_directory)
|
| 11 |
+
|
| 12 |
+
namespace cppgc {
|
| 13 |
+
|
| 14 |
+
class HeapHandle;
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Namespace contains testing helpers.
|
| 18 |
+
*/
|
| 19 |
+
namespace testing {
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* Overrides the state of the stack with the provided value. Parameters passed
|
| 23 |
+
* to explicit garbage collection calls still take precedence. Must not be
|
| 24 |
+
* nested.
|
| 25 |
+
*
|
| 26 |
+
* This scope is useful to make the garbage collector consider the stack when
|
| 27 |
+
* tasks that invoke garbage collection (through the provided platform) contain
|
| 28 |
+
* interesting pointers on its stack.
|
| 29 |
+
*/
|
| 30 |
+
class V8_EXPORT V8_NODISCARD OverrideEmbedderStackStateScope final {
|
| 31 |
+
CPPGC_STACK_ALLOCATED();
|
| 32 |
+
|
| 33 |
+
public:
|
| 34 |
+
/**
|
| 35 |
+
* Constructs a scoped object that automatically enters and leaves the scope.
|
| 36 |
+
*
|
| 37 |
+
* \param heap_handle The corresponding heap.
|
| 38 |
+
*/
|
| 39 |
+
explicit OverrideEmbedderStackStateScope(HeapHandle& heap_handle,
|
| 40 |
+
EmbedderStackState state);
|
| 41 |
+
~OverrideEmbedderStackStateScope();
|
| 42 |
+
|
| 43 |
+
OverrideEmbedderStackStateScope(const OverrideEmbedderStackStateScope&) =
|
| 44 |
+
delete;
|
| 45 |
+
OverrideEmbedderStackStateScope& operator=(
|
| 46 |
+
const OverrideEmbedderStackStateScope&) = delete;
|
| 47 |
+
|
| 48 |
+
private:
|
| 49 |
+
HeapHandle& heap_handle_;
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
/**
|
| 53 |
+
* Testing interface for managed heaps that allows for controlling garbage
|
| 54 |
+
* collection timings. Embedders should use this class when testing the
|
| 55 |
+
* interaction of their code with incremental/concurrent garbage collection.
|
| 56 |
+
*/
|
| 57 |
+
class V8_EXPORT StandaloneTestingHeap final {
|
| 58 |
+
public:
|
| 59 |
+
explicit StandaloneTestingHeap(HeapHandle&);
|
| 60 |
+
|
| 61 |
+
/**
|
| 62 |
+
* Start an incremental garbage collection.
|
| 63 |
+
*/
|
| 64 |
+
void StartGarbageCollection();
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* Perform an incremental step. This will also schedule concurrent steps if
|
| 68 |
+
* needed.
|
| 69 |
+
*
|
| 70 |
+
* \param stack_state The state of the stack during the step.
|
| 71 |
+
*/
|
| 72 |
+
bool PerformMarkingStep(EmbedderStackState stack_state);
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* Finalize the current garbage collection cycle atomically.
|
| 76 |
+
* Assumes that garbage collection is in progress.
|
| 77 |
+
*
|
| 78 |
+
* \param stack_state The state of the stack for finalizing the garbage
|
| 79 |
+
* collection cycle.
|
| 80 |
+
*/
|
| 81 |
+
void FinalizeGarbageCollection(EmbedderStackState stack_state);
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* Toggle main thread marking on/off. Allows to stress concurrent marking
|
| 85 |
+
* (e.g. to better detect data races).
|
| 86 |
+
*
|
| 87 |
+
* \param should_mark Denotes whether the main thread should contribute to
|
| 88 |
+
* marking. Defaults to true.
|
| 89 |
+
*/
|
| 90 |
+
void ToggleMainThreadMarking(bool should_mark);
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* Force enable compaction for the next garbage collection cycle.
|
| 94 |
+
*/
|
| 95 |
+
void ForceCompactionForNextGarbageCollection();
|
| 96 |
+
|
| 97 |
+
private:
|
| 98 |
+
HeapHandle& heap_handle_;
|
| 99 |
+
};
|
| 100 |
+
|
| 101 |
+
V8_EXPORT bool IsHeapObjectOld(void*);
|
| 102 |
+
|
| 103 |
+
} // namespace testing
|
| 104 |
+
} // namespace cppgc
|
| 105 |
+
|
| 106 |
+
#endif // INCLUDE_CPPGC_TESTING_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/js_native_api.h
ADDED
|
@@ -0,0 +1,618 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef SRC_JS_NATIVE_API_H_
|
| 2 |
+
#define SRC_JS_NATIVE_API_H_
|
| 3 |
+
|
| 4 |
+
// This file needs to be compatible with C compilers.
|
| 5 |
+
#include <stdbool.h> // NOLINT(modernize-deprecated-headers)
|
| 6 |
+
#include <stddef.h> // NOLINT(modernize-deprecated-headers)
|
| 7 |
+
|
| 8 |
+
#include "js_native_api_types.h"
|
| 9 |
+
|
| 10 |
+
// If you need __declspec(dllimport), either include <node_api.h> instead, or
|
| 11 |
+
// define NAPI_EXTERN as __declspec(dllimport) on the compiler's command line.
|
| 12 |
+
#ifndef NAPI_EXTERN
|
| 13 |
+
#ifdef _WIN32
|
| 14 |
+
#define NAPI_EXTERN __declspec(dllexport)
|
| 15 |
+
#elif defined(__wasm__)
|
| 16 |
+
#define NAPI_EXTERN \
|
| 17 |
+
__attribute__((visibility("default"))) \
|
| 18 |
+
__attribute__((__import_module__("napi")))
|
| 19 |
+
#else
|
| 20 |
+
#define NAPI_EXTERN __attribute__((visibility("default")))
|
| 21 |
+
#endif
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
#define NAPI_AUTO_LENGTH SIZE_MAX
|
| 25 |
+
|
| 26 |
+
#ifdef __cplusplus
|
| 27 |
+
#define EXTERN_C_START extern "C" {
|
| 28 |
+
#define EXTERN_C_END }
|
| 29 |
+
#else
|
| 30 |
+
#define EXTERN_C_START
|
| 31 |
+
#define EXTERN_C_END
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
EXTERN_C_START
|
| 35 |
+
|
| 36 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_last_error_info(
|
| 37 |
+
node_api_basic_env env, const napi_extended_error_info** result);
|
| 38 |
+
|
| 39 |
+
// Getters for defined singletons
|
| 40 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_undefined(napi_env env,
|
| 41 |
+
napi_value* result);
|
| 42 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_null(napi_env env,
|
| 43 |
+
napi_value* result);
|
| 44 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_global(napi_env env,
|
| 45 |
+
napi_value* result);
|
| 46 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_boolean(napi_env env,
|
| 47 |
+
bool value,
|
| 48 |
+
napi_value* result);
|
| 49 |
+
|
| 50 |
+
// Methods to create Primitive types/Objects
|
| 51 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_object(napi_env env,
|
| 52 |
+
napi_value* result);
|
| 53 |
+
#ifdef NAPI_EXPERIMENTAL
|
| 54 |
+
#define NODE_API_EXPERIMENTAL_HAS_CREATE_OBJECT_WITH_PROPERTIES
|
| 55 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 56 |
+
napi_create_object_with_properties(napi_env env,
|
| 57 |
+
napi_value prototype_or_null,
|
| 58 |
+
napi_value* property_names,
|
| 59 |
+
napi_value* property_values,
|
| 60 |
+
size_t property_count,
|
| 61 |
+
napi_value* result);
|
| 62 |
+
#endif // NAPI_EXPERIMENTAL
|
| 63 |
+
|
| 64 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_array(napi_env env,
|
| 65 |
+
napi_value* result);
|
| 66 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 67 |
+
napi_create_array_with_length(napi_env env, size_t length, napi_value* result);
|
| 68 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_double(napi_env env,
|
| 69 |
+
double value,
|
| 70 |
+
napi_value* result);
|
| 71 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_int32(napi_env env,
|
| 72 |
+
int32_t value,
|
| 73 |
+
napi_value* result);
|
| 74 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_uint32(napi_env env,
|
| 75 |
+
uint32_t value,
|
| 76 |
+
napi_value* result);
|
| 77 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_int64(napi_env env,
|
| 78 |
+
int64_t value,
|
| 79 |
+
napi_value* result);
|
| 80 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_latin1(
|
| 81 |
+
napi_env env, const char* str, size_t length, napi_value* result);
|
| 82 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_utf8(napi_env env,
|
| 83 |
+
const char* str,
|
| 84 |
+
size_t length,
|
| 85 |
+
napi_value* result);
|
| 86 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_string_utf16(napi_env env,
|
| 87 |
+
const char16_t* str,
|
| 88 |
+
size_t length,
|
| 89 |
+
napi_value* result);
|
| 90 |
+
#if NAPI_VERSION >= 10
|
| 91 |
+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_external_string_latin1(
|
| 92 |
+
napi_env env,
|
| 93 |
+
char* str,
|
| 94 |
+
size_t length,
|
| 95 |
+
node_api_basic_finalize finalize_callback,
|
| 96 |
+
void* finalize_hint,
|
| 97 |
+
napi_value* result,
|
| 98 |
+
bool* copied);
|
| 99 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 100 |
+
node_api_create_external_string_utf16(napi_env env,
|
| 101 |
+
char16_t* str,
|
| 102 |
+
size_t length,
|
| 103 |
+
node_api_basic_finalize finalize_callback,
|
| 104 |
+
void* finalize_hint,
|
| 105 |
+
napi_value* result,
|
| 106 |
+
bool* copied);
|
| 107 |
+
|
| 108 |
+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_property_key_latin1(
|
| 109 |
+
napi_env env, const char* str, size_t length, napi_value* result);
|
| 110 |
+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_property_key_utf8(
|
| 111 |
+
napi_env env, const char* str, size_t length, napi_value* result);
|
| 112 |
+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_property_key_utf16(
|
| 113 |
+
napi_env env, const char16_t* str, size_t length, napi_value* result);
|
| 114 |
+
#endif // NAPI_VERSION >= 10
|
| 115 |
+
|
| 116 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_symbol(napi_env env,
|
| 117 |
+
napi_value description,
|
| 118 |
+
napi_value* result);
|
| 119 |
+
#if NAPI_VERSION >= 9
|
| 120 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 121 |
+
node_api_symbol_for(napi_env env,
|
| 122 |
+
const char* utf8description,
|
| 123 |
+
size_t length,
|
| 124 |
+
napi_value* result);
|
| 125 |
+
#endif // NAPI_VERSION >= 9
|
| 126 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_function(napi_env env,
|
| 127 |
+
const char* utf8name,
|
| 128 |
+
size_t length,
|
| 129 |
+
napi_callback cb,
|
| 130 |
+
void* data,
|
| 131 |
+
napi_value* result);
|
| 132 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_error(napi_env env,
|
| 133 |
+
napi_value code,
|
| 134 |
+
napi_value msg,
|
| 135 |
+
napi_value* result);
|
| 136 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_type_error(napi_env env,
|
| 137 |
+
napi_value code,
|
| 138 |
+
napi_value msg,
|
| 139 |
+
napi_value* result);
|
| 140 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_range_error(napi_env env,
|
| 141 |
+
napi_value code,
|
| 142 |
+
napi_value msg,
|
| 143 |
+
napi_value* result);
|
| 144 |
+
#if NAPI_VERSION >= 9
|
| 145 |
+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_syntax_error(
|
| 146 |
+
napi_env env, napi_value code, napi_value msg, napi_value* result);
|
| 147 |
+
#endif // NAPI_VERSION >= 9
|
| 148 |
+
|
| 149 |
+
// Methods to get the native napi_value from Primitive type
|
| 150 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_typeof(napi_env env,
|
| 151 |
+
napi_value value,
|
| 152 |
+
napi_valuetype* result);
|
| 153 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_double(napi_env env,
|
| 154 |
+
napi_value value,
|
| 155 |
+
double* result);
|
| 156 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_int32(napi_env env,
|
| 157 |
+
napi_value value,
|
| 158 |
+
int32_t* result);
|
| 159 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_uint32(napi_env env,
|
| 160 |
+
napi_value value,
|
| 161 |
+
uint32_t* result);
|
| 162 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_int64(napi_env env,
|
| 163 |
+
napi_value value,
|
| 164 |
+
int64_t* result);
|
| 165 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_bool(napi_env env,
|
| 166 |
+
napi_value value,
|
| 167 |
+
bool* result);
|
| 168 |
+
|
| 169 |
+
// Copies LATIN-1 encoded bytes from a string into a buffer.
|
| 170 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_string_latin1(
|
| 171 |
+
napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result);
|
| 172 |
+
|
| 173 |
+
// Copies UTF-8 encoded bytes from a string into a buffer.
|
| 174 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_string_utf8(
|
| 175 |
+
napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result);
|
| 176 |
+
|
| 177 |
+
// Copies UTF-16 encoded bytes from a string into a buffer.
|
| 178 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_string_utf16(napi_env env,
|
| 179 |
+
napi_value value,
|
| 180 |
+
char16_t* buf,
|
| 181 |
+
size_t bufsize,
|
| 182 |
+
size_t* result);
|
| 183 |
+
|
| 184 |
+
// Methods to coerce values
|
| 185 |
+
// These APIs may execute user scripts
|
| 186 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_coerce_to_bool(napi_env env,
|
| 187 |
+
napi_value value,
|
| 188 |
+
napi_value* result);
|
| 189 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_coerce_to_number(napi_env env,
|
| 190 |
+
napi_value value,
|
| 191 |
+
napi_value* result);
|
| 192 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_coerce_to_object(napi_env env,
|
| 193 |
+
napi_value value,
|
| 194 |
+
napi_value* result);
|
| 195 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_coerce_to_string(napi_env env,
|
| 196 |
+
napi_value value,
|
| 197 |
+
napi_value* result);
|
| 198 |
+
|
| 199 |
+
// Methods to work with Objects
|
| 200 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_prototype(napi_env env,
|
| 201 |
+
napi_value object,
|
| 202 |
+
napi_value* result);
|
| 203 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_property_names(napi_env env,
|
| 204 |
+
napi_value object,
|
| 205 |
+
napi_value* result);
|
| 206 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_set_property(napi_env env,
|
| 207 |
+
napi_value object,
|
| 208 |
+
napi_value key,
|
| 209 |
+
napi_value value);
|
| 210 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_has_property(napi_env env,
|
| 211 |
+
napi_value object,
|
| 212 |
+
napi_value key,
|
| 213 |
+
bool* result);
|
| 214 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_property(napi_env env,
|
| 215 |
+
napi_value object,
|
| 216 |
+
napi_value key,
|
| 217 |
+
napi_value* result);
|
| 218 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_property(napi_env env,
|
| 219 |
+
napi_value object,
|
| 220 |
+
napi_value key,
|
| 221 |
+
bool* result);
|
| 222 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_has_own_property(napi_env env,
|
| 223 |
+
napi_value object,
|
| 224 |
+
napi_value key,
|
| 225 |
+
bool* result);
|
| 226 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_set_named_property(napi_env env,
|
| 227 |
+
napi_value object,
|
| 228 |
+
const char* utf8name,
|
| 229 |
+
napi_value value);
|
| 230 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_has_named_property(napi_env env,
|
| 231 |
+
napi_value object,
|
| 232 |
+
const char* utf8name,
|
| 233 |
+
bool* result);
|
| 234 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_named_property(napi_env env,
|
| 235 |
+
napi_value object,
|
| 236 |
+
const char* utf8name,
|
| 237 |
+
napi_value* result);
|
| 238 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_set_element(napi_env env,
|
| 239 |
+
napi_value object,
|
| 240 |
+
uint32_t index,
|
| 241 |
+
napi_value value);
|
| 242 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_has_element(napi_env env,
|
| 243 |
+
napi_value object,
|
| 244 |
+
uint32_t index,
|
| 245 |
+
bool* result);
|
| 246 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_element(napi_env env,
|
| 247 |
+
napi_value object,
|
| 248 |
+
uint32_t index,
|
| 249 |
+
napi_value* result);
|
| 250 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_element(napi_env env,
|
| 251 |
+
napi_value object,
|
| 252 |
+
uint32_t index,
|
| 253 |
+
bool* result);
|
| 254 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 255 |
+
napi_define_properties(napi_env env,
|
| 256 |
+
napi_value object,
|
| 257 |
+
size_t property_count,
|
| 258 |
+
const napi_property_descriptor* properties);
|
| 259 |
+
|
| 260 |
+
// Methods to work with Arrays
|
| 261 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_array(napi_env env,
|
| 262 |
+
napi_value value,
|
| 263 |
+
bool* result);
|
| 264 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_array_length(napi_env env,
|
| 265 |
+
napi_value value,
|
| 266 |
+
uint32_t* result);
|
| 267 |
+
|
| 268 |
+
// Methods to compare values
|
| 269 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_strict_equals(napi_env env,
|
| 270 |
+
napi_value lhs,
|
| 271 |
+
napi_value rhs,
|
| 272 |
+
bool* result);
|
| 273 |
+
|
| 274 |
+
// Methods to work with Functions
|
| 275 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_call_function(napi_env env,
|
| 276 |
+
napi_value recv,
|
| 277 |
+
napi_value func,
|
| 278 |
+
size_t argc,
|
| 279 |
+
const napi_value* argv,
|
| 280 |
+
napi_value* result);
|
| 281 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_new_instance(napi_env env,
|
| 282 |
+
napi_value constructor,
|
| 283 |
+
size_t argc,
|
| 284 |
+
const napi_value* argv,
|
| 285 |
+
napi_value* result);
|
| 286 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_instanceof(napi_env env,
|
| 287 |
+
napi_value object,
|
| 288 |
+
napi_value constructor,
|
| 289 |
+
bool* result);
|
| 290 |
+
|
| 291 |
+
// Methods to work with napi_callbacks
|
| 292 |
+
|
| 293 |
+
// Gets all callback info in a single call. (Ugly, but faster.)
|
| 294 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_cb_info(
|
| 295 |
+
napi_env env, // [in] Node-API environment handle
|
| 296 |
+
napi_callback_info cbinfo, // [in] Opaque callback-info handle
|
| 297 |
+
size_t* argc, // [in-out] Specifies the size of the provided argv array
|
| 298 |
+
// and receives the actual count of args.
|
| 299 |
+
napi_value* argv, // [out] Array of values
|
| 300 |
+
napi_value* this_arg, // [out] Receives the JS 'this' arg for the call
|
| 301 |
+
void** data); // [out] Receives the data pointer for the callback.
|
| 302 |
+
|
| 303 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_new_target(
|
| 304 |
+
napi_env env, napi_callback_info cbinfo, napi_value* result);
|
| 305 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 306 |
+
napi_define_class(napi_env env,
|
| 307 |
+
const char* utf8name,
|
| 308 |
+
size_t length,
|
| 309 |
+
napi_callback constructor,
|
| 310 |
+
void* data,
|
| 311 |
+
size_t property_count,
|
| 312 |
+
const napi_property_descriptor* properties,
|
| 313 |
+
napi_value* result);
|
| 314 |
+
|
| 315 |
+
// Methods to work with external data objects
|
| 316 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 317 |
+
napi_wrap(napi_env env,
|
| 318 |
+
napi_value js_object,
|
| 319 |
+
void* native_object,
|
| 320 |
+
node_api_basic_finalize finalize_cb,
|
| 321 |
+
void* finalize_hint,
|
| 322 |
+
napi_ref* result);
|
| 323 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_unwrap(napi_env env,
|
| 324 |
+
napi_value js_object,
|
| 325 |
+
void** result);
|
| 326 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_remove_wrap(napi_env env,
|
| 327 |
+
napi_value js_object,
|
| 328 |
+
void** result);
|
| 329 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 330 |
+
napi_create_external(napi_env env,
|
| 331 |
+
void* data,
|
| 332 |
+
node_api_basic_finalize finalize_cb,
|
| 333 |
+
void* finalize_hint,
|
| 334 |
+
napi_value* result);
|
| 335 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_external(napi_env env,
|
| 336 |
+
napi_value value,
|
| 337 |
+
void** result);
|
| 338 |
+
|
| 339 |
+
// Methods to control object lifespan
|
| 340 |
+
|
| 341 |
+
// Set initial_refcount to 0 for a weak reference, >0 for a strong reference.
|
| 342 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 343 |
+
napi_create_reference(napi_env env,
|
| 344 |
+
napi_value value,
|
| 345 |
+
uint32_t initial_refcount,
|
| 346 |
+
napi_ref* result);
|
| 347 |
+
|
| 348 |
+
// Deletes a reference. The referenced value is released, and may
|
| 349 |
+
// be GC'd unless there are other references to it.
|
| 350 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_reference(node_api_basic_env env,
|
| 351 |
+
napi_ref ref);
|
| 352 |
+
|
| 353 |
+
// Increments the reference count, optionally returning the resulting count.
|
| 354 |
+
// After this call the reference will be a strong reference because its
|
| 355 |
+
// refcount is >0, and the referenced object is effectively "pinned".
|
| 356 |
+
// Calling this when the refcount is 0 and the object is unavailable
|
| 357 |
+
// results in an error.
|
| 358 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_reference_ref(napi_env env,
|
| 359 |
+
napi_ref ref,
|
| 360 |
+
uint32_t* result);
|
| 361 |
+
|
| 362 |
+
// Decrements the reference count, optionally returning the resulting count.
|
| 363 |
+
// If the result is 0 the reference is now weak and the object may be GC'd
|
| 364 |
+
// at any time if there are no other references. Calling this when the
|
| 365 |
+
// refcount is already 0 results in an error.
|
| 366 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_reference_unref(napi_env env,
|
| 367 |
+
napi_ref ref,
|
| 368 |
+
uint32_t* result);
|
| 369 |
+
|
| 370 |
+
// Attempts to get a referenced value. If the reference is weak,
|
| 371 |
+
// the value might no longer be available, in that case the call
|
| 372 |
+
// is still successful but the result is NULL.
|
| 373 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_reference_value(napi_env env,
|
| 374 |
+
napi_ref ref,
|
| 375 |
+
napi_value* result);
|
| 376 |
+
|
| 377 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 378 |
+
napi_open_handle_scope(napi_env env, napi_handle_scope* result);
|
| 379 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 380 |
+
napi_close_handle_scope(napi_env env, napi_handle_scope scope);
|
| 381 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_open_escapable_handle_scope(
|
| 382 |
+
napi_env env, napi_escapable_handle_scope* result);
|
| 383 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_close_escapable_handle_scope(
|
| 384 |
+
napi_env env, napi_escapable_handle_scope scope);
|
| 385 |
+
|
| 386 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 387 |
+
napi_escape_handle(napi_env env,
|
| 388 |
+
napi_escapable_handle_scope scope,
|
| 389 |
+
napi_value escapee,
|
| 390 |
+
napi_value* result);
|
| 391 |
+
|
| 392 |
+
// Methods to support error handling
|
| 393 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_throw(napi_env env, napi_value error);
|
| 394 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_throw_error(napi_env env,
|
| 395 |
+
const char* code,
|
| 396 |
+
const char* msg);
|
| 397 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_throw_type_error(napi_env env,
|
| 398 |
+
const char* code,
|
| 399 |
+
const char* msg);
|
| 400 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_throw_range_error(napi_env env,
|
| 401 |
+
const char* code,
|
| 402 |
+
const char* msg);
|
| 403 |
+
#if NAPI_VERSION >= 9
|
| 404 |
+
NAPI_EXTERN napi_status NAPI_CDECL node_api_throw_syntax_error(napi_env env,
|
| 405 |
+
const char* code,
|
| 406 |
+
const char* msg);
|
| 407 |
+
#endif // NAPI_VERSION >= 9
|
| 408 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_error(napi_env env,
|
| 409 |
+
napi_value value,
|
| 410 |
+
bool* result);
|
| 411 |
+
|
| 412 |
+
// Methods to support catching exceptions
|
| 413 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_exception_pending(napi_env env,
|
| 414 |
+
bool* result);
|
| 415 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 416 |
+
napi_get_and_clear_last_exception(napi_env env, napi_value* result);
|
| 417 |
+
|
| 418 |
+
// Methods to work with array buffers and typed arrays
|
| 419 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_arraybuffer(napi_env env,
|
| 420 |
+
napi_value value,
|
| 421 |
+
bool* result);
|
| 422 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_arraybuffer(napi_env env,
|
| 423 |
+
size_t byte_length,
|
| 424 |
+
void** data,
|
| 425 |
+
napi_value* result);
|
| 426 |
+
#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED
|
| 427 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 428 |
+
napi_create_external_arraybuffer(napi_env env,
|
| 429 |
+
void* external_data,
|
| 430 |
+
size_t byte_length,
|
| 431 |
+
node_api_basic_finalize finalize_cb,
|
| 432 |
+
void* finalize_hint,
|
| 433 |
+
napi_value* result);
|
| 434 |
+
#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED
|
| 435 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_arraybuffer_info(
|
| 436 |
+
napi_env env, napi_value arraybuffer, void** data, size_t* byte_length);
|
| 437 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_typedarray(napi_env env,
|
| 438 |
+
napi_value value,
|
| 439 |
+
bool* result);
|
| 440 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 441 |
+
napi_create_typedarray(napi_env env,
|
| 442 |
+
napi_typedarray_type type,
|
| 443 |
+
size_t length,
|
| 444 |
+
napi_value arraybuffer,
|
| 445 |
+
size_t byte_offset,
|
| 446 |
+
napi_value* result);
|
| 447 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 448 |
+
napi_get_typedarray_info(napi_env env,
|
| 449 |
+
napi_value typedarray,
|
| 450 |
+
napi_typedarray_type* type,
|
| 451 |
+
size_t* length,
|
| 452 |
+
void** data,
|
| 453 |
+
napi_value* arraybuffer,
|
| 454 |
+
size_t* byte_offset);
|
| 455 |
+
|
| 456 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_dataview(napi_env env,
|
| 457 |
+
size_t length,
|
| 458 |
+
napi_value arraybuffer,
|
| 459 |
+
size_t byte_offset,
|
| 460 |
+
napi_value* result);
|
| 461 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_dataview(napi_env env,
|
| 462 |
+
napi_value value,
|
| 463 |
+
bool* result);
|
| 464 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 465 |
+
napi_get_dataview_info(napi_env env,
|
| 466 |
+
napi_value dataview,
|
| 467 |
+
size_t* bytelength,
|
| 468 |
+
void** data,
|
| 469 |
+
napi_value* arraybuffer,
|
| 470 |
+
size_t* byte_offset);
|
| 471 |
+
|
| 472 |
+
#ifdef NAPI_EXPERIMENTAL
|
| 473 |
+
#define NODE_API_EXPERIMENTAL_HAS_SHAREDARRAYBUFFER
|
| 474 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 475 |
+
node_api_is_sharedarraybuffer(napi_env env, napi_value value, bool* result);
|
| 476 |
+
NAPI_EXTERN napi_status NAPI_CDECL node_api_create_sharedarraybuffer(
|
| 477 |
+
napi_env env, size_t byte_length, void** data, napi_value* result);
|
| 478 |
+
#endif // NAPI_EXPERIMENTAL
|
| 479 |
+
|
| 480 |
+
// version management
|
| 481 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_version(node_api_basic_env env,
|
| 482 |
+
uint32_t* result);
|
| 483 |
+
|
| 484 |
+
// Promises
|
| 485 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_promise(napi_env env,
|
| 486 |
+
napi_deferred* deferred,
|
| 487 |
+
napi_value* promise);
|
| 488 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_resolve_deferred(napi_env env,
|
| 489 |
+
napi_deferred deferred,
|
| 490 |
+
napi_value resolution);
|
| 491 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_reject_deferred(napi_env env,
|
| 492 |
+
napi_deferred deferred,
|
| 493 |
+
napi_value rejection);
|
| 494 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_promise(napi_env env,
|
| 495 |
+
napi_value value,
|
| 496 |
+
bool* is_promise);
|
| 497 |
+
|
| 498 |
+
// Running a script
|
| 499 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_run_script(napi_env env,
|
| 500 |
+
napi_value script,
|
| 501 |
+
napi_value* result);
|
| 502 |
+
|
| 503 |
+
// Memory management
|
| 504 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_adjust_external_memory(
|
| 505 |
+
node_api_basic_env env, int64_t change_in_bytes, int64_t* adjusted_value);
|
| 506 |
+
|
| 507 |
+
#if NAPI_VERSION >= 5
|
| 508 |
+
|
| 509 |
+
// Dates
|
| 510 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_date(napi_env env,
|
| 511 |
+
double time,
|
| 512 |
+
napi_value* result);
|
| 513 |
+
|
| 514 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_date(napi_env env,
|
| 515 |
+
napi_value value,
|
| 516 |
+
bool* is_date);
|
| 517 |
+
|
| 518 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_date_value(napi_env env,
|
| 519 |
+
napi_value value,
|
| 520 |
+
double* result);
|
| 521 |
+
|
| 522 |
+
// Add finalizer for pointer
|
| 523 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 524 |
+
napi_add_finalizer(napi_env env,
|
| 525 |
+
napi_value js_object,
|
| 526 |
+
void* finalize_data,
|
| 527 |
+
node_api_basic_finalize finalize_cb,
|
| 528 |
+
void* finalize_hint,
|
| 529 |
+
napi_ref* result);
|
| 530 |
+
|
| 531 |
+
#endif // NAPI_VERSION >= 5
|
| 532 |
+
|
| 533 |
+
#ifdef NAPI_EXPERIMENTAL
|
| 534 |
+
#define NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER
|
| 535 |
+
|
| 536 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 537 |
+
node_api_post_finalizer(node_api_basic_env env,
|
| 538 |
+
napi_finalize finalize_cb,
|
| 539 |
+
void* finalize_data,
|
| 540 |
+
void* finalize_hint);
|
| 541 |
+
|
| 542 |
+
#endif // NAPI_EXPERIMENTAL
|
| 543 |
+
|
| 544 |
+
#if NAPI_VERSION >= 6
|
| 545 |
+
|
| 546 |
+
// BigInt
|
| 547 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_bigint_int64(napi_env env,
|
| 548 |
+
int64_t value,
|
| 549 |
+
napi_value* result);
|
| 550 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 551 |
+
napi_create_bigint_uint64(napi_env env, uint64_t value, napi_value* result);
|
| 552 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 553 |
+
napi_create_bigint_words(napi_env env,
|
| 554 |
+
int sign_bit,
|
| 555 |
+
size_t word_count,
|
| 556 |
+
const uint64_t* words,
|
| 557 |
+
napi_value* result);
|
| 558 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_bigint_int64(napi_env env,
|
| 559 |
+
napi_value value,
|
| 560 |
+
int64_t* result,
|
| 561 |
+
bool* lossless);
|
| 562 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_value_bigint_uint64(
|
| 563 |
+
napi_env env, napi_value value, uint64_t* result, bool* lossless);
|
| 564 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 565 |
+
napi_get_value_bigint_words(napi_env env,
|
| 566 |
+
napi_value value,
|
| 567 |
+
int* sign_bit,
|
| 568 |
+
size_t* word_count,
|
| 569 |
+
uint64_t* words);
|
| 570 |
+
|
| 571 |
+
// Object
|
| 572 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 573 |
+
napi_get_all_property_names(napi_env env,
|
| 574 |
+
napi_value object,
|
| 575 |
+
napi_key_collection_mode key_mode,
|
| 576 |
+
napi_key_filter key_filter,
|
| 577 |
+
napi_key_conversion key_conversion,
|
| 578 |
+
napi_value* result);
|
| 579 |
+
|
| 580 |
+
// Instance data
|
| 581 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 582 |
+
napi_set_instance_data(node_api_basic_env env,
|
| 583 |
+
void* data,
|
| 584 |
+
napi_finalize finalize_cb,
|
| 585 |
+
void* finalize_hint);
|
| 586 |
+
|
| 587 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 588 |
+
napi_get_instance_data(node_api_basic_env env, void** data);
|
| 589 |
+
#endif // NAPI_VERSION >= 6
|
| 590 |
+
|
| 591 |
+
#if NAPI_VERSION >= 7
|
| 592 |
+
// ArrayBuffer detaching
|
| 593 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 594 |
+
napi_detach_arraybuffer(napi_env env, napi_value arraybuffer);
|
| 595 |
+
|
| 596 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 597 |
+
napi_is_detached_arraybuffer(napi_env env, napi_value value, bool* result);
|
| 598 |
+
#endif // NAPI_VERSION >= 7
|
| 599 |
+
|
| 600 |
+
#if NAPI_VERSION >= 8
|
| 601 |
+
// Type tagging
|
| 602 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_type_tag_object(
|
| 603 |
+
napi_env env, napi_value value, const napi_type_tag* type_tag);
|
| 604 |
+
|
| 605 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 606 |
+
napi_check_object_type_tag(napi_env env,
|
| 607 |
+
napi_value value,
|
| 608 |
+
const napi_type_tag* type_tag,
|
| 609 |
+
bool* result);
|
| 610 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_object_freeze(napi_env env,
|
| 611 |
+
napi_value object);
|
| 612 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_object_seal(napi_env env,
|
| 613 |
+
napi_value object);
|
| 614 |
+
#endif // NAPI_VERSION >= 8
|
| 615 |
+
|
| 616 |
+
EXTERN_C_END
|
| 617 |
+
|
| 618 |
+
#endif // SRC_JS_NATIVE_API_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/js_native_api_types.h
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_API_TYPES_H_
|
| 3 |
+
|
| 4 |
+
// Use INT_MAX, this should only be consumed by the pre-processor anyway.
|
| 5 |
+
#define NAPI_VERSION_EXPERIMENTAL 2147483647
|
| 6 |
+
#ifndef NAPI_VERSION
|
| 7 |
+
#ifdef NAPI_EXPERIMENTAL
|
| 8 |
+
#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL
|
| 9 |
+
#else
|
| 10 |
+
// The baseline version for N-API.
|
| 11 |
+
// The NAPI_VERSION controls which version will be used by default when
|
| 12 |
+
// compilling a native addon. If the addon developer specifically wants to use
|
| 13 |
+
// functions available in a new version of N-API that is not yet ported in all
|
| 14 |
+
// LTS versions, they can set NAPI_VERSION knowing that they have specifically
|
| 15 |
+
// depended on that version.
|
| 16 |
+
#define NAPI_VERSION 8
|
| 17 |
+
#endif
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
// This file needs to be compatible with C compilers.
|
| 21 |
+
// This is a public include file, and these includes have essentially
|
| 22 |
+
// became part of it's API.
|
| 23 |
+
#include <stddef.h> // NOLINT(modernize-deprecated-headers)
|
| 24 |
+
#include <stdint.h> // NOLINT(modernize-deprecated-headers)
|
| 25 |
+
|
| 26 |
+
#if !defined __cplusplus || (defined(_MSC_VER) && _MSC_VER < 1900)
|
| 27 |
+
typedef uint16_t char16_t;
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
#ifndef NAPI_CDECL
|
| 31 |
+
#ifdef _WIN32
|
| 32 |
+
#define NAPI_CDECL __cdecl
|
| 33 |
+
#else
|
| 34 |
+
#define NAPI_CDECL
|
| 35 |
+
#endif
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
// JSVM API types are all opaque pointers for ABI stability
|
| 39 |
+
// typedef undefined structs instead of void* for compile time type safety
|
| 40 |
+
typedef struct napi_env__* napi_env;
|
| 41 |
+
|
| 42 |
+
// We need to mark APIs which can be called during garbage collection (GC),
|
| 43 |
+
// meaning that they do not affect the state of the JS engine, and can
|
| 44 |
+
// therefore be called synchronously from a finalizer that itself runs
|
| 45 |
+
// synchronously during GC. Such APIs can receive either a `napi_env` or a
|
| 46 |
+
// `node_api_basic_env` as their first parameter, because we should be able to
|
| 47 |
+
// also call them during normal, non-garbage-collecting operations, whereas
|
| 48 |
+
// APIs that affect the state of the JS engine can only receive a `napi_env` as
|
| 49 |
+
// their first parameter, because we must not call them during GC. In lieu of
|
| 50 |
+
// inheritance, we use the properties of the const qualifier to accomplish
|
| 51 |
+
// this, because both a const and a non-const value can be passed to an API
|
| 52 |
+
// expecting a const value, but only a non-const value can be passed to an API
|
| 53 |
+
// expecting a non-const value.
|
| 54 |
+
//
|
| 55 |
+
// In conjunction with appropriate CFLAGS to warn us if we're passing a const
|
| 56 |
+
// (basic) environment into an API that expects a non-const environment, and
|
| 57 |
+
// the definition of basic finalizer function pointer types below, which
|
| 58 |
+
// receive a basic environment as their first parameter, and can thus only call
|
| 59 |
+
// basic APIs (unless the user explicitly casts the environment), we achieve
|
| 60 |
+
// the ability to ensure at compile time that we do not call APIs that affect
|
| 61 |
+
// the state of the JS engine from a synchronous (basic) finalizer.
|
| 62 |
+
#if !defined(NAPI_EXPERIMENTAL) || \
|
| 63 |
+
(defined(NAPI_EXPERIMENTAL) && \
|
| 64 |
+
(defined(NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT) || \
|
| 65 |
+
defined(NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT)))
|
| 66 |
+
typedef struct napi_env__* node_api_nogc_env;
|
| 67 |
+
#else
|
| 68 |
+
typedef const struct napi_env__* node_api_nogc_env;
|
| 69 |
+
#endif
|
| 70 |
+
typedef node_api_nogc_env node_api_basic_env;
|
| 71 |
+
|
| 72 |
+
typedef struct napi_value__* napi_value;
|
| 73 |
+
typedef struct napi_ref__* napi_ref;
|
| 74 |
+
typedef struct napi_handle_scope__* napi_handle_scope;
|
| 75 |
+
typedef struct napi_escapable_handle_scope__* napi_escapable_handle_scope;
|
| 76 |
+
typedef struct napi_callback_info__* napi_callback_info;
|
| 77 |
+
typedef struct napi_deferred__* napi_deferred;
|
| 78 |
+
|
| 79 |
+
typedef enum {
|
| 80 |
+
napi_default = 0,
|
| 81 |
+
napi_writable = 1 << 0,
|
| 82 |
+
napi_enumerable = 1 << 1,
|
| 83 |
+
napi_configurable = 1 << 2,
|
| 84 |
+
|
| 85 |
+
// Used with napi_define_class to distinguish static properties
|
| 86 |
+
// from instance properties. Ignored by napi_define_properties.
|
| 87 |
+
napi_static = 1 << 10,
|
| 88 |
+
|
| 89 |
+
#if NAPI_VERSION >= 8
|
| 90 |
+
// Default for class methods.
|
| 91 |
+
napi_default_method = napi_writable | napi_configurable,
|
| 92 |
+
|
| 93 |
+
// Default for object properties, like in JS obj[prop].
|
| 94 |
+
napi_default_jsproperty = napi_writable | napi_enumerable | napi_configurable,
|
| 95 |
+
#endif // NAPI_VERSION >= 8
|
| 96 |
+
} napi_property_attributes;
|
| 97 |
+
|
| 98 |
+
typedef enum {
|
| 99 |
+
// ES6 types (corresponds to typeof)
|
| 100 |
+
napi_undefined,
|
| 101 |
+
napi_null,
|
| 102 |
+
napi_boolean,
|
| 103 |
+
napi_number,
|
| 104 |
+
napi_string,
|
| 105 |
+
napi_symbol,
|
| 106 |
+
napi_object,
|
| 107 |
+
napi_function,
|
| 108 |
+
napi_external,
|
| 109 |
+
napi_bigint,
|
| 110 |
+
} napi_valuetype;
|
| 111 |
+
|
| 112 |
+
typedef enum {
|
| 113 |
+
napi_int8_array,
|
| 114 |
+
napi_uint8_array,
|
| 115 |
+
napi_uint8_clamped_array,
|
| 116 |
+
napi_int16_array,
|
| 117 |
+
napi_uint16_array,
|
| 118 |
+
napi_int32_array,
|
| 119 |
+
napi_uint32_array,
|
| 120 |
+
napi_float32_array,
|
| 121 |
+
napi_float64_array,
|
| 122 |
+
napi_bigint64_array,
|
| 123 |
+
napi_biguint64_array,
|
| 124 |
+
} napi_typedarray_type;
|
| 125 |
+
|
| 126 |
+
typedef enum {
|
| 127 |
+
napi_ok,
|
| 128 |
+
napi_invalid_arg,
|
| 129 |
+
napi_object_expected,
|
| 130 |
+
napi_string_expected,
|
| 131 |
+
napi_name_expected,
|
| 132 |
+
napi_function_expected,
|
| 133 |
+
napi_number_expected,
|
| 134 |
+
napi_boolean_expected,
|
| 135 |
+
napi_array_expected,
|
| 136 |
+
napi_generic_failure,
|
| 137 |
+
napi_pending_exception,
|
| 138 |
+
napi_cancelled,
|
| 139 |
+
napi_escape_called_twice,
|
| 140 |
+
napi_handle_scope_mismatch,
|
| 141 |
+
napi_callback_scope_mismatch,
|
| 142 |
+
napi_queue_full,
|
| 143 |
+
napi_closing,
|
| 144 |
+
napi_bigint_expected,
|
| 145 |
+
napi_date_expected,
|
| 146 |
+
napi_arraybuffer_expected,
|
| 147 |
+
napi_detachable_arraybuffer_expected,
|
| 148 |
+
napi_would_deadlock, // unused
|
| 149 |
+
napi_no_external_buffers_allowed,
|
| 150 |
+
napi_cannot_run_js,
|
| 151 |
+
} napi_status;
|
| 152 |
+
// Note: when adding a new enum value to `napi_status`, please also update
|
| 153 |
+
// * `const int last_status` in the definition of `napi_get_last_error_info()'
|
| 154 |
+
// in file js_native_api_v8.cc.
|
| 155 |
+
// * `const char* error_messages[]` in file js_native_api_v8.cc with a brief
|
| 156 |
+
// message explaining the error.
|
| 157 |
+
// * the definition of `napi_status` in doc/api/n-api.md to reflect the newly
|
| 158 |
+
// added value(s).
|
| 159 |
+
|
| 160 |
+
typedef napi_value(NAPI_CDECL* napi_callback)(napi_env env,
|
| 161 |
+
napi_callback_info info);
|
| 162 |
+
typedef void(NAPI_CDECL* napi_finalize)(napi_env env,
|
| 163 |
+
void* finalize_data,
|
| 164 |
+
void* finalize_hint);
|
| 165 |
+
|
| 166 |
+
#if !defined(NAPI_EXPERIMENTAL) || \
|
| 167 |
+
(defined(NAPI_EXPERIMENTAL) && \
|
| 168 |
+
(defined(NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT) || \
|
| 169 |
+
defined(NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT)))
|
| 170 |
+
typedef napi_finalize node_api_nogc_finalize;
|
| 171 |
+
#else
|
| 172 |
+
typedef void(NAPI_CDECL* node_api_nogc_finalize)(node_api_nogc_env env,
|
| 173 |
+
void* finalize_data,
|
| 174 |
+
void* finalize_hint);
|
| 175 |
+
#endif
|
| 176 |
+
typedef node_api_nogc_finalize node_api_basic_finalize;
|
| 177 |
+
|
| 178 |
+
typedef struct {
|
| 179 |
+
// One of utf8name or name should be NULL.
|
| 180 |
+
const char* utf8name;
|
| 181 |
+
napi_value name;
|
| 182 |
+
|
| 183 |
+
napi_callback method;
|
| 184 |
+
napi_callback getter;
|
| 185 |
+
napi_callback setter;
|
| 186 |
+
napi_value value;
|
| 187 |
+
|
| 188 |
+
napi_property_attributes attributes;
|
| 189 |
+
void* data;
|
| 190 |
+
} napi_property_descriptor;
|
| 191 |
+
|
| 192 |
+
typedef struct {
|
| 193 |
+
const char* error_message;
|
| 194 |
+
void* engine_reserved;
|
| 195 |
+
uint32_t engine_error_code;
|
| 196 |
+
napi_status error_code;
|
| 197 |
+
} napi_extended_error_info;
|
| 198 |
+
|
| 199 |
+
#if NAPI_VERSION >= 6
|
| 200 |
+
typedef enum {
|
| 201 |
+
napi_key_include_prototypes,
|
| 202 |
+
napi_key_own_only
|
| 203 |
+
} napi_key_collection_mode;
|
| 204 |
+
|
| 205 |
+
typedef enum {
|
| 206 |
+
napi_key_all_properties = 0,
|
| 207 |
+
napi_key_writable = 1,
|
| 208 |
+
napi_key_enumerable = 1 << 1,
|
| 209 |
+
napi_key_configurable = 1 << 2,
|
| 210 |
+
napi_key_skip_strings = 1 << 3,
|
| 211 |
+
napi_key_skip_symbols = 1 << 4
|
| 212 |
+
} napi_key_filter;
|
| 213 |
+
|
| 214 |
+
typedef enum {
|
| 215 |
+
napi_key_keep_numbers,
|
| 216 |
+
napi_key_numbers_to_strings
|
| 217 |
+
} napi_key_conversion;
|
| 218 |
+
#endif // NAPI_VERSION >= 6
|
| 219 |
+
|
| 220 |
+
#if NAPI_VERSION >= 8
|
| 221 |
+
typedef struct {
|
| 222 |
+
uint64_t lower;
|
| 223 |
+
uint64_t upper;
|
| 224 |
+
} napi_type_tag;
|
| 225 |
+
#endif // NAPI_VERSION >= 8
|
| 226 |
+
|
| 227 |
+
#endif // SRC_JS_NATIVE_API_TYPES_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/node.h
ADDED
|
@@ -0,0 +1,1627 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright Joyent, Inc. and other Node contributors.
|
| 2 |
+
//
|
| 3 |
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
| 4 |
+
// copy of this software and associated documentation files (the
|
| 5 |
+
// "Software"), to deal in the Software without restriction, including
|
| 6 |
+
// without limitation the rights to use, copy, modify, merge, publish,
|
| 7 |
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
| 8 |
+
// persons to whom the Software is furnished to do so, subject to the
|
| 9 |
+
// following conditions:
|
| 10 |
+
//
|
| 11 |
+
// The above copyright notice and this permission notice shall be included
|
| 12 |
+
// in all copies or substantial portions of the Software.
|
| 13 |
+
//
|
| 14 |
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
| 15 |
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 16 |
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
| 17 |
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
| 18 |
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
| 19 |
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
| 20 |
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 21 |
+
|
| 22 |
+
#ifndef SRC_NODE_H_
|
| 23 |
+
#define SRC_NODE_H_
|
| 24 |
+
|
| 25 |
+
#ifdef _WIN32
|
| 26 |
+
# ifndef BUILDING_NODE_EXTENSION
|
| 27 |
+
# define NODE_EXTERN __declspec(dllexport)
|
| 28 |
+
# else
|
| 29 |
+
# define NODE_EXTERN __declspec(dllimport)
|
| 30 |
+
# endif
|
| 31 |
+
#else
|
| 32 |
+
# define NODE_EXTERN __attribute__((visibility("default")))
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
// Declarations annotated with NODE_EXTERN_PRIVATE do not form part of
|
| 36 |
+
// the public API. They are implementation details that can and will
|
| 37 |
+
// change between releases, even in semver patch releases. Do not use
|
| 38 |
+
// any such symbol in external code.
|
| 39 |
+
#ifdef NODE_SHARED_MODE
|
| 40 |
+
#define NODE_EXTERN_PRIVATE NODE_EXTERN
|
| 41 |
+
#else
|
| 42 |
+
#define NODE_EXTERN_PRIVATE
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
#ifdef BUILDING_NODE_EXTENSION
|
| 46 |
+
# undef BUILDING_V8_SHARED
|
| 47 |
+
# undef BUILDING_UV_SHARED
|
| 48 |
+
# define USING_V8_SHARED 1
|
| 49 |
+
# define USING_UV_SHARED 1
|
| 50 |
+
#endif
|
| 51 |
+
|
| 52 |
+
// This should be defined in make system.
|
| 53 |
+
// See issue https://github.com/nodejs/node-v0.x-archive/issues/1236
|
| 54 |
+
#if defined(__MINGW32__) || defined(_MSC_VER)
|
| 55 |
+
#ifndef _WIN32_WINNT
|
| 56 |
+
# define _WIN32_WINNT 0x0600 // Windows Server 2008
|
| 57 |
+
#endif
|
| 58 |
+
|
| 59 |
+
#ifndef NOMINMAX
|
| 60 |
+
# define NOMINMAX
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
#endif
|
| 64 |
+
|
| 65 |
+
#if defined(_MSC_VER)
|
| 66 |
+
#define PATH_MAX MAX_PATH
|
| 67 |
+
#endif
|
| 68 |
+
|
| 69 |
+
#ifdef _WIN32
|
| 70 |
+
#define SIGQUIT 3
|
| 71 |
+
#define SIGKILL 9
|
| 72 |
+
#endif
|
| 73 |
+
|
| 74 |
+
#include "v8.h" // NOLINT(build/include_order)
|
| 75 |
+
|
| 76 |
+
#include "v8-platform.h" // NOLINT(build/include_order)
|
| 77 |
+
#include "node_version.h" // NODE_MODULE_VERSION
|
| 78 |
+
|
| 79 |
+
#include "node_api.h"
|
| 80 |
+
|
| 81 |
+
#include <functional>
|
| 82 |
+
#include <memory>
|
| 83 |
+
#include <optional>
|
| 84 |
+
#include <ostream>
|
| 85 |
+
|
| 86 |
+
// We cannot use __POSIX__ in this header because that's only defined when
|
| 87 |
+
// building Node.js.
|
| 88 |
+
#ifndef _WIN32
|
| 89 |
+
#include <signal.h>
|
| 90 |
+
#endif // _WIN32
|
| 91 |
+
|
| 92 |
+
#define NODE_MAKE_VERSION(major, minor, patch) \
|
| 93 |
+
((major) * 0x1000 + (minor) * 0x100 + (patch))
|
| 94 |
+
|
| 95 |
+
#ifdef __clang__
|
| 96 |
+
# define NODE_CLANG_AT_LEAST(major, minor, patch) \
|
| 97 |
+
(NODE_MAKE_VERSION(major, minor, patch) <= \
|
| 98 |
+
NODE_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__))
|
| 99 |
+
#else
|
| 100 |
+
# define NODE_CLANG_AT_LEAST(major, minor, patch) (0)
|
| 101 |
+
#endif
|
| 102 |
+
|
| 103 |
+
#ifdef __GNUC__
|
| 104 |
+
# define NODE_GNUC_AT_LEAST(major, minor, patch) \
|
| 105 |
+
(NODE_MAKE_VERSION(major, minor, patch) <= \
|
| 106 |
+
NODE_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__))
|
| 107 |
+
#else
|
| 108 |
+
# define NODE_GNUC_AT_LEAST(major, minor, patch) (0)
|
| 109 |
+
#endif
|
| 110 |
+
|
| 111 |
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
| 112 |
+
# define NODE_DEPRECATED(message, declarator) declarator
|
| 113 |
+
#else // NODE_WANT_INTERNALS
|
| 114 |
+
# if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0)
|
| 115 |
+
# define NODE_DEPRECATED(message, declarator) \
|
| 116 |
+
__attribute__((deprecated(message))) declarator
|
| 117 |
+
# elif defined(_MSC_VER)
|
| 118 |
+
# define NODE_DEPRECATED(message, declarator) \
|
| 119 |
+
__declspec(deprecated) declarator
|
| 120 |
+
# else
|
| 121 |
+
# define NODE_DEPRECATED(message, declarator) declarator
|
| 122 |
+
# endif
|
| 123 |
+
#endif
|
| 124 |
+
|
| 125 |
+
// Forward-declare libuv loop
|
| 126 |
+
struct uv_loop_s;
|
| 127 |
+
|
| 128 |
+
// Forward-declare these functions now to stop MSVS from becoming
|
| 129 |
+
// terminally confused when it's done in node_internals.h
|
| 130 |
+
namespace node {
|
| 131 |
+
|
| 132 |
+
struct SnapshotData;
|
| 133 |
+
|
| 134 |
+
namespace tracing {
|
| 135 |
+
|
| 136 |
+
class TracingController;
|
| 137 |
+
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
NODE_EXTERN v8::Local<v8::Value> ErrnoException(v8::Isolate* isolate,
|
| 141 |
+
int errorno,
|
| 142 |
+
const char* syscall = nullptr,
|
| 143 |
+
const char* message = nullptr,
|
| 144 |
+
const char* path = nullptr);
|
| 145 |
+
NODE_EXTERN v8::Local<v8::Value> UVException(v8::Isolate* isolate,
|
| 146 |
+
int errorno,
|
| 147 |
+
const char* syscall = nullptr,
|
| 148 |
+
const char* message = nullptr,
|
| 149 |
+
const char* path = nullptr,
|
| 150 |
+
const char* dest = nullptr);
|
| 151 |
+
|
| 152 |
+
NODE_DEPRECATED("Use ErrnoException(isolate, ...)",
|
| 153 |
+
inline v8::Local<v8::Value> ErrnoException(
|
| 154 |
+
int errorno,
|
| 155 |
+
const char* syscall = nullptr,
|
| 156 |
+
const char* message = nullptr,
|
| 157 |
+
const char* path = nullptr) {
|
| 158 |
+
return ErrnoException(v8::Isolate::GetCurrent(),
|
| 159 |
+
errorno,
|
| 160 |
+
syscall,
|
| 161 |
+
message,
|
| 162 |
+
path);
|
| 163 |
+
})
|
| 164 |
+
|
| 165 |
+
NODE_DEPRECATED("Use UVException(isolate, ...)",
|
| 166 |
+
inline v8::Local<v8::Value> UVException(int errorno,
|
| 167 |
+
const char* syscall = nullptr,
|
| 168 |
+
const char* message = nullptr,
|
| 169 |
+
const char* path = nullptr) {
|
| 170 |
+
return UVException(v8::Isolate::GetCurrent(),
|
| 171 |
+
errorno,
|
| 172 |
+
syscall,
|
| 173 |
+
message,
|
| 174 |
+
path);
|
| 175 |
+
})
|
| 176 |
+
|
| 177 |
+
/*
|
| 178 |
+
* These methods need to be called in a HandleScope.
|
| 179 |
+
*
|
| 180 |
+
* It is preferred that you use the `MakeCallback` overloads taking
|
| 181 |
+
* `async_context` arguments.
|
| 182 |
+
*/
|
| 183 |
+
|
| 184 |
+
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
|
| 185 |
+
NODE_EXTERN v8::Local<v8::Value> MakeCallback(
|
| 186 |
+
v8::Isolate* isolate,
|
| 187 |
+
v8::Local<v8::Object> recv,
|
| 188 |
+
const char* method,
|
| 189 |
+
int argc,
|
| 190 |
+
v8::Local<v8::Value>* argv));
|
| 191 |
+
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
|
| 192 |
+
NODE_EXTERN v8::Local<v8::Value> MakeCallback(
|
| 193 |
+
v8::Isolate* isolate,
|
| 194 |
+
v8::Local<v8::Object> recv,
|
| 195 |
+
v8::Local<v8::String> symbol,
|
| 196 |
+
int argc,
|
| 197 |
+
v8::Local<v8::Value>* argv));
|
| 198 |
+
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
|
| 199 |
+
NODE_EXTERN v8::Local<v8::Value> MakeCallback(
|
| 200 |
+
v8::Isolate* isolate,
|
| 201 |
+
v8::Local<v8::Object> recv,
|
| 202 |
+
v8::Local<v8::Function> callback,
|
| 203 |
+
int argc,
|
| 204 |
+
v8::Local<v8::Value>* argv));
|
| 205 |
+
|
| 206 |
+
} // namespace node
|
| 207 |
+
|
| 208 |
+
#include <cassert>
|
| 209 |
+
#include <cstdint>
|
| 210 |
+
|
| 211 |
+
#ifndef NODE_STRINGIFY
|
| 212 |
+
# define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
|
| 213 |
+
# define NODE_STRINGIFY_HELPER(n) #n
|
| 214 |
+
#endif
|
| 215 |
+
|
| 216 |
+
#ifdef _WIN32
|
| 217 |
+
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
|
| 218 |
+
typedef intptr_t ssize_t;
|
| 219 |
+
# define _SSIZE_T_
|
| 220 |
+
# define _SSIZE_T_DEFINED
|
| 221 |
+
#endif
|
| 222 |
+
#else // !_WIN32
|
| 223 |
+
# include <sys/types.h> // size_t, ssize_t
|
| 224 |
+
#endif // _WIN32
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
namespace node {
|
| 228 |
+
|
| 229 |
+
class IsolateData;
|
| 230 |
+
class Environment;
|
| 231 |
+
class MultiIsolatePlatform;
|
| 232 |
+
class InitializationResultImpl;
|
| 233 |
+
|
| 234 |
+
namespace ProcessInitializationFlags {
|
| 235 |
+
enum Flags : uint32_t {
|
| 236 |
+
kNoFlags = 0,
|
| 237 |
+
// Enable stdio inheritance, which is disabled by default.
|
| 238 |
+
// This flag is also implied by kNoStdioInitialization.
|
| 239 |
+
kEnableStdioInheritance = 1 << 0,
|
| 240 |
+
// Disable reading the NODE_OPTIONS environment variable.
|
| 241 |
+
kDisableNodeOptionsEnv = 1 << 1,
|
| 242 |
+
// Do not parse CLI options.
|
| 243 |
+
kDisableCLIOptions = 1 << 2,
|
| 244 |
+
// Do not initialize ICU.
|
| 245 |
+
kNoICU = 1 << 3,
|
| 246 |
+
// Do not modify stdio file descriptor or TTY state.
|
| 247 |
+
kNoStdioInitialization = 1 << 4,
|
| 248 |
+
// Do not register Node.js-specific signal handlers
|
| 249 |
+
// and reset other signal handlers to default state.
|
| 250 |
+
kNoDefaultSignalHandling = 1 << 5,
|
| 251 |
+
// Do not perform V8 initialization.
|
| 252 |
+
kNoInitializeV8 = 1 << 6,
|
| 253 |
+
// Do not initialize a default Node.js-provided V8 platform instance.
|
| 254 |
+
kNoInitializeNodeV8Platform = 1 << 7,
|
| 255 |
+
// Do not initialize OpenSSL config.
|
| 256 |
+
kNoInitOpenSSL = 1 << 8,
|
| 257 |
+
// Do not initialize Node.js debugging based on environment variables.
|
| 258 |
+
kNoParseGlobalDebugVariables = 1 << 9,
|
| 259 |
+
// Do not adjust OS resource limits for this process.
|
| 260 |
+
kNoAdjustResourceLimits = 1 << 10,
|
| 261 |
+
// Do not map code segments into large pages for this process.
|
| 262 |
+
kNoUseLargePages = 1 << 11,
|
| 263 |
+
// Skip printing output for --help, --version, --v8-options.
|
| 264 |
+
kNoPrintHelpOrVersionOutput = 1 << 12,
|
| 265 |
+
// Do not perform cppgc initialization. If set, the embedder must call
|
| 266 |
+
// cppgc::InitializeProcess() before creating a Node.js environment
|
| 267 |
+
// and call cppgc::ShutdownProcess() before process shutdown.
|
| 268 |
+
kNoInitializeCppgc = 1 << 13,
|
| 269 |
+
// Initialize the process for predictable snapshot generation.
|
| 270 |
+
kGeneratePredictableSnapshot = 1 << 14,
|
| 271 |
+
|
| 272 |
+
// Emulate the behavior of InitializeNodeWithArgs() when passing
|
| 273 |
+
// a flags argument to the InitializeOncePerProcess() replacement
|
| 274 |
+
// function.
|
| 275 |
+
kLegacyInitializeNodeWithArgsBehavior =
|
| 276 |
+
kNoStdioInitialization | kNoDefaultSignalHandling | kNoInitializeV8 |
|
| 277 |
+
kNoInitializeNodeV8Platform | kNoInitOpenSSL |
|
| 278 |
+
kNoParseGlobalDebugVariables | kNoAdjustResourceLimits |
|
| 279 |
+
kNoUseLargePages | kNoPrintHelpOrVersionOutput | kNoInitializeCppgc,
|
| 280 |
+
};
|
| 281 |
+
} // namespace ProcessInitializationFlags
|
| 282 |
+
namespace ProcessFlags = ProcessInitializationFlags; // Legacy alias.
|
| 283 |
+
|
| 284 |
+
namespace StopFlags {
|
| 285 |
+
enum Flags : uint32_t {
|
| 286 |
+
kNoFlags = 0,
|
| 287 |
+
// Do not explicitly terminate the Isolate
|
| 288 |
+
// when exiting the Environment.
|
| 289 |
+
kDoNotTerminateIsolate = 1 << 0,
|
| 290 |
+
};
|
| 291 |
+
} // namespace StopFlags
|
| 292 |
+
|
| 293 |
+
class NODE_EXTERN InitializationResult {
|
| 294 |
+
public:
|
| 295 |
+
virtual ~InitializationResult() = default;
|
| 296 |
+
|
| 297 |
+
// Returns a suggested process exit code.
|
| 298 |
+
virtual int exit_code() const = 0;
|
| 299 |
+
|
| 300 |
+
// Returns 'true' if initialization was aborted early due to errors.
|
| 301 |
+
virtual bool early_return() const = 0;
|
| 302 |
+
|
| 303 |
+
// Returns the parsed list of non-Node.js arguments.
|
| 304 |
+
virtual const std::vector<std::string>& args() const = 0;
|
| 305 |
+
|
| 306 |
+
// Returns the parsed list of Node.js arguments.
|
| 307 |
+
virtual const std::vector<std::string>& exec_args() const = 0;
|
| 308 |
+
|
| 309 |
+
// Returns an array of errors. Note that these may be warnings
|
| 310 |
+
// whose existence does not imply a non-zero exit code.
|
| 311 |
+
virtual const std::vector<std::string>& errors() const = 0;
|
| 312 |
+
|
| 313 |
+
// If kNoInitializeNodeV8Platform was not specified, the global Node.js
|
| 314 |
+
// platform instance.
|
| 315 |
+
virtual MultiIsolatePlatform* platform() const = 0;
|
| 316 |
+
|
| 317 |
+
private:
|
| 318 |
+
InitializationResult() = default;
|
| 319 |
+
friend class InitializationResultImpl;
|
| 320 |
+
};
|
| 321 |
+
|
| 322 |
+
// TODO(addaleax): Officially deprecate this and replace it with something
|
| 323 |
+
// better suited for a public embedder API.
|
| 324 |
+
NODE_EXTERN int Start(int argc, char* argv[]);
|
| 325 |
+
|
| 326 |
+
// Tear down Node.js while it is running (there are active handles
|
| 327 |
+
// in the loop and / or actively executing JavaScript code).
|
| 328 |
+
NODE_EXTERN int Stop(Environment* env,
|
| 329 |
+
StopFlags::Flags flags = StopFlags::kNoFlags);
|
| 330 |
+
|
| 331 |
+
// Set up per-process state needed to run Node.js. This will consume arguments
|
| 332 |
+
// from argv, fill exec_argv, and possibly add errors resulting from parsing
|
| 333 |
+
// the arguments to `errors`. The return value is a suggested exit code for the
|
| 334 |
+
// program; If it is 0, then initializing Node.js succeeded.
|
| 335 |
+
// This runs a subset of the initialization performed by
|
| 336 |
+
// InitializeOncePerProcess(), which supersedes this function.
|
| 337 |
+
// The subset is roughly equivalent to the one given by
|
| 338 |
+
// `ProcessInitializationFlags::kLegacyInitializeNodeWithArgsBehavior`.
|
| 339 |
+
NODE_DEPRECATED("Use InitializeOncePerProcess() instead",
|
| 340 |
+
NODE_EXTERN int InitializeNodeWithArgs(
|
| 341 |
+
std::vector<std::string>* argv,
|
| 342 |
+
std::vector<std::string>* exec_argv,
|
| 343 |
+
std::vector<std::string>* errors,
|
| 344 |
+
ProcessInitializationFlags::Flags flags =
|
| 345 |
+
ProcessInitializationFlags::kNoFlags));
|
| 346 |
+
|
| 347 |
+
// Set up per-process state needed to run Node.js. This will consume arguments
|
| 348 |
+
// from args, and return information about the initialization success,
|
| 349 |
+
// including the arguments split into argv/exec_argv, a list of potential
|
| 350 |
+
// errors encountered during initialization, and a potential suggested
|
| 351 |
+
// exit code.
|
| 352 |
+
NODE_EXTERN std::shared_ptr<InitializationResult> InitializeOncePerProcess(
|
| 353 |
+
const std::vector<std::string>& args,
|
| 354 |
+
ProcessInitializationFlags::Flags flags =
|
| 355 |
+
ProcessInitializationFlags::kNoFlags);
|
| 356 |
+
// Undoes the initialization performed by InitializeOncePerProcess(),
|
| 357 |
+
// where cleanup is necessary.
|
| 358 |
+
NODE_EXTERN void TearDownOncePerProcess();
|
| 359 |
+
// Convenience overload for specifying multiple flags without having
|
| 360 |
+
// to worry about casts.
|
| 361 |
+
inline std::shared_ptr<InitializationResult> InitializeOncePerProcess(
|
| 362 |
+
const std::vector<std::string>& args,
|
| 363 |
+
std::initializer_list<ProcessInitializationFlags::Flags> list) {
|
| 364 |
+
uint64_t flags_accum = ProcessInitializationFlags::kNoFlags;
|
| 365 |
+
for (const auto flag : list) flags_accum |= static_cast<uint64_t>(flag);
|
| 366 |
+
return InitializeOncePerProcess(
|
| 367 |
+
args, static_cast<ProcessInitializationFlags::Flags>(flags_accum));
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
enum OptionEnvvarSettings {
|
| 371 |
+
// Allow the options to be set via the environment variable, like
|
| 372 |
+
// `NODE_OPTIONS`.
|
| 373 |
+
kAllowedInEnvvar = 0,
|
| 374 |
+
// Disallow the options to be set via the environment variable, like
|
| 375 |
+
// `NODE_OPTIONS`.
|
| 376 |
+
kDisallowedInEnvvar = 1,
|
| 377 |
+
};
|
| 378 |
+
|
| 379 |
+
// Process the arguments and set up the per-process options.
|
| 380 |
+
// If the `settings` is set as OptionEnvvarSettings::kAllowedInEnvvar, the
|
| 381 |
+
// options that are allowed in the environment variable are processed. Options
|
| 382 |
+
// that are disallowed to be set via environment variable are processed as
|
| 383 |
+
// errors.
|
| 384 |
+
// Otherwise all the options that are disallowed (and those are allowed) to be
|
| 385 |
+
// set via environment variable are processed.
|
| 386 |
+
NODE_EXTERN int ProcessGlobalArgs(std::vector<std::string>* args,
|
| 387 |
+
std::vector<std::string>* exec_args,
|
| 388 |
+
std::vector<std::string>* errors,
|
| 389 |
+
OptionEnvvarSettings settings);
|
| 390 |
+
|
| 391 |
+
class NodeArrayBufferAllocator;
|
| 392 |
+
|
| 393 |
+
// An ArrayBuffer::Allocator class with some Node.js-specific tweaks. If you do
|
| 394 |
+
// not have to use another allocator, using this class is recommended:
|
| 395 |
+
// - It supports Buffer.allocUnsafe() and Buffer.allocUnsafeSlow() with
|
| 396 |
+
// uninitialized memory.
|
| 397 |
+
// - It supports transferring, rather than copying, ArrayBuffers when using
|
| 398 |
+
// MessagePorts.
|
| 399 |
+
class NODE_EXTERN ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
| 400 |
+
public:
|
| 401 |
+
// If `always_debug` is true, create an ArrayBuffer::Allocator instance
|
| 402 |
+
// that performs additional integrity checks (e.g. make sure that only memory
|
| 403 |
+
// that was allocated by the it is also freed by it).
|
| 404 |
+
// This can also be set using the --debug-arraybuffer-allocations flag.
|
| 405 |
+
static std::unique_ptr<ArrayBufferAllocator> Create(
|
| 406 |
+
bool always_debug = false);
|
| 407 |
+
|
| 408 |
+
private:
|
| 409 |
+
virtual NodeArrayBufferAllocator* GetImpl() = 0;
|
| 410 |
+
|
| 411 |
+
friend class IsolateData;
|
| 412 |
+
};
|
| 413 |
+
|
| 414 |
+
// Legacy equivalents for ArrayBufferAllocator::Create().
|
| 415 |
+
NODE_EXTERN ArrayBufferAllocator* CreateArrayBufferAllocator();
|
| 416 |
+
NODE_EXTERN void FreeArrayBufferAllocator(ArrayBufferAllocator* allocator);
|
| 417 |
+
|
| 418 |
+
class NODE_EXTERN IsolatePlatformDelegate {
|
| 419 |
+
public:
|
| 420 |
+
virtual std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner() = 0;
|
| 421 |
+
virtual bool IdleTasksEnabled() = 0;
|
| 422 |
+
};
|
| 423 |
+
|
| 424 |
+
class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
|
| 425 |
+
public:
|
| 426 |
+
~MultiIsolatePlatform() override = default;
|
| 427 |
+
// Returns true if work was dispatched or executed. New tasks that are
|
| 428 |
+
// posted during flushing of the queue are postponed until the next
|
| 429 |
+
// flushing.
|
| 430 |
+
virtual bool FlushForegroundTasks(v8::Isolate* isolate) = 0;
|
| 431 |
+
virtual void DrainTasks(v8::Isolate* isolate) = 0;
|
| 432 |
+
|
| 433 |
+
// This needs to be called between the calls to `Isolate::Allocate()` and
|
| 434 |
+
// `Isolate::Initialize()`, so that initialization can already start
|
| 435 |
+
// using the platform.
|
| 436 |
+
// When using `NewIsolate()`, this is taken care of by that function.
|
| 437 |
+
// This function may only be called once per `Isolate`.
|
| 438 |
+
virtual void RegisterIsolate(v8::Isolate* isolate,
|
| 439 |
+
struct uv_loop_s* loop) = 0;
|
| 440 |
+
// This method can be used when an application handles task scheduling on its
|
| 441 |
+
// own through `IsolatePlatformDelegate`. Upon registering an isolate with
|
| 442 |
+
// this overload any other method in this class with the exception of
|
| 443 |
+
// `UnregisterIsolate` *must not* be used on that isolate.
|
| 444 |
+
virtual void RegisterIsolate(v8::Isolate* isolate,
|
| 445 |
+
IsolatePlatformDelegate* delegate) = 0;
|
| 446 |
+
|
| 447 |
+
// This function may only be called once per `Isolate`, and discard any
|
| 448 |
+
// pending delayed tasks scheduled for that isolate.
|
| 449 |
+
// This needs to be called right after calling `Isolate::Dispose()`.
|
| 450 |
+
virtual void UnregisterIsolate(v8::Isolate* isolate) = 0;
|
| 451 |
+
// This disposes, unregisters and frees up an isolate that's allocated using
|
| 452 |
+
// v8::Isolate::Allocate() in the correct order to prevent race conditions.
|
| 453 |
+
void DisposeIsolate(v8::Isolate* isolate);
|
| 454 |
+
|
| 455 |
+
// The platform should call the passed function once all state associated
|
| 456 |
+
// with the given isolate has been cleaned up. This can, but does not have to,
|
| 457 |
+
// happen asynchronously.
|
| 458 |
+
virtual void AddIsolateFinishedCallback(v8::Isolate* isolate,
|
| 459 |
+
void (*callback)(void*),
|
| 460 |
+
void* data) = 0;
|
| 461 |
+
|
| 462 |
+
static std::unique_ptr<MultiIsolatePlatform> Create(
|
| 463 |
+
int thread_pool_size,
|
| 464 |
+
v8::TracingController* tracing_controller = nullptr,
|
| 465 |
+
v8::PageAllocator* page_allocator = nullptr);
|
| 466 |
+
};
|
| 467 |
+
|
| 468 |
+
enum IsolateSettingsFlags {
|
| 469 |
+
MESSAGE_LISTENER_WITH_ERROR_LEVEL = 1 << 0,
|
| 470 |
+
DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1,
|
| 471 |
+
SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2,
|
| 472 |
+
SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3,
|
| 473 |
+
ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK = 0, /* legacy no-op */
|
| 474 |
+
};
|
| 475 |
+
|
| 476 |
+
struct IsolateSettings {
|
| 477 |
+
uint64_t flags = MESSAGE_LISTENER_WITH_ERROR_LEVEL |
|
| 478 |
+
DETAILED_SOURCE_POSITIONS_FOR_PROFILING;
|
| 479 |
+
v8::MicrotasksPolicy policy = v8::MicrotasksPolicy::kExplicit;
|
| 480 |
+
|
| 481 |
+
// Error handling callbacks
|
| 482 |
+
v8::Isolate::AbortOnUncaughtExceptionCallback
|
| 483 |
+
should_abort_on_uncaught_exception_callback = nullptr;
|
| 484 |
+
v8::FatalErrorCallback fatal_error_callback = nullptr;
|
| 485 |
+
v8::OOMErrorCallback oom_error_callback = nullptr;
|
| 486 |
+
v8::PrepareStackTraceCallback prepare_stack_trace_callback = nullptr;
|
| 487 |
+
|
| 488 |
+
// Miscellaneous callbacks
|
| 489 |
+
v8::PromiseRejectCallback promise_reject_callback = nullptr;
|
| 490 |
+
v8::AllowWasmCodeGenerationCallback
|
| 491 |
+
allow_wasm_code_generation_callback = nullptr;
|
| 492 |
+
v8::ModifyCodeGenerationFromStringsCallback2
|
| 493 |
+
modify_code_generation_from_strings_callback = nullptr;
|
| 494 |
+
|
| 495 |
+
// When the settings is passed to NewIsolate():
|
| 496 |
+
// - If cpp_heap is not nullptr, this CppHeap will be used to create
|
| 497 |
+
// the isolate and its ownership will be passed to V8.
|
| 498 |
+
// - If this is nullptr, Node.js will create a CppHeap that will be
|
| 499 |
+
// owned by V8.
|
| 500 |
+
//
|
| 501 |
+
// When the settings is passed to SetIsolateUpForNode():
|
| 502 |
+
// cpp_heap will be ignored. Embedders must ensure that the
|
| 503 |
+
// v8::Isolate has a CppHeap attached while it's still used by
|
| 504 |
+
// Node.js, for example using v8::CreateParams.
|
| 505 |
+
//
|
| 506 |
+
// See https://issues.chromium.org/issues/42203693. In future version
|
| 507 |
+
// of V8, this CppHeap will be created by V8 if not provided.
|
| 508 |
+
v8::CppHeap* cpp_heap = nullptr;
|
| 509 |
+
};
|
| 510 |
+
|
| 511 |
+
// Represents a startup snapshot blob, e.g. created by passing
|
| 512 |
+
// --node-snapshot-main=entry.js to the configure script at build time,
|
| 513 |
+
// or by running Node.js with the --build-snapshot option.
|
| 514 |
+
//
|
| 515 |
+
// If used, the snapshot *must* have been built with the same Node.js
|
| 516 |
+
// version and V8 flags as the version that is currently running, and will
|
| 517 |
+
// be rejected otherwise.
|
| 518 |
+
// The same EmbedderSnapshotData instance *must* be passed to both
|
| 519 |
+
// `NewIsolate()` and `CreateIsolateData()`. The first `Environment` instance
|
| 520 |
+
// should be created with an empty `context` argument and will then
|
| 521 |
+
// use the main context included in the snapshot blob. It can be retrieved
|
| 522 |
+
// using `GetMainContext()`. `LoadEnvironment` can receive an empty
|
| 523 |
+
// `StartExecutionCallback` in this case.
|
| 524 |
+
// If V8 was configured with the shared-readonly-heap option, it requires
|
| 525 |
+
// all snapshots used to create `Isolate` instances to be identical.
|
| 526 |
+
// This option *must* be unset by embedders who wish to use the startup
|
| 527 |
+
// feature during the build step by passing the --disable-shared-readonly-heap
|
| 528 |
+
// flag to the configure script.
|
| 529 |
+
//
|
| 530 |
+
// The snapshot *must* be kept alive during the execution of the Isolate
|
| 531 |
+
// that was created using it.
|
| 532 |
+
//
|
| 533 |
+
// Snapshots are an *experimental* feature. In particular, the embedder API
|
| 534 |
+
// exposed through this class is subject to change or removal between Node.js
|
| 535 |
+
// versions, including possible API and ABI breakage.
|
| 536 |
+
class EmbedderSnapshotData {
|
| 537 |
+
public:
|
| 538 |
+
struct DeleteSnapshotData {
|
| 539 |
+
void operator()(const EmbedderSnapshotData*) const;
|
| 540 |
+
};
|
| 541 |
+
using Pointer =
|
| 542 |
+
std::unique_ptr<const EmbedderSnapshotData, DeleteSnapshotData>;
|
| 543 |
+
|
| 544 |
+
// Return an EmbedderSnapshotData object that refers to the built-in
|
| 545 |
+
// snapshot of Node.js. This can have been configured through e.g.
|
| 546 |
+
// --node-snapshot-main=entry.js.
|
| 547 |
+
static Pointer BuiltinSnapshotData();
|
| 548 |
+
|
| 549 |
+
// Return an EmbedderSnapshotData object that is based on an input file.
|
| 550 |
+
// Calling this method will consume but not close the FILE* handle.
|
| 551 |
+
// The FILE* handle can be closed immediately following this call.
|
| 552 |
+
// If the snapshot is invalid, this returns an empty pointer.
|
| 553 |
+
static Pointer FromFile(FILE* in);
|
| 554 |
+
static Pointer FromBlob(const std::vector<char>& in);
|
| 555 |
+
static Pointer FromBlob(std::string_view in);
|
| 556 |
+
|
| 557 |
+
// Write this EmbedderSnapshotData object to an output file.
|
| 558 |
+
// Calling this method will not close the FILE* handle.
|
| 559 |
+
// The FILE* handle can be closed immediately following this call.
|
| 560 |
+
void ToFile(FILE* out) const;
|
| 561 |
+
std::vector<char> ToBlob() const;
|
| 562 |
+
|
| 563 |
+
// Returns whether custom snapshots can be used. Currently, this always
|
| 564 |
+
// returns false since V8 enforces shared readonly-heap.
|
| 565 |
+
static bool CanUseCustomSnapshotPerIsolate();
|
| 566 |
+
|
| 567 |
+
EmbedderSnapshotData(const EmbedderSnapshotData&) = delete;
|
| 568 |
+
EmbedderSnapshotData& operator=(const EmbedderSnapshotData&) = delete;
|
| 569 |
+
EmbedderSnapshotData(EmbedderSnapshotData&&) = delete;
|
| 570 |
+
EmbedderSnapshotData& operator=(EmbedderSnapshotData&&) = delete;
|
| 571 |
+
|
| 572 |
+
protected:
|
| 573 |
+
EmbedderSnapshotData(const SnapshotData* impl, bool owns_impl);
|
| 574 |
+
|
| 575 |
+
private:
|
| 576 |
+
const SnapshotData* impl_;
|
| 577 |
+
bool owns_impl_;
|
| 578 |
+
friend struct SnapshotData;
|
| 579 |
+
friend class CommonEnvironmentSetup;
|
| 580 |
+
};
|
| 581 |
+
|
| 582 |
+
// Overriding IsolateSettings may produce unexpected behavior
|
| 583 |
+
// in Node.js core functionality, so proceed at your own risk.
|
| 584 |
+
NODE_EXTERN void SetIsolateUpForNode(v8::Isolate* isolate,
|
| 585 |
+
const IsolateSettings& settings);
|
| 586 |
+
|
| 587 |
+
// Set a number of callbacks for the `isolate`, in particular the Node.js
|
| 588 |
+
// uncaught exception listener.
|
| 589 |
+
NODE_EXTERN void SetIsolateUpForNode(v8::Isolate* isolate);
|
| 590 |
+
|
| 591 |
+
// Creates a new isolate with Node.js-specific settings.
|
| 592 |
+
// This is a convenience method equivalent to using SetIsolateCreateParams(),
|
| 593 |
+
// Isolate::Allocate(), MultiIsolatePlatform::RegisterIsolate(),
|
| 594 |
+
// Isolate::Initialize(), and SetIsolateUpForNode().
|
| 595 |
+
NODE_EXTERN v8::Isolate* NewIsolate(
|
| 596 |
+
ArrayBufferAllocator* allocator,
|
| 597 |
+
struct uv_loop_s* event_loop,
|
| 598 |
+
MultiIsolatePlatform* platform,
|
| 599 |
+
const EmbedderSnapshotData* snapshot_data = nullptr,
|
| 600 |
+
const IsolateSettings& settings = {});
|
| 601 |
+
NODE_EXTERN v8::Isolate* NewIsolate(
|
| 602 |
+
std::shared_ptr<ArrayBufferAllocator> allocator,
|
| 603 |
+
struct uv_loop_s* event_loop,
|
| 604 |
+
MultiIsolatePlatform* platform,
|
| 605 |
+
const EmbedderSnapshotData* snapshot_data = nullptr,
|
| 606 |
+
const IsolateSettings& settings = {});
|
| 607 |
+
|
| 608 |
+
// Creates a new context with Node.js-specific tweaks.
|
| 609 |
+
NODE_EXTERN v8::Local<v8::Context> NewContext(
|
| 610 |
+
v8::Isolate* isolate,
|
| 611 |
+
v8::Local<v8::ObjectTemplate> object_template =
|
| 612 |
+
v8::Local<v8::ObjectTemplate>());
|
| 613 |
+
|
| 614 |
+
// Runs Node.js-specific tweaks on an already constructed context
|
| 615 |
+
// Return value indicates success of operation
|
| 616 |
+
NODE_EXTERN v8::Maybe<bool> InitializeContext(v8::Local<v8::Context> context);
|
| 617 |
+
|
| 618 |
+
// If `platform` is passed, it will be used to register new Worker instances.
|
| 619 |
+
// It can be `nullptr`, in which case creating new Workers inside of
|
| 620 |
+
// Environments that use this `IsolateData` will not work.
|
| 621 |
+
NODE_EXTERN IsolateData* CreateIsolateData(
|
| 622 |
+
v8::Isolate* isolate,
|
| 623 |
+
struct uv_loop_s* loop,
|
| 624 |
+
MultiIsolatePlatform* platform = nullptr,
|
| 625 |
+
ArrayBufferAllocator* allocator = nullptr,
|
| 626 |
+
const EmbedderSnapshotData* snapshot_data = nullptr);
|
| 627 |
+
NODE_EXTERN void FreeIsolateData(IsolateData* isolate_data);
|
| 628 |
+
|
| 629 |
+
struct ThreadId {
|
| 630 |
+
uint64_t id = static_cast<uint64_t>(-1);
|
| 631 |
+
};
|
| 632 |
+
NODE_EXTERN ThreadId AllocateEnvironmentThreadId();
|
| 633 |
+
|
| 634 |
+
namespace EnvironmentFlags {
|
| 635 |
+
enum Flags : uint64_t {
|
| 636 |
+
kNoFlags = 0,
|
| 637 |
+
// Use the default behaviour for Node.js instances.
|
| 638 |
+
kDefaultFlags = 1 << 0,
|
| 639 |
+
// Controls whether this Environment is allowed to affect per-process state
|
| 640 |
+
// (e.g. cwd, process title, uid, etc.).
|
| 641 |
+
// This is set when using kDefaultFlags.
|
| 642 |
+
kOwnsProcessState = 1 << 1,
|
| 643 |
+
// Set if this Environment instance is associated with the global inspector
|
| 644 |
+
// handling code (i.e. listening on SIGUSR1).
|
| 645 |
+
// This is set when using kDefaultFlags.
|
| 646 |
+
kOwnsInspector = 1 << 2,
|
| 647 |
+
// Set if Node.js should not run its own esm loader. This is needed by some
|
| 648 |
+
// embedders, because it's possible for the Node.js esm loader to conflict
|
| 649 |
+
// with another one in an embedder environment, e.g. Blink's in Chromium.
|
| 650 |
+
kNoRegisterESMLoader = 1 << 3,
|
| 651 |
+
// Set this flag to make Node.js track "raw" file descriptors, i.e. managed
|
| 652 |
+
// by fs.open() and fs.close(), and close them during FreeEnvironment().
|
| 653 |
+
kTrackUnmanagedFds = 1 << 4,
|
| 654 |
+
// Set this flag to force hiding console windows when spawning child
|
| 655 |
+
// processes. This is usually used when embedding Node.js in GUI programs on
|
| 656 |
+
// Windows.
|
| 657 |
+
kHideConsoleWindows = 1 << 5,
|
| 658 |
+
// Set this flag to disable loading native addons via `process.dlopen`.
|
| 659 |
+
// This environment flag is especially important for worker threads
|
| 660 |
+
// so that a worker thread can't load a native addon even if `execArgv`
|
| 661 |
+
// is overwritten and `--no-addons` is not specified but was specified
|
| 662 |
+
// for this Environment instance.
|
| 663 |
+
kNoNativeAddons = 1 << 6,
|
| 664 |
+
// Set this flag to disable searching modules from global paths like
|
| 665 |
+
// $HOME/.node_modules and $NODE_PATH. This is used by standalone apps that
|
| 666 |
+
// do not expect to have their behaviors changed because of globally
|
| 667 |
+
// installed modules.
|
| 668 |
+
kNoGlobalSearchPaths = 1 << 7,
|
| 669 |
+
// Do not export browser globals like setTimeout, console, etc.
|
| 670 |
+
kNoBrowserGlobals = 1 << 8,
|
| 671 |
+
// Controls whether or not the Environment should call V8Inspector::create().
|
| 672 |
+
// This control is needed by embedders who may not want to initialize the V8
|
| 673 |
+
// inspector in situations where one has already been created,
|
| 674 |
+
// e.g. Blink's in Chromium.
|
| 675 |
+
kNoCreateInspector = 1 << 9,
|
| 676 |
+
// Controls whether or not the InspectorAgent for this Environment should
|
| 677 |
+
// call StartDebugSignalHandler. This control is needed by embedders who may
|
| 678 |
+
// not want to allow other processes to start the V8 inspector.
|
| 679 |
+
kNoStartDebugSignalHandler = 1 << 10,
|
| 680 |
+
// Controls whether the InspectorAgent created for this Environment waits for
|
| 681 |
+
// Inspector frontend events during the Environment creation. It's used to
|
| 682 |
+
// call node::Stop(env) on a Worker thread that is waiting for the events.
|
| 683 |
+
kNoWaitForInspectorFrontend = 1 << 11
|
| 684 |
+
};
|
| 685 |
+
} // namespace EnvironmentFlags
|
| 686 |
+
|
| 687 |
+
enum class SnapshotFlags : uint32_t {
|
| 688 |
+
kDefault = 0,
|
| 689 |
+
// Whether code cache should be generated as part of the snapshot.
|
| 690 |
+
// Code cache reduces the time spent on compiling functions included
|
| 691 |
+
// in the snapshot at the expense of a bigger snapshot size and
|
| 692 |
+
// potentially breaking portability of the snapshot.
|
| 693 |
+
kWithoutCodeCache = 1 << 0,
|
| 694 |
+
};
|
| 695 |
+
|
| 696 |
+
struct SnapshotConfig {
|
| 697 |
+
SnapshotFlags flags = SnapshotFlags::kDefault;
|
| 698 |
+
|
| 699 |
+
// When builder_script_path is std::nullopt, the snapshot is generated as a
|
| 700 |
+
// built-in snapshot instead of a custom one, and it's expected that the
|
| 701 |
+
// built-in snapshot only contains states that reproduce in every run of the
|
| 702 |
+
// application. The event loop won't be run when generating a built-in
|
| 703 |
+
// snapshot, so asynchronous operations should be avoided.
|
| 704 |
+
//
|
| 705 |
+
// When builder_script_path is an std::string, it should match args[1]
|
| 706 |
+
// passed to CreateForSnapshotting(). The embedder is also expected to use
|
| 707 |
+
// LoadEnvironment() to run a script matching this path. In that case the
|
| 708 |
+
// snapshot is generated as a custom snapshot and the event loop is run, so
|
| 709 |
+
// the snapshot builder can execute asynchronous operations as long as they
|
| 710 |
+
// are run to completion when the snapshot is taken.
|
| 711 |
+
std::optional<std::string> builder_script_path;
|
| 712 |
+
};
|
| 713 |
+
|
| 714 |
+
struct InspectorParentHandle {
|
| 715 |
+
virtual ~InspectorParentHandle() = default;
|
| 716 |
+
};
|
| 717 |
+
|
| 718 |
+
// TODO(addaleax): Maybe move per-Environment options parsing here.
|
| 719 |
+
// Returns nullptr when the Environment cannot be created e.g. there are
|
| 720 |
+
// pending JavaScript exceptions.
|
| 721 |
+
// `context` may be empty if an `EmbedderSnapshotData` instance was provided
|
| 722 |
+
// to `NewIsolate()` and `CreateIsolateData()`.
|
| 723 |
+
NODE_EXTERN Environment* CreateEnvironment(
|
| 724 |
+
IsolateData* isolate_data,
|
| 725 |
+
v8::Local<v8::Context> context,
|
| 726 |
+
const std::vector<std::string>& args,
|
| 727 |
+
const std::vector<std::string>& exec_args,
|
| 728 |
+
EnvironmentFlags::Flags flags = EnvironmentFlags::kDefaultFlags,
|
| 729 |
+
ThreadId thread_id = {} /* allocates a thread id automatically */,
|
| 730 |
+
std::unique_ptr<InspectorParentHandle> inspector_parent_handle = {});
|
| 731 |
+
|
| 732 |
+
NODE_EXTERN Environment* CreateEnvironment(
|
| 733 |
+
IsolateData* isolate_data,
|
| 734 |
+
v8::Local<v8::Context> context,
|
| 735 |
+
const std::vector<std::string>& args,
|
| 736 |
+
const std::vector<std::string>& exec_args,
|
| 737 |
+
EnvironmentFlags::Flags flags,
|
| 738 |
+
ThreadId thread_id,
|
| 739 |
+
std::unique_ptr<InspectorParentHandle> inspector_parent_handle,
|
| 740 |
+
std::string_view thread_name);
|
| 741 |
+
|
| 742 |
+
// Returns a handle that can be passed to `LoadEnvironment()`, making the
|
| 743 |
+
// child Environment accessible to the inspector as if it were a Node.js Worker.
|
| 744 |
+
// `child_thread_id` can be created using `AllocateEnvironmentThreadId()`
|
| 745 |
+
// and then later passed on to `CreateEnvironment()` to create the child
|
| 746 |
+
// Environment, together with the inspector handle.
|
| 747 |
+
// This method should not be called while the parent Environment is active
|
| 748 |
+
// on another thread.
|
| 749 |
+
NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
|
| 750 |
+
Environment* parent_env,
|
| 751 |
+
ThreadId child_thread_id,
|
| 752 |
+
const char* child_url);
|
| 753 |
+
|
| 754 |
+
NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
|
| 755 |
+
Environment* parent_env,
|
| 756 |
+
ThreadId child_thread_id,
|
| 757 |
+
const char* child_url,
|
| 758 |
+
const char* name);
|
| 759 |
+
|
| 760 |
+
NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
|
| 761 |
+
Environment* parent_env,
|
| 762 |
+
ThreadId child_thread_id,
|
| 763 |
+
std::string_view child_url,
|
| 764 |
+
std::string_view name);
|
| 765 |
+
|
| 766 |
+
struct StartExecutionCallbackInfo {
|
| 767 |
+
v8::Local<v8::Object> process_object;
|
| 768 |
+
v8::Local<v8::Function> native_require;
|
| 769 |
+
v8::Local<v8::Function> run_cjs;
|
| 770 |
+
};
|
| 771 |
+
|
| 772 |
+
using StartExecutionCallback =
|
| 773 |
+
std::function<v8::MaybeLocal<v8::Value>(const StartExecutionCallbackInfo&)>;
|
| 774 |
+
using EmbedderPreloadCallback =
|
| 775 |
+
std::function<void(Environment* env,
|
| 776 |
+
v8::Local<v8::Value> process,
|
| 777 |
+
v8::Local<v8::Value> require)>;
|
| 778 |
+
|
| 779 |
+
// Run initialization for the environment.
|
| 780 |
+
//
|
| 781 |
+
// The |preload| function, usually used by embedders to inject scripts,
|
| 782 |
+
// will be run by Node.js before Node.js executes the entry point.
|
| 783 |
+
// The function is guaranteed to run before the user land module loader running
|
| 784 |
+
// any user code, so it is safe to assume that at this point, no user code has
|
| 785 |
+
// been run yet.
|
| 786 |
+
// The function will be executed with preload(process, require), and the passed
|
| 787 |
+
// require function has access to internal Node.js modules. There is no
|
| 788 |
+
// stability guarantee about the internals exposed to the internal require
|
| 789 |
+
// function. Expect breakages when updating Node.js versions if the embedder
|
| 790 |
+
// imports internal modules with the internal require function.
|
| 791 |
+
// Worker threads created in the environment will also respect The |preload|
|
| 792 |
+
// function, so make sure the function is thread-safe.
|
| 793 |
+
NODE_EXTERN v8::MaybeLocal<v8::Value> LoadEnvironment(
|
| 794 |
+
Environment* env,
|
| 795 |
+
StartExecutionCallback cb,
|
| 796 |
+
EmbedderPreloadCallback preload = nullptr);
|
| 797 |
+
NODE_EXTERN v8::MaybeLocal<v8::Value> LoadEnvironment(
|
| 798 |
+
Environment* env,
|
| 799 |
+
std::string_view main_script_source_utf8,
|
| 800 |
+
EmbedderPreloadCallback preload = nullptr);
|
| 801 |
+
NODE_EXTERN void FreeEnvironment(Environment* env);
|
| 802 |
+
|
| 803 |
+
// Set a callback that is called when process.exit() is called from JS,
|
| 804 |
+
// overriding the default handler.
|
| 805 |
+
// It receives the Environment* instance and the exit code as arguments.
|
| 806 |
+
// This could e.g. call Stop(env); in order to terminate execution and stop
|
| 807 |
+
// the event loop.
|
| 808 |
+
// The default handler disposes of the global V8 platform instance, if one is
|
| 809 |
+
// being used, and calls exit().
|
| 810 |
+
NODE_EXTERN void SetProcessExitHandler(
|
| 811 |
+
Environment* env,
|
| 812 |
+
std::function<void(Environment*, int)>&& handler);
|
| 813 |
+
NODE_EXTERN void DefaultProcessExitHandler(Environment* env, int exit_code);
|
| 814 |
+
|
| 815 |
+
// This may return nullptr if context is not associated with a Node instance.
|
| 816 |
+
NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
|
| 817 |
+
NODE_EXTERN IsolateData* GetEnvironmentIsolateData(Environment* env);
|
| 818 |
+
NODE_EXTERN ArrayBufferAllocator* GetArrayBufferAllocator(IsolateData* data);
|
| 819 |
+
// This is mostly useful for Environment* instances that were created through
|
| 820 |
+
// a snapshot and have a main context that was read from that snapshot.
|
| 821 |
+
NODE_EXTERN v8::Local<v8::Context> GetMainContext(Environment* env);
|
| 822 |
+
|
| 823 |
+
[[noreturn]] NODE_EXTERN void OnFatalError(const char* location,
|
| 824 |
+
const char* message);
|
| 825 |
+
NODE_EXTERN void PromiseRejectCallback(v8::PromiseRejectMessage message);
|
| 826 |
+
NODE_EXTERN bool AllowWasmCodeGenerationCallback(v8::Local<v8::Context> context,
|
| 827 |
+
v8::Local<v8::String>);
|
| 828 |
+
NODE_EXTERN bool ShouldAbortOnUncaughtException(v8::Isolate* isolate);
|
| 829 |
+
NODE_EXTERN v8::MaybeLocal<v8::Value> PrepareStackTraceCallback(
|
| 830 |
+
v8::Local<v8::Context> context,
|
| 831 |
+
v8::Local<v8::Value> exception,
|
| 832 |
+
v8::Local<v8::Array> trace);
|
| 833 |
+
|
| 834 |
+
// Writes a diagnostic report to a file. If filename is not provided, the
|
| 835 |
+
// default filename includes the date, time, PID, and a sequence number.
|
| 836 |
+
// The report's JavaScript stack trace is taken from err, if present.
|
| 837 |
+
// If isolate is nullptr, no information about the JavaScript environment
|
| 838 |
+
// is included in the report.
|
| 839 |
+
// Returns the filename of the written report.
|
| 840 |
+
NODE_EXTERN std::string TriggerNodeReport(v8::Isolate* isolate,
|
| 841 |
+
const char* message,
|
| 842 |
+
const char* trigger,
|
| 843 |
+
const std::string& filename,
|
| 844 |
+
v8::Local<v8::Value> error);
|
| 845 |
+
NODE_EXTERN std::string TriggerNodeReport(Environment* env,
|
| 846 |
+
const char* message,
|
| 847 |
+
const char* trigger,
|
| 848 |
+
const std::string& filename,
|
| 849 |
+
v8::Local<v8::Value> error);
|
| 850 |
+
NODE_EXTERN void GetNodeReport(v8::Isolate* isolate,
|
| 851 |
+
const char* message,
|
| 852 |
+
const char* trigger,
|
| 853 |
+
v8::Local<v8::Value> error,
|
| 854 |
+
std::ostream& out);
|
| 855 |
+
NODE_EXTERN void GetNodeReport(Environment* env,
|
| 856 |
+
const char* message,
|
| 857 |
+
const char* trigger,
|
| 858 |
+
v8::Local<v8::Value> error,
|
| 859 |
+
std::ostream& out);
|
| 860 |
+
|
| 861 |
+
// This returns the MultiIsolatePlatform used for an Environment or IsolateData
|
| 862 |
+
// instance, if one exists.
|
| 863 |
+
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
|
| 864 |
+
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
|
| 865 |
+
|
| 866 |
+
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
| 867 |
+
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
|
| 868 |
+
int thread_pool_size,
|
| 869 |
+
v8::TracingController* tracing_controller));
|
| 870 |
+
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
| 871 |
+
NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform));
|
| 872 |
+
|
| 873 |
+
// Get/set the currently active tracing controller. Using CreatePlatform()
|
| 874 |
+
// will implicitly set this by default. This is global and should be initialized
|
| 875 |
+
// along with the v8::Platform instance that is being used. `controller`
|
| 876 |
+
// is allowed to be `nullptr`.
|
| 877 |
+
// This is used for tracing events from Node.js itself. V8 uses the tracing
|
| 878 |
+
// controller returned from the active `v8::Platform` instance.
|
| 879 |
+
NODE_EXTERN v8::TracingController* GetTracingController();
|
| 880 |
+
NODE_EXTERN void SetTracingController(v8::TracingController* controller);
|
| 881 |
+
|
| 882 |
+
// Run `process.emit('beforeExit')` as it would usually happen when Node.js is
|
| 883 |
+
// run in standalone mode.
|
| 884 |
+
NODE_EXTERN v8::Maybe<bool> EmitProcessBeforeExit(Environment* env);
|
| 885 |
+
NODE_DEPRECATED("Use Maybe version (EmitProcessBeforeExit) instead",
|
| 886 |
+
NODE_EXTERN void EmitBeforeExit(Environment* env));
|
| 887 |
+
// Run `process.emit('exit')` as it would usually happen when Node.js is run
|
| 888 |
+
// in standalone mode. The return value corresponds to the exit code.
|
| 889 |
+
NODE_EXTERN v8::Maybe<int> EmitProcessExit(Environment* env);
|
| 890 |
+
NODE_DEPRECATED("Use Maybe version (EmitProcessExit) instead",
|
| 891 |
+
NODE_EXTERN int EmitExit(Environment* env));
|
| 892 |
+
|
| 893 |
+
// Runs hooks added through `AtExit()`. This is part of `FreeEnvironment()`,
|
| 894 |
+
// so calling it manually is typically not necessary.
|
| 895 |
+
NODE_EXTERN void RunAtExit(Environment* env);
|
| 896 |
+
|
| 897 |
+
// This may return nullptr if the current v8::Context is not associated
|
| 898 |
+
// with a Node instance.
|
| 899 |
+
NODE_EXTERN struct uv_loop_s* GetCurrentEventLoop(v8::Isolate* isolate);
|
| 900 |
+
|
| 901 |
+
// Runs the main loop for a given Environment. This roughly performs the
|
| 902 |
+
// following steps:
|
| 903 |
+
// 1. Call uv_run() on the event loop until it is drained.
|
| 904 |
+
// 2. Call platform->DrainTasks() on the associated platform/isolate.
|
| 905 |
+
// 3. If the event loop is alive again, go to Step 1.
|
| 906 |
+
// 4. Call EmitProcessBeforeExit().
|
| 907 |
+
// 5. If the event loop is alive again, go to Step 1.
|
| 908 |
+
// 6. Call EmitProcessExit() and forward the return value.
|
| 909 |
+
// If at any point node::Stop() is called, the function will attempt to return
|
| 910 |
+
// as soon as possible, returning an empty `Maybe`.
|
| 911 |
+
// This function only works if `env` has an associated `MultiIsolatePlatform`.
|
| 912 |
+
NODE_EXTERN v8::Maybe<int> SpinEventLoop(Environment* env);
|
| 913 |
+
|
| 914 |
+
NODE_EXTERN std::string GetAnonymousMainPath();
|
| 915 |
+
|
| 916 |
+
class NODE_EXTERN CommonEnvironmentSetup {
|
| 917 |
+
public:
|
| 918 |
+
~CommonEnvironmentSetup();
|
| 919 |
+
|
| 920 |
+
// Create a new CommonEnvironmentSetup, that is, a group of objects that
|
| 921 |
+
// together form the typical setup for a single Node.js Environment instance.
|
| 922 |
+
// If any error occurs, `*errors` will be populated and the returned pointer
|
| 923 |
+
// will be empty.
|
| 924 |
+
// env_args will be passed through as arguments to CreateEnvironment(), after
|
| 925 |
+
// `isolate_data` and `context`.
|
| 926 |
+
template <typename... EnvironmentArgs>
|
| 927 |
+
static std::unique_ptr<CommonEnvironmentSetup> Create(
|
| 928 |
+
MultiIsolatePlatform* platform,
|
| 929 |
+
std::vector<std::string>* errors,
|
| 930 |
+
EnvironmentArgs&&... env_args);
|
| 931 |
+
template <typename... EnvironmentArgs>
|
| 932 |
+
static std::unique_ptr<CommonEnvironmentSetup> CreateFromSnapshot(
|
| 933 |
+
MultiIsolatePlatform* platform,
|
| 934 |
+
std::vector<std::string>* errors,
|
| 935 |
+
const EmbedderSnapshotData* snapshot_data,
|
| 936 |
+
EnvironmentArgs&&... env_args);
|
| 937 |
+
|
| 938 |
+
// Create an embedding setup which will be used for creating a snapshot
|
| 939 |
+
// using CreateSnapshot().
|
| 940 |
+
//
|
| 941 |
+
// This will create and attach a v8::SnapshotCreator to this instance,
|
| 942 |
+
// and the same restrictions apply to this instance that also apply to
|
| 943 |
+
// other V8 snapshotting environments.
|
| 944 |
+
// Not all Node.js APIs are supported in this case. Currently, there is
|
| 945 |
+
// no support for native/host objects other than Node.js builtins
|
| 946 |
+
// in the snapshot.
|
| 947 |
+
//
|
| 948 |
+
// If the embedder wants to use LoadEnvironment() later to run a snapshot
|
| 949 |
+
// builder script they should make sure args[1] contains the path of the
|
| 950 |
+
// snapshot script, which will be used to create __filename and __dirname
|
| 951 |
+
// in the context where the builder script is run. If they do not want to
|
| 952 |
+
// include the build-time paths into the snapshot, use the string returned
|
| 953 |
+
// by GetAnonymousMainPath() as args[1] to anonymize the script.
|
| 954 |
+
//
|
| 955 |
+
// Snapshots are an *experimental* feature. In particular, the embedder API
|
| 956 |
+
// exposed through this class is subject to change or removal between Node.js
|
| 957 |
+
// versions, including possible API and ABI breakage.
|
| 958 |
+
static std::unique_ptr<CommonEnvironmentSetup> CreateForSnapshotting(
|
| 959 |
+
MultiIsolatePlatform* platform,
|
| 960 |
+
std::vector<std::string>* errors,
|
| 961 |
+
const std::vector<std::string>& args = {},
|
| 962 |
+
const std::vector<std::string>& exec_args = {},
|
| 963 |
+
const SnapshotConfig& snapshot_config = {});
|
| 964 |
+
EmbedderSnapshotData::Pointer CreateSnapshot();
|
| 965 |
+
|
| 966 |
+
struct uv_loop_s* event_loop() const;
|
| 967 |
+
v8::SnapshotCreator* snapshot_creator();
|
| 968 |
+
// Empty for snapshotting environments.
|
| 969 |
+
std::shared_ptr<ArrayBufferAllocator> array_buffer_allocator() const;
|
| 970 |
+
v8::Isolate* isolate() const;
|
| 971 |
+
IsolateData* isolate_data() const;
|
| 972 |
+
Environment* env() const;
|
| 973 |
+
v8::Local<v8::Context> context() const;
|
| 974 |
+
|
| 975 |
+
CommonEnvironmentSetup(const CommonEnvironmentSetup&) = delete;
|
| 976 |
+
CommonEnvironmentSetup& operator=(const CommonEnvironmentSetup&) = delete;
|
| 977 |
+
CommonEnvironmentSetup(CommonEnvironmentSetup&&) = delete;
|
| 978 |
+
CommonEnvironmentSetup& operator=(CommonEnvironmentSetup&&) = delete;
|
| 979 |
+
|
| 980 |
+
private:
|
| 981 |
+
enum Flags : uint32_t {
|
| 982 |
+
kNoFlags = 0,
|
| 983 |
+
kIsForSnapshotting = 1,
|
| 984 |
+
};
|
| 985 |
+
|
| 986 |
+
struct Impl;
|
| 987 |
+
Impl* impl_;
|
| 988 |
+
|
| 989 |
+
CommonEnvironmentSetup(
|
| 990 |
+
MultiIsolatePlatform*,
|
| 991 |
+
std::vector<std::string>*,
|
| 992 |
+
std::function<Environment*(const CommonEnvironmentSetup*)>);
|
| 993 |
+
CommonEnvironmentSetup(
|
| 994 |
+
MultiIsolatePlatform*,
|
| 995 |
+
std::vector<std::string>*,
|
| 996 |
+
const EmbedderSnapshotData*,
|
| 997 |
+
uint32_t flags,
|
| 998 |
+
std::function<Environment*(const CommonEnvironmentSetup*)>,
|
| 999 |
+
const SnapshotConfig* config = nullptr);
|
| 1000 |
+
};
|
| 1001 |
+
|
| 1002 |
+
// Implementation for CommonEnvironmentSetup::Create
|
| 1003 |
+
template <typename... EnvironmentArgs>
|
| 1004 |
+
std::unique_ptr<CommonEnvironmentSetup> CommonEnvironmentSetup::Create(
|
| 1005 |
+
MultiIsolatePlatform* platform,
|
| 1006 |
+
std::vector<std::string>* errors,
|
| 1007 |
+
EnvironmentArgs&&... env_args) {
|
| 1008 |
+
auto ret = std::unique_ptr<CommonEnvironmentSetup>(new CommonEnvironmentSetup(
|
| 1009 |
+
platform, errors,
|
| 1010 |
+
[&](const CommonEnvironmentSetup* setup) -> Environment* {
|
| 1011 |
+
return CreateEnvironment(
|
| 1012 |
+
setup->isolate_data(), setup->context(),
|
| 1013 |
+
std::forward<EnvironmentArgs>(env_args)...);
|
| 1014 |
+
}));
|
| 1015 |
+
if (!errors->empty()) ret.reset();
|
| 1016 |
+
return ret;
|
| 1017 |
+
}
|
| 1018 |
+
|
| 1019 |
+
// Implementation for ::CreateFromSnapshot -- the ::Create() method
|
| 1020 |
+
// could call this with a nullptr snapshot_data in a major version.
|
| 1021 |
+
template <typename... EnvironmentArgs>
|
| 1022 |
+
std::unique_ptr<CommonEnvironmentSetup>
|
| 1023 |
+
CommonEnvironmentSetup::CreateFromSnapshot(
|
| 1024 |
+
MultiIsolatePlatform* platform,
|
| 1025 |
+
std::vector<std::string>* errors,
|
| 1026 |
+
const EmbedderSnapshotData* snapshot_data,
|
| 1027 |
+
EnvironmentArgs&&... env_args) {
|
| 1028 |
+
auto ret = std::unique_ptr<CommonEnvironmentSetup>(new CommonEnvironmentSetup(
|
| 1029 |
+
platform,
|
| 1030 |
+
errors,
|
| 1031 |
+
snapshot_data,
|
| 1032 |
+
Flags::kNoFlags,
|
| 1033 |
+
[&](const CommonEnvironmentSetup* setup) -> Environment* {
|
| 1034 |
+
return CreateEnvironment(setup->isolate_data(),
|
| 1035 |
+
setup->context(),
|
| 1036 |
+
std::forward<EnvironmentArgs>(env_args)...);
|
| 1037 |
+
}));
|
| 1038 |
+
if (!errors->empty()) ret.reset();
|
| 1039 |
+
return ret;
|
| 1040 |
+
}
|
| 1041 |
+
|
| 1042 |
+
/* Converts a unixtime to V8 Date */
|
| 1043 |
+
NODE_DEPRECATED("Use v8::Date::New() directly",
|
| 1044 |
+
inline v8::Local<v8::Value> NODE_UNIXTIME_V8(double time) {
|
| 1045 |
+
return v8::Date::New(
|
| 1046 |
+
v8::Isolate::GetCurrent()->GetCurrentContext(),
|
| 1047 |
+
1000 * time)
|
| 1048 |
+
.ToLocalChecked();
|
| 1049 |
+
})
|
| 1050 |
+
#define NODE_UNIXTIME_V8 node::NODE_UNIXTIME_V8
|
| 1051 |
+
NODE_DEPRECATED("Use v8::Date::ValueOf() directly",
|
| 1052 |
+
inline double NODE_V8_UNIXTIME(v8::Local<v8::Date> date) {
|
| 1053 |
+
return date->ValueOf() / 1000;
|
| 1054 |
+
})
|
| 1055 |
+
#define NODE_V8_UNIXTIME node::NODE_V8_UNIXTIME
|
| 1056 |
+
|
| 1057 |
+
#define NODE_DEFINE_CONSTANT(target, constant) \
|
| 1058 |
+
do { \
|
| 1059 |
+
v8::Isolate* isolate = target->GetIsolate(); \
|
| 1060 |
+
v8::Local<v8::Context> context = isolate->GetCurrentContext(); \
|
| 1061 |
+
v8::Local<v8::String> constant_name = v8::String::NewFromUtf8Literal( \
|
| 1062 |
+
isolate, #constant, v8::NewStringType::kInternalized); \
|
| 1063 |
+
v8::Local<v8::Number> constant_value = \
|
| 1064 |
+
v8::Number::New(isolate, static_cast<double>(constant)); \
|
| 1065 |
+
v8::PropertyAttribute constant_attributes = \
|
| 1066 |
+
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete); \
|
| 1067 |
+
(target) \
|
| 1068 |
+
->DefineOwnProperty( \
|
| 1069 |
+
context, constant_name, constant_value, constant_attributes) \
|
| 1070 |
+
.Check(); \
|
| 1071 |
+
} while (0)
|
| 1072 |
+
|
| 1073 |
+
#define NODE_DEFINE_HIDDEN_CONSTANT(target, constant) \
|
| 1074 |
+
do { \
|
| 1075 |
+
v8::Isolate* isolate = target->GetIsolate(); \
|
| 1076 |
+
v8::Local<v8::Context> context = isolate->GetCurrentContext(); \
|
| 1077 |
+
v8::Local<v8::String> constant_name = v8::String::NewFromUtf8Literal( \
|
| 1078 |
+
isolate, #constant, v8::NewStringType::kInternalized); \
|
| 1079 |
+
v8::Local<v8::Number> constant_value = \
|
| 1080 |
+
v8::Number::New(isolate, static_cast<double>(constant)); \
|
| 1081 |
+
v8::PropertyAttribute constant_attributes = \
|
| 1082 |
+
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete | \
|
| 1083 |
+
v8::DontEnum); \
|
| 1084 |
+
(target) \
|
| 1085 |
+
->DefineOwnProperty( \
|
| 1086 |
+
context, constant_name, constant_value, constant_attributes) \
|
| 1087 |
+
.Check(); \
|
| 1088 |
+
} while (0)
|
| 1089 |
+
|
| 1090 |
+
// Used to be a macro, hence the uppercase name.
|
| 1091 |
+
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
|
| 1092 |
+
const char* name,
|
| 1093 |
+
v8::FunctionCallback callback) {
|
| 1094 |
+
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| 1095 |
+
v8::HandleScope handle_scope(isolate);
|
| 1096 |
+
v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate,
|
| 1097 |
+
callback);
|
| 1098 |
+
v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name,
|
| 1099 |
+
v8::NewStringType::kInternalized).ToLocalChecked();
|
| 1100 |
+
t->SetClassName(fn_name);
|
| 1101 |
+
recv->Set(fn_name, t);
|
| 1102 |
+
}
|
| 1103 |
+
|
| 1104 |
+
// Used to be a macro, hence the uppercase name.
|
| 1105 |
+
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
|
| 1106 |
+
const char* name,
|
| 1107 |
+
v8::FunctionCallback callback) {
|
| 1108 |
+
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| 1109 |
+
v8::HandleScope handle_scope(isolate);
|
| 1110 |
+
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
| 1111 |
+
v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate,
|
| 1112 |
+
callback);
|
| 1113 |
+
v8::Local<v8::Function> fn = t->GetFunction(context).ToLocalChecked();
|
| 1114 |
+
v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name,
|
| 1115 |
+
v8::NewStringType::kInternalized).ToLocalChecked();
|
| 1116 |
+
fn->SetName(fn_name);
|
| 1117 |
+
recv->Set(context, fn_name, fn).Check();
|
| 1118 |
+
}
|
| 1119 |
+
#define NODE_SET_METHOD node::NODE_SET_METHOD
|
| 1120 |
+
|
| 1121 |
+
// Used to be a macro, hence the uppercase name.
|
| 1122 |
+
// Not a template because it only makes sense for FunctionTemplates.
|
| 1123 |
+
inline void NODE_SET_PROTOTYPE_METHOD(v8::Local<v8::FunctionTemplate> recv,
|
| 1124 |
+
const char* name,
|
| 1125 |
+
v8::FunctionCallback callback) {
|
| 1126 |
+
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| 1127 |
+
v8::HandleScope handle_scope(isolate);
|
| 1128 |
+
v8::Local<v8::Signature> s = v8::Signature::New(isolate, recv);
|
| 1129 |
+
v8::Local<v8::FunctionTemplate> t =
|
| 1130 |
+
v8::FunctionTemplate::New(isolate, callback, v8::Local<v8::Value>(), s);
|
| 1131 |
+
v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name,
|
| 1132 |
+
v8::NewStringType::kInternalized).ToLocalChecked();
|
| 1133 |
+
t->SetClassName(fn_name);
|
| 1134 |
+
recv->PrototypeTemplate()->Set(fn_name, t);
|
| 1135 |
+
}
|
| 1136 |
+
#define NODE_SET_PROTOTYPE_METHOD node::NODE_SET_PROTOTYPE_METHOD
|
| 1137 |
+
|
| 1138 |
+
// BINARY is a deprecated alias of LATIN1.
|
| 1139 |
+
// BASE64URL is not currently exposed to the JavaScript side.
|
| 1140 |
+
enum encoding {
|
| 1141 |
+
ASCII,
|
| 1142 |
+
UTF8,
|
| 1143 |
+
BASE64,
|
| 1144 |
+
UCS2,
|
| 1145 |
+
BINARY,
|
| 1146 |
+
HEX,
|
| 1147 |
+
BUFFER,
|
| 1148 |
+
BASE64URL,
|
| 1149 |
+
LATIN1 = BINARY
|
| 1150 |
+
};
|
| 1151 |
+
|
| 1152 |
+
NODE_EXTERN enum encoding ParseEncoding(
|
| 1153 |
+
v8::Isolate* isolate,
|
| 1154 |
+
v8::Local<v8::Value> encoding_v,
|
| 1155 |
+
enum encoding default_encoding = LATIN1);
|
| 1156 |
+
|
| 1157 |
+
NODE_EXTERN void FatalException(v8::Isolate* isolate,
|
| 1158 |
+
const v8::TryCatch& try_catch);
|
| 1159 |
+
|
| 1160 |
+
NODE_EXTERN v8::MaybeLocal<v8::Value> TryEncode(
|
| 1161 |
+
v8::Isolate* isolate,
|
| 1162 |
+
const char* buf,
|
| 1163 |
+
size_t len,
|
| 1164 |
+
enum encoding encoding = LATIN1);
|
| 1165 |
+
|
| 1166 |
+
// Warning: This reverses endianness on Big Endian platforms, even though the
|
| 1167 |
+
// signature using uint16_t implies that it should not.
|
| 1168 |
+
NODE_EXTERN v8::MaybeLocal<v8::Value> TryEncode(v8::Isolate* isolate,
|
| 1169 |
+
const uint16_t* buf,
|
| 1170 |
+
size_t len);
|
| 1171 |
+
|
| 1172 |
+
// The original Encode(...) functions are deprecated because they do not
|
| 1173 |
+
// appropriately propagate exceptions and instead rely on ToLocalChecked()
|
| 1174 |
+
// which crashes the process if an exception occurs. We cannot just remove
|
| 1175 |
+
// these as it would break ABI compatibility, so we keep them around but
|
| 1176 |
+
// deprecate them in favor of the TryEncode(...) variations which return
|
| 1177 |
+
// a MaybeLocal<> and do not crash the process if an exception occurs.
|
| 1178 |
+
NODE_DEPRECATED(
|
| 1179 |
+
"Use TryEncode(...) instead",
|
| 1180 |
+
NODE_EXTERN v8::Local<v8::Value> Encode(v8::Isolate* isolate,
|
| 1181 |
+
const char* buf,
|
| 1182 |
+
size_t len,
|
| 1183 |
+
enum encoding encoding = LATIN1));
|
| 1184 |
+
|
| 1185 |
+
// Warning: This reverses endianness on Big Endian platforms, even though the
|
| 1186 |
+
// signature using uint16_t implies that it should not.
|
| 1187 |
+
NODE_DEPRECATED("Use TryEncode(...) instead",
|
| 1188 |
+
NODE_EXTERN v8::Local<v8::Value> Encode(v8::Isolate* isolate,
|
| 1189 |
+
const uint16_t* buf,
|
| 1190 |
+
size_t len));
|
| 1191 |
+
|
| 1192 |
+
// Returns -1 if the handle was not valid for decoding
|
| 1193 |
+
NODE_EXTERN ssize_t DecodeBytes(v8::Isolate* isolate,
|
| 1194 |
+
v8::Local<v8::Value>,
|
| 1195 |
+
enum encoding encoding = LATIN1);
|
| 1196 |
+
// returns bytes written.
|
| 1197 |
+
NODE_EXTERN ssize_t DecodeWrite(v8::Isolate* isolate,
|
| 1198 |
+
char* buf,
|
| 1199 |
+
size_t buflen,
|
| 1200 |
+
v8::Local<v8::Value>,
|
| 1201 |
+
enum encoding encoding = LATIN1);
|
| 1202 |
+
#ifdef _WIN32
|
| 1203 |
+
NODE_EXTERN v8::Local<v8::Value> WinapiErrnoException(
|
| 1204 |
+
v8::Isolate* isolate,
|
| 1205 |
+
int errorno,
|
| 1206 |
+
const char* syscall = nullptr,
|
| 1207 |
+
const char* msg = "",
|
| 1208 |
+
const char* path = nullptr);
|
| 1209 |
+
#endif
|
| 1210 |
+
|
| 1211 |
+
const char* signo_string(int errorno);
|
| 1212 |
+
|
| 1213 |
+
|
| 1214 |
+
typedef void (*addon_register_func)(
|
| 1215 |
+
v8::Local<v8::Object> exports,
|
| 1216 |
+
v8::Local<v8::Value> module,
|
| 1217 |
+
void* priv);
|
| 1218 |
+
|
| 1219 |
+
typedef void (*addon_context_register_func)(
|
| 1220 |
+
v8::Local<v8::Object> exports,
|
| 1221 |
+
v8::Local<v8::Value> module,
|
| 1222 |
+
v8::Local<v8::Context> context,
|
| 1223 |
+
void* priv);
|
| 1224 |
+
|
| 1225 |
+
enum ModuleFlags {
|
| 1226 |
+
kLinked = 0x02
|
| 1227 |
+
};
|
| 1228 |
+
|
| 1229 |
+
struct node_module {
|
| 1230 |
+
int nm_version;
|
| 1231 |
+
unsigned int nm_flags;
|
| 1232 |
+
void* nm_dso_handle;
|
| 1233 |
+
const char* nm_filename;
|
| 1234 |
+
node::addon_register_func nm_register_func;
|
| 1235 |
+
node::addon_context_register_func nm_context_register_func;
|
| 1236 |
+
const char* nm_modname;
|
| 1237 |
+
void* nm_priv;
|
| 1238 |
+
struct node_module* nm_link;
|
| 1239 |
+
};
|
| 1240 |
+
|
| 1241 |
+
extern "C" NODE_EXTERN void node_module_register(void* mod);
|
| 1242 |
+
|
| 1243 |
+
#ifdef _WIN32
|
| 1244 |
+
# define NODE_MODULE_EXPORT __declspec(dllexport)
|
| 1245 |
+
#else
|
| 1246 |
+
# define NODE_MODULE_EXPORT __attribute__((visibility("default")))
|
| 1247 |
+
#endif
|
| 1248 |
+
|
| 1249 |
+
#ifdef NODE_SHARED_MODE
|
| 1250 |
+
# define NODE_CTOR_PREFIX
|
| 1251 |
+
#else
|
| 1252 |
+
# define NODE_CTOR_PREFIX static
|
| 1253 |
+
#endif
|
| 1254 |
+
|
| 1255 |
+
#if defined(_MSC_VER)
|
| 1256 |
+
#define NODE_C_CTOR(fn) \
|
| 1257 |
+
NODE_CTOR_PREFIX void __cdecl fn(void); \
|
| 1258 |
+
namespace { \
|
| 1259 |
+
struct fn##_ { \
|
| 1260 |
+
fn##_() { fn(); }; \
|
| 1261 |
+
} fn##_v_; \
|
| 1262 |
+
} \
|
| 1263 |
+
NODE_CTOR_PREFIX void __cdecl fn(void)
|
| 1264 |
+
#else
|
| 1265 |
+
#define NODE_C_CTOR(fn) \
|
| 1266 |
+
NODE_CTOR_PREFIX void fn(void) __attribute__((constructor)); \
|
| 1267 |
+
NODE_CTOR_PREFIX void fn(void)
|
| 1268 |
+
#endif
|
| 1269 |
+
|
| 1270 |
+
#define NODE_MODULE_X(modname, regfunc, priv, flags) \
|
| 1271 |
+
extern "C" { \
|
| 1272 |
+
static node::node_module _module = \
|
| 1273 |
+
{ \
|
| 1274 |
+
NODE_MODULE_VERSION, \
|
| 1275 |
+
flags, \
|
| 1276 |
+
NULL, /* NOLINT (readability/null_usage) */ \
|
| 1277 |
+
__FILE__, \
|
| 1278 |
+
(node::addon_register_func) (regfunc), \
|
| 1279 |
+
NULL, /* NOLINT (readability/null_usage) */ \
|
| 1280 |
+
NODE_STRINGIFY(modname), \
|
| 1281 |
+
priv, \
|
| 1282 |
+
NULL /* NOLINT (readability/null_usage) */ \
|
| 1283 |
+
}; \
|
| 1284 |
+
NODE_C_CTOR(_register_ ## modname) { \
|
| 1285 |
+
node_module_register(&_module); \
|
| 1286 |
+
} \
|
| 1287 |
+
}
|
| 1288 |
+
|
| 1289 |
+
#define NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, priv, flags) \
|
| 1290 |
+
extern "C" { \
|
| 1291 |
+
static node::node_module _module = \
|
| 1292 |
+
{ \
|
| 1293 |
+
NODE_MODULE_VERSION, \
|
| 1294 |
+
flags, \
|
| 1295 |
+
NULL, /* NOLINT (readability/null_usage) */ \
|
| 1296 |
+
__FILE__, \
|
| 1297 |
+
NULL, /* NOLINT (readability/null_usage) */ \
|
| 1298 |
+
(node::addon_context_register_func) (regfunc), \
|
| 1299 |
+
NODE_STRINGIFY(modname), \
|
| 1300 |
+
priv, \
|
| 1301 |
+
NULL /* NOLINT (readability/null_usage) */ \
|
| 1302 |
+
}; \
|
| 1303 |
+
NODE_C_CTOR(_register_ ## modname) { \
|
| 1304 |
+
node_module_register(&_module); \
|
| 1305 |
+
} \
|
| 1306 |
+
}
|
| 1307 |
+
|
| 1308 |
+
// Usage: `NODE_MODULE(NODE_GYP_MODULE_NAME, InitializerFunction)`
|
| 1309 |
+
// If no NODE_MODULE is declared, Node.js looks for the well-known
|
| 1310 |
+
// symbol `node_register_module_v${NODE_MODULE_VERSION}`.
|
| 1311 |
+
#define NODE_MODULE(modname, regfunc) \
|
| 1312 |
+
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
|
| 1313 |
+
|
| 1314 |
+
#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \
|
| 1315 |
+
/* NOLINTNEXTLINE (readability/null_usage) */ \
|
| 1316 |
+
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
|
| 1317 |
+
|
| 1318 |
+
// Embedders can use this type of binding for statically linked native bindings.
|
| 1319 |
+
// It is used the same way addon bindings are used, except that linked bindings
|
| 1320 |
+
// can be accessed through `process._linkedBinding(modname)`.
|
| 1321 |
+
#define NODE_MODULE_LINKED(modname, regfunc) \
|
| 1322 |
+
/* NOLINTNEXTLINE (readability/null_usage) */ \
|
| 1323 |
+
NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, \
|
| 1324 |
+
node::ModuleFlags::kLinked)
|
| 1325 |
+
|
| 1326 |
+
/*
|
| 1327 |
+
* For backward compatibility in add-on modules.
|
| 1328 |
+
*/
|
| 1329 |
+
#define NODE_MODULE_DECL /* nothing */
|
| 1330 |
+
|
| 1331 |
+
#define NODE_MODULE_INITIALIZER_BASE node_register_module_v
|
| 1332 |
+
|
| 1333 |
+
#define NODE_MODULE_INITIALIZER_X(base, version) \
|
| 1334 |
+
NODE_MODULE_INITIALIZER_X_HELPER(base, version)
|
| 1335 |
+
|
| 1336 |
+
#define NODE_MODULE_INITIALIZER_X_HELPER(base, version) base##version
|
| 1337 |
+
|
| 1338 |
+
#define NODE_MODULE_INITIALIZER \
|
| 1339 |
+
NODE_MODULE_INITIALIZER_X(NODE_MODULE_INITIALIZER_BASE, \
|
| 1340 |
+
NODE_MODULE_VERSION)
|
| 1341 |
+
|
| 1342 |
+
#define NODE_MODULE_INIT() \
|
| 1343 |
+
extern "C" NODE_MODULE_EXPORT void \
|
| 1344 |
+
NODE_MODULE_INITIALIZER(v8::Local<v8::Object> exports, \
|
| 1345 |
+
v8::Local<v8::Value> module, \
|
| 1346 |
+
v8::Local<v8::Context> context); \
|
| 1347 |
+
NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, \
|
| 1348 |
+
NODE_MODULE_INITIALIZER) \
|
| 1349 |
+
void NODE_MODULE_INITIALIZER(v8::Local<v8::Object> exports, \
|
| 1350 |
+
v8::Local<v8::Value> module, \
|
| 1351 |
+
v8::Local<v8::Context> context)
|
| 1352 |
+
|
| 1353 |
+
// Allows embedders to add a binding to the current Environment* that can be
|
| 1354 |
+
// accessed through process._linkedBinding() in the target Environment and all
|
| 1355 |
+
// Worker threads that it creates.
|
| 1356 |
+
// In each variant, the registration function needs to be usable at least for
|
| 1357 |
+
// the time during which the Environment exists.
|
| 1358 |
+
NODE_EXTERN void AddLinkedBinding(Environment* env, const node_module& mod);
|
| 1359 |
+
NODE_EXTERN void AddLinkedBinding(Environment* env,
|
| 1360 |
+
const struct napi_module& mod);
|
| 1361 |
+
NODE_EXTERN void AddLinkedBinding(Environment* env,
|
| 1362 |
+
const char* name,
|
| 1363 |
+
addon_context_register_func fn,
|
| 1364 |
+
void* priv);
|
| 1365 |
+
NODE_EXTERN void AddLinkedBinding(
|
| 1366 |
+
Environment* env,
|
| 1367 |
+
const char* name,
|
| 1368 |
+
napi_addon_register_func fn,
|
| 1369 |
+
int32_t module_api_version = NODE_API_DEFAULT_MODULE_API_VERSION);
|
| 1370 |
+
|
| 1371 |
+
/* Registers a callback with the passed-in Environment instance. The callback
|
| 1372 |
+
* is called after the event loop exits, but before the VM is disposed.
|
| 1373 |
+
* Callbacks are run in reverse order of registration, i.e. newest first.
|
| 1374 |
+
*/
|
| 1375 |
+
NODE_EXTERN void AtExit(Environment* env,
|
| 1376 |
+
void (*cb)(void* arg),
|
| 1377 |
+
void* arg);
|
| 1378 |
+
|
| 1379 |
+
typedef double async_id;
|
| 1380 |
+
struct async_context {
|
| 1381 |
+
::node::async_id async_id;
|
| 1382 |
+
::node::async_id trigger_async_id;
|
| 1383 |
+
};
|
| 1384 |
+
|
| 1385 |
+
/* This is a lot like node::AtExit, except that the hooks added via this
|
| 1386 |
+
* function are run before the AtExit ones and will always be registered
|
| 1387 |
+
* for the current Environment instance.
|
| 1388 |
+
* These functions are safe to use in an addon supporting multiple
|
| 1389 |
+
* threads/isolates. */
|
| 1390 |
+
NODE_EXTERN void AddEnvironmentCleanupHook(v8::Isolate* isolate,
|
| 1391 |
+
void (*fun)(void* arg),
|
| 1392 |
+
void* arg);
|
| 1393 |
+
|
| 1394 |
+
NODE_EXTERN void RemoveEnvironmentCleanupHook(v8::Isolate* isolate,
|
| 1395 |
+
void (*fun)(void* arg),
|
| 1396 |
+
void* arg);
|
| 1397 |
+
|
| 1398 |
+
/* These are async equivalents of the above. After the cleanup hook is invoked,
|
| 1399 |
+
* `cb(cbarg)` *must* be called, and attempting to remove the cleanup hook will
|
| 1400 |
+
* have no effect. */
|
| 1401 |
+
struct ACHHandle;
|
| 1402 |
+
struct NODE_EXTERN DeleteACHHandle { void operator()(ACHHandle*) const; };
|
| 1403 |
+
typedef std::unique_ptr<ACHHandle, DeleteACHHandle> AsyncCleanupHookHandle;
|
| 1404 |
+
|
| 1405 |
+
/* This function is not intended to be used externally, it exists to aid in
|
| 1406 |
+
* keeping ABI compatibility between Node and Electron. */
|
| 1407 |
+
NODE_EXTERN ACHHandle* AddEnvironmentCleanupHookInternal(
|
| 1408 |
+
v8::Isolate* isolate,
|
| 1409 |
+
void (*fun)(void* arg, void (*cb)(void*), void* cbarg),
|
| 1410 |
+
void* arg);
|
| 1411 |
+
inline AsyncCleanupHookHandle AddEnvironmentCleanupHook(
|
| 1412 |
+
v8::Isolate* isolate,
|
| 1413 |
+
void (*fun)(void* arg, void (*cb)(void*), void* cbarg),
|
| 1414 |
+
void* arg) {
|
| 1415 |
+
return AsyncCleanupHookHandle(AddEnvironmentCleanupHookInternal(isolate, fun,
|
| 1416 |
+
arg));
|
| 1417 |
+
}
|
| 1418 |
+
|
| 1419 |
+
/* This function is not intended to be used externally, it exists to aid in
|
| 1420 |
+
* keeping ABI compatibility between Node and Electron. */
|
| 1421 |
+
NODE_EXTERN void RemoveEnvironmentCleanupHookInternal(ACHHandle* holder);
|
| 1422 |
+
inline void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder) {
|
| 1423 |
+
RemoveEnvironmentCleanupHookInternal(holder.get());
|
| 1424 |
+
}
|
| 1425 |
+
|
| 1426 |
+
// This behaves like V8's Isolate::RequestInterrupt(), but also wakes up
|
| 1427 |
+
// the event loop if it is currently idle. Interrupt requests are drained
|
| 1428 |
+
// in `FreeEnvironment()`. The passed callback can not call back into
|
| 1429 |
+
// JavaScript.
|
| 1430 |
+
// This function can be called from any thread.
|
| 1431 |
+
NODE_EXTERN void RequestInterrupt(Environment* env,
|
| 1432 |
+
void (*fun)(void* arg),
|
| 1433 |
+
void* arg);
|
| 1434 |
+
|
| 1435 |
+
/* Returns the id of the current execution context. If the return value is
|
| 1436 |
+
* zero then no execution has been set. This will happen if the user handles
|
| 1437 |
+
* I/O from native code. */
|
| 1438 |
+
NODE_EXTERN async_id AsyncHooksGetExecutionAsyncId(v8::Isolate* isolate);
|
| 1439 |
+
|
| 1440 |
+
/* Returns the id of the current execution context. If the return value is
|
| 1441 |
+
* zero then no execution has been set. This will happen if the user handles
|
| 1442 |
+
* I/O from native code. */
|
| 1443 |
+
NODE_EXTERN async_id
|
| 1444 |
+
AsyncHooksGetExecutionAsyncId(v8::Local<v8::Context> context);
|
| 1445 |
+
|
| 1446 |
+
/* Return same value as async_hooks.triggerAsyncId(); */
|
| 1447 |
+
NODE_EXTERN async_id AsyncHooksGetTriggerAsyncId(v8::Isolate* isolate);
|
| 1448 |
+
|
| 1449 |
+
/* If the native API doesn't inherit from the helper class then the callbacks
|
| 1450 |
+
* must be triggered manually. This triggers the init() callback. The return
|
| 1451 |
+
* value is the async id assigned to the resource.
|
| 1452 |
+
*
|
| 1453 |
+
* The `trigger_async_id` parameter should correspond to the resource which is
|
| 1454 |
+
* creating the new resource, which will usually be the return value of
|
| 1455 |
+
* `AsyncHooksGetTriggerAsyncId()`. */
|
| 1456 |
+
NODE_EXTERN async_context EmitAsyncInit(v8::Isolate* isolate,
|
| 1457 |
+
v8::Local<v8::Object> resource,
|
| 1458 |
+
const char* name,
|
| 1459 |
+
async_id trigger_async_id = -1);
|
| 1460 |
+
NODE_EXTERN async_context EmitAsyncInit(v8::Isolate* isolate,
|
| 1461 |
+
v8::Local<v8::Object> resource,
|
| 1462 |
+
std::string_view name,
|
| 1463 |
+
async_id trigger_async_id = -1);
|
| 1464 |
+
|
| 1465 |
+
NODE_EXTERN async_context EmitAsyncInit(v8::Isolate* isolate,
|
| 1466 |
+
v8::Local<v8::Object> resource,
|
| 1467 |
+
v8::Local<v8::String> name,
|
| 1468 |
+
async_id trigger_async_id = -1);
|
| 1469 |
+
|
| 1470 |
+
/* Emit the destroy() callback. The overload taking an `Environment*` argument
|
| 1471 |
+
* should be used when the Isolate’s current Context is not associated with
|
| 1472 |
+
* a Node.js Environment, or when there is no current Context, for example
|
| 1473 |
+
* when calling this function during garbage collection. In that case, the
|
| 1474 |
+
* `Environment*` value should have been acquired previously, e.g. through
|
| 1475 |
+
* `GetCurrentEnvironment()`. */
|
| 1476 |
+
NODE_EXTERN void EmitAsyncDestroy(v8::Isolate* isolate,
|
| 1477 |
+
async_context asyncContext);
|
| 1478 |
+
NODE_EXTERN void EmitAsyncDestroy(Environment* env,
|
| 1479 |
+
async_context asyncContext);
|
| 1480 |
+
|
| 1481 |
+
class InternalCallbackScope;
|
| 1482 |
+
|
| 1483 |
+
/* This class works like `MakeCallback()` in that it sets up a specific
|
| 1484 |
+
* asyncContext as the current one and informs the async_hooks and domains
|
| 1485 |
+
* modules that this context is currently active.
|
| 1486 |
+
*
|
| 1487 |
+
* `MakeCallback()` is a wrapper around this class as well as
|
| 1488 |
+
* `Function::Call()`. Either one of these mechanisms needs to be used for
|
| 1489 |
+
* top-level calls into JavaScript (i.e. without any existing JS stack).
|
| 1490 |
+
*
|
| 1491 |
+
* This object should be stack-allocated to ensure that it is contained in a
|
| 1492 |
+
* valid HandleScope.
|
| 1493 |
+
*
|
| 1494 |
+
* Exceptions happening within this scope will be treated like uncaught
|
| 1495 |
+
* exceptions. If this behaviour is undesirable, a new `v8::TryCatch` scope
|
| 1496 |
+
* needs to be created inside of this scope.
|
| 1497 |
+
*/
|
| 1498 |
+
class NODE_EXTERN CallbackScope {
|
| 1499 |
+
public:
|
| 1500 |
+
CallbackScope(v8::Isolate* isolate,
|
| 1501 |
+
v8::Local<v8::Object> resource,
|
| 1502 |
+
async_context asyncContext);
|
| 1503 |
+
CallbackScope(Environment* env,
|
| 1504 |
+
v8::Local<v8::Object> resource,
|
| 1505 |
+
async_context asyncContext);
|
| 1506 |
+
~CallbackScope();
|
| 1507 |
+
|
| 1508 |
+
void operator=(const CallbackScope&) = delete;
|
| 1509 |
+
void operator=(CallbackScope&&) = delete;
|
| 1510 |
+
CallbackScope(const CallbackScope&) = delete;
|
| 1511 |
+
CallbackScope(CallbackScope&&) = delete;
|
| 1512 |
+
|
| 1513 |
+
private:
|
| 1514 |
+
InternalCallbackScope* private_;
|
| 1515 |
+
v8::TryCatch try_catch_;
|
| 1516 |
+
};
|
| 1517 |
+
|
| 1518 |
+
/* An API specific to emit before/after callbacks is unnecessary because
|
| 1519 |
+
* MakeCallback will automatically call them for you.
|
| 1520 |
+
*
|
| 1521 |
+
* These methods may create handles on their own, so run them inside a
|
| 1522 |
+
* HandleScope.
|
| 1523 |
+
*
|
| 1524 |
+
* `asyncId` and `triggerAsyncId` should correspond to the values returned by
|
| 1525 |
+
* `EmitAsyncInit()` and `AsyncHooksGetTriggerAsyncId()`, respectively, when the
|
| 1526 |
+
* invoking resource was created. If these values are unknown, 0 can be passed.
|
| 1527 |
+
* */
|
| 1528 |
+
NODE_EXTERN
|
| 1529 |
+
v8::MaybeLocal<v8::Value> MakeCallback(v8::Isolate* isolate,
|
| 1530 |
+
v8::Local<v8::Object> recv,
|
| 1531 |
+
v8::Local<v8::Function> callback,
|
| 1532 |
+
int argc,
|
| 1533 |
+
v8::Local<v8::Value>* argv,
|
| 1534 |
+
async_context asyncContext);
|
| 1535 |
+
NODE_EXTERN
|
| 1536 |
+
v8::MaybeLocal<v8::Value> MakeCallback(v8::Isolate* isolate,
|
| 1537 |
+
v8::Local<v8::Object> recv,
|
| 1538 |
+
const char* method,
|
| 1539 |
+
int argc,
|
| 1540 |
+
v8::Local<v8::Value>* argv,
|
| 1541 |
+
async_context asyncContext);
|
| 1542 |
+
NODE_EXTERN
|
| 1543 |
+
v8::MaybeLocal<v8::Value> MakeCallback(v8::Isolate* isolate,
|
| 1544 |
+
v8::Local<v8::Object> recv,
|
| 1545 |
+
v8::Local<v8::String> symbol,
|
| 1546 |
+
int argc,
|
| 1547 |
+
v8::Local<v8::Value>* argv,
|
| 1548 |
+
async_context asyncContext);
|
| 1549 |
+
|
| 1550 |
+
/* Helper class users can optionally inherit from. If
|
| 1551 |
+
* `AsyncResource::MakeCallback()` is used, then all four callbacks will be
|
| 1552 |
+
* called automatically. */
|
| 1553 |
+
class NODE_EXTERN AsyncResource {
|
| 1554 |
+
public:
|
| 1555 |
+
AsyncResource(v8::Isolate* isolate,
|
| 1556 |
+
v8::Local<v8::Object> resource,
|
| 1557 |
+
const char* name,
|
| 1558 |
+
async_id trigger_async_id = -1);
|
| 1559 |
+
AsyncResource(v8::Isolate* isolate,
|
| 1560 |
+
v8::Local<v8::Object> resource,
|
| 1561 |
+
std::string_view name,
|
| 1562 |
+
async_id trigger_async_id = -1);
|
| 1563 |
+
|
| 1564 |
+
virtual ~AsyncResource();
|
| 1565 |
+
|
| 1566 |
+
AsyncResource(const AsyncResource&) = delete;
|
| 1567 |
+
void operator=(const AsyncResource&) = delete;
|
| 1568 |
+
|
| 1569 |
+
v8::MaybeLocal<v8::Value> MakeCallback(
|
| 1570 |
+
v8::Local<v8::Function> callback,
|
| 1571 |
+
int argc,
|
| 1572 |
+
v8::Local<v8::Value>* argv);
|
| 1573 |
+
|
| 1574 |
+
v8::MaybeLocal<v8::Value> MakeCallback(
|
| 1575 |
+
const char* method,
|
| 1576 |
+
int argc,
|
| 1577 |
+
v8::Local<v8::Value>* argv);
|
| 1578 |
+
|
| 1579 |
+
v8::MaybeLocal<v8::Value> MakeCallback(
|
| 1580 |
+
v8::Local<v8::String> symbol,
|
| 1581 |
+
int argc,
|
| 1582 |
+
v8::Local<v8::Value>* argv);
|
| 1583 |
+
|
| 1584 |
+
v8::Local<v8::Object> get_resource();
|
| 1585 |
+
async_id get_async_id() const;
|
| 1586 |
+
async_id get_trigger_async_id() const;
|
| 1587 |
+
|
| 1588 |
+
protected:
|
| 1589 |
+
class NODE_EXTERN CallbackScope : public node::CallbackScope {
|
| 1590 |
+
public:
|
| 1591 |
+
explicit CallbackScope(AsyncResource* res);
|
| 1592 |
+
};
|
| 1593 |
+
|
| 1594 |
+
private:
|
| 1595 |
+
Environment* env_;
|
| 1596 |
+
v8::Global<v8::Object> resource_;
|
| 1597 |
+
v8::Global<v8::Value> context_frame_;
|
| 1598 |
+
async_context async_context_;
|
| 1599 |
+
};
|
| 1600 |
+
|
| 1601 |
+
#ifndef _WIN32
|
| 1602 |
+
// Register a signal handler without interrupting any handlers that node
|
| 1603 |
+
// itself needs. This does override handlers registered through
|
| 1604 |
+
// process.on('SIG...', function() { ... }). The `reset_handler` flag indicates
|
| 1605 |
+
// whether the signal handler for the given signal should be reset to its
|
| 1606 |
+
// default value before executing the handler (i.e. it works like SA_RESETHAND).
|
| 1607 |
+
// The `reset_handler` flag is invalid when `signal` is SIGSEGV.
|
| 1608 |
+
NODE_EXTERN
|
| 1609 |
+
void RegisterSignalHandler(int signal,
|
| 1610 |
+
void (*handler)(int signal,
|
| 1611 |
+
siginfo_t* info,
|
| 1612 |
+
void* ucontext),
|
| 1613 |
+
bool reset_handler = false);
|
| 1614 |
+
#endif // _WIN32
|
| 1615 |
+
|
| 1616 |
+
// This is kept as a compatibility layer for addons to wrap cppgc-managed
|
| 1617 |
+
// objects on Node.js versions without v8::Object::Wrap(). Addons created to
|
| 1618 |
+
// work with only Node.js versions with v8::Object::Wrap() should use that
|
| 1619 |
+
// instead.
|
| 1620 |
+
NODE_DEPRECATED("Use v8::Object::Wrap()",
|
| 1621 |
+
NODE_EXTERN void SetCppgcReference(v8::Isolate* isolate,
|
| 1622 |
+
v8::Local<v8::Object> object,
|
| 1623 |
+
void* wrappable));
|
| 1624 |
+
|
| 1625 |
+
} // namespace node
|
| 1626 |
+
|
| 1627 |
+
#endif // SRC_NODE_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/node_api.h
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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H_
|
| 2 |
+
#define SRC_NODE_API_H_
|
| 3 |
+
|
| 4 |
+
#if defined(BUILDING_NODE_EXTENSION) && !defined(NAPI_EXTERN)
|
| 5 |
+
#ifdef _WIN32
|
| 6 |
+
// Building native addon against node
|
| 7 |
+
#define NAPI_EXTERN __declspec(dllimport)
|
| 8 |
+
#elif defined(__wasm__)
|
| 9 |
+
#define NAPI_EXTERN __attribute__((__import_module__("napi")))
|
| 10 |
+
#endif
|
| 11 |
+
#endif
|
| 12 |
+
#include "js_native_api.h"
|
| 13 |
+
#include "node_api_types.h"
|
| 14 |
+
|
| 15 |
+
struct uv_loop_s; // Forward declaration.
|
| 16 |
+
|
| 17 |
+
#ifdef _WIN32
|
| 18 |
+
#define NAPI_MODULE_EXPORT __declspec(dllexport)
|
| 19 |
+
#else
|
| 20 |
+
#ifdef __EMSCRIPTEN__
|
| 21 |
+
#define NAPI_MODULE_EXPORT \
|
| 22 |
+
__attribute__((visibility("default"))) __attribute__((used))
|
| 23 |
+
#else
|
| 24 |
+
#define NAPI_MODULE_EXPORT __attribute__((visibility("default")))
|
| 25 |
+
#endif
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
#if defined(__GNUC__)
|
| 29 |
+
#define NAPI_NO_RETURN __attribute__((noreturn))
|
| 30 |
+
#elif defined(_WIN32)
|
| 31 |
+
#define NAPI_NO_RETURN __declspec(noreturn)
|
| 32 |
+
#else
|
| 33 |
+
#define NAPI_NO_RETURN
|
| 34 |
+
#endif
|
| 35 |
+
|
| 36 |
+
// Used by deprecated registration method napi_module_register.
|
| 37 |
+
typedef struct napi_module {
|
| 38 |
+
int nm_version;
|
| 39 |
+
unsigned int nm_flags;
|
| 40 |
+
const char* nm_filename;
|
| 41 |
+
napi_addon_register_func nm_register_func;
|
| 42 |
+
const char* nm_modname;
|
| 43 |
+
void* nm_priv;
|
| 44 |
+
void* reserved[4];
|
| 45 |
+
} napi_module;
|
| 46 |
+
|
| 47 |
+
#define NAPI_MODULE_VERSION 1
|
| 48 |
+
|
| 49 |
+
#define NAPI_MODULE_INITIALIZER_X(base, version) \
|
| 50 |
+
NAPI_MODULE_INITIALIZER_X_HELPER(base, version)
|
| 51 |
+
#define NAPI_MODULE_INITIALIZER_X_HELPER(base, version) base##version
|
| 52 |
+
|
| 53 |
+
#ifdef __wasm__
|
| 54 |
+
#define NAPI_MODULE_INITIALIZER_BASE napi_register_wasm_v
|
| 55 |
+
#else
|
| 56 |
+
#define NAPI_MODULE_INITIALIZER_BASE napi_register_module_v
|
| 57 |
+
#endif
|
| 58 |
+
|
| 59 |
+
#define NODE_API_MODULE_GET_API_VERSION_BASE node_api_module_get_api_version_v
|
| 60 |
+
|
| 61 |
+
#define NAPI_MODULE_INITIALIZER \
|
| 62 |
+
NAPI_MODULE_INITIALIZER_X(NAPI_MODULE_INITIALIZER_BASE, NAPI_MODULE_VERSION)
|
| 63 |
+
|
| 64 |
+
#define NODE_API_MODULE_GET_API_VERSION \
|
| 65 |
+
NAPI_MODULE_INITIALIZER_X(NODE_API_MODULE_GET_API_VERSION_BASE, \
|
| 66 |
+
NAPI_MODULE_VERSION)
|
| 67 |
+
|
| 68 |
+
#define NAPI_MODULE_INIT() \
|
| 69 |
+
EXTERN_C_START \
|
| 70 |
+
NAPI_MODULE_EXPORT int32_t NODE_API_MODULE_GET_API_VERSION(void) { \
|
| 71 |
+
return NAPI_VERSION; \
|
| 72 |
+
} \
|
| 73 |
+
NAPI_MODULE_EXPORT napi_value NAPI_MODULE_INITIALIZER(napi_env env, \
|
| 74 |
+
napi_value exports); \
|
| 75 |
+
EXTERN_C_END \
|
| 76 |
+
napi_value NAPI_MODULE_INITIALIZER(napi_env env, napi_value exports)
|
| 77 |
+
|
| 78 |
+
#define NAPI_MODULE(modname, regfunc) \
|
| 79 |
+
NAPI_MODULE_INIT() { return regfunc(env, exports); }
|
| 80 |
+
|
| 81 |
+
// Deprecated. Use NAPI_MODULE.
|
| 82 |
+
#define NAPI_MODULE_X(modname, regfunc, priv, flags) \
|
| 83 |
+
NAPI_MODULE(modname, regfunc)
|
| 84 |
+
|
| 85 |
+
EXTERN_C_START
|
| 86 |
+
|
| 87 |
+
// Deprecated. Replaced by symbol-based registration defined by NAPI_MODULE
|
| 88 |
+
// and NAPI_MODULE_INIT macros.
|
| 89 |
+
NAPI_EXTERN void NAPI_CDECL
|
| 90 |
+
napi_module_register(napi_module* mod);
|
| 91 |
+
|
| 92 |
+
NAPI_EXTERN NAPI_NO_RETURN void NAPI_CDECL
|
| 93 |
+
napi_fatal_error(const char* location,
|
| 94 |
+
size_t location_len,
|
| 95 |
+
const char* message,
|
| 96 |
+
size_t message_len);
|
| 97 |
+
|
| 98 |
+
// Methods for custom handling of async operations
|
| 99 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 100 |
+
napi_async_init(napi_env env,
|
| 101 |
+
napi_value async_resource,
|
| 102 |
+
napi_value async_resource_name,
|
| 103 |
+
napi_async_context* result);
|
| 104 |
+
|
| 105 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 106 |
+
napi_async_destroy(napi_env env, napi_async_context async_context);
|
| 107 |
+
|
| 108 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 109 |
+
napi_make_callback(napi_env env,
|
| 110 |
+
napi_async_context async_context,
|
| 111 |
+
napi_value recv,
|
| 112 |
+
napi_value func,
|
| 113 |
+
size_t argc,
|
| 114 |
+
const napi_value* argv,
|
| 115 |
+
napi_value* result);
|
| 116 |
+
|
| 117 |
+
// Methods to provide node::Buffer functionality with napi types
|
| 118 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_buffer(napi_env env,
|
| 119 |
+
size_t length,
|
| 120 |
+
void** data,
|
| 121 |
+
napi_value* result);
|
| 122 |
+
#ifndef NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED
|
| 123 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 124 |
+
napi_create_external_buffer(napi_env env,
|
| 125 |
+
size_t length,
|
| 126 |
+
void* data,
|
| 127 |
+
node_api_basic_finalize finalize_cb,
|
| 128 |
+
void* finalize_hint,
|
| 129 |
+
napi_value* result);
|
| 130 |
+
#endif // NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED
|
| 131 |
+
|
| 132 |
+
#if NAPI_VERSION >= 10
|
| 133 |
+
|
| 134 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 135 |
+
node_api_create_buffer_from_arraybuffer(napi_env env,
|
| 136 |
+
napi_value arraybuffer,
|
| 137 |
+
size_t byte_offset,
|
| 138 |
+
size_t byte_length,
|
| 139 |
+
napi_value* result);
|
| 140 |
+
#endif // NAPI_VERSION >= 10
|
| 141 |
+
|
| 142 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_create_buffer_copy(napi_env env,
|
| 143 |
+
size_t length,
|
| 144 |
+
const void* data,
|
| 145 |
+
void** result_data,
|
| 146 |
+
napi_value* result);
|
| 147 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_is_buffer(napi_env env,
|
| 148 |
+
napi_value value,
|
| 149 |
+
bool* result);
|
| 150 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_buffer_info(napi_env env,
|
| 151 |
+
napi_value value,
|
| 152 |
+
void** data,
|
| 153 |
+
size_t* length);
|
| 154 |
+
|
| 155 |
+
// Methods to manage simple async operations
|
| 156 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 157 |
+
napi_create_async_work(napi_env env,
|
| 158 |
+
napi_value async_resource,
|
| 159 |
+
napi_value async_resource_name,
|
| 160 |
+
napi_async_execute_callback execute,
|
| 161 |
+
napi_async_complete_callback complete,
|
| 162 |
+
void* data,
|
| 163 |
+
napi_async_work* result);
|
| 164 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_async_work(napi_env env,
|
| 165 |
+
napi_async_work work);
|
| 166 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_queue_async_work(node_api_basic_env env,
|
| 167 |
+
napi_async_work work);
|
| 168 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 169 |
+
napi_cancel_async_work(node_api_basic_env env, napi_async_work work);
|
| 170 |
+
|
| 171 |
+
// version management
|
| 172 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_node_version(
|
| 173 |
+
node_api_basic_env env, const napi_node_version** version);
|
| 174 |
+
|
| 175 |
+
#if NAPI_VERSION >= 2
|
| 176 |
+
|
| 177 |
+
// Return the current libuv event loop for a given environment
|
| 178 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 179 |
+
napi_get_uv_event_loop(node_api_basic_env env, struct uv_loop_s** loop);
|
| 180 |
+
|
| 181 |
+
#endif // NAPI_VERSION >= 2
|
| 182 |
+
|
| 183 |
+
#if NAPI_VERSION >= 3
|
| 184 |
+
|
| 185 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_fatal_exception(napi_env env,
|
| 186 |
+
napi_value err);
|
| 187 |
+
|
| 188 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_add_env_cleanup_hook(
|
| 189 |
+
node_api_basic_env env, napi_cleanup_hook fun, void* arg);
|
| 190 |
+
|
| 191 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_remove_env_cleanup_hook(
|
| 192 |
+
node_api_basic_env env, napi_cleanup_hook fun, void* arg);
|
| 193 |
+
|
| 194 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 195 |
+
napi_open_callback_scope(napi_env env,
|
| 196 |
+
napi_value resource_object,
|
| 197 |
+
napi_async_context context,
|
| 198 |
+
napi_callback_scope* result);
|
| 199 |
+
|
| 200 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 201 |
+
napi_close_callback_scope(napi_env env, napi_callback_scope scope);
|
| 202 |
+
|
| 203 |
+
#endif // NAPI_VERSION >= 3
|
| 204 |
+
|
| 205 |
+
#if NAPI_VERSION >= 4
|
| 206 |
+
|
| 207 |
+
// Calling into JS from other threads
|
| 208 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 209 |
+
napi_create_threadsafe_function(napi_env env,
|
| 210 |
+
napi_value func,
|
| 211 |
+
napi_value async_resource,
|
| 212 |
+
napi_value async_resource_name,
|
| 213 |
+
size_t max_queue_size,
|
| 214 |
+
size_t initial_thread_count,
|
| 215 |
+
void* thread_finalize_data,
|
| 216 |
+
napi_finalize thread_finalize_cb,
|
| 217 |
+
void* context,
|
| 218 |
+
napi_threadsafe_function_call_js call_js_cb,
|
| 219 |
+
napi_threadsafe_function* result);
|
| 220 |
+
|
| 221 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_get_threadsafe_function_context(
|
| 222 |
+
napi_threadsafe_function func, void** result);
|
| 223 |
+
|
| 224 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 225 |
+
napi_call_threadsafe_function(napi_threadsafe_function func,
|
| 226 |
+
void* data,
|
| 227 |
+
napi_threadsafe_function_call_mode is_blocking);
|
| 228 |
+
|
| 229 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 230 |
+
napi_acquire_threadsafe_function(napi_threadsafe_function func);
|
| 231 |
+
|
| 232 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_release_threadsafe_function(
|
| 233 |
+
napi_threadsafe_function func, napi_threadsafe_function_release_mode mode);
|
| 234 |
+
|
| 235 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_unref_threadsafe_function(
|
| 236 |
+
node_api_basic_env env, napi_threadsafe_function func);
|
| 237 |
+
|
| 238 |
+
NAPI_EXTERN napi_status NAPI_CDECL napi_ref_threadsafe_function(
|
| 239 |
+
node_api_basic_env env, napi_threadsafe_function func);
|
| 240 |
+
|
| 241 |
+
#endif // NAPI_VERSION >= 4
|
| 242 |
+
|
| 243 |
+
#if NAPI_VERSION >= 8
|
| 244 |
+
|
| 245 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 246 |
+
napi_add_async_cleanup_hook(node_api_basic_env env,
|
| 247 |
+
napi_async_cleanup_hook hook,
|
| 248 |
+
void* arg,
|
| 249 |
+
napi_async_cleanup_hook_handle* remove_handle);
|
| 250 |
+
|
| 251 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 252 |
+
napi_remove_async_cleanup_hook(napi_async_cleanup_hook_handle remove_handle);
|
| 253 |
+
|
| 254 |
+
#endif // NAPI_VERSION >= 8
|
| 255 |
+
|
| 256 |
+
#if NAPI_VERSION >= 9
|
| 257 |
+
|
| 258 |
+
NAPI_EXTERN napi_status NAPI_CDECL
|
| 259 |
+
node_api_get_module_file_name(node_api_basic_env env, const char** result);
|
| 260 |
+
|
| 261 |
+
#endif // NAPI_VERSION >= 9
|
| 262 |
+
|
| 263 |
+
EXTERN_C_END
|
| 264 |
+
|
| 265 |
+
#endif // SRC_NODE_API_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/node_api_types.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef SRC_NODE_API_TYPES_H_
|
| 2 |
+
#define SRC_NODE_API_TYPES_H_
|
| 3 |
+
|
| 4 |
+
#include "js_native_api_types.h"
|
| 5 |
+
|
| 6 |
+
typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env,
|
| 7 |
+
napi_value exports);
|
| 8 |
+
typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void);
|
| 9 |
+
|
| 10 |
+
typedef struct napi_callback_scope__* napi_callback_scope;
|
| 11 |
+
typedef struct napi_async_context__* napi_async_context;
|
| 12 |
+
typedef struct napi_async_work__* napi_async_work;
|
| 13 |
+
|
| 14 |
+
#if NAPI_VERSION >= 3
|
| 15 |
+
typedef void(NAPI_CDECL* napi_cleanup_hook)(void* arg);
|
| 16 |
+
#endif // NAPI_VERSION >= 3
|
| 17 |
+
|
| 18 |
+
#if NAPI_VERSION >= 4
|
| 19 |
+
typedef struct napi_threadsafe_function__* napi_threadsafe_function;
|
| 20 |
+
#endif // NAPI_VERSION >= 4
|
| 21 |
+
|
| 22 |
+
#if NAPI_VERSION >= 4
|
| 23 |
+
typedef enum {
|
| 24 |
+
napi_tsfn_release,
|
| 25 |
+
napi_tsfn_abort
|
| 26 |
+
} napi_threadsafe_function_release_mode;
|
| 27 |
+
|
| 28 |
+
typedef enum {
|
| 29 |
+
napi_tsfn_nonblocking,
|
| 30 |
+
napi_tsfn_blocking
|
| 31 |
+
} napi_threadsafe_function_call_mode;
|
| 32 |
+
#endif // NAPI_VERSION >= 4
|
| 33 |
+
|
| 34 |
+
typedef void(NAPI_CDECL* napi_async_execute_callback)(napi_env env, void* data);
|
| 35 |
+
typedef void(NAPI_CDECL* napi_async_complete_callback)(napi_env env,
|
| 36 |
+
napi_status status,
|
| 37 |
+
void* data);
|
| 38 |
+
#if NAPI_VERSION >= 4
|
| 39 |
+
typedef void(NAPI_CDECL* napi_threadsafe_function_call_js)(
|
| 40 |
+
napi_env env, napi_value js_callback, void* context, void* data);
|
| 41 |
+
#endif // NAPI_VERSION >= 4
|
| 42 |
+
|
| 43 |
+
typedef struct {
|
| 44 |
+
uint32_t major;
|
| 45 |
+
uint32_t minor;
|
| 46 |
+
uint32_t patch;
|
| 47 |
+
const char* release;
|
| 48 |
+
} napi_node_version;
|
| 49 |
+
|
| 50 |
+
#if NAPI_VERSION >= 8
|
| 51 |
+
typedef struct napi_async_cleanup_hook_handle__* napi_async_cleanup_hook_handle;
|
| 52 |
+
typedef void(NAPI_CDECL* napi_async_cleanup_hook)(
|
| 53 |
+
napi_async_cleanup_hook_handle handle, void* data);
|
| 54 |
+
#endif // NAPI_VERSION >= 8
|
| 55 |
+
|
| 56 |
+
#endif // SRC_NODE_API_TYPES_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/node_buffer.h
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright Joyent, Inc. and other Node contributors.
|
| 2 |
+
//
|
| 3 |
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
| 4 |
+
// copy of this software and associated documentation files (the
|
| 5 |
+
// "Software"), to deal in the Software without restriction, including
|
| 6 |
+
// without limitation the rights to use, copy, modify, merge, publish,
|
| 7 |
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
| 8 |
+
// persons to whom the Software is furnished to do so, subject to the
|
| 9 |
+
// following conditions:
|
| 10 |
+
//
|
| 11 |
+
// The above copyright notice and this permission notice shall be included
|
| 12 |
+
// in all copies or substantial portions of the Software.
|
| 13 |
+
//
|
| 14 |
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
| 15 |
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 16 |
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
| 17 |
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
| 18 |
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
| 19 |
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
| 20 |
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 21 |
+
|
| 22 |
+
#ifndef SRC_NODE_BUFFER_H_
|
| 23 |
+
#define SRC_NODE_BUFFER_H_
|
| 24 |
+
|
| 25 |
+
#include "node.h"
|
| 26 |
+
#include "v8.h"
|
| 27 |
+
|
| 28 |
+
namespace node {
|
| 29 |
+
|
| 30 |
+
namespace Buffer {
|
| 31 |
+
|
| 32 |
+
static const size_t kMaxLength = v8::Uint8Array::kMaxLength;
|
| 33 |
+
|
| 34 |
+
typedef void (*FreeCallback)(char* data, void* hint);
|
| 35 |
+
|
| 36 |
+
NODE_EXTERN bool HasInstance(v8::Local<v8::Value> val);
|
| 37 |
+
NODE_EXTERN bool HasInstance(v8::Local<v8::Object> val);
|
| 38 |
+
NODE_EXTERN char* Data(v8::Local<v8::Value> val);
|
| 39 |
+
NODE_EXTERN char* Data(v8::Local<v8::Object> val);
|
| 40 |
+
NODE_EXTERN size_t Length(v8::Local<v8::Value> val);
|
| 41 |
+
NODE_EXTERN size_t Length(v8::Local<v8::Object> val);
|
| 42 |
+
|
| 43 |
+
// public constructor - data is copied
|
| 44 |
+
NODE_EXTERN v8::MaybeLocal<v8::Object> Copy(v8::Isolate* isolate,
|
| 45 |
+
const char* data,
|
| 46 |
+
size_t len);
|
| 47 |
+
|
| 48 |
+
// public constructor
|
| 49 |
+
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
|
| 50 |
+
|
| 51 |
+
// public constructor from string
|
| 52 |
+
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
|
| 53 |
+
v8::Local<v8::String> string,
|
| 54 |
+
enum encoding enc = UTF8);
|
| 55 |
+
|
| 56 |
+
// public constructor - data is used, callback is passed data on object gc
|
| 57 |
+
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
|
| 58 |
+
char* data,
|
| 59 |
+
size_t length,
|
| 60 |
+
FreeCallback callback,
|
| 61 |
+
void* hint);
|
| 62 |
+
|
| 63 |
+
// public constructor - data is used.
|
| 64 |
+
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
|
| 65 |
+
char* data,
|
| 66 |
+
size_t len);
|
| 67 |
+
|
| 68 |
+
// Creates a Buffer instance over an existing ArrayBuffer.
|
| 69 |
+
NODE_EXTERN v8::MaybeLocal<v8::Uint8Array> New(v8::Isolate* isolate,
|
| 70 |
+
v8::Local<v8::ArrayBuffer> ab,
|
| 71 |
+
size_t byte_offset,
|
| 72 |
+
size_t length);
|
| 73 |
+
|
| 74 |
+
// This is verbose to be explicit with inline commenting
|
| 75 |
+
static inline bool IsWithinBounds(size_t off, size_t len, size_t max) {
|
| 76 |
+
// Asking to seek too far into the buffer
|
| 77 |
+
// check to avoid wrapping in subsequent subtraction
|
| 78 |
+
if (off > max)
|
| 79 |
+
return false;
|
| 80 |
+
|
| 81 |
+
// Asking for more than is left over in the buffer
|
| 82 |
+
if (max - off < len)
|
| 83 |
+
return false;
|
| 84 |
+
|
| 85 |
+
// Otherwise we're in bounds
|
| 86 |
+
return true;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
} // namespace Buffer
|
| 90 |
+
} // namespace node
|
| 91 |
+
|
| 92 |
+
#endif // SRC_NODE_BUFFER_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/node_object_wrap.h
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright Joyent, Inc. and other Node contributors.
|
| 2 |
+
//
|
| 3 |
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
| 4 |
+
// copy of this software and associated documentation files (the
|
| 5 |
+
// "Software"), to deal in the Software without restriction, including
|
| 6 |
+
// without limitation the rights to use, copy, modify, merge, publish,
|
| 7 |
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
| 8 |
+
// persons to whom the Software is furnished to do so, subject to the
|
| 9 |
+
// following conditions:
|
| 10 |
+
//
|
| 11 |
+
// The above copyright notice and this permission notice shall be included
|
| 12 |
+
// in all copies or substantial portions of the Software.
|
| 13 |
+
//
|
| 14 |
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
| 15 |
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 16 |
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
| 17 |
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
| 18 |
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
| 19 |
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
| 20 |
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 21 |
+
|
| 22 |
+
#ifndef SRC_NODE_OBJECT_WRAP_H_
|
| 23 |
+
#define SRC_NODE_OBJECT_WRAP_H_
|
| 24 |
+
|
| 25 |
+
#include "v8.h"
|
| 26 |
+
#include <cassert>
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
namespace node {
|
| 30 |
+
|
| 31 |
+
class ObjectWrap {
|
| 32 |
+
public:
|
| 33 |
+
ObjectWrap() {
|
| 34 |
+
refs_ = 0;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
virtual ~ObjectWrap() {
|
| 39 |
+
if (persistent().IsEmpty())
|
| 40 |
+
return;
|
| 41 |
+
persistent().ClearWeak();
|
| 42 |
+
persistent().Reset();
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
template <class T>
|
| 47 |
+
static inline T* Unwrap(v8::Local<v8::Object> handle) {
|
| 48 |
+
assert(!handle.IsEmpty());
|
| 49 |
+
assert(handle->InternalFieldCount() > 0);
|
| 50 |
+
// Cast to ObjectWrap before casting to T. A direct cast from void
|
| 51 |
+
// to T won't work right when T has more than one base class.
|
| 52 |
+
void* ptr = handle->GetAlignedPointerFromInternalField(0);
|
| 53 |
+
ObjectWrap* wrap = static_cast<ObjectWrap*>(ptr);
|
| 54 |
+
return static_cast<T*>(wrap);
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
inline v8::Local<v8::Object> handle() {
|
| 59 |
+
return handle(v8::Isolate::GetCurrent());
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
inline v8::Local<v8::Object> handle(v8::Isolate* isolate) {
|
| 64 |
+
return v8::Local<v8::Object>::New(isolate, persistent());
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
// NOLINTNEXTLINE(runtime/v8_persistent)
|
| 69 |
+
inline v8::Persistent<v8::Object>& persistent() {
|
| 70 |
+
return handle_;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
protected:
|
| 75 |
+
inline void Wrap(v8::Local<v8::Object> handle) {
|
| 76 |
+
assert(persistent().IsEmpty());
|
| 77 |
+
assert(handle->InternalFieldCount() > 0);
|
| 78 |
+
handle->SetAlignedPointerInInternalField(0, this);
|
| 79 |
+
persistent().Reset(v8::Isolate::GetCurrent(), handle);
|
| 80 |
+
MakeWeak();
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
inline void MakeWeak() {
|
| 85 |
+
persistent().SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter);
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
/* Ref() marks the object as being attached to an event loop.
|
| 89 |
+
* Refed objects will not be garbage collected, even if
|
| 90 |
+
* all references are lost.
|
| 91 |
+
*/
|
| 92 |
+
virtual void Ref() {
|
| 93 |
+
assert(!persistent().IsEmpty());
|
| 94 |
+
persistent().ClearWeak();
|
| 95 |
+
refs_++;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/* Unref() marks an object as detached from the event loop. This is its
|
| 99 |
+
* default state. When an object with a "weak" reference changes from
|
| 100 |
+
* attached to detached state it will be freed. Be careful not to access
|
| 101 |
+
* the object after making this call as it might be gone!
|
| 102 |
+
* (A "weak reference" means an object that only has a
|
| 103 |
+
* persistent handle.)
|
| 104 |
+
*
|
| 105 |
+
* DO NOT CALL THIS FROM DESTRUCTOR
|
| 106 |
+
*/
|
| 107 |
+
virtual void Unref() {
|
| 108 |
+
assert(!persistent().IsEmpty());
|
| 109 |
+
assert(!persistent().IsWeak());
|
| 110 |
+
assert(refs_ > 0);
|
| 111 |
+
if (--refs_ == 0)
|
| 112 |
+
MakeWeak();
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
int refs_; // ro
|
| 116 |
+
|
| 117 |
+
private:
|
| 118 |
+
static void WeakCallback(
|
| 119 |
+
const v8::WeakCallbackInfo<ObjectWrap>& data) {
|
| 120 |
+
ObjectWrap* wrap = data.GetParameter();
|
| 121 |
+
assert(wrap->refs_ == 0);
|
| 122 |
+
wrap->handle_.Reset();
|
| 123 |
+
delete wrap;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
// NOLINTNEXTLINE(runtime/v8_persistent)
|
| 127 |
+
v8::Persistent<v8::Object> handle_;
|
| 128 |
+
};
|
| 129 |
+
|
| 130 |
+
} // namespace node
|
| 131 |
+
|
| 132 |
+
#endif // SRC_NODE_OBJECT_WRAP_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/node_version.h
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright Joyent, Inc. and other Node contributors.
|
| 2 |
+
//
|
| 3 |
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
| 4 |
+
// copy of this software and associated documentation files (the
|
| 5 |
+
// "Software"), to deal in the Software without restriction, including
|
| 6 |
+
// without limitation the rights to use, copy, modify, merge, publish,
|
| 7 |
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
| 8 |
+
// persons to whom the Software is furnished to do so, subject to the
|
| 9 |
+
// following conditions:
|
| 10 |
+
//
|
| 11 |
+
// The above copyright notice and this permission notice shall be included
|
| 12 |
+
// in all copies or substantial portions of the Software.
|
| 13 |
+
//
|
| 14 |
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
| 15 |
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 16 |
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
| 17 |
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
| 18 |
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
| 19 |
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
| 20 |
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 21 |
+
|
| 22 |
+
#ifndef SRC_NODE_VERSION_H_
|
| 23 |
+
#define SRC_NODE_VERSION_H_
|
| 24 |
+
|
| 25 |
+
#define NODE_MAJOR_VERSION 24
|
| 26 |
+
#define NODE_MINOR_VERSION 12
|
| 27 |
+
#define NODE_PATCH_VERSION 0
|
| 28 |
+
|
| 29 |
+
#define NODE_VERSION_IS_LTS 1
|
| 30 |
+
#define NODE_VERSION_LTS_CODENAME "Krypton"
|
| 31 |
+
|
| 32 |
+
#define NODE_VERSION_IS_RELEASE 1
|
| 33 |
+
|
| 34 |
+
#ifndef NODE_STRINGIFY
|
| 35 |
+
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
|
| 36 |
+
#define NODE_STRINGIFY_HELPER(n) #n
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
#ifndef NODE_RELEASE
|
| 40 |
+
#define NODE_RELEASE "node"
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#ifndef NODE_TAG
|
| 44 |
+
# if NODE_VERSION_IS_RELEASE
|
| 45 |
+
# define NODE_TAG ""
|
| 46 |
+
# else
|
| 47 |
+
# define NODE_TAG "-pre"
|
| 48 |
+
# endif
|
| 49 |
+
#else
|
| 50 |
+
// NODE_TAG is passed without quotes when rc.exe is run from msbuild
|
| 51 |
+
# define NODE_EXE_VERSION NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
|
| 52 |
+
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
|
| 53 |
+
NODE_STRINGIFY(NODE_PATCH_VERSION) \
|
| 54 |
+
NODE_STRINGIFY(NODE_TAG)
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
|
| 58 |
+
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
|
| 59 |
+
NODE_STRINGIFY(NODE_PATCH_VERSION) \
|
| 60 |
+
NODE_TAG
|
| 61 |
+
#ifndef NODE_EXE_VERSION
|
| 62 |
+
# define NODE_EXE_VERSION NODE_VERSION_STRING
|
| 63 |
+
#endif
|
| 64 |
+
|
| 65 |
+
#define NODE_VERSION "v" NODE_VERSION_STRING
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
#define NODE_VERSION_AT_LEAST(major, minor, patch) \
|
| 69 |
+
(( (major) < NODE_MAJOR_VERSION) \
|
| 70 |
+
|| ((major) == NODE_MAJOR_VERSION && (minor) < NODE_MINOR_VERSION) \
|
| 71 |
+
|| ((major) == NODE_MAJOR_VERSION && \
|
| 72 |
+
(minor) == NODE_MINOR_VERSION && (patch) <= NODE_PATCH_VERSION))
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* Node.js will refuse to load modules that weren't compiled against its own
|
| 76 |
+
* module ABI number, exposed as the process.versions.modules property.
|
| 77 |
+
*
|
| 78 |
+
* Node.js will refuse to load modules with a non-matching ABI version. The
|
| 79 |
+
* version number here should be changed whenever an ABI-incompatible API change
|
| 80 |
+
* is made in the C++ side, including in V8 or other dependencies.
|
| 81 |
+
*
|
| 82 |
+
* Node.js will not change the module version during a Major release line
|
| 83 |
+
* We will, at times update the version of V8 shipped in the release line
|
| 84 |
+
* if it can be made ABI compatible with the previous version.
|
| 85 |
+
*
|
| 86 |
+
* Embedders building Node.js can define NODE_EMBEDDER_MODULE_VERSION to
|
| 87 |
+
* override the default value of NODE_MODULE_VERSION.
|
| 88 |
+
*
|
| 89 |
+
* The registry of used NODE_MODULE_VERSION numbers is located at
|
| 90 |
+
* https://github.com/nodejs/node/blob/HEAD/doc/abi_version_registry.json
|
| 91 |
+
* Extenders, embedders and other consumers of Node.js that require ABI
|
| 92 |
+
* version matching should open a pull request to reserve a number in this
|
| 93 |
+
* registry.
|
| 94 |
+
*/
|
| 95 |
+
#if defined(NODE_EMBEDDER_MODULE_VERSION)
|
| 96 |
+
#define NODE_MODULE_VERSION NODE_EMBEDDER_MODULE_VERSION
|
| 97 |
+
#else
|
| 98 |
+
#define NODE_MODULE_VERSION 137
|
| 99 |
+
#endif
|
| 100 |
+
|
| 101 |
+
// The NAPI_VERSION supported by the runtime. This is the inclusive range of
|
| 102 |
+
// versions which the Node.js binary being built supports.
|
| 103 |
+
#define NODE_API_SUPPORTED_VERSION_MAX 10
|
| 104 |
+
#define NODE_API_SUPPORTED_VERSION_MIN 1
|
| 105 |
+
|
| 106 |
+
// Node API modules use NAPI_VERSION 8 by default if it is not explicitly
|
| 107 |
+
// specified. It must be always 8.
|
| 108 |
+
#define NODE_API_DEFAULT_MODULE_API_VERSION 8
|
| 109 |
+
|
| 110 |
+
#endif // SRC_NODE_VERSION_H_
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/asn1.h
ADDED
|
@@ -0,0 +1,1134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/asn1.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_ASN1_H
|
| 16 |
+
# define OPENSSL_ASN1_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_ASN1_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# ifndef OPENSSL_NO_STDIO
|
| 25 |
+
# include <stdio.h>
|
| 26 |
+
# endif
|
| 27 |
+
# include <time.h>
|
| 28 |
+
# include <openssl/e_os2.h>
|
| 29 |
+
# include <openssl/opensslconf.h>
|
| 30 |
+
# include <openssl/bio.h>
|
| 31 |
+
# include <openssl/safestack.h>
|
| 32 |
+
# include <openssl/asn1err.h>
|
| 33 |
+
# include <openssl/symhacks.h>
|
| 34 |
+
|
| 35 |
+
# include <openssl/types.h>
|
| 36 |
+
# include <openssl/bn.h>
|
| 37 |
+
|
| 38 |
+
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
| 39 |
+
# undef OPENSSL_EXTERN
|
| 40 |
+
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
| 41 |
+
# endif
|
| 42 |
+
|
| 43 |
+
#ifdef __cplusplus
|
| 44 |
+
extern "C" {
|
| 45 |
+
#endif
|
| 46 |
+
|
| 47 |
+
# define V_ASN1_UNIVERSAL 0x00
|
| 48 |
+
# define V_ASN1_APPLICATION 0x40
|
| 49 |
+
# define V_ASN1_CONTEXT_SPECIFIC 0x80
|
| 50 |
+
# define V_ASN1_PRIVATE 0xc0
|
| 51 |
+
|
| 52 |
+
# define V_ASN1_CONSTRUCTED 0x20
|
| 53 |
+
# define V_ASN1_PRIMITIVE_TAG 0x1f
|
| 54 |
+
# define V_ASN1_PRIMATIVE_TAG /*compat*/ V_ASN1_PRIMITIVE_TAG
|
| 55 |
+
|
| 56 |
+
# define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */
|
| 57 |
+
# define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
|
| 58 |
+
# define V_ASN1_ANY -4 /* used in ASN1 template code */
|
| 59 |
+
|
| 60 |
+
# define V_ASN1_UNDEF -1
|
| 61 |
+
/* ASN.1 tag values */
|
| 62 |
+
# define V_ASN1_EOC 0
|
| 63 |
+
# define V_ASN1_BOOLEAN 1
|
| 64 |
+
# define V_ASN1_INTEGER 2
|
| 65 |
+
# define V_ASN1_BIT_STRING 3
|
| 66 |
+
# define V_ASN1_OCTET_STRING 4
|
| 67 |
+
# define V_ASN1_NULL 5
|
| 68 |
+
# define V_ASN1_OBJECT 6
|
| 69 |
+
# define V_ASN1_OBJECT_DESCRIPTOR 7
|
| 70 |
+
# define V_ASN1_EXTERNAL 8
|
| 71 |
+
# define V_ASN1_REAL 9
|
| 72 |
+
# define V_ASN1_ENUMERATED 10
|
| 73 |
+
# define V_ASN1_UTF8STRING 12
|
| 74 |
+
# define V_ASN1_SEQUENCE 16
|
| 75 |
+
# define V_ASN1_SET 17
|
| 76 |
+
# define V_ASN1_NUMERICSTRING 18
|
| 77 |
+
# define V_ASN1_PRINTABLESTRING 19
|
| 78 |
+
# define V_ASN1_T61STRING 20
|
| 79 |
+
# define V_ASN1_TELETEXSTRING 20 /* alias */
|
| 80 |
+
# define V_ASN1_VIDEOTEXSTRING 21
|
| 81 |
+
# define V_ASN1_IA5STRING 22
|
| 82 |
+
# define V_ASN1_UTCTIME 23
|
| 83 |
+
# define V_ASN1_GENERALIZEDTIME 24
|
| 84 |
+
# define V_ASN1_GRAPHICSTRING 25
|
| 85 |
+
# define V_ASN1_ISO64STRING 26
|
| 86 |
+
# define V_ASN1_VISIBLESTRING 26 /* alias */
|
| 87 |
+
# define V_ASN1_GENERALSTRING 27
|
| 88 |
+
# define V_ASN1_UNIVERSALSTRING 28
|
| 89 |
+
# define V_ASN1_BMPSTRING 30
|
| 90 |
+
|
| 91 |
+
/*
|
| 92 |
+
* NB the constants below are used internally by ASN1_INTEGER
|
| 93 |
+
* and ASN1_ENUMERATED to indicate the sign. They are *not* on
|
| 94 |
+
* the wire tag values.
|
| 95 |
+
*/
|
| 96 |
+
|
| 97 |
+
# define V_ASN1_NEG 0x100
|
| 98 |
+
# define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
|
| 99 |
+
# define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
|
| 100 |
+
|
| 101 |
+
/* For use with d2i_ASN1_type_bytes() */
|
| 102 |
+
# define B_ASN1_NUMERICSTRING 0x0001
|
| 103 |
+
# define B_ASN1_PRINTABLESTRING 0x0002
|
| 104 |
+
# define B_ASN1_T61STRING 0x0004
|
| 105 |
+
# define B_ASN1_TELETEXSTRING 0x0004
|
| 106 |
+
# define B_ASN1_VIDEOTEXSTRING 0x0008
|
| 107 |
+
# define B_ASN1_IA5STRING 0x0010
|
| 108 |
+
# define B_ASN1_GRAPHICSTRING 0x0020
|
| 109 |
+
# define B_ASN1_ISO64STRING 0x0040
|
| 110 |
+
# define B_ASN1_VISIBLESTRING 0x0040
|
| 111 |
+
# define B_ASN1_GENERALSTRING 0x0080
|
| 112 |
+
# define B_ASN1_UNIVERSALSTRING 0x0100
|
| 113 |
+
# define B_ASN1_OCTET_STRING 0x0200
|
| 114 |
+
# define B_ASN1_BIT_STRING 0x0400
|
| 115 |
+
# define B_ASN1_BMPSTRING 0x0800
|
| 116 |
+
# define B_ASN1_UNKNOWN 0x1000
|
| 117 |
+
# define B_ASN1_UTF8STRING 0x2000
|
| 118 |
+
# define B_ASN1_UTCTIME 0x4000
|
| 119 |
+
# define B_ASN1_GENERALIZEDTIME 0x8000
|
| 120 |
+
# define B_ASN1_SEQUENCE 0x10000
|
| 121 |
+
/* For use with ASN1_mbstring_copy() */
|
| 122 |
+
# define MBSTRING_FLAG 0x1000
|
| 123 |
+
# define MBSTRING_UTF8 (MBSTRING_FLAG)
|
| 124 |
+
# define MBSTRING_ASC (MBSTRING_FLAG|1)
|
| 125 |
+
# define MBSTRING_BMP (MBSTRING_FLAG|2)
|
| 126 |
+
# define MBSTRING_UNIV (MBSTRING_FLAG|4)
|
| 127 |
+
# define SMIME_OLDMIME 0x400
|
| 128 |
+
# define SMIME_CRLFEOL 0x800
|
| 129 |
+
# define SMIME_STREAM 0x1000
|
| 130 |
+
|
| 131 |
+
/* Stacks for types not otherwise defined in this header */
|
| 132 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_ALGOR, X509_ALGOR, X509_ALGOR)
|
| 133 |
+
#define sk_X509_ALGOR_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ALGOR_sk_type(sk))
|
| 134 |
+
#define sk_X509_ALGOR_value(sk, idx) ((X509_ALGOR *)OPENSSL_sk_value(ossl_check_const_X509_ALGOR_sk_type(sk), (idx)))
|
| 135 |
+
#define sk_X509_ALGOR_new(cmp) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new(ossl_check_X509_ALGOR_compfunc_type(cmp)))
|
| 136 |
+
#define sk_X509_ALGOR_new_null() ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new_null())
|
| 137 |
+
#define sk_X509_ALGOR_new_reserve(cmp, n) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new_reserve(ossl_check_X509_ALGOR_compfunc_type(cmp), (n)))
|
| 138 |
+
#define sk_X509_ALGOR_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ALGOR_sk_type(sk), (n))
|
| 139 |
+
#define sk_X509_ALGOR_free(sk) OPENSSL_sk_free(ossl_check_X509_ALGOR_sk_type(sk))
|
| 140 |
+
#define sk_X509_ALGOR_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ALGOR_sk_type(sk))
|
| 141 |
+
#define sk_X509_ALGOR_delete(sk, i) ((X509_ALGOR *)OPENSSL_sk_delete(ossl_check_X509_ALGOR_sk_type(sk), (i)))
|
| 142 |
+
#define sk_X509_ALGOR_delete_ptr(sk, ptr) ((X509_ALGOR *)OPENSSL_sk_delete_ptr(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)))
|
| 143 |
+
#define sk_X509_ALGOR_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
| 144 |
+
#define sk_X509_ALGOR_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
| 145 |
+
#define sk_X509_ALGOR_pop(sk) ((X509_ALGOR *)OPENSSL_sk_pop(ossl_check_X509_ALGOR_sk_type(sk)))
|
| 146 |
+
#define sk_X509_ALGOR_shift(sk) ((X509_ALGOR *)OPENSSL_sk_shift(ossl_check_X509_ALGOR_sk_type(sk)))
|
| 147 |
+
#define sk_X509_ALGOR_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ALGOR_sk_type(sk),ossl_check_X509_ALGOR_freefunc_type(freefunc))
|
| 148 |
+
#define sk_X509_ALGOR_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), (idx))
|
| 149 |
+
#define sk_X509_ALGOR_set(sk, idx, ptr) ((X509_ALGOR *)OPENSSL_sk_set(ossl_check_X509_ALGOR_sk_type(sk), (idx), ossl_check_X509_ALGOR_type(ptr)))
|
| 150 |
+
#define sk_X509_ALGOR_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
| 151 |
+
#define sk_X509_ALGOR_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
| 152 |
+
#define sk_X509_ALGOR_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), pnum)
|
| 153 |
+
#define sk_X509_ALGOR_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ALGOR_sk_type(sk))
|
| 154 |
+
#define sk_X509_ALGOR_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ALGOR_sk_type(sk))
|
| 155 |
+
#define sk_X509_ALGOR_dup(sk) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_dup(ossl_check_const_X509_ALGOR_sk_type(sk)))
|
| 156 |
+
#define sk_X509_ALGOR_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_copyfunc_type(copyfunc), ossl_check_X509_ALGOR_freefunc_type(freefunc)))
|
| 157 |
+
#define sk_X509_ALGOR_set_cmp_func(sk, cmp) ((sk_X509_ALGOR_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_compfunc_type(cmp)))
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
|
| 162 |
+
/*
|
| 163 |
+
* This indicates that the ASN1_STRING is not a real value but just a place
|
| 164 |
+
* holder for the location where indefinite length constructed data should be
|
| 165 |
+
* inserted in the memory buffer
|
| 166 |
+
*/
|
| 167 |
+
# define ASN1_STRING_FLAG_NDEF 0x010
|
| 168 |
+
|
| 169 |
+
/*
|
| 170 |
+
* This flag is used by the CMS code to indicate that a string is not
|
| 171 |
+
* complete and is a place holder for content when it had all been accessed.
|
| 172 |
+
* The flag will be reset when content has been written to it.
|
| 173 |
+
*/
|
| 174 |
+
|
| 175 |
+
# define ASN1_STRING_FLAG_CONT 0x020
|
| 176 |
+
/*
|
| 177 |
+
* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
|
| 178 |
+
* type.
|
| 179 |
+
*/
|
| 180 |
+
# define ASN1_STRING_FLAG_MSTRING 0x040
|
| 181 |
+
/* String is embedded and only content should be freed */
|
| 182 |
+
# define ASN1_STRING_FLAG_EMBED 0x080
|
| 183 |
+
/* String should be parsed in RFC 5280's time format */
|
| 184 |
+
# define ASN1_STRING_FLAG_X509_TIME 0x100
|
| 185 |
+
/* This is the base type that holds just about everything :-) */
|
| 186 |
+
struct asn1_string_st {
|
| 187 |
+
int length;
|
| 188 |
+
int type;
|
| 189 |
+
unsigned char *data;
|
| 190 |
+
/*
|
| 191 |
+
* The value of the following field depends on the type being held. It
|
| 192 |
+
* is mostly being used for BIT_STRING so if the input data has a
|
| 193 |
+
* non-zero 'unused bits' value, it will be handled correctly
|
| 194 |
+
*/
|
| 195 |
+
long flags;
|
| 196 |
+
};
|
| 197 |
+
|
| 198 |
+
/*
|
| 199 |
+
* ASN1_ENCODING structure: this is used to save the received encoding of an
|
| 200 |
+
* ASN1 type. This is useful to get round problems with invalid encodings
|
| 201 |
+
* which can break signatures.
|
| 202 |
+
*/
|
| 203 |
+
|
| 204 |
+
typedef struct ASN1_ENCODING_st {
|
| 205 |
+
unsigned char *enc; /* DER encoding */
|
| 206 |
+
long len; /* Length of encoding */
|
| 207 |
+
int modified; /* set to 1 if 'enc' is invalid */
|
| 208 |
+
} ASN1_ENCODING;
|
| 209 |
+
|
| 210 |
+
/* Used with ASN1 LONG type: if a long is set to this it is omitted */
|
| 211 |
+
# define ASN1_LONG_UNDEF 0x7fffffffL
|
| 212 |
+
|
| 213 |
+
# define STABLE_FLAGS_MALLOC 0x01
|
| 214 |
+
/*
|
| 215 |
+
* A zero passed to ASN1_STRING_TABLE_new_add for the flags is interpreted
|
| 216 |
+
* as "don't change" and STABLE_FLAGS_MALLOC is always set. By setting
|
| 217 |
+
* STABLE_FLAGS_MALLOC only we can clear the existing value. Use the alias
|
| 218 |
+
* STABLE_FLAGS_CLEAR to reflect this.
|
| 219 |
+
*/
|
| 220 |
+
# define STABLE_FLAGS_CLEAR STABLE_FLAGS_MALLOC
|
| 221 |
+
# define STABLE_NO_MASK 0x02
|
| 222 |
+
# define DIRSTRING_TYPE \
|
| 223 |
+
(B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
|
| 224 |
+
# define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
|
| 225 |
+
|
| 226 |
+
struct asn1_string_table_st {
|
| 227 |
+
int nid;
|
| 228 |
+
long minsize;
|
| 229 |
+
long maxsize;
|
| 230 |
+
unsigned long mask;
|
| 231 |
+
unsigned long flags;
|
| 232 |
+
};
|
| 233 |
+
|
| 234 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_STRING_TABLE, ASN1_STRING_TABLE, ASN1_STRING_TABLE)
|
| 235 |
+
#define sk_ASN1_STRING_TABLE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk))
|
| 236 |
+
#define sk_ASN1_STRING_TABLE_value(sk, idx) ((ASN1_STRING_TABLE *)OPENSSL_sk_value(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), (idx)))
|
| 237 |
+
#define sk_ASN1_STRING_TABLE_new(cmp) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp)))
|
| 238 |
+
#define sk_ASN1_STRING_TABLE_new_null() ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new_null())
|
| 239 |
+
#define sk_ASN1_STRING_TABLE_new_reserve(cmp, n) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp), (n)))
|
| 240 |
+
#define sk_ASN1_STRING_TABLE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (n))
|
| 241 |
+
#define sk_ASN1_STRING_TABLE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
| 242 |
+
#define sk_ASN1_STRING_TABLE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
| 243 |
+
#define sk_ASN1_STRING_TABLE_delete(sk, i) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (i)))
|
| 244 |
+
#define sk_ASN1_STRING_TABLE_delete_ptr(sk, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)))
|
| 245 |
+
#define sk_ASN1_STRING_TABLE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
| 246 |
+
#define sk_ASN1_STRING_TABLE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
| 247 |
+
#define sk_ASN1_STRING_TABLE_pop(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_pop(ossl_check_ASN1_STRING_TABLE_sk_type(sk)))
|
| 248 |
+
#define sk_ASN1_STRING_TABLE_shift(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_shift(ossl_check_ASN1_STRING_TABLE_sk_type(sk)))
|
| 249 |
+
#define sk_ASN1_STRING_TABLE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk),ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc))
|
| 250 |
+
#define sk_ASN1_STRING_TABLE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), (idx))
|
| 251 |
+
#define sk_ASN1_STRING_TABLE_set(sk, idx, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_set(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (idx), ossl_check_ASN1_STRING_TABLE_type(ptr)))
|
| 252 |
+
#define sk_ASN1_STRING_TABLE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
| 253 |
+
#define sk_ASN1_STRING_TABLE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
| 254 |
+
#define sk_ASN1_STRING_TABLE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), pnum)
|
| 255 |
+
#define sk_ASN1_STRING_TABLE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
| 256 |
+
#define sk_ASN1_STRING_TABLE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk))
|
| 257 |
+
#define sk_ASN1_STRING_TABLE_dup(sk) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk)))
|
| 258 |
+
#define sk_ASN1_STRING_TABLE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_copyfunc_type(copyfunc), ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc)))
|
| 259 |
+
#define sk_ASN1_STRING_TABLE_set_cmp_func(sk, cmp) ((sk_ASN1_STRING_TABLE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp)))
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
/* size limits: this stuff is taken straight from RFC2459 */
|
| 263 |
+
|
| 264 |
+
# define ub_name 32768
|
| 265 |
+
# define ub_common_name 64
|
| 266 |
+
# define ub_locality_name 128
|
| 267 |
+
# define ub_state_name 128
|
| 268 |
+
# define ub_organization_name 64
|
| 269 |
+
# define ub_organization_unit_name 64
|
| 270 |
+
# define ub_title 64
|
| 271 |
+
# define ub_email_address 128
|
| 272 |
+
|
| 273 |
+
/*
|
| 274 |
+
* Declarations for template structures: for full definitions see asn1t.h
|
| 275 |
+
*/
|
| 276 |
+
typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
|
| 277 |
+
typedef struct ASN1_TLC_st ASN1_TLC;
|
| 278 |
+
/* This is just an opaque pointer */
|
| 279 |
+
typedef struct ASN1_VALUE_st ASN1_VALUE;
|
| 280 |
+
|
| 281 |
+
/* Declare ASN1 functions: the implement macro is in asn1t.h */
|
| 282 |
+
|
| 283 |
+
/*
|
| 284 |
+
* The mysterious 'extern' that's passed to some macros is innocuous,
|
| 285 |
+
* and is there to quiet pre-C99 compilers that may complain about empty
|
| 286 |
+
* arguments in macro calls.
|
| 287 |
+
*/
|
| 288 |
+
|
| 289 |
+
# define DECLARE_ASN1_FUNCTIONS_attr(attr, type) \
|
| 290 |
+
DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, type)
|
| 291 |
+
# define DECLARE_ASN1_FUNCTIONS(type) \
|
| 292 |
+
DECLARE_ASN1_FUNCTIONS_attr(extern, type)
|
| 293 |
+
|
| 294 |
+
# define DECLARE_ASN1_ALLOC_FUNCTIONS_attr(attr, type) \
|
| 295 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, type)
|
| 296 |
+
# define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
|
| 297 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_attr(extern, type)
|
| 298 |
+
|
| 299 |
+
# define DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, name) \
|
| 300 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \
|
| 301 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name)
|
| 302 |
+
# define DECLARE_ASN1_FUNCTIONS_name(type, name) \
|
| 303 |
+
DECLARE_ASN1_FUNCTIONS_name_attr(extern, type, name)
|
| 304 |
+
|
| 305 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, itname, name) \
|
| 306 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \
|
| 307 |
+
DECLARE_ASN1_ITEM_attr(attr, itname)
|
| 308 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
|
| 309 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_attr(extern, type, itname, name)
|
| 310 |
+
|
| 311 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name) \
|
| 312 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, name, name)
|
| 313 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_name(type, name) \
|
| 314 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(extern, type, name)
|
| 315 |
+
|
| 316 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \
|
| 317 |
+
attr type *d2i_##name(type **a, const unsigned char **in, long len); \
|
| 318 |
+
attr int i2d_##name(const type *a, unsigned char **out);
|
| 319 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_only(type, name) \
|
| 320 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(extern, type, name)
|
| 321 |
+
|
| 322 |
+
# define DECLARE_ASN1_NDEF_FUNCTION_attr(attr, name) \
|
| 323 |
+
attr int i2d_##name##_NDEF(const name *a, unsigned char **out);
|
| 324 |
+
# define DECLARE_ASN1_NDEF_FUNCTION(name) \
|
| 325 |
+
DECLARE_ASN1_NDEF_FUNCTION_attr(extern, name)
|
| 326 |
+
|
| 327 |
+
# define DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \
|
| 328 |
+
attr type *name##_new(void); \
|
| 329 |
+
attr void name##_free(type *a);
|
| 330 |
+
# define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
|
| 331 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(extern, type, name)
|
| 332 |
+
|
| 333 |
+
# define DECLARE_ASN1_DUP_FUNCTION_attr(attr, type) \
|
| 334 |
+
DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, type)
|
| 335 |
+
# define DECLARE_ASN1_DUP_FUNCTION(type) \
|
| 336 |
+
DECLARE_ASN1_DUP_FUNCTION_attr(extern, type)
|
| 337 |
+
|
| 338 |
+
# define DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, name) \
|
| 339 |
+
attr type *name##_dup(const type *a);
|
| 340 |
+
# define DECLARE_ASN1_DUP_FUNCTION_name(type, name) \
|
| 341 |
+
DECLARE_ASN1_DUP_FUNCTION_name_attr(extern, type, name)
|
| 342 |
+
|
| 343 |
+
# define DECLARE_ASN1_PRINT_FUNCTION_attr(attr, stname) \
|
| 344 |
+
DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, stname)
|
| 345 |
+
# define DECLARE_ASN1_PRINT_FUNCTION(stname) \
|
| 346 |
+
DECLARE_ASN1_PRINT_FUNCTION_attr(extern, stname)
|
| 347 |
+
|
| 348 |
+
# define DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, fname) \
|
| 349 |
+
attr int fname##_print_ctx(BIO *out, const stname *x, int indent, \
|
| 350 |
+
const ASN1_PCTX *pctx);
|
| 351 |
+
# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
|
| 352 |
+
DECLARE_ASN1_PRINT_FUNCTION_fname_attr(extern, stname, fname)
|
| 353 |
+
|
| 354 |
+
# define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
|
| 355 |
+
# define I2D_OF(type) int (*)(const type *,unsigned char **)
|
| 356 |
+
|
| 357 |
+
# define CHECKED_D2I_OF(type, d2i) \
|
| 358 |
+
((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0)))
|
| 359 |
+
# define CHECKED_I2D_OF(type, i2d) \
|
| 360 |
+
((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
|
| 361 |
+
# define CHECKED_NEW_OF(type, xnew) \
|
| 362 |
+
((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0)))
|
| 363 |
+
# define CHECKED_PTR_OF(type, p) \
|
| 364 |
+
((void*) (1 ? p : (type*)0))
|
| 365 |
+
# define CHECKED_PPTR_OF(type, p) \
|
| 366 |
+
((void**) (1 ? p : (type**)0))
|
| 367 |
+
|
| 368 |
+
# define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
|
| 369 |
+
# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(const type *,unsigned char **)
|
| 370 |
+
# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
|
| 371 |
+
|
| 372 |
+
typedef void *d2i_of_void(void **, const unsigned char **, long);
|
| 373 |
+
typedef int i2d_of_void(const void *, unsigned char **);
|
| 374 |
+
typedef int OSSL_i2d_of_void_ctx(const void *, unsigned char **, void *vctx);
|
| 375 |
+
|
| 376 |
+
/*-
|
| 377 |
+
* The following macros and typedefs allow an ASN1_ITEM
|
| 378 |
+
* to be embedded in a structure and referenced. Since
|
| 379 |
+
* the ASN1_ITEM pointers need to be globally accessible
|
| 380 |
+
* (possibly from shared libraries) they may exist in
|
| 381 |
+
* different forms. On platforms that support it the
|
| 382 |
+
* ASN1_ITEM structure itself will be globally exported.
|
| 383 |
+
* Other platforms will export a function that returns
|
| 384 |
+
* an ASN1_ITEM pointer.
|
| 385 |
+
*
|
| 386 |
+
* To handle both cases transparently the macros below
|
| 387 |
+
* should be used instead of hard coding an ASN1_ITEM
|
| 388 |
+
* pointer in a structure.
|
| 389 |
+
*
|
| 390 |
+
* The structure will look like this:
|
| 391 |
+
*
|
| 392 |
+
* typedef struct SOMETHING_st {
|
| 393 |
+
* ...
|
| 394 |
+
* ASN1_ITEM_EXP *iptr;
|
| 395 |
+
* ...
|
| 396 |
+
* } SOMETHING;
|
| 397 |
+
*
|
| 398 |
+
* It would be initialised as e.g.:
|
| 399 |
+
*
|
| 400 |
+
* SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
|
| 401 |
+
*
|
| 402 |
+
* and the actual pointer extracted with:
|
| 403 |
+
*
|
| 404 |
+
* const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
|
| 405 |
+
*
|
| 406 |
+
* Finally an ASN1_ITEM pointer can be extracted from an
|
| 407 |
+
* appropriate reference with: ASN1_ITEM_rptr(X509). This
|
| 408 |
+
* would be used when a function takes an ASN1_ITEM * argument.
|
| 409 |
+
*
|
| 410 |
+
*/
|
| 411 |
+
|
| 412 |
+
|
| 413 |
+
/*
|
| 414 |
+
* Platforms that can't easily handle shared global variables are declared as
|
| 415 |
+
* functions returning ASN1_ITEM pointers.
|
| 416 |
+
*/
|
| 417 |
+
|
| 418 |
+
/* ASN1_ITEM pointer exported type */
|
| 419 |
+
typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
|
| 420 |
+
|
| 421 |
+
/* Macro to obtain ASN1_ITEM pointer from exported type */
|
| 422 |
+
# define ASN1_ITEM_ptr(iptr) (iptr())
|
| 423 |
+
|
| 424 |
+
/* Macro to include ASN1_ITEM pointer from base type */
|
| 425 |
+
# define ASN1_ITEM_ref(iptr) (iptr##_it)
|
| 426 |
+
|
| 427 |
+
# define ASN1_ITEM_rptr(ref) (ref##_it())
|
| 428 |
+
|
| 429 |
+
# define DECLARE_ASN1_ITEM_attr(attr, name) \
|
| 430 |
+
attr const ASN1_ITEM * name##_it(void);
|
| 431 |
+
# define DECLARE_ASN1_ITEM(name) \
|
| 432 |
+
DECLARE_ASN1_ITEM_attr(extern, name)
|
| 433 |
+
|
| 434 |
+
/* Parameters used by ASN1_STRING_print_ex() */
|
| 435 |
+
|
| 436 |
+
/*
|
| 437 |
+
* These determine which characters to escape: RFC2253 special characters,
|
| 438 |
+
* control characters and MSB set characters
|
| 439 |
+
*/
|
| 440 |
+
|
| 441 |
+
# define ASN1_STRFLGS_ESC_2253 1
|
| 442 |
+
# define ASN1_STRFLGS_ESC_CTRL 2
|
| 443 |
+
# define ASN1_STRFLGS_ESC_MSB 4
|
| 444 |
+
|
| 445 |
+
/* Lower 8 bits are reserved as an output type specifier */
|
| 446 |
+
# define ASN1_DTFLGS_TYPE_MASK 0x0FUL
|
| 447 |
+
# define ASN1_DTFLGS_RFC822 0x00UL
|
| 448 |
+
# define ASN1_DTFLGS_ISO8601 0x01UL
|
| 449 |
+
|
| 450 |
+
/*
|
| 451 |
+
* This flag determines how we do escaping: normally RC2253 backslash only,
|
| 452 |
+
* set this to use backslash and quote.
|
| 453 |
+
*/
|
| 454 |
+
|
| 455 |
+
# define ASN1_STRFLGS_ESC_QUOTE 8
|
| 456 |
+
|
| 457 |
+
/* These three flags are internal use only. */
|
| 458 |
+
|
| 459 |
+
/* Character is a valid PrintableString character */
|
| 460 |
+
# define CHARTYPE_PRINTABLESTRING 0x10
|
| 461 |
+
/* Character needs escaping if it is the first character */
|
| 462 |
+
# define CHARTYPE_FIRST_ESC_2253 0x20
|
| 463 |
+
/* Character needs escaping if it is the last character */
|
| 464 |
+
# define CHARTYPE_LAST_ESC_2253 0x40
|
| 465 |
+
|
| 466 |
+
/*
|
| 467 |
+
* NB the internal flags are safely reused below by flags handled at the top
|
| 468 |
+
* level.
|
| 469 |
+
*/
|
| 470 |
+
|
| 471 |
+
/*
|
| 472 |
+
* If this is set we convert all character strings to UTF8 first
|
| 473 |
+
*/
|
| 474 |
+
|
| 475 |
+
# define ASN1_STRFLGS_UTF8_CONVERT 0x10
|
| 476 |
+
|
| 477 |
+
/*
|
| 478 |
+
* If this is set we don't attempt to interpret content: just assume all
|
| 479 |
+
* strings are 1 byte per character. This will produce some pretty odd
|
| 480 |
+
* looking output!
|
| 481 |
+
*/
|
| 482 |
+
|
| 483 |
+
# define ASN1_STRFLGS_IGNORE_TYPE 0x20
|
| 484 |
+
|
| 485 |
+
/* If this is set we include the string type in the output */
|
| 486 |
+
# define ASN1_STRFLGS_SHOW_TYPE 0x40
|
| 487 |
+
|
| 488 |
+
/*
|
| 489 |
+
* This determines which strings to display and which to 'dump' (hex dump of
|
| 490 |
+
* content octets or DER encoding). We can only dump non character strings or
|
| 491 |
+
* everything. If we don't dump 'unknown' they are interpreted as character
|
| 492 |
+
* strings with 1 octet per character and are subject to the usual escaping
|
| 493 |
+
* options.
|
| 494 |
+
*/
|
| 495 |
+
|
| 496 |
+
# define ASN1_STRFLGS_DUMP_ALL 0x80
|
| 497 |
+
# define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
|
| 498 |
+
|
| 499 |
+
/*
|
| 500 |
+
* These determine what 'dumping' does, we can dump the content octets or the
|
| 501 |
+
* DER encoding: both use the RFC2253 #XXXXX notation.
|
| 502 |
+
*/
|
| 503 |
+
|
| 504 |
+
# define ASN1_STRFLGS_DUMP_DER 0x200
|
| 505 |
+
|
| 506 |
+
/*
|
| 507 |
+
* This flag specifies that RC2254 escaping shall be performed.
|
| 508 |
+
*/
|
| 509 |
+
#define ASN1_STRFLGS_ESC_2254 0x400
|
| 510 |
+
|
| 511 |
+
/*
|
| 512 |
+
* All the string flags consistent with RFC2253, escaping control characters
|
| 513 |
+
* isn't essential in RFC2253 but it is advisable anyway.
|
| 514 |
+
*/
|
| 515 |
+
|
| 516 |
+
# define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
|
| 517 |
+
ASN1_STRFLGS_ESC_CTRL | \
|
| 518 |
+
ASN1_STRFLGS_ESC_MSB | \
|
| 519 |
+
ASN1_STRFLGS_UTF8_CONVERT | \
|
| 520 |
+
ASN1_STRFLGS_DUMP_UNKNOWN | \
|
| 521 |
+
ASN1_STRFLGS_DUMP_DER)
|
| 522 |
+
|
| 523 |
+
|
| 524 |
+
struct asn1_type_st {
|
| 525 |
+
int type;
|
| 526 |
+
union {
|
| 527 |
+
char *ptr;
|
| 528 |
+
ASN1_BOOLEAN boolean;
|
| 529 |
+
ASN1_STRING *asn1_string;
|
| 530 |
+
ASN1_OBJECT *object;
|
| 531 |
+
ASN1_INTEGER *integer;
|
| 532 |
+
ASN1_ENUMERATED *enumerated;
|
| 533 |
+
ASN1_BIT_STRING *bit_string;
|
| 534 |
+
ASN1_OCTET_STRING *octet_string;
|
| 535 |
+
ASN1_PRINTABLESTRING *printablestring;
|
| 536 |
+
ASN1_T61STRING *t61string;
|
| 537 |
+
ASN1_IA5STRING *ia5string;
|
| 538 |
+
ASN1_GENERALSTRING *generalstring;
|
| 539 |
+
ASN1_BMPSTRING *bmpstring;
|
| 540 |
+
ASN1_UNIVERSALSTRING *universalstring;
|
| 541 |
+
ASN1_UTCTIME *utctime;
|
| 542 |
+
ASN1_GENERALIZEDTIME *generalizedtime;
|
| 543 |
+
ASN1_VISIBLESTRING *visiblestring;
|
| 544 |
+
ASN1_UTF8STRING *utf8string;
|
| 545 |
+
/*
|
| 546 |
+
* set and sequence are left complete and still contain the set or
|
| 547 |
+
* sequence bytes
|
| 548 |
+
*/
|
| 549 |
+
ASN1_STRING *set;
|
| 550 |
+
ASN1_STRING *sequence;
|
| 551 |
+
ASN1_VALUE *asn1_value;
|
| 552 |
+
} value;
|
| 553 |
+
};
|
| 554 |
+
|
| 555 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_TYPE, ASN1_TYPE, ASN1_TYPE)
|
| 556 |
+
#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
|
| 557 |
+
#define sk_ASN1_TYPE_value(sk, idx) ((ASN1_TYPE *)OPENSSL_sk_value(ossl_check_const_ASN1_TYPE_sk_type(sk), (idx)))
|
| 558 |
+
#define sk_ASN1_TYPE_new(cmp) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new(ossl_check_ASN1_TYPE_compfunc_type(cmp)))
|
| 559 |
+
#define sk_ASN1_TYPE_new_null() ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new_null())
|
| 560 |
+
#define sk_ASN1_TYPE_new_reserve(cmp, n) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_TYPE_compfunc_type(cmp), (n)))
|
| 561 |
+
#define sk_ASN1_TYPE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_TYPE_sk_type(sk), (n))
|
| 562 |
+
#define sk_ASN1_TYPE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_TYPE_sk_type(sk))
|
| 563 |
+
#define sk_ASN1_TYPE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_TYPE_sk_type(sk))
|
| 564 |
+
#define sk_ASN1_TYPE_delete(sk, i) ((ASN1_TYPE *)OPENSSL_sk_delete(ossl_check_ASN1_TYPE_sk_type(sk), (i)))
|
| 565 |
+
#define sk_ASN1_TYPE_delete_ptr(sk, ptr) ((ASN1_TYPE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)))
|
| 566 |
+
#define sk_ASN1_TYPE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
| 567 |
+
#define sk_ASN1_TYPE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
| 568 |
+
#define sk_ASN1_TYPE_pop(sk) ((ASN1_TYPE *)OPENSSL_sk_pop(ossl_check_ASN1_TYPE_sk_type(sk)))
|
| 569 |
+
#define sk_ASN1_TYPE_shift(sk) ((ASN1_TYPE *)OPENSSL_sk_shift(ossl_check_ASN1_TYPE_sk_type(sk)))
|
| 570 |
+
#define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk),ossl_check_ASN1_TYPE_freefunc_type(freefunc))
|
| 571 |
+
#define sk_ASN1_TYPE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), (idx))
|
| 572 |
+
#define sk_ASN1_TYPE_set(sk, idx, ptr) ((ASN1_TYPE *)OPENSSL_sk_set(ossl_check_ASN1_TYPE_sk_type(sk), (idx), ossl_check_ASN1_TYPE_type(ptr)))
|
| 573 |
+
#define sk_ASN1_TYPE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
| 574 |
+
#define sk_ASN1_TYPE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
| 575 |
+
#define sk_ASN1_TYPE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), pnum)
|
| 576 |
+
#define sk_ASN1_TYPE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_TYPE_sk_type(sk))
|
| 577 |
+
#define sk_ASN1_TYPE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_TYPE_sk_type(sk))
|
| 578 |
+
#define sk_ASN1_TYPE_dup(sk) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_TYPE_sk_type(sk)))
|
| 579 |
+
#define sk_ASN1_TYPE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_copyfunc_type(copyfunc), ossl_check_ASN1_TYPE_freefunc_type(freefunc)))
|
| 580 |
+
#define sk_ASN1_TYPE_set_cmp_func(sk, cmp) ((sk_ASN1_TYPE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_compfunc_type(cmp)))
|
| 581 |
+
|
| 582 |
+
|
| 583 |
+
typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
|
| 584 |
+
|
| 585 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)
|
| 586 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)
|
| 587 |
+
|
| 588 |
+
/* This is used to contain a list of bit names */
|
| 589 |
+
typedef struct BIT_STRING_BITNAME_st {
|
| 590 |
+
int bitnum;
|
| 591 |
+
const char *lname;
|
| 592 |
+
const char *sname;
|
| 593 |
+
} BIT_STRING_BITNAME;
|
| 594 |
+
|
| 595 |
+
# define B_ASN1_TIME \
|
| 596 |
+
B_ASN1_UTCTIME | \
|
| 597 |
+
B_ASN1_GENERALIZEDTIME
|
| 598 |
+
|
| 599 |
+
# define B_ASN1_PRINTABLE \
|
| 600 |
+
B_ASN1_NUMERICSTRING| \
|
| 601 |
+
B_ASN1_PRINTABLESTRING| \
|
| 602 |
+
B_ASN1_T61STRING| \
|
| 603 |
+
B_ASN1_IA5STRING| \
|
| 604 |
+
B_ASN1_BIT_STRING| \
|
| 605 |
+
B_ASN1_UNIVERSALSTRING|\
|
| 606 |
+
B_ASN1_BMPSTRING|\
|
| 607 |
+
B_ASN1_UTF8STRING|\
|
| 608 |
+
B_ASN1_SEQUENCE|\
|
| 609 |
+
B_ASN1_UNKNOWN
|
| 610 |
+
|
| 611 |
+
# define B_ASN1_DIRECTORYSTRING \
|
| 612 |
+
B_ASN1_PRINTABLESTRING| \
|
| 613 |
+
B_ASN1_TELETEXSTRING|\
|
| 614 |
+
B_ASN1_BMPSTRING|\
|
| 615 |
+
B_ASN1_UNIVERSALSTRING|\
|
| 616 |
+
B_ASN1_UTF8STRING
|
| 617 |
+
|
| 618 |
+
# define B_ASN1_DISPLAYTEXT \
|
| 619 |
+
B_ASN1_IA5STRING| \
|
| 620 |
+
B_ASN1_VISIBLESTRING| \
|
| 621 |
+
B_ASN1_BMPSTRING|\
|
| 622 |
+
B_ASN1_UTF8STRING
|
| 623 |
+
|
| 624 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name(ASN1_TYPE, ASN1_TYPE)
|
| 625 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
|
| 626 |
+
|
| 627 |
+
int ASN1_TYPE_get(const ASN1_TYPE *a);
|
| 628 |
+
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
|
| 629 |
+
int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
|
| 630 |
+
int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
|
| 631 |
+
|
| 632 |
+
ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t);
|
| 633 |
+
void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t);
|
| 634 |
+
|
| 635 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_OBJECT, ASN1_OBJECT, ASN1_OBJECT)
|
| 636 |
+
#define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk))
|
| 637 |
+
#define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx)))
|
| 638 |
+
#define sk_ASN1_OBJECT_new(cmp) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new(ossl_check_ASN1_OBJECT_compfunc_type(cmp)))
|
| 639 |
+
#define sk_ASN1_OBJECT_new_null() ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new_null())
|
| 640 |
+
#define sk_ASN1_OBJECT_new_reserve(cmp, n) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_OBJECT_compfunc_type(cmp), (n)))
|
| 641 |
+
#define sk_ASN1_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_OBJECT_sk_type(sk), (n))
|
| 642 |
+
#define sk_ASN1_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_ASN1_OBJECT_sk_type(sk))
|
| 643 |
+
#define sk_ASN1_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_OBJECT_sk_type(sk))
|
| 644 |
+
#define sk_ASN1_OBJECT_delete(sk, i) ((ASN1_OBJECT *)OPENSSL_sk_delete(ossl_check_ASN1_OBJECT_sk_type(sk), (i)))
|
| 645 |
+
#define sk_ASN1_OBJECT_delete_ptr(sk, ptr) ((ASN1_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)))
|
| 646 |
+
#define sk_ASN1_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
| 647 |
+
#define sk_ASN1_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
| 648 |
+
#define sk_ASN1_OBJECT_pop(sk) ((ASN1_OBJECT *)OPENSSL_sk_pop(ossl_check_ASN1_OBJECT_sk_type(sk)))
|
| 649 |
+
#define sk_ASN1_OBJECT_shift(sk) ((ASN1_OBJECT *)OPENSSL_sk_shift(ossl_check_ASN1_OBJECT_sk_type(sk)))
|
| 650 |
+
#define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk),ossl_check_ASN1_OBJECT_freefunc_type(freefunc))
|
| 651 |
+
#define sk_ASN1_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), (idx))
|
| 652 |
+
#define sk_ASN1_OBJECT_set(sk, idx, ptr) ((ASN1_OBJECT *)OPENSSL_sk_set(ossl_check_ASN1_OBJECT_sk_type(sk), (idx), ossl_check_ASN1_OBJECT_type(ptr)))
|
| 653 |
+
#define sk_ASN1_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
| 654 |
+
#define sk_ASN1_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
| 655 |
+
#define sk_ASN1_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), pnum)
|
| 656 |
+
#define sk_ASN1_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_OBJECT_sk_type(sk))
|
| 657 |
+
#define sk_ASN1_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_OBJECT_sk_type(sk))
|
| 658 |
+
#define sk_ASN1_OBJECT_dup(sk) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_ASN1_OBJECT_sk_type(sk)))
|
| 659 |
+
#define sk_ASN1_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_copyfunc_type(copyfunc), ossl_check_ASN1_OBJECT_freefunc_type(freefunc)))
|
| 660 |
+
#define sk_ASN1_OBJECT_set_cmp_func(sk, cmp) ((sk_ASN1_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_compfunc_type(cmp)))
|
| 661 |
+
|
| 662 |
+
|
| 663 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT)
|
| 664 |
+
|
| 665 |
+
ASN1_STRING *ASN1_STRING_new(void);
|
| 666 |
+
void ASN1_STRING_free(ASN1_STRING *a);
|
| 667 |
+
void ASN1_STRING_clear_free(ASN1_STRING *a);
|
| 668 |
+
int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
|
| 669 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_STRING)
|
| 670 |
+
ASN1_STRING *ASN1_STRING_type_new(int type);
|
| 671 |
+
int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
|
| 672 |
+
/*
|
| 673 |
+
* Since this is used to store all sorts of things, via macros, for now,
|
| 674 |
+
* make its data void *
|
| 675 |
+
*/
|
| 676 |
+
int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
|
| 677 |
+
void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
|
| 678 |
+
int ASN1_STRING_length(const ASN1_STRING *x);
|
| 679 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 680 |
+
OSSL_DEPRECATEDIN_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int n);
|
| 681 |
+
# endif
|
| 682 |
+
int ASN1_STRING_type(const ASN1_STRING *x);
|
| 683 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 684 |
+
OSSL_DEPRECATEDIN_1_1_0 unsigned char *ASN1_STRING_data(ASN1_STRING *x);
|
| 685 |
+
# endif
|
| 686 |
+
const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
|
| 687 |
+
|
| 688 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
|
| 689 |
+
int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length);
|
| 690 |
+
int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
|
| 691 |
+
int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n);
|
| 692 |
+
int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a,
|
| 693 |
+
const unsigned char *flags, int flags_len);
|
| 694 |
+
|
| 695 |
+
int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
|
| 696 |
+
BIT_STRING_BITNAME *tbl, int indent);
|
| 697 |
+
int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
|
| 698 |
+
int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
|
| 699 |
+
BIT_STRING_BITNAME *tbl);
|
| 700 |
+
|
| 701 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_INTEGER, ASN1_INTEGER, ASN1_INTEGER)
|
| 702 |
+
#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
|
| 703 |
+
#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
|
| 704 |
+
#define sk_ASN1_INTEGER_new(cmp) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new(ossl_check_ASN1_INTEGER_compfunc_type(cmp)))
|
| 705 |
+
#define sk_ASN1_INTEGER_new_null() ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new_null())
|
| 706 |
+
#define sk_ASN1_INTEGER_new_reserve(cmp, n) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_INTEGER_compfunc_type(cmp), (n)))
|
| 707 |
+
#define sk_ASN1_INTEGER_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_INTEGER_sk_type(sk), (n))
|
| 708 |
+
#define sk_ASN1_INTEGER_free(sk) OPENSSL_sk_free(ossl_check_ASN1_INTEGER_sk_type(sk))
|
| 709 |
+
#define sk_ASN1_INTEGER_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_INTEGER_sk_type(sk))
|
| 710 |
+
#define sk_ASN1_INTEGER_delete(sk, i) ((ASN1_INTEGER *)OPENSSL_sk_delete(ossl_check_ASN1_INTEGER_sk_type(sk), (i)))
|
| 711 |
+
#define sk_ASN1_INTEGER_delete_ptr(sk, ptr) ((ASN1_INTEGER *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)))
|
| 712 |
+
#define sk_ASN1_INTEGER_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
| 713 |
+
#define sk_ASN1_INTEGER_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
| 714 |
+
#define sk_ASN1_INTEGER_pop(sk) ((ASN1_INTEGER *)OPENSSL_sk_pop(ossl_check_ASN1_INTEGER_sk_type(sk)))
|
| 715 |
+
#define sk_ASN1_INTEGER_shift(sk) ((ASN1_INTEGER *)OPENSSL_sk_shift(ossl_check_ASN1_INTEGER_sk_type(sk)))
|
| 716 |
+
#define sk_ASN1_INTEGER_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_INTEGER_sk_type(sk),ossl_check_ASN1_INTEGER_freefunc_type(freefunc))
|
| 717 |
+
#define sk_ASN1_INTEGER_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), (idx))
|
| 718 |
+
#define sk_ASN1_INTEGER_set(sk, idx, ptr) ((ASN1_INTEGER *)OPENSSL_sk_set(ossl_check_ASN1_INTEGER_sk_type(sk), (idx), ossl_check_ASN1_INTEGER_type(ptr)))
|
| 719 |
+
#define sk_ASN1_INTEGER_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
| 720 |
+
#define sk_ASN1_INTEGER_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
| 721 |
+
#define sk_ASN1_INTEGER_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), pnum)
|
| 722 |
+
#define sk_ASN1_INTEGER_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_INTEGER_sk_type(sk))
|
| 723 |
+
#define sk_ASN1_INTEGER_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_INTEGER_sk_type(sk))
|
| 724 |
+
#define sk_ASN1_INTEGER_dup(sk) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_dup(ossl_check_const_ASN1_INTEGER_sk_type(sk)))
|
| 725 |
+
#define sk_ASN1_INTEGER_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_copyfunc_type(copyfunc), ossl_check_ASN1_INTEGER_freefunc_type(freefunc)))
|
| 726 |
+
#define sk_ASN1_INTEGER_set_cmp_func(sk, cmp) ((sk_ASN1_INTEGER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_compfunc_type(cmp)))
|
| 727 |
+
|
| 728 |
+
|
| 729 |
+
|
| 730 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
|
| 731 |
+
ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
|
| 732 |
+
long length);
|
| 733 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_INTEGER)
|
| 734 |
+
int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
|
| 735 |
+
|
| 736 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
|
| 737 |
+
|
| 738 |
+
int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
|
| 739 |
+
ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
|
| 740 |
+
ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
|
| 741 |
+
int offset_day, long offset_sec);
|
| 742 |
+
int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
|
| 743 |
+
int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
|
| 744 |
+
|
| 745 |
+
int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
|
| 746 |
+
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
| 747 |
+
time_t t);
|
| 748 |
+
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
|
| 749 |
+
time_t t, int offset_day,
|
| 750 |
+
long offset_sec);
|
| 751 |
+
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
|
| 752 |
+
|
| 753 |
+
int ASN1_TIME_diff(int *pday, int *psec,
|
| 754 |
+
const ASN1_TIME *from, const ASN1_TIME *to);
|
| 755 |
+
|
| 756 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
|
| 757 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_OCTET_STRING)
|
| 758 |
+
int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
|
| 759 |
+
const ASN1_OCTET_STRING *b);
|
| 760 |
+
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,
|
| 761 |
+
int len);
|
| 762 |
+
|
| 763 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_UTF8STRING, ASN1_UTF8STRING, ASN1_UTF8STRING)
|
| 764 |
+
#define sk_ASN1_UTF8STRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))
|
| 765 |
+
#define sk_ASN1_UTF8STRING_value(sk, idx) ((ASN1_UTF8STRING *)OPENSSL_sk_value(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), (idx)))
|
| 766 |
+
#define sk_ASN1_UTF8STRING_new(cmp) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp)))
|
| 767 |
+
#define sk_ASN1_UTF8STRING_new_null() ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_null())
|
| 768 |
+
#define sk_ASN1_UTF8STRING_new_reserve(cmp, n) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp), (n)))
|
| 769 |
+
#define sk_ASN1_UTF8STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_UTF8STRING_sk_type(sk), (n))
|
| 770 |
+
#define sk_ASN1_UTF8STRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
| 771 |
+
#define sk_ASN1_UTF8STRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
| 772 |
+
#define sk_ASN1_UTF8STRING_delete(sk, i) ((ASN1_UTF8STRING *)OPENSSL_sk_delete(ossl_check_ASN1_UTF8STRING_sk_type(sk), (i)))
|
| 773 |
+
#define sk_ASN1_UTF8STRING_delete_ptr(sk, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)))
|
| 774 |
+
#define sk_ASN1_UTF8STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
| 775 |
+
#define sk_ASN1_UTF8STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
| 776 |
+
#define sk_ASN1_UTF8STRING_pop(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_pop(ossl_check_ASN1_UTF8STRING_sk_type(sk)))
|
| 777 |
+
#define sk_ASN1_UTF8STRING_shift(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_shift(ossl_check_ASN1_UTF8STRING_sk_type(sk)))
|
| 778 |
+
#define sk_ASN1_UTF8STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_UTF8STRING_sk_type(sk),ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc))
|
| 779 |
+
#define sk_ASN1_UTF8STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), (idx))
|
| 780 |
+
#define sk_ASN1_UTF8STRING_set(sk, idx, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_set(ossl_check_ASN1_UTF8STRING_sk_type(sk), (idx), ossl_check_ASN1_UTF8STRING_type(ptr)))
|
| 781 |
+
#define sk_ASN1_UTF8STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
| 782 |
+
#define sk_ASN1_UTF8STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
| 783 |
+
#define sk_ASN1_UTF8STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), pnum)
|
| 784 |
+
#define sk_ASN1_UTF8STRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
| 785 |
+
#define sk_ASN1_UTF8STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))
|
| 786 |
+
#define sk_ASN1_UTF8STRING_dup(sk) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_UTF8STRING_sk_type(sk)))
|
| 787 |
+
#define sk_ASN1_UTF8STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_copyfunc_type(copyfunc), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc)))
|
| 788 |
+
#define sk_ASN1_UTF8STRING_set_cmp_func(sk, cmp) ((sk_ASN1_UTF8STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_compfunc_type(cmp)))
|
| 789 |
+
|
| 790 |
+
|
| 791 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
|
| 792 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
|
| 793 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
|
| 794 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
|
| 795 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
|
| 796 |
+
|
| 797 |
+
int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
|
| 798 |
+
int UTF8_putc(unsigned char *str, int len, unsigned long value);
|
| 799 |
+
|
| 800 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_GENERALSTRING, ASN1_GENERALSTRING, ASN1_GENERALSTRING)
|
| 801 |
+
#define sk_ASN1_GENERALSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk))
|
| 802 |
+
#define sk_ASN1_GENERALSTRING_value(sk, idx) ((ASN1_GENERALSTRING *)OPENSSL_sk_value(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), (idx)))
|
| 803 |
+
#define sk_ASN1_GENERALSTRING_new(cmp) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp)))
|
| 804 |
+
#define sk_ASN1_GENERALSTRING_new_null() ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new_null())
|
| 805 |
+
#define sk_ASN1_GENERALSTRING_new_reserve(cmp, n) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp), (n)))
|
| 806 |
+
#define sk_ASN1_GENERALSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (n))
|
| 807 |
+
#define sk_ASN1_GENERALSTRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
| 808 |
+
#define sk_ASN1_GENERALSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
| 809 |
+
#define sk_ASN1_GENERALSTRING_delete(sk, i) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (i)))
|
| 810 |
+
#define sk_ASN1_GENERALSTRING_delete_ptr(sk, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)))
|
| 811 |
+
#define sk_ASN1_GENERALSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
| 812 |
+
#define sk_ASN1_GENERALSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
| 813 |
+
#define sk_ASN1_GENERALSTRING_pop(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_pop(ossl_check_ASN1_GENERALSTRING_sk_type(sk)))
|
| 814 |
+
#define sk_ASN1_GENERALSTRING_shift(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_shift(ossl_check_ASN1_GENERALSTRING_sk_type(sk)))
|
| 815 |
+
#define sk_ASN1_GENERALSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk),ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc))
|
| 816 |
+
#define sk_ASN1_GENERALSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), (idx))
|
| 817 |
+
#define sk_ASN1_GENERALSTRING_set(sk, idx, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_set(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (idx), ossl_check_ASN1_GENERALSTRING_type(ptr)))
|
| 818 |
+
#define sk_ASN1_GENERALSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
| 819 |
+
#define sk_ASN1_GENERALSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
| 820 |
+
#define sk_ASN1_GENERALSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), pnum)
|
| 821 |
+
#define sk_ASN1_GENERALSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
| 822 |
+
#define sk_ASN1_GENERALSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk))
|
| 823 |
+
#define sk_ASN1_GENERALSTRING_dup(sk) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk)))
|
| 824 |
+
#define sk_ASN1_GENERALSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_copyfunc_type(copyfunc), ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc)))
|
| 825 |
+
#define sk_ASN1_GENERALSTRING_set_cmp_func(sk, cmp) ((sk_ASN1_GENERALSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp)))
|
| 826 |
+
|
| 827 |
+
|
| 828 |
+
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
|
| 829 |
+
|
| 830 |
+
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
|
| 831 |
+
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)
|
| 832 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)
|
| 833 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING)
|
| 834 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING)
|
| 835 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING)
|
| 836 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
|
| 837 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
|
| 838 |
+
DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
|
| 839 |
+
|
| 840 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_TIME)
|
| 841 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_UTCTIME)
|
| 842 |
+
DECLARE_ASN1_DUP_FUNCTION(ASN1_GENERALIZEDTIME)
|
| 843 |
+
|
| 844 |
+
DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)
|
| 845 |
+
|
| 846 |
+
ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
|
| 847 |
+
ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,
|
| 848 |
+
int offset_day, long offset_sec);
|
| 849 |
+
int ASN1_TIME_check(const ASN1_TIME *t);
|
| 850 |
+
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
|
| 851 |
+
ASN1_GENERALIZEDTIME **out);
|
| 852 |
+
int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
|
| 853 |
+
int ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str);
|
| 854 |
+
int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm);
|
| 855 |
+
int ASN1_TIME_normalize(ASN1_TIME *s);
|
| 856 |
+
int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t);
|
| 857 |
+
int ASN1_TIME_compare(const ASN1_TIME *a, const ASN1_TIME *b);
|
| 858 |
+
|
| 859 |
+
int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a);
|
| 860 |
+
int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);
|
| 861 |
+
int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a);
|
| 862 |
+
int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size);
|
| 863 |
+
int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a);
|
| 864 |
+
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);
|
| 865 |
+
int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type);
|
| 866 |
+
int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a);
|
| 867 |
+
|
| 868 |
+
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num);
|
| 869 |
+
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
|
| 870 |
+
const char *sn, const char *ln);
|
| 871 |
+
|
| 872 |
+
int ASN1_INTEGER_get_int64(int64_t *pr, const ASN1_INTEGER *a);
|
| 873 |
+
int ASN1_INTEGER_set_int64(ASN1_INTEGER *a, int64_t r);
|
| 874 |
+
int ASN1_INTEGER_get_uint64(uint64_t *pr, const ASN1_INTEGER *a);
|
| 875 |
+
int ASN1_INTEGER_set_uint64(ASN1_INTEGER *a, uint64_t r);
|
| 876 |
+
|
| 877 |
+
int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
|
| 878 |
+
long ASN1_INTEGER_get(const ASN1_INTEGER *a);
|
| 879 |
+
ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
|
| 880 |
+
BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
|
| 881 |
+
|
| 882 |
+
int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_ENUMERATED *a);
|
| 883 |
+
int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r);
|
| 884 |
+
|
| 885 |
+
|
| 886 |
+
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
|
| 887 |
+
long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
|
| 888 |
+
ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai);
|
| 889 |
+
BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn);
|
| 890 |
+
|
| 891 |
+
/* General */
|
| 892 |
+
/* given a string, return the correct type, max is the maximum length */
|
| 893 |
+
int ASN1_PRINTABLE_type(const unsigned char *s, int max);
|
| 894 |
+
|
| 895 |
+
unsigned long ASN1_tag2bit(int tag);
|
| 896 |
+
|
| 897 |
+
/* SPECIALS */
|
| 898 |
+
int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
|
| 899 |
+
int *pclass, long omax);
|
| 900 |
+
int ASN1_check_infinite_end(unsigned char **p, long len);
|
| 901 |
+
int ASN1_const_check_infinite_end(const unsigned char **p, long len);
|
| 902 |
+
void ASN1_put_object(unsigned char **pp, int constructed, int length,
|
| 903 |
+
int tag, int xclass);
|
| 904 |
+
int ASN1_put_eoc(unsigned char **pp);
|
| 905 |
+
int ASN1_object_size(int constructed, int length, int tag);
|
| 906 |
+
|
| 907 |
+
/* Used to implement other functions */
|
| 908 |
+
void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, const void *x);
|
| 909 |
+
|
| 910 |
+
# define ASN1_dup_of(type,i2d,d2i,x) \
|
| 911 |
+
((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \
|
| 912 |
+
CHECKED_D2I_OF(type, d2i), \
|
| 913 |
+
CHECKED_PTR_OF(const type, x)))
|
| 914 |
+
|
| 915 |
+
void *ASN1_item_dup(const ASN1_ITEM *it, const void *x);
|
| 916 |
+
int ASN1_item_sign_ex(const ASN1_ITEM *it, X509_ALGOR *algor1,
|
| 917 |
+
X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
|
| 918 |
+
const void *data, const ASN1_OCTET_STRING *id,
|
| 919 |
+
EVP_PKEY *pkey, const EVP_MD *md, OSSL_LIB_CTX *libctx,
|
| 920 |
+
const char *propq);
|
| 921 |
+
int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg,
|
| 922 |
+
const ASN1_BIT_STRING *signature, const void *data,
|
| 923 |
+
const ASN1_OCTET_STRING *id, EVP_PKEY *pkey,
|
| 924 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 925 |
+
|
| 926 |
+
/* ASN1 alloc/free macros for when a type is only used internally */
|
| 927 |
+
|
| 928 |
+
# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type))
|
| 929 |
+
# define M_ASN1_free_of(x, type) \
|
| 930 |
+
ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
|
| 931 |
+
|
| 932 |
+
# ifndef OPENSSL_NO_STDIO
|
| 933 |
+
void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x);
|
| 934 |
+
|
| 935 |
+
# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
|
| 936 |
+
((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \
|
| 937 |
+
CHECKED_D2I_OF(type, d2i), \
|
| 938 |
+
in, \
|
| 939 |
+
CHECKED_PPTR_OF(type, x)))
|
| 940 |
+
|
| 941 |
+
void *ASN1_item_d2i_fp_ex(const ASN1_ITEM *it, FILE *in, void *x,
|
| 942 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 943 |
+
void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
|
| 944 |
+
int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, const void *x);
|
| 945 |
+
|
| 946 |
+
# define ASN1_i2d_fp_of(type,i2d,out,x) \
|
| 947 |
+
(ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \
|
| 948 |
+
out, \
|
| 949 |
+
CHECKED_PTR_OF(const type, x)))
|
| 950 |
+
|
| 951 |
+
int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, const void *x);
|
| 952 |
+
int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags);
|
| 953 |
+
# endif
|
| 954 |
+
|
| 955 |
+
int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in);
|
| 956 |
+
|
| 957 |
+
void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x);
|
| 958 |
+
|
| 959 |
+
# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
|
| 960 |
+
((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \
|
| 961 |
+
CHECKED_D2I_OF(type, d2i), \
|
| 962 |
+
in, \
|
| 963 |
+
CHECKED_PPTR_OF(type, x)))
|
| 964 |
+
|
| 965 |
+
void *ASN1_item_d2i_bio_ex(const ASN1_ITEM *it, BIO *in, void *pval,
|
| 966 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 967 |
+
void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *pval);
|
| 968 |
+
int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, const void *x);
|
| 969 |
+
|
| 970 |
+
# define ASN1_i2d_bio_of(type,i2d,out,x) \
|
| 971 |
+
(ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
|
| 972 |
+
out, \
|
| 973 |
+
CHECKED_PTR_OF(const type, x)))
|
| 974 |
+
|
| 975 |
+
int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, const void *x);
|
| 976 |
+
BIO *ASN1_item_i2d_mem_bio(const ASN1_ITEM *it, const ASN1_VALUE *val);
|
| 977 |
+
int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
|
| 978 |
+
int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
|
| 979 |
+
int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm);
|
| 980 |
+
int ASN1_TIME_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags);
|
| 981 |
+
int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
|
| 982 |
+
int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags);
|
| 983 |
+
int ASN1_buf_print(BIO *bp, const unsigned char *buf, size_t buflen, int off);
|
| 984 |
+
int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
|
| 985 |
+
unsigned char *buf, int off);
|
| 986 |
+
int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent);
|
| 987 |
+
int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent,
|
| 988 |
+
int dump);
|
| 989 |
+
const char *ASN1_tag2str(int tag);
|
| 990 |
+
|
| 991 |
+
/* Used to load and write Netscape format cert */
|
| 992 |
+
|
| 993 |
+
int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
|
| 994 |
+
|
| 995 |
+
int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len);
|
| 996 |
+
int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len);
|
| 997 |
+
int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
|
| 998 |
+
unsigned char *data, int len);
|
| 999 |
+
int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num,
|
| 1000 |
+
unsigned char *data, int max_len);
|
| 1001 |
+
|
| 1002 |
+
void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it);
|
| 1003 |
+
void *ASN1_item_unpack_ex(const ASN1_STRING *oct, const ASN1_ITEM *it,
|
| 1004 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 1005 |
+
|
| 1006 |
+
ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
|
| 1007 |
+
ASN1_OCTET_STRING **oct);
|
| 1008 |
+
|
| 1009 |
+
void ASN1_STRING_set_default_mask(unsigned long mask);
|
| 1010 |
+
int ASN1_STRING_set_default_mask_asc(const char *p);
|
| 1011 |
+
unsigned long ASN1_STRING_get_default_mask(void);
|
| 1012 |
+
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
|
| 1013 |
+
int inform, unsigned long mask);
|
| 1014 |
+
int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
|
| 1015 |
+
int inform, unsigned long mask,
|
| 1016 |
+
long minsize, long maxsize);
|
| 1017 |
+
|
| 1018 |
+
ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
|
| 1019 |
+
const unsigned char *in, int inlen,
|
| 1020 |
+
int inform, int nid);
|
| 1021 |
+
ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
|
| 1022 |
+
int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
|
| 1023 |
+
void ASN1_STRING_TABLE_cleanup(void);
|
| 1024 |
+
|
| 1025 |
+
/* ASN1 template functions */
|
| 1026 |
+
|
| 1027 |
+
/* Old API compatible functions */
|
| 1028 |
+
ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
|
| 1029 |
+
ASN1_VALUE *ASN1_item_new_ex(const ASN1_ITEM *it, OSSL_LIB_CTX *libctx,
|
| 1030 |
+
const char *propq);
|
| 1031 |
+
void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
|
| 1032 |
+
ASN1_VALUE *ASN1_item_d2i_ex(ASN1_VALUE **val, const unsigned char **in,
|
| 1033 |
+
long len, const ASN1_ITEM *it,
|
| 1034 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 1035 |
+
ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,
|
| 1036 |
+
long len, const ASN1_ITEM *it);
|
| 1037 |
+
int ASN1_item_i2d(const ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
| 1038 |
+
int ASN1_item_ndef_i2d(const ASN1_VALUE *val, unsigned char **out,
|
| 1039 |
+
const ASN1_ITEM *it);
|
| 1040 |
+
|
| 1041 |
+
void ASN1_add_oid_module(void);
|
| 1042 |
+
void ASN1_add_stable_module(void);
|
| 1043 |
+
|
| 1044 |
+
ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf);
|
| 1045 |
+
ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf);
|
| 1046 |
+
int ASN1_str2mask(const char *str, unsigned long *pmask);
|
| 1047 |
+
|
| 1048 |
+
/* ASN1 Print flags */
|
| 1049 |
+
|
| 1050 |
+
/* Indicate missing OPTIONAL fields */
|
| 1051 |
+
# define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001
|
| 1052 |
+
/* Mark start and end of SEQUENCE */
|
| 1053 |
+
# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002
|
| 1054 |
+
/* Mark start and end of SEQUENCE/SET OF */
|
| 1055 |
+
# define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004
|
| 1056 |
+
/* Show the ASN1 type of primitives */
|
| 1057 |
+
# define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008
|
| 1058 |
+
/* Don't show ASN1 type of ANY */
|
| 1059 |
+
# define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010
|
| 1060 |
+
/* Don't show ASN1 type of MSTRINGs */
|
| 1061 |
+
# define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020
|
| 1062 |
+
/* Don't show field names in SEQUENCE */
|
| 1063 |
+
# define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040
|
| 1064 |
+
/* Show structure names of each SEQUENCE field */
|
| 1065 |
+
# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080
|
| 1066 |
+
/* Don't show structure name even at top level */
|
| 1067 |
+
# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100
|
| 1068 |
+
|
| 1069 |
+
int ASN1_item_print(BIO *out, const ASN1_VALUE *ifld, int indent,
|
| 1070 |
+
const ASN1_ITEM *it, const ASN1_PCTX *pctx);
|
| 1071 |
+
ASN1_PCTX *ASN1_PCTX_new(void);
|
| 1072 |
+
void ASN1_PCTX_free(ASN1_PCTX *p);
|
| 1073 |
+
unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p);
|
| 1074 |
+
void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1075 |
+
unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p);
|
| 1076 |
+
void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1077 |
+
unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p);
|
| 1078 |
+
void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1079 |
+
unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p);
|
| 1080 |
+
void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1081 |
+
unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p);
|
| 1082 |
+
void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);
|
| 1083 |
+
|
| 1084 |
+
ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx));
|
| 1085 |
+
void ASN1_SCTX_free(ASN1_SCTX *p);
|
| 1086 |
+
const ASN1_ITEM *ASN1_SCTX_get_item(ASN1_SCTX *p);
|
| 1087 |
+
const ASN1_TEMPLATE *ASN1_SCTX_get_template(ASN1_SCTX *p);
|
| 1088 |
+
unsigned long ASN1_SCTX_get_flags(ASN1_SCTX *p);
|
| 1089 |
+
void ASN1_SCTX_set_app_data(ASN1_SCTX *p, void *data);
|
| 1090 |
+
void *ASN1_SCTX_get_app_data(ASN1_SCTX *p);
|
| 1091 |
+
|
| 1092 |
+
const BIO_METHOD *BIO_f_asn1(void);
|
| 1093 |
+
|
| 1094 |
+
/* cannot constify val because of CMS_stream() */
|
| 1095 |
+
BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);
|
| 1096 |
+
|
| 1097 |
+
int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
|
| 1098 |
+
const ASN1_ITEM *it);
|
| 1099 |
+
int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
|
| 1100 |
+
const char *hdr, const ASN1_ITEM *it);
|
| 1101 |
+
/* cannot constify val because of CMS_dataFinal() */
|
| 1102 |
+
int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
|
| 1103 |
+
int ctype_nid, int econt_nid,
|
| 1104 |
+
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it);
|
| 1105 |
+
int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
|
| 1106 |
+
int ctype_nid, int econt_nid,
|
| 1107 |
+
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it,
|
| 1108 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 1109 |
+
ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
|
| 1110 |
+
ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, int flags, BIO **bcont,
|
| 1111 |
+
const ASN1_ITEM *it, ASN1_VALUE **x,
|
| 1112 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 1113 |
+
int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
|
| 1114 |
+
int SMIME_text(BIO *in, BIO *out);
|
| 1115 |
+
|
| 1116 |
+
const ASN1_ITEM *ASN1_ITEM_lookup(const char *name);
|
| 1117 |
+
const ASN1_ITEM *ASN1_ITEM_get(size_t i);
|
| 1118 |
+
|
| 1119 |
+
/* Legacy compatibility */
|
| 1120 |
+
# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
|
| 1121 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
|
| 1122 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
|
| 1123 |
+
# define DECLARE_ASN1_FUNCTIONS_const(type) DECLARE_ASN1_FUNCTIONS(type)
|
| 1124 |
+
# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
|
| 1125 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(type, name)
|
| 1126 |
+
# define I2D_OF_const(type) I2D_OF(type)
|
| 1127 |
+
# define ASN1_dup_of_const(type,i2d,d2i,x) ASN1_dup_of(type,i2d,d2i,x)
|
| 1128 |
+
# define ASN1_i2d_fp_of_const(type,i2d,out,x) ASN1_i2d_fp_of(type,i2d,out,x)
|
| 1129 |
+
# define ASN1_i2d_bio_of_const(type,i2d,out,x) ASN1_i2d_bio_of(type,i2d,out,x)
|
| 1130 |
+
|
| 1131 |
+
# ifdef __cplusplus
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/asn1t.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_ASN1T_H
|
| 16 |
+
# define OPENSSL_ASN1T_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_ASN1T_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <stddef.h>
|
| 25 |
+
# include <openssl/e_os2.h>
|
| 26 |
+
# include <openssl/asn1.h>
|
| 27 |
+
|
| 28 |
+
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
| 29 |
+
# undef OPENSSL_EXTERN
|
| 30 |
+
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
| 31 |
+
# endif
|
| 32 |
+
|
| 33 |
+
/* ASN1 template defines, structures and functions */
|
| 34 |
+
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
/*-
|
| 40 |
+
* These are the possible values for the itype field of the
|
| 41 |
+
* ASN1_ITEM structure and determine how it is interpreted.
|
| 42 |
+
*
|
| 43 |
+
* For PRIMITIVE types the underlying type
|
| 44 |
+
* determines the behaviour if items is NULL.
|
| 45 |
+
*
|
| 46 |
+
* Otherwise templates must contain a single
|
| 47 |
+
* template and the type is treated in the
|
| 48 |
+
* same way as the type specified in the template.
|
| 49 |
+
*
|
| 50 |
+
* For SEQUENCE types the templates field points
|
| 51 |
+
* to the members, the size field is the
|
| 52 |
+
* structure size.
|
| 53 |
+
*
|
| 54 |
+
* For CHOICE types the templates field points
|
| 55 |
+
* to each possible member (typically a union)
|
| 56 |
+
* and the 'size' field is the offset of the
|
| 57 |
+
* selector.
|
| 58 |
+
*
|
| 59 |
+
* The 'funcs' field is used for application-specific
|
| 60 |
+
* data and functions.
|
| 61 |
+
*
|
| 62 |
+
* The EXTERN type uses a new style d2i/i2d.
|
| 63 |
+
* The new style should be used where possible
|
| 64 |
+
* because it avoids things like the d2i IMPLICIT
|
| 65 |
+
* hack.
|
| 66 |
+
*
|
| 67 |
+
* MSTRING is a multiple string type, it is used
|
| 68 |
+
* for a CHOICE of character strings where the
|
| 69 |
+
* actual strings all occupy an ASN1_STRING
|
| 70 |
+
* structure. In this case the 'utype' field
|
| 71 |
+
* has a special meaning, it is used as a mask
|
| 72 |
+
* of acceptable types using the B_ASN1 constants.
|
| 73 |
+
*
|
| 74 |
+
* NDEF_SEQUENCE is the same as SEQUENCE except
|
| 75 |
+
* that it will use indefinite length constructed
|
| 76 |
+
* encoding if requested.
|
| 77 |
+
*
|
| 78 |
+
*/
|
| 79 |
+
|
| 80 |
+
# define ASN1_ITYPE_PRIMITIVE 0x0
|
| 81 |
+
# define ASN1_ITYPE_SEQUENCE 0x1
|
| 82 |
+
# define ASN1_ITYPE_CHOICE 0x2
|
| 83 |
+
/* unused value 0x3 */
|
| 84 |
+
# define ASN1_ITYPE_EXTERN 0x4
|
| 85 |
+
# define ASN1_ITYPE_MSTRING 0x5
|
| 86 |
+
# define ASN1_ITYPE_NDEF_SEQUENCE 0x6
|
| 87 |
+
|
| 88 |
+
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
| 89 |
+
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
|
| 90 |
+
|
| 91 |
+
/* Macros for start and end of ASN1_ITEM definition */
|
| 92 |
+
|
| 93 |
+
# define ASN1_ITEM_start(itname) \
|
| 94 |
+
const ASN1_ITEM * itname##_it(void) \
|
| 95 |
+
{ \
|
| 96 |
+
static const ASN1_ITEM local_it = {
|
| 97 |
+
|
| 98 |
+
# define static_ASN1_ITEM_start(itname) \
|
| 99 |
+
static ASN1_ITEM_start(itname)
|
| 100 |
+
|
| 101 |
+
# define ASN1_ITEM_end(itname) \
|
| 102 |
+
}; \
|
| 103 |
+
return &local_it; \
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
/* Macros to aid ASN1 template writing */
|
| 107 |
+
|
| 108 |
+
# define ASN1_ITEM_TEMPLATE(tname) \
|
| 109 |
+
static const ASN1_TEMPLATE tname##_item_tt
|
| 110 |
+
|
| 111 |
+
# define ASN1_ITEM_TEMPLATE_END(tname) \
|
| 112 |
+
;\
|
| 113 |
+
ASN1_ITEM_start(tname) \
|
| 114 |
+
ASN1_ITYPE_PRIMITIVE,\
|
| 115 |
+
-1,\
|
| 116 |
+
&tname##_item_tt,\
|
| 117 |
+
0,\
|
| 118 |
+
NULL,\
|
| 119 |
+
0,\
|
| 120 |
+
#tname \
|
| 121 |
+
ASN1_ITEM_end(tname)
|
| 122 |
+
# define static_ASN1_ITEM_TEMPLATE_END(tname) \
|
| 123 |
+
;\
|
| 124 |
+
static_ASN1_ITEM_start(tname) \
|
| 125 |
+
ASN1_ITYPE_PRIMITIVE,\
|
| 126 |
+
-1,\
|
| 127 |
+
&tname##_item_tt,\
|
| 128 |
+
0,\
|
| 129 |
+
NULL,\
|
| 130 |
+
0,\
|
| 131 |
+
#tname \
|
| 132 |
+
ASN1_ITEM_end(tname)
|
| 133 |
+
|
| 134 |
+
/* This is a ASN1 type which just embeds a template */
|
| 135 |
+
|
| 136 |
+
/*-
|
| 137 |
+
* This pair helps declare a SEQUENCE. We can do:
|
| 138 |
+
*
|
| 139 |
+
* ASN1_SEQUENCE(stname) = {
|
| 140 |
+
* ... SEQUENCE components ...
|
| 141 |
+
* } ASN1_SEQUENCE_END(stname)
|
| 142 |
+
*
|
| 143 |
+
* This will produce an ASN1_ITEM called stname_it
|
| 144 |
+
* for a structure called stname.
|
| 145 |
+
*
|
| 146 |
+
* If you want the same structure but a different
|
| 147 |
+
* name then use:
|
| 148 |
+
*
|
| 149 |
+
* ASN1_SEQUENCE(itname) = {
|
| 150 |
+
* ... SEQUENCE components ...
|
| 151 |
+
* } ASN1_SEQUENCE_END_name(stname, itname)
|
| 152 |
+
*
|
| 153 |
+
* This will create an item called itname_it using
|
| 154 |
+
* a structure called stname.
|
| 155 |
+
*/
|
| 156 |
+
|
| 157 |
+
# define ASN1_SEQUENCE(tname) \
|
| 158 |
+
static const ASN1_TEMPLATE tname##_seq_tt[]
|
| 159 |
+
|
| 160 |
+
# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
|
| 161 |
+
|
| 162 |
+
# define static_ASN1_SEQUENCE_END(stname) static_ASN1_SEQUENCE_END_name(stname, stname)
|
| 163 |
+
|
| 164 |
+
# define ASN1_SEQUENCE_END_name(stname, tname) \
|
| 165 |
+
;\
|
| 166 |
+
ASN1_ITEM_start(tname) \
|
| 167 |
+
ASN1_ITYPE_SEQUENCE,\
|
| 168 |
+
V_ASN1_SEQUENCE,\
|
| 169 |
+
tname##_seq_tt,\
|
| 170 |
+
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
| 171 |
+
NULL,\
|
| 172 |
+
sizeof(stname),\
|
| 173 |
+
#tname \
|
| 174 |
+
ASN1_ITEM_end(tname)
|
| 175 |
+
|
| 176 |
+
# define static_ASN1_SEQUENCE_END_name(stname, tname) \
|
| 177 |
+
;\
|
| 178 |
+
static_ASN1_ITEM_start(tname) \
|
| 179 |
+
ASN1_ITYPE_SEQUENCE,\
|
| 180 |
+
V_ASN1_SEQUENCE,\
|
| 181 |
+
tname##_seq_tt,\
|
| 182 |
+
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
| 183 |
+
NULL,\
|
| 184 |
+
sizeof(stname),\
|
| 185 |
+
#stname \
|
| 186 |
+
ASN1_ITEM_end(tname)
|
| 187 |
+
|
| 188 |
+
# define ASN1_NDEF_SEQUENCE(tname) \
|
| 189 |
+
ASN1_SEQUENCE(tname)
|
| 190 |
+
|
| 191 |
+
# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
|
| 192 |
+
ASN1_SEQUENCE_cb(tname, cb)
|
| 193 |
+
|
| 194 |
+
# define ASN1_SEQUENCE_cb(tname, cb) \
|
| 195 |
+
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0, NULL}; \
|
| 196 |
+
ASN1_SEQUENCE(tname)
|
| 197 |
+
|
| 198 |
+
# define ASN1_SEQUENCE_const_cb(tname, const_cb) \
|
| 199 |
+
static const ASN1_AUX tname##_aux = \
|
| 200 |
+
{NULL, ASN1_AFLG_CONST_CB, 0, 0, NULL, 0, const_cb}; \
|
| 201 |
+
ASN1_SEQUENCE(tname)
|
| 202 |
+
|
| 203 |
+
# define ASN1_SEQUENCE_cb_const_cb(tname, cb, const_cb) \
|
| 204 |
+
static const ASN1_AUX tname##_aux = \
|
| 205 |
+
{NULL, ASN1_AFLG_CONST_CB, 0, 0, cb, 0, const_cb}; \
|
| 206 |
+
ASN1_SEQUENCE(tname)
|
| 207 |
+
|
| 208 |
+
# define ASN1_SEQUENCE_ref(tname, cb) \
|
| 209 |
+
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0, NULL}; \
|
| 210 |
+
ASN1_SEQUENCE(tname)
|
| 211 |
+
|
| 212 |
+
# define ASN1_SEQUENCE_enc(tname, enc, cb) \
|
| 213 |
+
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc), NULL}; \
|
| 214 |
+
ASN1_SEQUENCE(tname)
|
| 215 |
+
|
| 216 |
+
# define ASN1_NDEF_SEQUENCE_END(tname) \
|
| 217 |
+
;\
|
| 218 |
+
ASN1_ITEM_start(tname) \
|
| 219 |
+
ASN1_ITYPE_NDEF_SEQUENCE,\
|
| 220 |
+
V_ASN1_SEQUENCE,\
|
| 221 |
+
tname##_seq_tt,\
|
| 222 |
+
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
| 223 |
+
NULL,\
|
| 224 |
+
sizeof(tname),\
|
| 225 |
+
#tname \
|
| 226 |
+
ASN1_ITEM_end(tname)
|
| 227 |
+
# define static_ASN1_NDEF_SEQUENCE_END(tname) \
|
| 228 |
+
;\
|
| 229 |
+
static_ASN1_ITEM_start(tname) \
|
| 230 |
+
ASN1_ITYPE_NDEF_SEQUENCE,\
|
| 231 |
+
V_ASN1_SEQUENCE,\
|
| 232 |
+
tname##_seq_tt,\
|
| 233 |
+
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
| 234 |
+
NULL,\
|
| 235 |
+
sizeof(tname),\
|
| 236 |
+
#tname \
|
| 237 |
+
ASN1_ITEM_end(tname)
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
|
| 241 |
+
|
| 242 |
+
# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
|
| 243 |
+
# define static_ASN1_SEQUENCE_END_cb(stname, tname) static_ASN1_SEQUENCE_END_ref(stname, tname)
|
| 244 |
+
|
| 245 |
+
# define ASN1_SEQUENCE_END_ref(stname, tname) \
|
| 246 |
+
;\
|
| 247 |
+
ASN1_ITEM_start(tname) \
|
| 248 |
+
ASN1_ITYPE_SEQUENCE,\
|
| 249 |
+
V_ASN1_SEQUENCE,\
|
| 250 |
+
tname##_seq_tt,\
|
| 251 |
+
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
| 252 |
+
&tname##_aux,\
|
| 253 |
+
sizeof(stname),\
|
| 254 |
+
#tname \
|
| 255 |
+
ASN1_ITEM_end(tname)
|
| 256 |
+
# define static_ASN1_SEQUENCE_END_ref(stname, tname) \
|
| 257 |
+
;\
|
| 258 |
+
static_ASN1_ITEM_start(tname) \
|
| 259 |
+
ASN1_ITYPE_SEQUENCE,\
|
| 260 |
+
V_ASN1_SEQUENCE,\
|
| 261 |
+
tname##_seq_tt,\
|
| 262 |
+
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
| 263 |
+
&tname##_aux,\
|
| 264 |
+
sizeof(stname),\
|
| 265 |
+
#stname \
|
| 266 |
+
ASN1_ITEM_end(tname)
|
| 267 |
+
|
| 268 |
+
# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
|
| 269 |
+
;\
|
| 270 |
+
ASN1_ITEM_start(tname) \
|
| 271 |
+
ASN1_ITYPE_NDEF_SEQUENCE,\
|
| 272 |
+
V_ASN1_SEQUENCE,\
|
| 273 |
+
tname##_seq_tt,\
|
| 274 |
+
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
| 275 |
+
&tname##_aux,\
|
| 276 |
+
sizeof(stname),\
|
| 277 |
+
#stname \
|
| 278 |
+
ASN1_ITEM_end(tname)
|
| 279 |
+
|
| 280 |
+
/*-
|
| 281 |
+
* This pair helps declare a CHOICE type. We can do:
|
| 282 |
+
*
|
| 283 |
+
* ASN1_CHOICE(chname) = {
|
| 284 |
+
* ... CHOICE options ...
|
| 285 |
+
* ASN1_CHOICE_END(chname)
|
| 286 |
+
*
|
| 287 |
+
* This will produce an ASN1_ITEM called chname_it
|
| 288 |
+
* for a structure called chname. The structure
|
| 289 |
+
* definition must look like this:
|
| 290 |
+
* typedef struct {
|
| 291 |
+
* int type;
|
| 292 |
+
* union {
|
| 293 |
+
* ASN1_SOMETHING *opt1;
|
| 294 |
+
* ASN1_SOMEOTHER *opt2;
|
| 295 |
+
* } value;
|
| 296 |
+
* } chname;
|
| 297 |
+
*
|
| 298 |
+
* the name of the selector must be 'type'.
|
| 299 |
+
* to use an alternative selector name use the
|
| 300 |
+
* ASN1_CHOICE_END_selector() version.
|
| 301 |
+
*/
|
| 302 |
+
|
| 303 |
+
# define ASN1_CHOICE(tname) \
|
| 304 |
+
static const ASN1_TEMPLATE tname##_ch_tt[]
|
| 305 |
+
|
| 306 |
+
# define ASN1_CHOICE_cb(tname, cb) \
|
| 307 |
+
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0, NULL}; \
|
| 308 |
+
ASN1_CHOICE(tname)
|
| 309 |
+
|
| 310 |
+
# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
|
| 311 |
+
|
| 312 |
+
# define static_ASN1_CHOICE_END(stname) static_ASN1_CHOICE_END_name(stname, stname)
|
| 313 |
+
|
| 314 |
+
# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
|
| 315 |
+
|
| 316 |
+
# define static_ASN1_CHOICE_END_name(stname, tname) static_ASN1_CHOICE_END_selector(stname, tname, type)
|
| 317 |
+
|
| 318 |
+
# define ASN1_CHOICE_END_selector(stname, tname, selname) \
|
| 319 |
+
;\
|
| 320 |
+
ASN1_ITEM_start(tname) \
|
| 321 |
+
ASN1_ITYPE_CHOICE,\
|
| 322 |
+
offsetof(stname,selname) ,\
|
| 323 |
+
tname##_ch_tt,\
|
| 324 |
+
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
|
| 325 |
+
NULL,\
|
| 326 |
+
sizeof(stname),\
|
| 327 |
+
#stname \
|
| 328 |
+
ASN1_ITEM_end(tname)
|
| 329 |
+
|
| 330 |
+
# define static_ASN1_CHOICE_END_selector(stname, tname, selname) \
|
| 331 |
+
;\
|
| 332 |
+
static_ASN1_ITEM_start(tname) \
|
| 333 |
+
ASN1_ITYPE_CHOICE,\
|
| 334 |
+
offsetof(stname,selname) ,\
|
| 335 |
+
tname##_ch_tt,\
|
| 336 |
+
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
|
| 337 |
+
NULL,\
|
| 338 |
+
sizeof(stname),\
|
| 339 |
+
#stname \
|
| 340 |
+
ASN1_ITEM_end(tname)
|
| 341 |
+
|
| 342 |
+
# define ASN1_CHOICE_END_cb(stname, tname, selname) \
|
| 343 |
+
;\
|
| 344 |
+
ASN1_ITEM_start(tname) \
|
| 345 |
+
ASN1_ITYPE_CHOICE,\
|
| 346 |
+
offsetof(stname,selname) ,\
|
| 347 |
+
tname##_ch_tt,\
|
| 348 |
+
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
|
| 349 |
+
&tname##_aux,\
|
| 350 |
+
sizeof(stname),\
|
| 351 |
+
#stname \
|
| 352 |
+
ASN1_ITEM_end(tname)
|
| 353 |
+
|
| 354 |
+
/* This helps with the template wrapper form of ASN1_ITEM */
|
| 355 |
+
|
| 356 |
+
# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
|
| 357 |
+
(flags), (tag), 0,\
|
| 358 |
+
#name, ASN1_ITEM_ref(type) }
|
| 359 |
+
|
| 360 |
+
/* These help with SEQUENCE or CHOICE components */
|
| 361 |
+
|
| 362 |
+
/* used to declare other types */
|
| 363 |
+
|
| 364 |
+
# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
|
| 365 |
+
(flags), (tag), offsetof(stname, field),\
|
| 366 |
+
#field, ASN1_ITEM_ref(type) }
|
| 367 |
+
|
| 368 |
+
/* implicit and explicit helper macros */
|
| 369 |
+
|
| 370 |
+
# define ASN1_IMP_EX(stname, field, type, tag, ex) \
|
| 371 |
+
ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | (ex), tag, stname, field, type)
|
| 372 |
+
|
| 373 |
+
# define ASN1_EXP_EX(stname, field, type, tag, ex) \
|
| 374 |
+
ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | (ex), tag, stname, field, type)
|
| 375 |
+
|
| 376 |
+
/* Any defined by macros: the field used is in the table itself */
|
| 377 |
+
|
| 378 |
+
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
|
| 379 |
+
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
|
| 380 |
+
|
| 381 |
+
/* Plain simple type */
|
| 382 |
+
# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
|
| 383 |
+
/* Embedded simple type */
|
| 384 |
+
# define ASN1_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_EMBED,0, stname, field, type)
|
| 385 |
+
|
| 386 |
+
/* OPTIONAL simple type */
|
| 387 |
+
# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
|
| 388 |
+
# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type)
|
| 389 |
+
|
| 390 |
+
/* IMPLICIT tagged simple type */
|
| 391 |
+
# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
|
| 392 |
+
# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
|
| 393 |
+
|
| 394 |
+
/* IMPLICIT tagged OPTIONAL simple type */
|
| 395 |
+
# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
|
| 396 |
+
# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED)
|
| 397 |
+
|
| 398 |
+
/* Same as above but EXPLICIT */
|
| 399 |
+
|
| 400 |
+
# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
|
| 401 |
+
# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
|
| 402 |
+
# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
|
| 403 |
+
# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED)
|
| 404 |
+
|
| 405 |
+
/* SEQUENCE OF type */
|
| 406 |
+
# define ASN1_SEQUENCE_OF(stname, field, type) \
|
| 407 |
+
ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
|
| 408 |
+
|
| 409 |
+
/* OPTIONAL SEQUENCE OF */
|
| 410 |
+
# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
|
| 411 |
+
ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
|
| 412 |
+
|
| 413 |
+
/* Same as above but for SET OF */
|
| 414 |
+
|
| 415 |
+
# define ASN1_SET_OF(stname, field, type) \
|
| 416 |
+
ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
|
| 417 |
+
|
| 418 |
+
# define ASN1_SET_OF_OPT(stname, field, type) \
|
| 419 |
+
ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
|
| 420 |
+
|
| 421 |
+
/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
|
| 422 |
+
|
| 423 |
+
# define ASN1_IMP_SET_OF(stname, field, type, tag) \
|
| 424 |
+
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
|
| 425 |
+
|
| 426 |
+
# define ASN1_EXP_SET_OF(stname, field, type, tag) \
|
| 427 |
+
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
|
| 428 |
+
|
| 429 |
+
# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
|
| 430 |
+
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
|
| 431 |
+
|
| 432 |
+
# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
|
| 433 |
+
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
|
| 434 |
+
|
| 435 |
+
# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
|
| 436 |
+
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
|
| 437 |
+
|
| 438 |
+
# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
|
| 439 |
+
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
|
| 440 |
+
|
| 441 |
+
# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
|
| 442 |
+
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
|
| 443 |
+
|
| 444 |
+
# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
|
| 445 |
+
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
|
| 446 |
+
|
| 447 |
+
/* EXPLICIT using indefinite length constructed form */
|
| 448 |
+
# define ASN1_NDEF_EXP(stname, field, type, tag) \
|
| 449 |
+
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
|
| 450 |
+
|
| 451 |
+
/* EXPLICIT OPTIONAL using indefinite length constructed form */
|
| 452 |
+
# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
|
| 453 |
+
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
|
| 454 |
+
|
| 455 |
+
/* Macros for the ASN1_ADB structure */
|
| 456 |
+
|
| 457 |
+
# define ASN1_ADB(name) \
|
| 458 |
+
static const ASN1_ADB_TABLE name##_adbtbl[]
|
| 459 |
+
|
| 460 |
+
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
| 461 |
+
;\
|
| 462 |
+
static const ASN1_ITEM *name##_adb(void) \
|
| 463 |
+
{ \
|
| 464 |
+
static const ASN1_ADB internal_adb = \
|
| 465 |
+
{\
|
| 466 |
+
flags,\
|
| 467 |
+
offsetof(name, field),\
|
| 468 |
+
adb_cb,\
|
| 469 |
+
name##_adbtbl,\
|
| 470 |
+
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
|
| 471 |
+
def,\
|
| 472 |
+
none\
|
| 473 |
+
}; \
|
| 474 |
+
return (const ASN1_ITEM *) &internal_adb; \
|
| 475 |
+
} \
|
| 476 |
+
void dummy_function(void)
|
| 477 |
+
|
| 478 |
+
# define ADB_ENTRY(val, template) {val, template}
|
| 479 |
+
|
| 480 |
+
# define ASN1_ADB_TEMPLATE(name) \
|
| 481 |
+
static const ASN1_TEMPLATE name##_tt
|
| 482 |
+
|
| 483 |
+
/*
|
| 484 |
+
* This is the ASN1 template structure that defines a wrapper round the
|
| 485 |
+
* actual type. It determines the actual position of the field in the value
|
| 486 |
+
* structure, various flags such as OPTIONAL and the field name.
|
| 487 |
+
*/
|
| 488 |
+
|
| 489 |
+
struct ASN1_TEMPLATE_st {
|
| 490 |
+
unsigned long flags; /* Various flags */
|
| 491 |
+
long tag; /* tag, not used if no tagging */
|
| 492 |
+
unsigned long offset; /* Offset of this field in structure */
|
| 493 |
+
const char *field_name; /* Field name */
|
| 494 |
+
ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
|
| 495 |
+
};
|
| 496 |
+
|
| 497 |
+
/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
|
| 498 |
+
|
| 499 |
+
# define ASN1_TEMPLATE_item(t) (t->item_ptr)
|
| 500 |
+
# define ASN1_TEMPLATE_adb(t) (t->item_ptr)
|
| 501 |
+
|
| 502 |
+
typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
|
| 503 |
+
typedef struct ASN1_ADB_st ASN1_ADB;
|
| 504 |
+
|
| 505 |
+
struct ASN1_ADB_st {
|
| 506 |
+
unsigned long flags; /* Various flags */
|
| 507 |
+
unsigned long offset; /* Offset of selector field */
|
| 508 |
+
int (*adb_cb)(long *psel); /* Application callback */
|
| 509 |
+
const ASN1_ADB_TABLE *tbl; /* Table of possible types */
|
| 510 |
+
long tblcount; /* Number of entries in tbl */
|
| 511 |
+
const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
|
| 512 |
+
const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
|
| 513 |
+
};
|
| 514 |
+
|
| 515 |
+
struct ASN1_ADB_TABLE_st {
|
| 516 |
+
long value; /* NID for an object or value for an int */
|
| 517 |
+
const ASN1_TEMPLATE tt; /* item for this value */
|
| 518 |
+
};
|
| 519 |
+
|
| 520 |
+
/* template flags */
|
| 521 |
+
|
| 522 |
+
/* Field is optional */
|
| 523 |
+
# define ASN1_TFLG_OPTIONAL (0x1)
|
| 524 |
+
|
| 525 |
+
/* Field is a SET OF */
|
| 526 |
+
# define ASN1_TFLG_SET_OF (0x1 << 1)
|
| 527 |
+
|
| 528 |
+
/* Field is a SEQUENCE OF */
|
| 529 |
+
# define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
|
| 530 |
+
|
| 531 |
+
/*
|
| 532 |
+
* Special case: this refers to a SET OF that will be sorted into DER order
|
| 533 |
+
* when encoded *and* the corresponding STACK will be modified to match the
|
| 534 |
+
* new order.
|
| 535 |
+
*/
|
| 536 |
+
# define ASN1_TFLG_SET_ORDER (0x3 << 1)
|
| 537 |
+
|
| 538 |
+
/* Mask for SET OF or SEQUENCE OF */
|
| 539 |
+
# define ASN1_TFLG_SK_MASK (0x3 << 1)
|
| 540 |
+
|
| 541 |
+
/*
|
| 542 |
+
* These flags mean the tag should be taken from the tag field. If EXPLICIT
|
| 543 |
+
* then the underlying type is used for the inner tag.
|
| 544 |
+
*/
|
| 545 |
+
|
| 546 |
+
/* IMPLICIT tagging */
|
| 547 |
+
# define ASN1_TFLG_IMPTAG (0x1 << 3)
|
| 548 |
+
|
| 549 |
+
/* EXPLICIT tagging, inner tag from underlying type */
|
| 550 |
+
# define ASN1_TFLG_EXPTAG (0x2 << 3)
|
| 551 |
+
|
| 552 |
+
# define ASN1_TFLG_TAG_MASK (0x3 << 3)
|
| 553 |
+
|
| 554 |
+
/* context specific IMPLICIT */
|
| 555 |
+
# define ASN1_TFLG_IMPLICIT (ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT)
|
| 556 |
+
|
| 557 |
+
/* context specific EXPLICIT */
|
| 558 |
+
# define ASN1_TFLG_EXPLICIT (ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT)
|
| 559 |
+
|
| 560 |
+
/*
|
| 561 |
+
* If tagging is in force these determine the type of tag to use. Otherwise
|
| 562 |
+
* the tag is determined by the underlying type. These values reflect the
|
| 563 |
+
* actual octet format.
|
| 564 |
+
*/
|
| 565 |
+
|
| 566 |
+
/* Universal tag */
|
| 567 |
+
# define ASN1_TFLG_UNIVERSAL (0x0<<6)
|
| 568 |
+
/* Application tag */
|
| 569 |
+
# define ASN1_TFLG_APPLICATION (0x1<<6)
|
| 570 |
+
/* Context specific tag */
|
| 571 |
+
# define ASN1_TFLG_CONTEXT (0x2<<6)
|
| 572 |
+
/* Private tag */
|
| 573 |
+
# define ASN1_TFLG_PRIVATE (0x3<<6)
|
| 574 |
+
|
| 575 |
+
# define ASN1_TFLG_TAG_CLASS (0x3<<6)
|
| 576 |
+
|
| 577 |
+
/*
|
| 578 |
+
* These are for ANY DEFINED BY type. In this case the 'item' field points to
|
| 579 |
+
* an ASN1_ADB structure which contains a table of values to decode the
|
| 580 |
+
* relevant type
|
| 581 |
+
*/
|
| 582 |
+
|
| 583 |
+
# define ASN1_TFLG_ADB_MASK (0x3<<8)
|
| 584 |
+
|
| 585 |
+
# define ASN1_TFLG_ADB_OID (0x1<<8)
|
| 586 |
+
|
| 587 |
+
# define ASN1_TFLG_ADB_INT (0x1<<9)
|
| 588 |
+
|
| 589 |
+
/*
|
| 590 |
+
* This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes
|
| 591 |
+
* indefinite length constructed encoding to be used if required.
|
| 592 |
+
*/
|
| 593 |
+
|
| 594 |
+
# define ASN1_TFLG_NDEF (0x1<<11)
|
| 595 |
+
|
| 596 |
+
/* Field is embedded and not a pointer */
|
| 597 |
+
# define ASN1_TFLG_EMBED (0x1 << 12)
|
| 598 |
+
|
| 599 |
+
/* This is the actual ASN1 item itself */
|
| 600 |
+
|
| 601 |
+
struct ASN1_ITEM_st {
|
| 602 |
+
char itype; /* The item type, primitive, SEQUENCE, CHOICE
|
| 603 |
+
* or extern */
|
| 604 |
+
long utype; /* underlying type */
|
| 605 |
+
const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains
|
| 606 |
+
* the contents */
|
| 607 |
+
long tcount; /* Number of templates if SEQUENCE or CHOICE */
|
| 608 |
+
const void *funcs; /* further data and type-specific functions */
|
| 609 |
+
/* funcs can be ASN1_PRIMITIVE_FUNCS*, ASN1_EXTERN_FUNCS*, or ASN1_AUX* */
|
| 610 |
+
long size; /* Structure size (usually) */
|
| 611 |
+
const char *sname; /* Structure name */
|
| 612 |
+
};
|
| 613 |
+
|
| 614 |
+
/*
|
| 615 |
+
* Cache for ASN1 tag and length, so we don't keep re-reading it for things
|
| 616 |
+
* like CHOICE
|
| 617 |
+
*/
|
| 618 |
+
|
| 619 |
+
struct ASN1_TLC_st {
|
| 620 |
+
char valid; /* Values below are valid */
|
| 621 |
+
int ret; /* return value */
|
| 622 |
+
long plen; /* length */
|
| 623 |
+
int ptag; /* class value */
|
| 624 |
+
int pclass; /* class value */
|
| 625 |
+
int hdrlen; /* header length */
|
| 626 |
+
};
|
| 627 |
+
|
| 628 |
+
/* Typedefs for ASN1 function pointers */
|
| 629 |
+
typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
| 630 |
+
const ASN1_ITEM *it, int tag, int aclass, char opt,
|
| 631 |
+
ASN1_TLC *ctx);
|
| 632 |
+
|
| 633 |
+
typedef int ASN1_ex_d2i_ex(ASN1_VALUE **pval, const unsigned char **in, long len,
|
| 634 |
+
const ASN1_ITEM *it, int tag, int aclass, char opt,
|
| 635 |
+
ASN1_TLC *ctx, OSSL_LIB_CTX *libctx,
|
| 636 |
+
const char *propq);
|
| 637 |
+
typedef int ASN1_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
|
| 638 |
+
const ASN1_ITEM *it, int tag, int aclass);
|
| 639 |
+
typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
| 640 |
+
typedef int ASN1_ex_new_ex_func(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
| 641 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 642 |
+
typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
| 643 |
+
|
| 644 |
+
typedef int ASN1_ex_print_func(BIO *out, const ASN1_VALUE **pval,
|
| 645 |
+
int indent, const char *fname,
|
| 646 |
+
const ASN1_PCTX *pctx);
|
| 647 |
+
|
| 648 |
+
typedef int ASN1_primitive_i2c(const ASN1_VALUE **pval, unsigned char *cont,
|
| 649 |
+
int *putype, const ASN1_ITEM *it);
|
| 650 |
+
typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont,
|
| 651 |
+
int len, int utype, char *free_cont,
|
| 652 |
+
const ASN1_ITEM *it);
|
| 653 |
+
typedef int ASN1_primitive_print(BIO *out, const ASN1_VALUE **pval,
|
| 654 |
+
const ASN1_ITEM *it, int indent,
|
| 655 |
+
const ASN1_PCTX *pctx);
|
| 656 |
+
|
| 657 |
+
typedef struct ASN1_EXTERN_FUNCS_st {
|
| 658 |
+
void *app_data;
|
| 659 |
+
ASN1_ex_new_func *asn1_ex_new;
|
| 660 |
+
ASN1_ex_free_func *asn1_ex_free;
|
| 661 |
+
ASN1_ex_free_func *asn1_ex_clear;
|
| 662 |
+
ASN1_ex_d2i *asn1_ex_d2i;
|
| 663 |
+
ASN1_ex_i2d *asn1_ex_i2d;
|
| 664 |
+
ASN1_ex_print_func *asn1_ex_print;
|
| 665 |
+
ASN1_ex_new_ex_func *asn1_ex_new_ex;
|
| 666 |
+
ASN1_ex_d2i_ex *asn1_ex_d2i_ex;
|
| 667 |
+
} ASN1_EXTERN_FUNCS;
|
| 668 |
+
|
| 669 |
+
typedef struct ASN1_PRIMITIVE_FUNCS_st {
|
| 670 |
+
void *app_data;
|
| 671 |
+
unsigned long flags;
|
| 672 |
+
ASN1_ex_new_func *prim_new;
|
| 673 |
+
ASN1_ex_free_func *prim_free;
|
| 674 |
+
ASN1_ex_free_func *prim_clear;
|
| 675 |
+
ASN1_primitive_c2i *prim_c2i;
|
| 676 |
+
ASN1_primitive_i2c *prim_i2c;
|
| 677 |
+
ASN1_primitive_print *prim_print;
|
| 678 |
+
} ASN1_PRIMITIVE_FUNCS;
|
| 679 |
+
|
| 680 |
+
/*
|
| 681 |
+
* This is the ASN1_AUX structure: it handles various miscellaneous
|
| 682 |
+
* requirements. For example the use of reference counts and an informational
|
| 683 |
+
* callback. The "informational callback" is called at various points during
|
| 684 |
+
* the ASN1 encoding and decoding. It can be used to provide minor
|
| 685 |
+
* customisation of the structures used. This is most useful where the
|
| 686 |
+
* supplied routines *almost* do the right thing but need some extra help at
|
| 687 |
+
* a few points. If the callback returns zero then it is assumed a fatal
|
| 688 |
+
* error has occurred and the main operation should be abandoned. If major
|
| 689 |
+
* changes in the default behaviour are required then an external type is
|
| 690 |
+
* more appropriate.
|
| 691 |
+
* For the operations ASN1_OP_I2D_PRE, ASN1_OP_I2D_POST, ASN1_OP_PRINT_PRE, and
|
| 692 |
+
* ASN1_OP_PRINT_POST, meanwhile a variant of the callback with const parameter
|
| 693 |
+
* 'in' is provided to make clear statically that its input is not modified. If
|
| 694 |
+
* and only if this variant is in use the flag ASN1_AFLG_CONST_CB must be set.
|
| 695 |
+
*/
|
| 696 |
+
|
| 697 |
+
typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it,
|
| 698 |
+
void *exarg);
|
| 699 |
+
typedef int ASN1_aux_const_cb(int operation, const ASN1_VALUE **in,
|
| 700 |
+
const ASN1_ITEM *it, void *exarg);
|
| 701 |
+
|
| 702 |
+
typedef struct ASN1_AUX_st {
|
| 703 |
+
void *app_data;
|
| 704 |
+
int flags;
|
| 705 |
+
int ref_offset; /* Offset of reference value */
|
| 706 |
+
int ref_lock; /* Offset of lock value */
|
| 707 |
+
ASN1_aux_cb *asn1_cb;
|
| 708 |
+
int enc_offset; /* Offset of ASN1_ENCODING structure */
|
| 709 |
+
ASN1_aux_const_cb *asn1_const_cb; /* for ASN1_OP_I2D_ and ASN1_OP_PRINT_ */
|
| 710 |
+
} ASN1_AUX;
|
| 711 |
+
|
| 712 |
+
/* For print related callbacks exarg points to this structure */
|
| 713 |
+
typedef struct ASN1_PRINT_ARG_st {
|
| 714 |
+
BIO *out;
|
| 715 |
+
int indent;
|
| 716 |
+
const ASN1_PCTX *pctx;
|
| 717 |
+
} ASN1_PRINT_ARG;
|
| 718 |
+
|
| 719 |
+
/* For streaming related callbacks exarg points to this structure */
|
| 720 |
+
typedef struct ASN1_STREAM_ARG_st {
|
| 721 |
+
/* BIO to stream through */
|
| 722 |
+
BIO *out;
|
| 723 |
+
/* BIO with filters appended */
|
| 724 |
+
BIO *ndef_bio;
|
| 725 |
+
/* Streaming I/O boundary */
|
| 726 |
+
unsigned char **boundary;
|
| 727 |
+
} ASN1_STREAM_ARG;
|
| 728 |
+
|
| 729 |
+
/* Flags in ASN1_AUX */
|
| 730 |
+
|
| 731 |
+
/* Use a reference count */
|
| 732 |
+
# define ASN1_AFLG_REFCOUNT 1
|
| 733 |
+
/* Save the encoding of structure (useful for signatures) */
|
| 734 |
+
# define ASN1_AFLG_ENCODING 2
|
| 735 |
+
/* The Sequence length is invalid */
|
| 736 |
+
# define ASN1_AFLG_BROKEN 4
|
| 737 |
+
/* Use the new asn1_const_cb */
|
| 738 |
+
# define ASN1_AFLG_CONST_CB 8
|
| 739 |
+
|
| 740 |
+
/* operation values for asn1_cb */
|
| 741 |
+
|
| 742 |
+
# define ASN1_OP_NEW_PRE 0
|
| 743 |
+
# define ASN1_OP_NEW_POST 1
|
| 744 |
+
# define ASN1_OP_FREE_PRE 2
|
| 745 |
+
# define ASN1_OP_FREE_POST 3
|
| 746 |
+
# define ASN1_OP_D2I_PRE 4
|
| 747 |
+
# define ASN1_OP_D2I_POST 5
|
| 748 |
+
# define ASN1_OP_I2D_PRE 6
|
| 749 |
+
# define ASN1_OP_I2D_POST 7
|
| 750 |
+
# define ASN1_OP_PRINT_PRE 8
|
| 751 |
+
# define ASN1_OP_PRINT_POST 9
|
| 752 |
+
# define ASN1_OP_STREAM_PRE 10
|
| 753 |
+
# define ASN1_OP_STREAM_POST 11
|
| 754 |
+
# define ASN1_OP_DETACHED_PRE 12
|
| 755 |
+
# define ASN1_OP_DETACHED_POST 13
|
| 756 |
+
# define ASN1_OP_DUP_PRE 14
|
| 757 |
+
# define ASN1_OP_DUP_POST 15
|
| 758 |
+
# define ASN1_OP_GET0_LIBCTX 16
|
| 759 |
+
# define ASN1_OP_GET0_PROPQ 17
|
| 760 |
+
|
| 761 |
+
/* Macro to implement a primitive type */
|
| 762 |
+
# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
|
| 763 |
+
# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
|
| 764 |
+
ASN1_ITEM_start(itname) \
|
| 765 |
+
ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
|
| 766 |
+
ASN1_ITEM_end(itname)
|
| 767 |
+
|
| 768 |
+
/* Macro to implement a multi string type */
|
| 769 |
+
# define IMPLEMENT_ASN1_MSTRING(itname, mask) \
|
| 770 |
+
ASN1_ITEM_start(itname) \
|
| 771 |
+
ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
|
| 772 |
+
ASN1_ITEM_end(itname)
|
| 773 |
+
|
| 774 |
+
# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
|
| 775 |
+
ASN1_ITEM_start(sname) \
|
| 776 |
+
ASN1_ITYPE_EXTERN, \
|
| 777 |
+
tag, \
|
| 778 |
+
NULL, \
|
| 779 |
+
0, \
|
| 780 |
+
&fptrs, \
|
| 781 |
+
0, \
|
| 782 |
+
#sname \
|
| 783 |
+
ASN1_ITEM_end(sname)
|
| 784 |
+
|
| 785 |
+
/* Macro to implement standard functions in terms of ASN1_ITEM structures */
|
| 786 |
+
|
| 787 |
+
# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
|
| 788 |
+
|
| 789 |
+
# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
|
| 790 |
+
|
| 791 |
+
# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
|
| 792 |
+
IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
|
| 793 |
+
|
| 794 |
+
# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \
|
| 795 |
+
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)
|
| 796 |
+
|
| 797 |
+
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
|
| 798 |
+
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
|
| 799 |
+
|
| 800 |
+
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
|
| 801 |
+
pre stname *fname##_new(void) \
|
| 802 |
+
{ \
|
| 803 |
+
return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
|
| 804 |
+
} \
|
| 805 |
+
pre void fname##_free(stname *a) \
|
| 806 |
+
{ \
|
| 807 |
+
ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
|
| 808 |
+
}
|
| 809 |
+
|
| 810 |
+
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
|
| 811 |
+
stname *fname##_new(void) \
|
| 812 |
+
{ \
|
| 813 |
+
return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
|
| 814 |
+
} \
|
| 815 |
+
void fname##_free(stname *a) \
|
| 816 |
+
{ \
|
| 817 |
+
ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
|
| 818 |
+
}
|
| 819 |
+
|
| 820 |
+
# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
|
| 821 |
+
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
|
| 822 |
+
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
|
| 823 |
+
|
| 824 |
+
# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
|
| 825 |
+
stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
|
| 826 |
+
{ \
|
| 827 |
+
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
|
| 828 |
+
} \
|
| 829 |
+
int i2d_##fname(const stname *a, unsigned char **out) \
|
| 830 |
+
{ \
|
| 831 |
+
return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
|
| 832 |
+
}
|
| 833 |
+
|
| 834 |
+
# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
|
| 835 |
+
int i2d_##stname##_NDEF(const stname *a, unsigned char **out) \
|
| 836 |
+
{ \
|
| 837 |
+
return ASN1_item_ndef_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
|
| 838 |
+
}
|
| 839 |
+
|
| 840 |
+
# define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname) \
|
| 841 |
+
static stname *d2i_##stname(stname **a, \
|
| 842 |
+
const unsigned char **in, long len) \
|
| 843 |
+
{ \
|
| 844 |
+
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \
|
| 845 |
+
ASN1_ITEM_rptr(stname)); \
|
| 846 |
+
} \
|
| 847 |
+
static int i2d_##stname(const stname *a, unsigned char **out) \
|
| 848 |
+
{ \
|
| 849 |
+
return ASN1_item_i2d((const ASN1_VALUE *)a, out, \
|
| 850 |
+
ASN1_ITEM_rptr(stname)); \
|
| 851 |
+
}
|
| 852 |
+
|
| 853 |
+
# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
|
| 854 |
+
stname * stname##_dup(const stname *x) \
|
| 855 |
+
{ \
|
| 856 |
+
return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
|
| 857 |
+
}
|
| 858 |
+
|
| 859 |
+
# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
|
| 860 |
+
IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
|
| 861 |
+
|
| 862 |
+
# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
|
| 863 |
+
int fname##_print_ctx(BIO *out, const stname *x, int indent, \
|
| 864 |
+
const ASN1_PCTX *pctx) \
|
| 865 |
+
{ \
|
| 866 |
+
return ASN1_item_print(out, (const ASN1_VALUE *)x, indent, \
|
| 867 |
+
ASN1_ITEM_rptr(itname), pctx); \
|
| 868 |
+
}
|
| 869 |
+
|
| 870 |
+
/* external definitions for primitive types */
|
| 871 |
+
|
| 872 |
+
DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
|
| 873 |
+
DECLARE_ASN1_ITEM(ASN1_TBOOLEAN)
|
| 874 |
+
DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
|
| 875 |
+
DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
|
| 876 |
+
DECLARE_ASN1_ITEM(CBIGNUM)
|
| 877 |
+
DECLARE_ASN1_ITEM(BIGNUM)
|
| 878 |
+
DECLARE_ASN1_ITEM(INT32)
|
| 879 |
+
DECLARE_ASN1_ITEM(ZINT32)
|
| 880 |
+
DECLARE_ASN1_ITEM(UINT32)
|
| 881 |
+
DECLARE_ASN1_ITEM(ZUINT32)
|
| 882 |
+
DECLARE_ASN1_ITEM(INT64)
|
| 883 |
+
DECLARE_ASN1_ITEM(ZINT64)
|
| 884 |
+
DECLARE_ASN1_ITEM(UINT64)
|
| 885 |
+
DECLARE_ASN1_ITEM(ZUINT64)
|
| 886 |
+
|
| 887 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 888 |
+
/*
|
| 889 |
+
* LONG and ZLONG are strongly discouraged for use as stored data, as the
|
| 890 |
+
* underlying C type (long) differs in size depending on the architecture.
|
| 891 |
+
* They are designed with 32-bit longs in mind.
|
| 892 |
+
*/
|
| 893 |
+
DECLARE_ASN1_ITEM(LONG)
|
| 894 |
+
DECLARE_ASN1_ITEM(ZLONG)
|
| 895 |
+
# endif
|
| 896 |
+
|
| 897 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_VALUE, ASN1_VALUE, ASN1_VALUE)
|
| 898 |
+
#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
|
| 899 |
+
#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
|
| 900 |
+
#define sk_ASN1_VALUE_new(cmp) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new(ossl_check_ASN1_VALUE_compfunc_type(cmp)))
|
| 901 |
+
#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
|
| 902 |
+
#define sk_ASN1_VALUE_new_reserve(cmp, n) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_VALUE_compfunc_type(cmp), (n)))
|
| 903 |
+
#define sk_ASN1_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_VALUE_sk_type(sk), (n))
|
| 904 |
+
#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
|
| 905 |
+
#define sk_ASN1_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_VALUE_sk_type(sk))
|
| 906 |
+
#define sk_ASN1_VALUE_delete(sk, i) ((ASN1_VALUE *)OPENSSL_sk_delete(ossl_check_ASN1_VALUE_sk_type(sk), (i)))
|
| 907 |
+
#define sk_ASN1_VALUE_delete_ptr(sk, ptr) ((ASN1_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr)))
|
| 908 |
+
#define sk_ASN1_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
|
| 909 |
+
#define sk_ASN1_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
|
| 910 |
+
#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk)))
|
| 911 |
+
#define sk_ASN1_VALUE_shift(sk) ((ASN1_VALUE *)OPENSSL_sk_shift(ossl_check_ASN1_VALUE_sk_type(sk)))
|
| 912 |
+
#define sk_ASN1_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_VALUE_sk_type(sk),ossl_check_ASN1_VALUE_freefunc_type(freefunc))
|
| 913 |
+
#define sk_ASN1_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), (idx))
|
| 914 |
+
#define sk_ASN1_VALUE_set(sk, idx, ptr) ((ASN1_VALUE *)OPENSSL_sk_set(ossl_check_ASN1_VALUE_sk_type(sk), (idx), ossl_check_ASN1_VALUE_type(ptr)))
|
| 915 |
+
#define sk_ASN1_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
|
| 916 |
+
#define sk_ASN1_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
|
| 917 |
+
#define sk_ASN1_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), pnum)
|
| 918 |
+
#define sk_ASN1_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_VALUE_sk_type(sk))
|
| 919 |
+
#define sk_ASN1_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_VALUE_sk_type(sk))
|
| 920 |
+
#define sk_ASN1_VALUE_dup(sk) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_VALUE_sk_type(sk)))
|
| 921 |
+
#define sk_ASN1_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_copyfunc_type(copyfunc), ossl_check_ASN1_VALUE_freefunc_type(freefunc)))
|
| 922 |
+
#define sk_ASN1_VALUE_set_cmp_func(sk, cmp) ((sk_ASN1_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_compfunc_type(cmp)))
|
| 923 |
+
|
| 924 |
+
|
| 925 |
+
|
| 926 |
+
/* Functions used internally by the ASN1 code */
|
| 927 |
+
|
| 928 |
+
int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
| 929 |
+
void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
| 930 |
+
|
| 931 |
+
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
| 932 |
+
const ASN1_ITEM *it, int tag, int aclass, char opt,
|
| 933 |
+
ASN1_TLC *ctx);
|
| 934 |
+
|
| 935 |
+
int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
|
| 936 |
+
const ASN1_ITEM *it, int tag, int aclass);
|
| 937 |
+
|
| 938 |
+
/* Legacy compatibility */
|
| 939 |
+
# define IMPLEMENT_ASN1_FUNCTIONS_const(name) IMPLEMENT_ASN1_FUNCTIONS(name)
|
| 940 |
+
# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
|
| 941 |
+
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname)
|
| 942 |
+
|
| 943 |
+
#ifdef __cplusplus
|
| 944 |
+
}
|
| 945 |
+
#endif
|
| 946 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/cmp.h
ADDED
|
@@ -0,0 +1,727 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/cmp.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
* Copyright Nokia 2007-2019
|
| 7 |
+
* Copyright Siemens AG 2015-2019
|
| 8 |
+
*
|
| 9 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 10 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 11 |
+
* in the file LICENSE in the source distribution or at
|
| 12 |
+
* https://www.openssl.org/source/license.html
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
#ifndef OPENSSL_CMP_H
|
| 18 |
+
# define OPENSSL_CMP_H
|
| 19 |
+
|
| 20 |
+
# include <openssl/opensslconf.h>
|
| 21 |
+
# ifndef OPENSSL_NO_CMP
|
| 22 |
+
|
| 23 |
+
# include <openssl/crmf.h>
|
| 24 |
+
# include <openssl/cmperr.h>
|
| 25 |
+
# include <openssl/cmp_util.h>
|
| 26 |
+
# include <openssl/http.h>
|
| 27 |
+
|
| 28 |
+
/* explicit #includes not strictly needed since implied by the above: */
|
| 29 |
+
# include <openssl/types.h>
|
| 30 |
+
# include <openssl/safestack.h>
|
| 31 |
+
# include <openssl/x509.h>
|
| 32 |
+
# include <openssl/x509v3.h>
|
| 33 |
+
|
| 34 |
+
# ifdef __cplusplus
|
| 35 |
+
extern "C" {
|
| 36 |
+
# endif
|
| 37 |
+
|
| 38 |
+
# define OSSL_CMP_PVNO_2 2
|
| 39 |
+
# define OSSL_CMP_PVNO_3 3
|
| 40 |
+
# define OSSL_CMP_PVNO OSSL_CMP_PVNO_2 /* v2 is the default */
|
| 41 |
+
|
| 42 |
+
/*-
|
| 43 |
+
* PKIFailureInfo ::= BIT STRING {
|
| 44 |
+
* -- since we can fail in more than one way!
|
| 45 |
+
* -- More codes may be added in the future if/when required.
|
| 46 |
+
* badAlg (0),
|
| 47 |
+
* -- unrecognized or unsupported Algorithm Identifier
|
| 48 |
+
* badMessageCheck (1),
|
| 49 |
+
* -- integrity check failed (e.g., signature did not verify)
|
| 50 |
+
* badRequest (2),
|
| 51 |
+
* -- transaction not permitted or supported
|
| 52 |
+
* badTime (3),
|
| 53 |
+
* -- messageTime was not sufficiently close to the system time,
|
| 54 |
+
* -- as defined by local policy
|
| 55 |
+
* badCertId (4),
|
| 56 |
+
* -- no certificate could be found matching the provided criteria
|
| 57 |
+
* badDataFormat (5),
|
| 58 |
+
* -- the data submitted has the wrong format
|
| 59 |
+
* wrongAuthority (6),
|
| 60 |
+
* -- the authority indicated in the request is different from the
|
| 61 |
+
* -- one creating the response token
|
| 62 |
+
* incorrectData (7),
|
| 63 |
+
* -- the requester's data is incorrect (for notary services)
|
| 64 |
+
* missingTimeStamp (8),
|
| 65 |
+
* -- when the timestamp is missing but should be there
|
| 66 |
+
* -- (by policy)
|
| 67 |
+
* badPOP (9),
|
| 68 |
+
* -- the proof-of-possession failed
|
| 69 |
+
* certRevoked (10),
|
| 70 |
+
* -- the certificate has already been revoked
|
| 71 |
+
* certConfirmed (11),
|
| 72 |
+
* -- the certificate has already been confirmed
|
| 73 |
+
* wrongIntegrity (12),
|
| 74 |
+
* -- invalid integrity, password based instead of signature or
|
| 75 |
+
* -- vice versa
|
| 76 |
+
* badRecipientNonce (13),
|
| 77 |
+
* -- invalid recipient nonce, either missing or wrong value
|
| 78 |
+
* timeNotAvailable (14),
|
| 79 |
+
* -- the TSA's time source is not available
|
| 80 |
+
* unacceptedPolicy (15),
|
| 81 |
+
* -- the requested TSA policy is not supported by the TSA.
|
| 82 |
+
* unacceptedExtension (16),
|
| 83 |
+
* -- the requested extension is not supported by the TSA.
|
| 84 |
+
* addInfoNotAvailable (17),
|
| 85 |
+
* -- the additional information requested could not be
|
| 86 |
+
* -- understood or is not available
|
| 87 |
+
* badSenderNonce (18),
|
| 88 |
+
* -- invalid sender nonce, either missing or wrong size
|
| 89 |
+
* badCertTemplate (19),
|
| 90 |
+
* -- invalid cert. template or missing mandatory information
|
| 91 |
+
* signerNotTrusted (20),
|
| 92 |
+
* -- signer of the message unknown or not trusted
|
| 93 |
+
* transactionIdInUse (21),
|
| 94 |
+
* -- the transaction identifier is already in use
|
| 95 |
+
* unsupportedVersion (22),
|
| 96 |
+
* -- the version of the message is not supported
|
| 97 |
+
* notAuthorized (23),
|
| 98 |
+
* -- the sender was not authorized to make the preceding
|
| 99 |
+
* -- request or perform the preceding action
|
| 100 |
+
* systemUnavail (24),
|
| 101 |
+
* -- the request cannot be handled due to system unavailability
|
| 102 |
+
* systemFailure (25),
|
| 103 |
+
* -- the request cannot be handled due to system failure
|
| 104 |
+
* duplicateCertReq (26)
|
| 105 |
+
* -- certificate cannot be issued because a duplicate
|
| 106 |
+
* -- certificate already exists
|
| 107 |
+
* }
|
| 108 |
+
*/
|
| 109 |
+
# define OSSL_CMP_PKIFAILUREINFO_badAlg 0
|
| 110 |
+
# define OSSL_CMP_PKIFAILUREINFO_badMessageCheck 1
|
| 111 |
+
# define OSSL_CMP_PKIFAILUREINFO_badRequest 2
|
| 112 |
+
# define OSSL_CMP_PKIFAILUREINFO_badTime 3
|
| 113 |
+
# define OSSL_CMP_PKIFAILUREINFO_badCertId 4
|
| 114 |
+
# define OSSL_CMP_PKIFAILUREINFO_badDataFormat 5
|
| 115 |
+
# define OSSL_CMP_PKIFAILUREINFO_wrongAuthority 6
|
| 116 |
+
# define OSSL_CMP_PKIFAILUREINFO_incorrectData 7
|
| 117 |
+
# define OSSL_CMP_PKIFAILUREINFO_missingTimeStamp 8
|
| 118 |
+
# define OSSL_CMP_PKIFAILUREINFO_badPOP 9
|
| 119 |
+
# define OSSL_CMP_PKIFAILUREINFO_certRevoked 10
|
| 120 |
+
# define OSSL_CMP_PKIFAILUREINFO_certConfirmed 11
|
| 121 |
+
# define OSSL_CMP_PKIFAILUREINFO_wrongIntegrity 12
|
| 122 |
+
# define OSSL_CMP_PKIFAILUREINFO_badRecipientNonce 13
|
| 123 |
+
# define OSSL_CMP_PKIFAILUREINFO_timeNotAvailable 14
|
| 124 |
+
# define OSSL_CMP_PKIFAILUREINFO_unacceptedPolicy 15
|
| 125 |
+
# define OSSL_CMP_PKIFAILUREINFO_unacceptedExtension 16
|
| 126 |
+
# define OSSL_CMP_PKIFAILUREINFO_addInfoNotAvailable 17
|
| 127 |
+
# define OSSL_CMP_PKIFAILUREINFO_badSenderNonce 18
|
| 128 |
+
# define OSSL_CMP_PKIFAILUREINFO_badCertTemplate 19
|
| 129 |
+
# define OSSL_CMP_PKIFAILUREINFO_signerNotTrusted 20
|
| 130 |
+
# define OSSL_CMP_PKIFAILUREINFO_transactionIdInUse 21
|
| 131 |
+
# define OSSL_CMP_PKIFAILUREINFO_unsupportedVersion 22
|
| 132 |
+
# define OSSL_CMP_PKIFAILUREINFO_notAuthorized 23
|
| 133 |
+
# define OSSL_CMP_PKIFAILUREINFO_systemUnavail 24
|
| 134 |
+
# define OSSL_CMP_PKIFAILUREINFO_systemFailure 25
|
| 135 |
+
# define OSSL_CMP_PKIFAILUREINFO_duplicateCertReq 26
|
| 136 |
+
# define OSSL_CMP_PKIFAILUREINFO_MAX 26
|
| 137 |
+
# define OSSL_CMP_PKIFAILUREINFO_MAX_BIT_PATTERN \
|
| 138 |
+
((1 << (OSSL_CMP_PKIFAILUREINFO_MAX + 1)) - 1)
|
| 139 |
+
# if OSSL_CMP_PKIFAILUREINFO_MAX_BIT_PATTERN > INT_MAX
|
| 140 |
+
# error CMP_PKIFAILUREINFO_MAX bit pattern does not fit in type int
|
| 141 |
+
# endif
|
| 142 |
+
typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO;
|
| 143 |
+
|
| 144 |
+
# define OSSL_CMP_CTX_FAILINFO_badAlg (1 << 0)
|
| 145 |
+
# define OSSL_CMP_CTX_FAILINFO_badMessageCheck (1 << 1)
|
| 146 |
+
# define OSSL_CMP_CTX_FAILINFO_badRequest (1 << 2)
|
| 147 |
+
# define OSSL_CMP_CTX_FAILINFO_badTime (1 << 3)
|
| 148 |
+
# define OSSL_CMP_CTX_FAILINFO_badCertId (1 << 4)
|
| 149 |
+
# define OSSL_CMP_CTX_FAILINFO_badDataFormat (1 << 5)
|
| 150 |
+
# define OSSL_CMP_CTX_FAILINFO_wrongAuthority (1 << 6)
|
| 151 |
+
# define OSSL_CMP_CTX_FAILINFO_incorrectData (1 << 7)
|
| 152 |
+
# define OSSL_CMP_CTX_FAILINFO_missingTimeStamp (1 << 8)
|
| 153 |
+
# define OSSL_CMP_CTX_FAILINFO_badPOP (1 << 9)
|
| 154 |
+
# define OSSL_CMP_CTX_FAILINFO_certRevoked (1 << 10)
|
| 155 |
+
# define OSSL_CMP_CTX_FAILINFO_certConfirmed (1 << 11)
|
| 156 |
+
# define OSSL_CMP_CTX_FAILINFO_wrongIntegrity (1 << 12)
|
| 157 |
+
# define OSSL_CMP_CTX_FAILINFO_badRecipientNonce (1 << 13)
|
| 158 |
+
# define OSSL_CMP_CTX_FAILINFO_timeNotAvailable (1 << 14)
|
| 159 |
+
# define OSSL_CMP_CTX_FAILINFO_unacceptedPolicy (1 << 15)
|
| 160 |
+
# define OSSL_CMP_CTX_FAILINFO_unacceptedExtension (1 << 16)
|
| 161 |
+
# define OSSL_CMP_CTX_FAILINFO_addInfoNotAvailable (1 << 17)
|
| 162 |
+
# define OSSL_CMP_CTX_FAILINFO_badSenderNonce (1 << 18)
|
| 163 |
+
# define OSSL_CMP_CTX_FAILINFO_badCertTemplate (1 << 19)
|
| 164 |
+
# define OSSL_CMP_CTX_FAILINFO_signerNotTrusted (1 << 20)
|
| 165 |
+
# define OSSL_CMP_CTX_FAILINFO_transactionIdInUse (1 << 21)
|
| 166 |
+
# define OSSL_CMP_CTX_FAILINFO_unsupportedVersion (1 << 22)
|
| 167 |
+
# define OSSL_CMP_CTX_FAILINFO_notAuthorized (1 << 23)
|
| 168 |
+
# define OSSL_CMP_CTX_FAILINFO_systemUnavail (1 << 24)
|
| 169 |
+
# define OSSL_CMP_CTX_FAILINFO_systemFailure (1 << 25)
|
| 170 |
+
# define OSSL_CMP_CTX_FAILINFO_duplicateCertReq (1 << 26)
|
| 171 |
+
|
| 172 |
+
/*-
|
| 173 |
+
* PKIStatus ::= INTEGER {
|
| 174 |
+
* accepted (0),
|
| 175 |
+
* -- you got exactly what you asked for
|
| 176 |
+
* grantedWithMods (1),
|
| 177 |
+
* -- you got something like what you asked for; the
|
| 178 |
+
* -- requester is responsible for ascertaining the differences
|
| 179 |
+
* rejection (2),
|
| 180 |
+
* -- you don't get it, more information elsewhere in the message
|
| 181 |
+
* waiting (3),
|
| 182 |
+
* -- the request body part has not yet been processed; expect to
|
| 183 |
+
* -- hear more later (note: proper handling of this status
|
| 184 |
+
* -- response MAY use the polling req/rep PKIMessages specified
|
| 185 |
+
* -- in Section 5.3.22; alternatively, polling in the underlying
|
| 186 |
+
* -- transport layer MAY have some utility in this regard)
|
| 187 |
+
* revocationWarning (4),
|
| 188 |
+
* -- this message contains a warning that a revocation is
|
| 189 |
+
* -- imminent
|
| 190 |
+
* revocationNotification (5),
|
| 191 |
+
* -- notification that a revocation has occurred
|
| 192 |
+
* keyUpdateWarning (6)
|
| 193 |
+
* -- update already done for the oldCertId specified in
|
| 194 |
+
* -- CertReqMsg
|
| 195 |
+
* }
|
| 196 |
+
*/
|
| 197 |
+
# define OSSL_CMP_PKISTATUS_request -3
|
| 198 |
+
# define OSSL_CMP_PKISTATUS_trans -2
|
| 199 |
+
# define OSSL_CMP_PKISTATUS_unspecified -1
|
| 200 |
+
# define OSSL_CMP_PKISTATUS_accepted 0
|
| 201 |
+
# define OSSL_CMP_PKISTATUS_grantedWithMods 1
|
| 202 |
+
# define OSSL_CMP_PKISTATUS_rejection 2
|
| 203 |
+
# define OSSL_CMP_PKISTATUS_waiting 3
|
| 204 |
+
# define OSSL_CMP_PKISTATUS_revocationWarning 4
|
| 205 |
+
# define OSSL_CMP_PKISTATUS_revocationNotification 5
|
| 206 |
+
# define OSSL_CMP_PKISTATUS_keyUpdateWarning 6
|
| 207 |
+
typedef ASN1_INTEGER OSSL_CMP_PKISTATUS;
|
| 208 |
+
|
| 209 |
+
DECLARE_ASN1_ITEM(OSSL_CMP_PKISTATUS)
|
| 210 |
+
|
| 211 |
+
# define OSSL_CMP_CERTORENCCERT_CERTIFICATE 0
|
| 212 |
+
# define OSSL_CMP_CERTORENCCERT_ENCRYPTEDCERT 1
|
| 213 |
+
|
| 214 |
+
/* data type declarations */
|
| 215 |
+
typedef struct ossl_cmp_ctx_st OSSL_CMP_CTX;
|
| 216 |
+
typedef struct ossl_cmp_pkiheader_st OSSL_CMP_PKIHEADER;
|
| 217 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKIHEADER)
|
| 218 |
+
typedef struct ossl_cmp_msg_st OSSL_CMP_MSG;
|
| 219 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_MSG)
|
| 220 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(OSSL_CMP_MSG, OSSL_CMP_MSG, OSSL_CMP_MSG)
|
| 221 |
+
typedef struct ossl_cmp_certstatus_st OSSL_CMP_CERTSTATUS;
|
| 222 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTSTATUS, OSSL_CMP_CERTSTATUS, OSSL_CMP_CERTSTATUS)
|
| 223 |
+
#define sk_OSSL_CMP_CERTSTATUS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk))
|
| 224 |
+
#define sk_OSSL_CMP_CERTSTATUS_value(sk, idx) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk), (idx)))
|
| 225 |
+
#define sk_OSSL_CMP_CERTSTATUS_new(cmp) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp)))
|
| 226 |
+
#define sk_OSSL_CMP_CERTSTATUS_new_null() ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new_null())
|
| 227 |
+
#define sk_OSSL_CMP_CERTSTATUS_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp), (n)))
|
| 228 |
+
#define sk_OSSL_CMP_CERTSTATUS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), (n))
|
| 229 |
+
#define sk_OSSL_CMP_CERTSTATUS_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk))
|
| 230 |
+
#define sk_OSSL_CMP_CERTSTATUS_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk))
|
| 231 |
+
#define sk_OSSL_CMP_CERTSTATUS_delete(sk, i) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), (i)))
|
| 232 |
+
#define sk_OSSL_CMP_CERTSTATUS_delete_ptr(sk, ptr) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr)))
|
| 233 |
+
#define sk_OSSL_CMP_CERTSTATUS_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr))
|
| 234 |
+
#define sk_OSSL_CMP_CERTSTATUS_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr))
|
| 235 |
+
#define sk_OSSL_CMP_CERTSTATUS_pop(sk) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk)))
|
| 236 |
+
#define sk_OSSL_CMP_CERTSTATUS_shift(sk) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk)))
|
| 237 |
+
#define sk_OSSL_CMP_CERTSTATUS_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk),ossl_check_OSSL_CMP_CERTSTATUS_freefunc_type(freefunc))
|
| 238 |
+
#define sk_OSSL_CMP_CERTSTATUS_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr), (idx))
|
| 239 |
+
#define sk_OSSL_CMP_CERTSTATUS_set(sk, idx, ptr) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), (idx), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr)))
|
| 240 |
+
#define sk_OSSL_CMP_CERTSTATUS_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr))
|
| 241 |
+
#define sk_OSSL_CMP_CERTSTATUS_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr))
|
| 242 |
+
#define sk_OSSL_CMP_CERTSTATUS_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr), pnum)
|
| 243 |
+
#define sk_OSSL_CMP_CERTSTATUS_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk))
|
| 244 |
+
#define sk_OSSL_CMP_CERTSTATUS_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk))
|
| 245 |
+
#define sk_OSSL_CMP_CERTSTATUS_dup(sk) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk)))
|
| 246 |
+
#define sk_OSSL_CMP_CERTSTATUS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTSTATUS_freefunc_type(freefunc)))
|
| 247 |
+
#define sk_OSSL_CMP_CERTSTATUS_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTSTATUS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp)))
|
| 248 |
+
|
| 249 |
+
typedef struct ossl_cmp_itav_st OSSL_CMP_ITAV;
|
| 250 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_ITAV)
|
| 251 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_ITAV, OSSL_CMP_ITAV, OSSL_CMP_ITAV)
|
| 252 |
+
#define sk_OSSL_CMP_ITAV_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk))
|
| 253 |
+
#define sk_OSSL_CMP_ITAV_value(sk, idx) ((OSSL_CMP_ITAV *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk), (idx)))
|
| 254 |
+
#define sk_OSSL_CMP_ITAV_new(cmp) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp)))
|
| 255 |
+
#define sk_OSSL_CMP_ITAV_new_null() ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new_null())
|
| 256 |
+
#define sk_OSSL_CMP_ITAV_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp), (n)))
|
| 257 |
+
#define sk_OSSL_CMP_ITAV_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_ITAV_sk_type(sk), (n))
|
| 258 |
+
#define sk_OSSL_CMP_ITAV_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk))
|
| 259 |
+
#define sk_OSSL_CMP_ITAV_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_ITAV_sk_type(sk))
|
| 260 |
+
#define sk_OSSL_CMP_ITAV_delete(sk, i) ((OSSL_CMP_ITAV *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_ITAV_sk_type(sk), (i)))
|
| 261 |
+
#define sk_OSSL_CMP_ITAV_delete_ptr(sk, ptr) ((OSSL_CMP_ITAV *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr)))
|
| 262 |
+
#define sk_OSSL_CMP_ITAV_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr))
|
| 263 |
+
#define sk_OSSL_CMP_ITAV_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr))
|
| 264 |
+
#define sk_OSSL_CMP_ITAV_pop(sk) ((OSSL_CMP_ITAV *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_ITAV_sk_type(sk)))
|
| 265 |
+
#define sk_OSSL_CMP_ITAV_shift(sk) ((OSSL_CMP_ITAV *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_ITAV_sk_type(sk)))
|
| 266 |
+
#define sk_OSSL_CMP_ITAV_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk),ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc))
|
| 267 |
+
#define sk_OSSL_CMP_ITAV_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr), (idx))
|
| 268 |
+
#define sk_OSSL_CMP_ITAV_set(sk, idx, ptr) ((OSSL_CMP_ITAV *)OPENSSL_sk_set(ossl_check_OSSL_CMP_ITAV_sk_type(sk), (idx), ossl_check_OSSL_CMP_ITAV_type(ptr)))
|
| 269 |
+
#define sk_OSSL_CMP_ITAV_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr))
|
| 270 |
+
#define sk_OSSL_CMP_ITAV_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr))
|
| 271 |
+
#define sk_OSSL_CMP_ITAV_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr), pnum)
|
| 272 |
+
#define sk_OSSL_CMP_ITAV_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_ITAV_sk_type(sk))
|
| 273 |
+
#define sk_OSSL_CMP_ITAV_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk))
|
| 274 |
+
#define sk_OSSL_CMP_ITAV_dup(sk) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk)))
|
| 275 |
+
#define sk_OSSL_CMP_ITAV_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc)))
|
| 276 |
+
#define sk_OSSL_CMP_ITAV_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_ITAV_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp)))
|
| 277 |
+
|
| 278 |
+
|
| 279 |
+
typedef struct ossl_cmp_crlstatus_st OSSL_CMP_CRLSTATUS;
|
| 280 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CRLSTATUS, OSSL_CMP_CRLSTATUS, OSSL_CMP_CRLSTATUS)
|
| 281 |
+
#define sk_OSSL_CMP_CRLSTATUS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
| 282 |
+
#define sk_OSSL_CMP_CRLSTATUS_value(sk, idx) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk), (idx)))
|
| 283 |
+
#define sk_OSSL_CMP_CRLSTATUS_new(cmp) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp)))
|
| 284 |
+
#define sk_OSSL_CMP_CRLSTATUS_new_null() ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_new_null())
|
| 285 |
+
#define sk_OSSL_CMP_CRLSTATUS_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp), (n)))
|
| 286 |
+
#define sk_OSSL_CMP_CRLSTATUS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (n))
|
| 287 |
+
#define sk_OSSL_CMP_CRLSTATUS_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
| 288 |
+
#define sk_OSSL_CMP_CRLSTATUS_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
| 289 |
+
#define sk_OSSL_CMP_CRLSTATUS_delete(sk, i) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (i)))
|
| 290 |
+
#define sk_OSSL_CMP_CRLSTATUS_delete_ptr(sk, ptr) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr)))
|
| 291 |
+
#define sk_OSSL_CMP_CRLSTATUS_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))
|
| 292 |
+
#define sk_OSSL_CMP_CRLSTATUS_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))
|
| 293 |
+
#define sk_OSSL_CMP_CRLSTATUS_pop(sk) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk)))
|
| 294 |
+
#define sk_OSSL_CMP_CRLSTATUS_shift(sk) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk)))
|
| 295 |
+
#define sk_OSSL_CMP_CRLSTATUS_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk),ossl_check_OSSL_CMP_CRLSTATUS_freefunc_type(freefunc))
|
| 296 |
+
#define sk_OSSL_CMP_CRLSTATUS_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr), (idx))
|
| 297 |
+
#define sk_OSSL_CMP_CRLSTATUS_set(sk, idx, ptr) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (idx), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr)))
|
| 298 |
+
#define sk_OSSL_CMP_CRLSTATUS_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))
|
| 299 |
+
#define sk_OSSL_CMP_CRLSTATUS_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))
|
| 300 |
+
#define sk_OSSL_CMP_CRLSTATUS_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr), pnum)
|
| 301 |
+
#define sk_OSSL_CMP_CRLSTATUS_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
| 302 |
+
#define sk_OSSL_CMP_CRLSTATUS_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
| 303 |
+
#define sk_OSSL_CMP_CRLSTATUS_dup(sk) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk)))
|
| 304 |
+
#define sk_OSSL_CMP_CRLSTATUS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CRLSTATUS_freefunc_type(freefunc)))
|
| 305 |
+
#define sk_OSSL_CMP_CRLSTATUS_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CRLSTATUS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp)))
|
| 306 |
+
|
| 307 |
+
|
| 308 |
+
typedef OSSL_CRMF_ATTRIBUTETYPEANDVALUE OSSL_CMP_ATAV;
|
| 309 |
+
# define OSSL_CMP_ATAV_free OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free
|
| 310 |
+
typedef STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) OSSL_CMP_ATAVS;
|
| 311 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CMP_ATAVS)
|
| 312 |
+
# define stack_st_OSSL_CMP_ATAV stack_st_OSSL_CRMF_ATTRIBUTETYPEANDVALUE
|
| 313 |
+
# define sk_OSSL_CMP_ATAV_num sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_num
|
| 314 |
+
# define sk_OSSL_CMP_ATAV_value sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_value
|
| 315 |
+
# define sk_OSSL_CMP_ATAV_push sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_push
|
| 316 |
+
# define sk_OSSL_CMP_ATAV_pop_free sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop_free
|
| 317 |
+
|
| 318 |
+
typedef struct ossl_cmp_revrepcontent_st OSSL_CMP_REVREPCONTENT;
|
| 319 |
+
typedef struct ossl_cmp_pkisi_st OSSL_CMP_PKISI;
|
| 320 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKISI)
|
| 321 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_PKISI)
|
| 322 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_PKISI, OSSL_CMP_PKISI, OSSL_CMP_PKISI)
|
| 323 |
+
#define sk_OSSL_CMP_PKISI_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk))
|
| 324 |
+
#define sk_OSSL_CMP_PKISI_value(sk, idx) ((OSSL_CMP_PKISI *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk), (idx)))
|
| 325 |
+
#define sk_OSSL_CMP_PKISI_new(cmp) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp)))
|
| 326 |
+
#define sk_OSSL_CMP_PKISI_new_null() ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new_null())
|
| 327 |
+
#define sk_OSSL_CMP_PKISI_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp), (n)))
|
| 328 |
+
#define sk_OSSL_CMP_PKISI_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_PKISI_sk_type(sk), (n))
|
| 329 |
+
#define sk_OSSL_CMP_PKISI_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_PKISI_sk_type(sk))
|
| 330 |
+
#define sk_OSSL_CMP_PKISI_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_PKISI_sk_type(sk))
|
| 331 |
+
#define sk_OSSL_CMP_PKISI_delete(sk, i) ((OSSL_CMP_PKISI *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_PKISI_sk_type(sk), (i)))
|
| 332 |
+
#define sk_OSSL_CMP_PKISI_delete_ptr(sk, ptr) ((OSSL_CMP_PKISI *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr)))
|
| 333 |
+
#define sk_OSSL_CMP_PKISI_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr))
|
| 334 |
+
#define sk_OSSL_CMP_PKISI_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr))
|
| 335 |
+
#define sk_OSSL_CMP_PKISI_pop(sk) ((OSSL_CMP_PKISI *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_PKISI_sk_type(sk)))
|
| 336 |
+
#define sk_OSSL_CMP_PKISI_shift(sk) ((OSSL_CMP_PKISI *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_PKISI_sk_type(sk)))
|
| 337 |
+
#define sk_OSSL_CMP_PKISI_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_PKISI_sk_type(sk),ossl_check_OSSL_CMP_PKISI_freefunc_type(freefunc))
|
| 338 |
+
#define sk_OSSL_CMP_PKISI_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr), (idx))
|
| 339 |
+
#define sk_OSSL_CMP_PKISI_set(sk, idx, ptr) ((OSSL_CMP_PKISI *)OPENSSL_sk_set(ossl_check_OSSL_CMP_PKISI_sk_type(sk), (idx), ossl_check_OSSL_CMP_PKISI_type(ptr)))
|
| 340 |
+
#define sk_OSSL_CMP_PKISI_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr))
|
| 341 |
+
#define sk_OSSL_CMP_PKISI_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr))
|
| 342 |
+
#define sk_OSSL_CMP_PKISI_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr), pnum)
|
| 343 |
+
#define sk_OSSL_CMP_PKISI_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_PKISI_sk_type(sk))
|
| 344 |
+
#define sk_OSSL_CMP_PKISI_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk))
|
| 345 |
+
#define sk_OSSL_CMP_PKISI_dup(sk) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk)))
|
| 346 |
+
#define sk_OSSL_CMP_PKISI_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_PKISI_freefunc_type(freefunc)))
|
| 347 |
+
#define sk_OSSL_CMP_PKISI_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_PKISI_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp)))
|
| 348 |
+
|
| 349 |
+
typedef struct ossl_cmp_certrepmessage_st OSSL_CMP_CERTREPMESSAGE;
|
| 350 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTREPMESSAGE, OSSL_CMP_CERTREPMESSAGE, OSSL_CMP_CERTREPMESSAGE)
|
| 351 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))
|
| 352 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_value(sk, idx) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (idx)))
|
| 353 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_new(cmp) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp)))
|
| 354 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_new_null() ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new_null())
|
| 355 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp), (n)))
|
| 356 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (n))
|
| 357 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))
|
| 358 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))
|
| 359 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_delete(sk, i) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (i)))
|
| 360 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_delete_ptr(sk, ptr) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr)))
|
| 361 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr))
|
| 362 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr))
|
| 363 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_pop(sk) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk)))
|
| 364 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_shift(sk) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk)))
|
| 365 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk),ossl_check_OSSL_CMP_CERTREPMESSAGE_freefunc_type(freefunc))
|
| 366 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr), (idx))
|
| 367 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_set(sk, idx, ptr) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (idx), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr)))
|
| 368 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr))
|
| 369 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr))
|
| 370 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr), pnum)
|
| 371 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))
|
| 372 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))
|
| 373 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_dup(sk) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk)))
|
| 374 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTREPMESSAGE_freefunc_type(freefunc)))
|
| 375 |
+
#define sk_OSSL_CMP_CERTREPMESSAGE_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTREPMESSAGE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp)))
|
| 376 |
+
|
| 377 |
+
typedef struct ossl_cmp_pollrep_st OSSL_CMP_POLLREP;
|
| 378 |
+
typedef STACK_OF(OSSL_CMP_POLLREP) OSSL_CMP_POLLREPCONTENT;
|
| 379 |
+
typedef struct ossl_cmp_certresponse_st OSSL_CMP_CERTRESPONSE;
|
| 380 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTRESPONSE, OSSL_CMP_CERTRESPONSE, OSSL_CMP_CERTRESPONSE)
|
| 381 |
+
#define sk_OSSL_CMP_CERTRESPONSE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk))
|
| 382 |
+
#define sk_OSSL_CMP_CERTRESPONSE_value(sk, idx) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk), (idx)))
|
| 383 |
+
#define sk_OSSL_CMP_CERTRESPONSE_new(cmp) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp)))
|
| 384 |
+
#define sk_OSSL_CMP_CERTRESPONSE_new_null() ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new_null())
|
| 385 |
+
#define sk_OSSL_CMP_CERTRESPONSE_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp), (n)))
|
| 386 |
+
#define sk_OSSL_CMP_CERTRESPONSE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), (n))
|
| 387 |
+
#define sk_OSSL_CMP_CERTRESPONSE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk))
|
| 388 |
+
#define sk_OSSL_CMP_CERTRESPONSE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk))
|
| 389 |
+
#define sk_OSSL_CMP_CERTRESPONSE_delete(sk, i) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), (i)))
|
| 390 |
+
#define sk_OSSL_CMP_CERTRESPONSE_delete_ptr(sk, ptr) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr)))
|
| 391 |
+
#define sk_OSSL_CMP_CERTRESPONSE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr))
|
| 392 |
+
#define sk_OSSL_CMP_CERTRESPONSE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr))
|
| 393 |
+
#define sk_OSSL_CMP_CERTRESPONSE_pop(sk) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk)))
|
| 394 |
+
#define sk_OSSL_CMP_CERTRESPONSE_shift(sk) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk)))
|
| 395 |
+
#define sk_OSSL_CMP_CERTRESPONSE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk),ossl_check_OSSL_CMP_CERTRESPONSE_freefunc_type(freefunc))
|
| 396 |
+
#define sk_OSSL_CMP_CERTRESPONSE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr), (idx))
|
| 397 |
+
#define sk_OSSL_CMP_CERTRESPONSE_set(sk, idx, ptr) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), (idx), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr)))
|
| 398 |
+
#define sk_OSSL_CMP_CERTRESPONSE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr))
|
| 399 |
+
#define sk_OSSL_CMP_CERTRESPONSE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr))
|
| 400 |
+
#define sk_OSSL_CMP_CERTRESPONSE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr), pnum)
|
| 401 |
+
#define sk_OSSL_CMP_CERTRESPONSE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk))
|
| 402 |
+
#define sk_OSSL_CMP_CERTRESPONSE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk))
|
| 403 |
+
#define sk_OSSL_CMP_CERTRESPONSE_dup(sk) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk)))
|
| 404 |
+
#define sk_OSSL_CMP_CERTRESPONSE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTRESPONSE_freefunc_type(freefunc)))
|
| 405 |
+
#define sk_OSSL_CMP_CERTRESPONSE_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTRESPONSE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp)))
|
| 406 |
+
|
| 407 |
+
typedef STACK_OF(ASN1_UTF8STRING) OSSL_CMP_PKIFREETEXT;
|
| 408 |
+
|
| 409 |
+
/*
|
| 410 |
+
* function DECLARATIONS
|
| 411 |
+
*/
|
| 412 |
+
|
| 413 |
+
/* from cmp_asn.c */
|
| 414 |
+
OSSL_CMP_ITAV *OSSL_CMP_ITAV_create(ASN1_OBJECT *type, ASN1_TYPE *value);
|
| 415 |
+
void OSSL_CMP_ITAV_set0(OSSL_CMP_ITAV *itav, ASN1_OBJECT *type,
|
| 416 |
+
ASN1_TYPE *value);
|
| 417 |
+
ASN1_OBJECT *OSSL_CMP_ITAV_get0_type(const OSSL_CMP_ITAV *itav);
|
| 418 |
+
ASN1_TYPE *OSSL_CMP_ITAV_get0_value(const OSSL_CMP_ITAV *itav);
|
| 419 |
+
int OSSL_CMP_ITAV_push0_stack_item(STACK_OF(OSSL_CMP_ITAV) **sk_p,
|
| 420 |
+
OSSL_CMP_ITAV *itav);
|
| 421 |
+
void OSSL_CMP_ITAV_free(OSSL_CMP_ITAV *itav);
|
| 422 |
+
|
| 423 |
+
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new0_certProfile(STACK_OF(ASN1_UTF8STRING)
|
| 424 |
+
*certProfile);
|
| 425 |
+
int OSSL_CMP_ITAV_get0_certProfile(const OSSL_CMP_ITAV *itav,
|
| 426 |
+
STACK_OF(ASN1_UTF8STRING) **out);
|
| 427 |
+
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_caCerts(const STACK_OF(X509) *caCerts);
|
| 428 |
+
int OSSL_CMP_ITAV_get0_caCerts(const OSSL_CMP_ITAV *itav, STACK_OF(X509) **out);
|
| 429 |
+
|
| 430 |
+
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaCert(const X509 *rootCaCert);
|
| 431 |
+
int OSSL_CMP_ITAV_get0_rootCaCert(const OSSL_CMP_ITAV *itav, X509 **out);
|
| 432 |
+
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaKeyUpdate(const X509 *newWithNew,
|
| 433 |
+
const X509 *newWithOld,
|
| 434 |
+
const X509 *oldWithNew);
|
| 435 |
+
int OSSL_CMP_ITAV_get0_rootCaKeyUpdate(const OSSL_CMP_ITAV *itav,
|
| 436 |
+
X509 **newWithNew,
|
| 437 |
+
X509 **newWithOld,
|
| 438 |
+
X509 **oldWithNew);
|
| 439 |
+
|
| 440 |
+
OSSL_CMP_CRLSTATUS *OSSL_CMP_CRLSTATUS_create(const X509_CRL *crl,
|
| 441 |
+
const X509 *cert, int only_DN);
|
| 442 |
+
OSSL_CMP_CRLSTATUS *OSSL_CMP_CRLSTATUS_new1(const DIST_POINT_NAME *dpn,
|
| 443 |
+
const GENERAL_NAMES *issuer,
|
| 444 |
+
const ASN1_TIME *thisUpdate);
|
| 445 |
+
int OSSL_CMP_CRLSTATUS_get0(const OSSL_CMP_CRLSTATUS *crlstatus,
|
| 446 |
+
DIST_POINT_NAME **dpn, GENERAL_NAMES **issuer,
|
| 447 |
+
ASN1_TIME **thisUpdate);
|
| 448 |
+
void OSSL_CMP_CRLSTATUS_free(OSSL_CMP_CRLSTATUS *crlstatus);
|
| 449 |
+
OSSL_CMP_ITAV
|
| 450 |
+
*OSSL_CMP_ITAV_new0_crlStatusList(STACK_OF(OSSL_CMP_CRLSTATUS) *crlStatusList);
|
| 451 |
+
int OSSL_CMP_ITAV_get0_crlStatusList(const OSSL_CMP_ITAV *itav,
|
| 452 |
+
STACK_OF(OSSL_CMP_CRLSTATUS) **out);
|
| 453 |
+
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_crls(const X509_CRL *crls);
|
| 454 |
+
int OSSL_CMP_ITAV_get0_crls(const OSSL_CMP_ITAV *it, STACK_OF(X509_CRL) **out);
|
| 455 |
+
OSSL_CMP_ITAV
|
| 456 |
+
*OSSL_CMP_ITAV_new0_certReqTemplate(OSSL_CRMF_CERTTEMPLATE *certTemplate,
|
| 457 |
+
OSSL_CMP_ATAVS *keySpec);
|
| 458 |
+
int OSSL_CMP_ITAV_get1_certReqTemplate(const OSSL_CMP_ITAV *itav,
|
| 459 |
+
OSSL_CRMF_CERTTEMPLATE **certTemplate,
|
| 460 |
+
OSSL_CMP_ATAVS **keySpec);
|
| 461 |
+
|
| 462 |
+
OSSL_CMP_ATAV *OSSL_CMP_ATAV_create(ASN1_OBJECT *type, ASN1_TYPE *value);
|
| 463 |
+
void OSSL_CMP_ATAV_set0(OSSL_CMP_ATAV *itav, ASN1_OBJECT *type,
|
| 464 |
+
ASN1_TYPE *value);
|
| 465 |
+
ASN1_OBJECT *OSSL_CMP_ATAV_get0_type(const OSSL_CMP_ATAV *itav);
|
| 466 |
+
ASN1_TYPE *OSSL_CMP_ATAV_get0_value(const OSSL_CMP_ATAV *itav);
|
| 467 |
+
OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_algId(const X509_ALGOR *alg);
|
| 468 |
+
X509_ALGOR *OSSL_CMP_ATAV_get0_algId(const OSSL_CMP_ATAV *atav);
|
| 469 |
+
OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_rsaKeyLen(int len);
|
| 470 |
+
int OSSL_CMP_ATAV_get_rsaKeyLen(const OSSL_CMP_ATAV *atav);
|
| 471 |
+
int OSSL_CMP_ATAV_push1(OSSL_CMP_ATAVS **sk_p, const OSSL_CMP_ATAV *atav);
|
| 472 |
+
|
| 473 |
+
void OSSL_CMP_MSG_free(OSSL_CMP_MSG *msg);
|
| 474 |
+
|
| 475 |
+
/* from cmp_ctx.c */
|
| 476 |
+
OSSL_CMP_CTX *OSSL_CMP_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
|
| 477 |
+
void OSSL_CMP_CTX_free(OSSL_CMP_CTX *ctx);
|
| 478 |
+
int OSSL_CMP_CTX_reinit(OSSL_CMP_CTX *ctx);
|
| 479 |
+
OSSL_LIB_CTX *OSSL_CMP_CTX_get0_libctx(const OSSL_CMP_CTX *ctx);
|
| 480 |
+
const char *OSSL_CMP_CTX_get0_propq(const OSSL_CMP_CTX *ctx);
|
| 481 |
+
/* CMP general options: */
|
| 482 |
+
# define OSSL_CMP_OPT_LOG_VERBOSITY 0
|
| 483 |
+
/* CMP transfer options: */
|
| 484 |
+
# define OSSL_CMP_OPT_KEEP_ALIVE 10
|
| 485 |
+
# define OSSL_CMP_OPT_MSG_TIMEOUT 11
|
| 486 |
+
# define OSSL_CMP_OPT_TOTAL_TIMEOUT 12
|
| 487 |
+
# define OSSL_CMP_OPT_USE_TLS 13
|
| 488 |
+
/* CMP request options: */
|
| 489 |
+
# define OSSL_CMP_OPT_VALIDITY_DAYS 20
|
| 490 |
+
# define OSSL_CMP_OPT_SUBJECTALTNAME_NODEFAULT 21
|
| 491 |
+
# define OSSL_CMP_OPT_SUBJECTALTNAME_CRITICAL 22
|
| 492 |
+
# define OSSL_CMP_OPT_POLICIES_CRITICAL 23
|
| 493 |
+
# define OSSL_CMP_OPT_POPO_METHOD 24
|
| 494 |
+
# define OSSL_CMP_OPT_IMPLICIT_CONFIRM 25
|
| 495 |
+
# define OSSL_CMP_OPT_DISABLE_CONFIRM 26
|
| 496 |
+
# define OSSL_CMP_OPT_REVOCATION_REASON 27
|
| 497 |
+
/* CMP protection options: */
|
| 498 |
+
# define OSSL_CMP_OPT_UNPROTECTED_SEND 30
|
| 499 |
+
# define OSSL_CMP_OPT_UNPROTECTED_ERRORS 31
|
| 500 |
+
# define OSSL_CMP_OPT_OWF_ALGNID 32
|
| 501 |
+
# define OSSL_CMP_OPT_MAC_ALGNID 33
|
| 502 |
+
# define OSSL_CMP_OPT_DIGEST_ALGNID 34
|
| 503 |
+
# define OSSL_CMP_OPT_IGNORE_KEYUSAGE 35
|
| 504 |
+
# define OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR 36
|
| 505 |
+
# define OSSL_CMP_OPT_NO_CACHE_EXTRACERTS 37
|
| 506 |
+
int OSSL_CMP_CTX_set_option(OSSL_CMP_CTX *ctx, int opt, int val);
|
| 507 |
+
int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt);
|
| 508 |
+
/* CMP-specific callback for logging and outputting the error queue: */
|
| 509 |
+
int OSSL_CMP_CTX_set_log_cb(OSSL_CMP_CTX *ctx, OSSL_CMP_log_cb_t cb);
|
| 510 |
+
# define OSSL_CMP_CTX_set_log_verbosity(ctx, level) \
|
| 511 |
+
OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_LOG_VERBOSITY, level)
|
| 512 |
+
void OSSL_CMP_CTX_print_errors(const OSSL_CMP_CTX *ctx);
|
| 513 |
+
/* message transfer: */
|
| 514 |
+
int OSSL_CMP_CTX_set1_serverPath(OSSL_CMP_CTX *ctx, const char *path);
|
| 515 |
+
int OSSL_CMP_CTX_set1_server(OSSL_CMP_CTX *ctx, const char *address);
|
| 516 |
+
int OSSL_CMP_CTX_set_serverPort(OSSL_CMP_CTX *ctx, int port);
|
| 517 |
+
int OSSL_CMP_CTX_set1_proxy(OSSL_CMP_CTX *ctx, const char *name);
|
| 518 |
+
int OSSL_CMP_CTX_set1_no_proxy(OSSL_CMP_CTX *ctx, const char *names);
|
| 519 |
+
# ifndef OPENSSL_NO_HTTP
|
| 520 |
+
int OSSL_CMP_CTX_set_http_cb(OSSL_CMP_CTX *ctx, OSSL_HTTP_bio_cb_t cb);
|
| 521 |
+
int OSSL_CMP_CTX_set_http_cb_arg(OSSL_CMP_CTX *ctx, void *arg);
|
| 522 |
+
void *OSSL_CMP_CTX_get_http_cb_arg(const OSSL_CMP_CTX *ctx);
|
| 523 |
+
# endif
|
| 524 |
+
typedef OSSL_CMP_MSG *(*OSSL_CMP_transfer_cb_t) (OSSL_CMP_CTX *ctx,
|
| 525 |
+
const OSSL_CMP_MSG *req);
|
| 526 |
+
int OSSL_CMP_CTX_set_transfer_cb(OSSL_CMP_CTX *ctx, OSSL_CMP_transfer_cb_t cb);
|
| 527 |
+
int OSSL_CMP_CTX_set_transfer_cb_arg(OSSL_CMP_CTX *ctx, void *arg);
|
| 528 |
+
void *OSSL_CMP_CTX_get_transfer_cb_arg(const OSSL_CMP_CTX *ctx);
|
| 529 |
+
/* server authentication: */
|
| 530 |
+
int OSSL_CMP_CTX_set1_srvCert(OSSL_CMP_CTX *ctx, X509 *cert);
|
| 531 |
+
int OSSL_CMP_CTX_set1_expected_sender(OSSL_CMP_CTX *ctx, const X509_NAME *name);
|
| 532 |
+
int OSSL_CMP_CTX_set0_trustedStore(OSSL_CMP_CTX *ctx, X509_STORE *store);
|
| 533 |
+
# define OSSL_CMP_CTX_set0_trusted OSSL_CMP_CTX_set0_trustedStore
|
| 534 |
+
X509_STORE *OSSL_CMP_CTX_get0_trustedStore(const OSSL_CMP_CTX *ctx);
|
| 535 |
+
# define OSSL_CMP_CTX_get0_trusted OSSL_CMP_CTX_get0_trustedStore
|
| 536 |
+
int OSSL_CMP_CTX_set1_untrusted(OSSL_CMP_CTX *ctx, STACK_OF(X509) *certs);
|
| 537 |
+
STACK_OF(X509) *OSSL_CMP_CTX_get0_untrusted(const OSSL_CMP_CTX *ctx);
|
| 538 |
+
/* client authentication: */
|
| 539 |
+
int OSSL_CMP_CTX_set1_cert(OSSL_CMP_CTX *ctx, X509 *cert);
|
| 540 |
+
int OSSL_CMP_CTX_build_cert_chain(OSSL_CMP_CTX *ctx, X509_STORE *own_trusted,
|
| 541 |
+
STACK_OF(X509) *candidates);
|
| 542 |
+
int OSSL_CMP_CTX_set1_pkey(OSSL_CMP_CTX *ctx, EVP_PKEY *pkey);
|
| 543 |
+
int OSSL_CMP_CTX_set1_referenceValue(OSSL_CMP_CTX *ctx,
|
| 544 |
+
const unsigned char *ref, int len);
|
| 545 |
+
int OSSL_CMP_CTX_set1_secretValue(OSSL_CMP_CTX *ctx,
|
| 546 |
+
const unsigned char *sec, int len);
|
| 547 |
+
/* CMP message header and extra certificates: */
|
| 548 |
+
int OSSL_CMP_CTX_set1_recipient(OSSL_CMP_CTX *ctx, const X509_NAME *name);
|
| 549 |
+
int OSSL_CMP_CTX_push0_geninfo_ITAV(OSSL_CMP_CTX *ctx, OSSL_CMP_ITAV *itav);
|
| 550 |
+
int OSSL_CMP_CTX_reset_geninfo_ITAVs(OSSL_CMP_CTX *ctx);
|
| 551 |
+
STACK_OF(OSSL_CMP_ITAV)
|
| 552 |
+
*OSSL_CMP_CTX_get0_geninfo_ITAVs(const OSSL_CMP_CTX *ctx);
|
| 553 |
+
int OSSL_CMP_CTX_set1_extraCertsOut(OSSL_CMP_CTX *ctx,
|
| 554 |
+
STACK_OF(X509) *extraCertsOut);
|
| 555 |
+
/* certificate template: */
|
| 556 |
+
int OSSL_CMP_CTX_set0_newPkey(OSSL_CMP_CTX *ctx, int priv, EVP_PKEY *pkey);
|
| 557 |
+
EVP_PKEY *OSSL_CMP_CTX_get0_newPkey(const OSSL_CMP_CTX *ctx, int priv);
|
| 558 |
+
int OSSL_CMP_CTX_set1_issuer(OSSL_CMP_CTX *ctx, const X509_NAME *name);
|
| 559 |
+
int OSSL_CMP_CTX_set1_serialNumber(OSSL_CMP_CTX *ctx, const ASN1_INTEGER *sn);
|
| 560 |
+
int OSSL_CMP_CTX_set1_subjectName(OSSL_CMP_CTX *ctx, const X509_NAME *name);
|
| 561 |
+
int OSSL_CMP_CTX_push1_subjectAltName(OSSL_CMP_CTX *ctx,
|
| 562 |
+
const GENERAL_NAME *name);
|
| 563 |
+
int OSSL_CMP_CTX_set0_reqExtensions(OSSL_CMP_CTX *ctx, X509_EXTENSIONS *exts);
|
| 564 |
+
int OSSL_CMP_CTX_reqExtensions_have_SAN(OSSL_CMP_CTX *ctx);
|
| 565 |
+
int OSSL_CMP_CTX_push0_policy(OSSL_CMP_CTX *ctx, POLICYINFO *pinfo);
|
| 566 |
+
int OSSL_CMP_CTX_set1_oldCert(OSSL_CMP_CTX *ctx, X509 *cert);
|
| 567 |
+
int OSSL_CMP_CTX_set1_p10CSR(OSSL_CMP_CTX *ctx, const X509_REQ *csr);
|
| 568 |
+
/* misc body contents: */
|
| 569 |
+
int OSSL_CMP_CTX_push0_genm_ITAV(OSSL_CMP_CTX *ctx, OSSL_CMP_ITAV *itav);
|
| 570 |
+
/* certificate confirmation: */
|
| 571 |
+
typedef int (*OSSL_CMP_certConf_cb_t) (OSSL_CMP_CTX *ctx, X509 *cert,
|
| 572 |
+
int fail_info, const char **txt);
|
| 573 |
+
int OSSL_CMP_certConf_cb(OSSL_CMP_CTX *ctx, X509 *cert, int fail_info,
|
| 574 |
+
const char **text);
|
| 575 |
+
int OSSL_CMP_CTX_set_certConf_cb(OSSL_CMP_CTX *ctx, OSSL_CMP_certConf_cb_t cb);
|
| 576 |
+
int OSSL_CMP_CTX_set_certConf_cb_arg(OSSL_CMP_CTX *ctx, void *arg);
|
| 577 |
+
void *OSSL_CMP_CTX_get_certConf_cb_arg(const OSSL_CMP_CTX *ctx);
|
| 578 |
+
/* result fetching: */
|
| 579 |
+
int OSSL_CMP_CTX_get_status(const OSSL_CMP_CTX *ctx);
|
| 580 |
+
OSSL_CMP_PKIFREETEXT *OSSL_CMP_CTX_get0_statusString(const OSSL_CMP_CTX *ctx);
|
| 581 |
+
int OSSL_CMP_CTX_get_failInfoCode(const OSSL_CMP_CTX *ctx);
|
| 582 |
+
# define OSSL_CMP_PKISI_BUFLEN 1024
|
| 583 |
+
X509 *OSSL_CMP_CTX_get0_validatedSrvCert(const OSSL_CMP_CTX *ctx);
|
| 584 |
+
X509 *OSSL_CMP_CTX_get0_newCert(const OSSL_CMP_CTX *ctx);
|
| 585 |
+
STACK_OF(X509) *OSSL_CMP_CTX_get1_newChain(const OSSL_CMP_CTX *ctx);
|
| 586 |
+
STACK_OF(X509) *OSSL_CMP_CTX_get1_caPubs(const OSSL_CMP_CTX *ctx);
|
| 587 |
+
STACK_OF(X509) *OSSL_CMP_CTX_get1_extraCertsIn(const OSSL_CMP_CTX *ctx);
|
| 588 |
+
int OSSL_CMP_CTX_set1_transactionID(OSSL_CMP_CTX *ctx,
|
| 589 |
+
const ASN1_OCTET_STRING *id);
|
| 590 |
+
int OSSL_CMP_CTX_set1_senderNonce(OSSL_CMP_CTX *ctx,
|
| 591 |
+
const ASN1_OCTET_STRING *nonce);
|
| 592 |
+
|
| 593 |
+
/* from cmp_status.c */
|
| 594 |
+
char *OSSL_CMP_CTX_snprint_PKIStatus(const OSSL_CMP_CTX *ctx, char *buf,
|
| 595 |
+
size_t bufsize);
|
| 596 |
+
char *OSSL_CMP_snprint_PKIStatusInfo(const OSSL_CMP_PKISI *statusInfo,
|
| 597 |
+
char *buf, size_t bufsize);
|
| 598 |
+
OSSL_CMP_PKISI *
|
| 599 |
+
OSSL_CMP_STATUSINFO_new(int status, int fail_info, const char *text);
|
| 600 |
+
|
| 601 |
+
/* from cmp_hdr.c */
|
| 602 |
+
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const
|
| 603 |
+
OSSL_CMP_PKIHEADER *hdr);
|
| 604 |
+
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const OSSL_CMP_PKIHEADER *hdr);
|
| 605 |
+
STACK_OF(OSSL_CMP_ITAV)
|
| 606 |
+
*OSSL_CMP_HDR_get0_geninfo_ITAVs(const OSSL_CMP_PKIHEADER *hdr);
|
| 607 |
+
|
| 608 |
+
/* from cmp_msg.c */
|
| 609 |
+
OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg);
|
| 610 |
+
int OSSL_CMP_MSG_get_bodytype(const OSSL_CMP_MSG *msg);
|
| 611 |
+
X509_PUBKEY *OSSL_CMP_MSG_get0_certreq_publickey(const OSSL_CMP_MSG *msg);
|
| 612 |
+
int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
|
| 613 |
+
int OSSL_CMP_MSG_update_recipNonce(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
|
| 614 |
+
OSSL_CRMF_MSG *OSSL_CMP_CTX_setup_CRM(OSSL_CMP_CTX *ctx, int for_KUR, int rid);
|
| 615 |
+
OSSL_CMP_MSG *OSSL_CMP_MSG_read(const char *file, OSSL_LIB_CTX *libctx,
|
| 616 |
+
const char *propq);
|
| 617 |
+
int OSSL_CMP_MSG_write(const char *file, const OSSL_CMP_MSG *msg);
|
| 618 |
+
OSSL_CMP_MSG *d2i_OSSL_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg);
|
| 619 |
+
int i2d_OSSL_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg);
|
| 620 |
+
|
| 621 |
+
/* from cmp_vfy.c */
|
| 622 |
+
int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg);
|
| 623 |
+
int OSSL_CMP_validate_cert_path(const OSSL_CMP_CTX *ctx,
|
| 624 |
+
X509_STORE *trusted_store, X509 *cert);
|
| 625 |
+
|
| 626 |
+
/* from cmp_http.c */
|
| 627 |
+
# ifndef OPENSSL_NO_HTTP
|
| 628 |
+
OSSL_CMP_MSG *OSSL_CMP_MSG_http_perform(OSSL_CMP_CTX *ctx,
|
| 629 |
+
const OSSL_CMP_MSG *req);
|
| 630 |
+
# endif
|
| 631 |
+
|
| 632 |
+
/* from cmp_server.c */
|
| 633 |
+
typedef struct ossl_cmp_srv_ctx_st OSSL_CMP_SRV_CTX;
|
| 634 |
+
OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 635 |
+
const OSSL_CMP_MSG *req);
|
| 636 |
+
OSSL_CMP_MSG * OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx,
|
| 637 |
+
const OSSL_CMP_MSG *req);
|
| 638 |
+
OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
|
| 639 |
+
void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx);
|
| 640 |
+
typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)
|
| 641 |
+
(OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *req, int certReqId,
|
| 642 |
+
const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr,
|
| 643 |
+
X509 **certOut, STACK_OF(X509) **chainOut, STACK_OF(X509) **caPubs);
|
| 644 |
+
typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_rr_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 645 |
+
const OSSL_CMP_MSG *req,
|
| 646 |
+
const X509_NAME *issuer,
|
| 647 |
+
const ASN1_INTEGER *serial);
|
| 648 |
+
typedef int (*OSSL_CMP_SRV_genm_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 649 |
+
const OSSL_CMP_MSG *req,
|
| 650 |
+
const STACK_OF(OSSL_CMP_ITAV) *in,
|
| 651 |
+
STACK_OF(OSSL_CMP_ITAV) **out);
|
| 652 |
+
typedef void (*OSSL_CMP_SRV_error_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 653 |
+
const OSSL_CMP_MSG *req,
|
| 654 |
+
const OSSL_CMP_PKISI *statusInfo,
|
| 655 |
+
const ASN1_INTEGER *errorCode,
|
| 656 |
+
const OSSL_CMP_PKIFREETEXT *errDetails);
|
| 657 |
+
typedef int (*OSSL_CMP_SRV_certConf_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 658 |
+
const OSSL_CMP_MSG *req,
|
| 659 |
+
int certReqId,
|
| 660 |
+
const ASN1_OCTET_STRING *certHash,
|
| 661 |
+
const OSSL_CMP_PKISI *si);
|
| 662 |
+
typedef int (*OSSL_CMP_SRV_pollReq_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 663 |
+
const OSSL_CMP_MSG *req, int certReqId,
|
| 664 |
+
OSSL_CMP_MSG **certReq,
|
| 665 |
+
int64_t *check_after);
|
| 666 |
+
int OSSL_CMP_SRV_CTX_init(OSSL_CMP_SRV_CTX *srv_ctx, void *custom_ctx,
|
| 667 |
+
OSSL_CMP_SRV_cert_request_cb_t process_cert_request,
|
| 668 |
+
OSSL_CMP_SRV_rr_cb_t process_rr,
|
| 669 |
+
OSSL_CMP_SRV_genm_cb_t process_genm,
|
| 670 |
+
OSSL_CMP_SRV_error_cb_t process_error,
|
| 671 |
+
OSSL_CMP_SRV_certConf_cb_t process_certConf,
|
| 672 |
+
OSSL_CMP_SRV_pollReq_cb_t process_pollReq);
|
| 673 |
+
typedef int (*OSSL_CMP_SRV_delayed_delivery_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 674 |
+
const OSSL_CMP_MSG *req);
|
| 675 |
+
typedef int (*OSSL_CMP_SRV_clean_transaction_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 676 |
+
const ASN1_OCTET_STRING *id);
|
| 677 |
+
int OSSL_CMP_SRV_CTX_init_trans(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 678 |
+
OSSL_CMP_SRV_delayed_delivery_cb_t delay,
|
| 679 |
+
OSSL_CMP_SRV_clean_transaction_cb_t clean);
|
| 680 |
+
OSSL_CMP_CTX *OSSL_CMP_SRV_CTX_get0_cmp_ctx(const OSSL_CMP_SRV_CTX *srv_ctx);
|
| 681 |
+
void *OSSL_CMP_SRV_CTX_get0_custom_ctx(const OSSL_CMP_SRV_CTX *srv_ctx);
|
| 682 |
+
int OSSL_CMP_SRV_CTX_set_send_unprotected_errors(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 683 |
+
int val);
|
| 684 |
+
int OSSL_CMP_SRV_CTX_set_accept_unprotected(OSSL_CMP_SRV_CTX *srv_ctx, int val);
|
| 685 |
+
int OSSL_CMP_SRV_CTX_set_accept_raverified(OSSL_CMP_SRV_CTX *srv_ctx, int val);
|
| 686 |
+
int OSSL_CMP_SRV_CTX_set_grant_implicit_confirm(OSSL_CMP_SRV_CTX *srv_ctx,
|
| 687 |
+
int val);
|
| 688 |
+
|
| 689 |
+
/* from cmp_client.c */
|
| 690 |
+
X509 *OSSL_CMP_exec_certreq(OSSL_CMP_CTX *ctx, int req_type,
|
| 691 |
+
const OSSL_CRMF_MSG *crm);
|
| 692 |
+
# define OSSL_CMP_IR 0
|
| 693 |
+
# define OSSL_CMP_CR 2
|
| 694 |
+
# define OSSL_CMP_P10CR 4
|
| 695 |
+
# define OSSL_CMP_KUR 7
|
| 696 |
+
# define OSSL_CMP_GENM 21
|
| 697 |
+
# define OSSL_CMP_ERROR 23
|
| 698 |
+
# define OSSL_CMP_exec_IR_ses(ctx) \
|
| 699 |
+
OSSL_CMP_exec_certreq(ctx, OSSL_CMP_IR, NULL)
|
| 700 |
+
# define OSSL_CMP_exec_CR_ses(ctx) \
|
| 701 |
+
OSSL_CMP_exec_certreq(ctx, OSSL_CMP_CR, NULL)
|
| 702 |
+
# define OSSL_CMP_exec_P10CR_ses(ctx) \
|
| 703 |
+
OSSL_CMP_exec_certreq(ctx, OSSL_CMP_P10CR, NULL)
|
| 704 |
+
# define OSSL_CMP_exec_KUR_ses(ctx) \
|
| 705 |
+
OSSL_CMP_exec_certreq(ctx, OSSL_CMP_KUR, NULL)
|
| 706 |
+
int OSSL_CMP_try_certreq(OSSL_CMP_CTX *ctx, int req_type,
|
| 707 |
+
const OSSL_CRMF_MSG *crm, int *checkAfter);
|
| 708 |
+
int OSSL_CMP_exec_RR_ses(OSSL_CMP_CTX *ctx);
|
| 709 |
+
STACK_OF(OSSL_CMP_ITAV) *OSSL_CMP_exec_GENM_ses(OSSL_CMP_CTX *ctx);
|
| 710 |
+
|
| 711 |
+
/* from cmp_genm.c */
|
| 712 |
+
int OSSL_CMP_get1_caCerts(OSSL_CMP_CTX *ctx, STACK_OF(X509) **out);
|
| 713 |
+
int OSSL_CMP_get1_rootCaKeyUpdate(OSSL_CMP_CTX *ctx,
|
| 714 |
+
const X509 *oldWithOld, X509 **newWithNew,
|
| 715 |
+
X509 **newWithOld, X509 **oldWithNew);
|
| 716 |
+
int OSSL_CMP_get1_crlUpdate(OSSL_CMP_CTX *ctx, const X509 *crlcert,
|
| 717 |
+
const X509_CRL *last_crl,
|
| 718 |
+
X509_CRL **crl);
|
| 719 |
+
int OSSL_CMP_get1_certReqTemplate(OSSL_CMP_CTX *ctx,
|
| 720 |
+
OSSL_CRMF_CERTTEMPLATE **certTemplate,
|
| 721 |
+
OSSL_CMP_ATAVS **keySpec);
|
| 722 |
+
|
| 723 |
+
# ifdef __cplusplus
|
| 724 |
+
}
|
| 725 |
+
# endif
|
| 726 |
+
# endif /* !defined(OPENSSL_NO_CMP) */
|
| 727 |
+
#endif /* !defined(OPENSSL_CMP_H) */
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/cms.h
ADDED
|
@@ -0,0 +1,511 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/cms.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_CMS_H
|
| 16 |
+
# define OPENSSL_CMS_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_CMS_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/opensslconf.h>
|
| 25 |
+
|
| 26 |
+
# ifndef OPENSSL_NO_CMS
|
| 27 |
+
# include <openssl/x509.h>
|
| 28 |
+
# include <openssl/x509v3.h>
|
| 29 |
+
# include <openssl/cmserr.h>
|
| 30 |
+
# ifdef __cplusplus
|
| 31 |
+
extern "C" {
|
| 32 |
+
# endif
|
| 33 |
+
|
| 34 |
+
typedef struct CMS_EnvelopedData_st CMS_EnvelopedData;
|
| 35 |
+
typedef struct CMS_ContentInfo_st CMS_ContentInfo;
|
| 36 |
+
typedef struct CMS_SignerInfo_st CMS_SignerInfo;
|
| 37 |
+
typedef struct CMS_SignedData_st CMS_SignedData;
|
| 38 |
+
typedef struct CMS_CertificateChoices CMS_CertificateChoices;
|
| 39 |
+
typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
|
| 40 |
+
typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
|
| 41 |
+
typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
|
| 42 |
+
typedef struct CMS_Receipt_st CMS_Receipt;
|
| 43 |
+
typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
|
| 44 |
+
typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
|
| 45 |
+
|
| 46 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CMS_SignerInfo, CMS_SignerInfo, CMS_SignerInfo)
|
| 47 |
+
#define sk_CMS_SignerInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_SignerInfo_sk_type(sk))
|
| 48 |
+
#define sk_CMS_SignerInfo_value(sk, idx) ((CMS_SignerInfo *)OPENSSL_sk_value(ossl_check_const_CMS_SignerInfo_sk_type(sk), (idx)))
|
| 49 |
+
#define sk_CMS_SignerInfo_new(cmp) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new(ossl_check_CMS_SignerInfo_compfunc_type(cmp)))
|
| 50 |
+
#define sk_CMS_SignerInfo_new_null() ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new_null())
|
| 51 |
+
#define sk_CMS_SignerInfo_new_reserve(cmp, n) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new_reserve(ossl_check_CMS_SignerInfo_compfunc_type(cmp), (n)))
|
| 52 |
+
#define sk_CMS_SignerInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_SignerInfo_sk_type(sk), (n))
|
| 53 |
+
#define sk_CMS_SignerInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_SignerInfo_sk_type(sk))
|
| 54 |
+
#define sk_CMS_SignerInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_SignerInfo_sk_type(sk))
|
| 55 |
+
#define sk_CMS_SignerInfo_delete(sk, i) ((CMS_SignerInfo *)OPENSSL_sk_delete(ossl_check_CMS_SignerInfo_sk_type(sk), (i)))
|
| 56 |
+
#define sk_CMS_SignerInfo_delete_ptr(sk, ptr) ((CMS_SignerInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr)))
|
| 57 |
+
#define sk_CMS_SignerInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
| 58 |
+
#define sk_CMS_SignerInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
| 59 |
+
#define sk_CMS_SignerInfo_pop(sk) ((CMS_SignerInfo *)OPENSSL_sk_pop(ossl_check_CMS_SignerInfo_sk_type(sk)))
|
| 60 |
+
#define sk_CMS_SignerInfo_shift(sk) ((CMS_SignerInfo *)OPENSSL_sk_shift(ossl_check_CMS_SignerInfo_sk_type(sk)))
|
| 61 |
+
#define sk_CMS_SignerInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_SignerInfo_sk_type(sk),ossl_check_CMS_SignerInfo_freefunc_type(freefunc))
|
| 62 |
+
#define sk_CMS_SignerInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), (idx))
|
| 63 |
+
#define sk_CMS_SignerInfo_set(sk, idx, ptr) ((CMS_SignerInfo *)OPENSSL_sk_set(ossl_check_CMS_SignerInfo_sk_type(sk), (idx), ossl_check_CMS_SignerInfo_type(ptr)))
|
| 64 |
+
#define sk_CMS_SignerInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
| 65 |
+
#define sk_CMS_SignerInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
| 66 |
+
#define sk_CMS_SignerInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), pnum)
|
| 67 |
+
#define sk_CMS_SignerInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_SignerInfo_sk_type(sk))
|
| 68 |
+
#define sk_CMS_SignerInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_SignerInfo_sk_type(sk))
|
| 69 |
+
#define sk_CMS_SignerInfo_dup(sk) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_SignerInfo_sk_type(sk)))
|
| 70 |
+
#define sk_CMS_SignerInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_copyfunc_type(copyfunc), ossl_check_CMS_SignerInfo_freefunc_type(freefunc)))
|
| 71 |
+
#define sk_CMS_SignerInfo_set_cmp_func(sk, cmp) ((sk_CMS_SignerInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_compfunc_type(cmp)))
|
| 72 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey)
|
| 73 |
+
#define sk_CMS_RecipientEncryptedKey_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 74 |
+
#define sk_CMS_RecipientEncryptedKey_value(sk, idx) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), (idx)))
|
| 75 |
+
#define sk_CMS_RecipientEncryptedKey_new(cmp) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp)))
|
| 76 |
+
#define sk_CMS_RecipientEncryptedKey_new_null() ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new_null())
|
| 77 |
+
#define sk_CMS_RecipientEncryptedKey_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp), (n)))
|
| 78 |
+
#define sk_CMS_RecipientEncryptedKey_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (n))
|
| 79 |
+
#define sk_CMS_RecipientEncryptedKey_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 80 |
+
#define sk_CMS_RecipientEncryptedKey_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 81 |
+
#define sk_CMS_RecipientEncryptedKey_delete(sk, i) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (i)))
|
| 82 |
+
#define sk_CMS_RecipientEncryptedKey_delete_ptr(sk, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr)))
|
| 83 |
+
#define sk_CMS_RecipientEncryptedKey_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
| 84 |
+
#define sk_CMS_RecipientEncryptedKey_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
| 85 |
+
#define sk_CMS_RecipientEncryptedKey_pop(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_pop(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)))
|
| 86 |
+
#define sk_CMS_RecipientEncryptedKey_shift(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_shift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)))
|
| 87 |
+
#define sk_CMS_RecipientEncryptedKey_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk),ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc))
|
| 88 |
+
#define sk_CMS_RecipientEncryptedKey_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), (idx))
|
| 89 |
+
#define sk_CMS_RecipientEncryptedKey_set(sk, idx, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_set(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (idx), ossl_check_CMS_RecipientEncryptedKey_type(ptr)))
|
| 90 |
+
#define sk_CMS_RecipientEncryptedKey_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
| 91 |
+
#define sk_CMS_RecipientEncryptedKey_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
| 92 |
+
#define sk_CMS_RecipientEncryptedKey_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), pnum)
|
| 93 |
+
#define sk_CMS_RecipientEncryptedKey_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 94 |
+
#define sk_CMS_RecipientEncryptedKey_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))
|
| 95 |
+
#define sk_CMS_RecipientEncryptedKey_dup(sk) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk)))
|
| 96 |
+
#define sk_CMS_RecipientEncryptedKey_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_copyfunc_type(copyfunc), ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc)))
|
| 97 |
+
#define sk_CMS_RecipientEncryptedKey_set_cmp_func(sk, cmp) ((sk_CMS_RecipientEncryptedKey_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp)))
|
| 98 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientInfo, CMS_RecipientInfo, CMS_RecipientInfo)
|
| 99 |
+
#define sk_CMS_RecipientInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
|
| 100 |
+
#define sk_CMS_RecipientInfo_value(sk, idx) ((CMS_RecipientInfo *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientInfo_sk_type(sk), (idx)))
|
| 101 |
+
#define sk_CMS_RecipientInfo_new(cmp) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new(ossl_check_CMS_RecipientInfo_compfunc_type(cmp)))
|
| 102 |
+
#define sk_CMS_RecipientInfo_new_null() ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new_null())
|
| 103 |
+
#define sk_CMS_RecipientInfo_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientInfo_compfunc_type(cmp), (n)))
|
| 104 |
+
#define sk_CMS_RecipientInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientInfo_sk_type(sk), (n))
|
| 105 |
+
#define sk_CMS_RecipientInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
| 106 |
+
#define sk_CMS_RecipientInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
| 107 |
+
#define sk_CMS_RecipientInfo_delete(sk, i) ((CMS_RecipientInfo *)OPENSSL_sk_delete(ossl_check_CMS_RecipientInfo_sk_type(sk), (i)))
|
| 108 |
+
#define sk_CMS_RecipientInfo_delete_ptr(sk, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr)))
|
| 109 |
+
#define sk_CMS_RecipientInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
| 110 |
+
#define sk_CMS_RecipientInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
| 111 |
+
#define sk_CMS_RecipientInfo_pop(sk) ((CMS_RecipientInfo *)OPENSSL_sk_pop(ossl_check_CMS_RecipientInfo_sk_type(sk)))
|
| 112 |
+
#define sk_CMS_RecipientInfo_shift(sk) ((CMS_RecipientInfo *)OPENSSL_sk_shift(ossl_check_CMS_RecipientInfo_sk_type(sk)))
|
| 113 |
+
#define sk_CMS_RecipientInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientInfo_sk_type(sk),ossl_check_CMS_RecipientInfo_freefunc_type(freefunc))
|
| 114 |
+
#define sk_CMS_RecipientInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), (idx))
|
| 115 |
+
#define sk_CMS_RecipientInfo_set(sk, idx, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_set(ossl_check_CMS_RecipientInfo_sk_type(sk), (idx), ossl_check_CMS_RecipientInfo_type(ptr)))
|
| 116 |
+
#define sk_CMS_RecipientInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
| 117 |
+
#define sk_CMS_RecipientInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
| 118 |
+
#define sk_CMS_RecipientInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), pnum)
|
| 119 |
+
#define sk_CMS_RecipientInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
| 120 |
+
#define sk_CMS_RecipientInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
|
| 121 |
+
#define sk_CMS_RecipientInfo_dup(sk) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientInfo_sk_type(sk)))
|
| 122 |
+
#define sk_CMS_RecipientInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_copyfunc_type(copyfunc), ossl_check_CMS_RecipientInfo_freefunc_type(freefunc)))
|
| 123 |
+
#define sk_CMS_RecipientInfo_set_cmp_func(sk, cmp) ((sk_CMS_RecipientInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_compfunc_type(cmp)))
|
| 124 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RevocationInfoChoice, CMS_RevocationInfoChoice, CMS_RevocationInfoChoice)
|
| 125 |
+
#define sk_CMS_RevocationInfoChoice_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))
|
| 126 |
+
#define sk_CMS_RevocationInfoChoice_value(sk, idx) ((CMS_RevocationInfoChoice *)OPENSSL_sk_value(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), (idx)))
|
| 127 |
+
#define sk_CMS_RevocationInfoChoice_new(cmp) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp)))
|
| 128 |
+
#define sk_CMS_RevocationInfoChoice_new_null() ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new_null())
|
| 129 |
+
#define sk_CMS_RevocationInfoChoice_new_reserve(cmp, n) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp), (n)))
|
| 130 |
+
#define sk_CMS_RevocationInfoChoice_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (n))
|
| 131 |
+
#define sk_CMS_RevocationInfoChoice_free(sk) OPENSSL_sk_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
| 132 |
+
#define sk_CMS_RevocationInfoChoice_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
| 133 |
+
#define sk_CMS_RevocationInfoChoice_delete(sk, i) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (i)))
|
| 134 |
+
#define sk_CMS_RevocationInfoChoice_delete_ptr(sk, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr)))
|
| 135 |
+
#define sk_CMS_RevocationInfoChoice_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
| 136 |
+
#define sk_CMS_RevocationInfoChoice_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
| 137 |
+
#define sk_CMS_RevocationInfoChoice_pop(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_pop(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)))
|
| 138 |
+
#define sk_CMS_RevocationInfoChoice_shift(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_shift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)))
|
| 139 |
+
#define sk_CMS_RevocationInfoChoice_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk),ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc))
|
| 140 |
+
#define sk_CMS_RevocationInfoChoice_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), (idx))
|
| 141 |
+
#define sk_CMS_RevocationInfoChoice_set(sk, idx, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_set(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (idx), ossl_check_CMS_RevocationInfoChoice_type(ptr)))
|
| 142 |
+
#define sk_CMS_RevocationInfoChoice_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
| 143 |
+
#define sk_CMS_RevocationInfoChoice_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
| 144 |
+
#define sk_CMS_RevocationInfoChoice_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), pnum)
|
| 145 |
+
#define sk_CMS_RevocationInfoChoice_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
| 146 |
+
#define sk_CMS_RevocationInfoChoice_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))
|
| 147 |
+
#define sk_CMS_RevocationInfoChoice_dup(sk) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_dup(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk)))
|
| 148 |
+
#define sk_CMS_RevocationInfoChoice_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_copyfunc_type(copyfunc), ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc)))
|
| 149 |
+
#define sk_CMS_RevocationInfoChoice_set_cmp_func(sk, cmp) ((sk_CMS_RevocationInfoChoice_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp)))
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
DECLARE_ASN1_ITEM(CMS_EnvelopedData)
|
| 153 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(CMS_SignedData)
|
| 154 |
+
DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
|
| 155 |
+
DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
|
| 156 |
+
DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
| 157 |
+
|
| 158 |
+
DECLARE_ASN1_DUP_FUNCTION(CMS_EnvelopedData)
|
| 159 |
+
|
| 160 |
+
CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 161 |
+
|
| 162 |
+
# define CMS_SIGNERINFO_ISSUER_SERIAL 0
|
| 163 |
+
# define CMS_SIGNERINFO_KEYIDENTIFIER 1
|
| 164 |
+
|
| 165 |
+
# define CMS_RECIPINFO_NONE -1
|
| 166 |
+
# define CMS_RECIPINFO_TRANS 0
|
| 167 |
+
# define CMS_RECIPINFO_AGREE 1
|
| 168 |
+
# define CMS_RECIPINFO_KEK 2
|
| 169 |
+
# define CMS_RECIPINFO_PASS 3
|
| 170 |
+
# define CMS_RECIPINFO_OTHER 4
|
| 171 |
+
|
| 172 |
+
/* S/MIME related flags */
|
| 173 |
+
|
| 174 |
+
# define CMS_TEXT 0x1
|
| 175 |
+
# define CMS_NOCERTS 0x2
|
| 176 |
+
# define CMS_NO_CONTENT_VERIFY 0x4
|
| 177 |
+
# define CMS_NO_ATTR_VERIFY 0x8
|
| 178 |
+
# define CMS_NOSIGS \
|
| 179 |
+
(CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
|
| 180 |
+
# define CMS_NOINTERN 0x10
|
| 181 |
+
# define CMS_NO_SIGNER_CERT_VERIFY 0x20
|
| 182 |
+
# define CMS_NOVERIFY 0x20
|
| 183 |
+
# define CMS_DETACHED 0x40
|
| 184 |
+
# define CMS_BINARY 0x80
|
| 185 |
+
# define CMS_NOATTR 0x100
|
| 186 |
+
# define CMS_NOSMIMECAP 0x200
|
| 187 |
+
# define CMS_NOOLDMIMETYPE 0x400
|
| 188 |
+
# define CMS_CRLFEOL 0x800
|
| 189 |
+
# define CMS_STREAM 0x1000
|
| 190 |
+
# define CMS_NOCRL 0x2000
|
| 191 |
+
# define CMS_PARTIAL 0x4000
|
| 192 |
+
# define CMS_REUSE_DIGEST 0x8000
|
| 193 |
+
# define CMS_USE_KEYID 0x10000
|
| 194 |
+
# define CMS_DEBUG_DECRYPT 0x20000
|
| 195 |
+
# define CMS_KEY_PARAM 0x40000
|
| 196 |
+
# define CMS_ASCIICRLF 0x80000
|
| 197 |
+
# define CMS_CADES 0x100000
|
| 198 |
+
# define CMS_USE_ORIGINATOR_KEYID 0x200000
|
| 199 |
+
# define CMS_NO_SIGNING_TIME 0x400000
|
| 200 |
+
|
| 201 |
+
const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
|
| 202 |
+
|
| 203 |
+
BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
|
| 204 |
+
int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
|
| 205 |
+
|
| 206 |
+
ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
|
| 207 |
+
int CMS_is_detached(CMS_ContentInfo *cms);
|
| 208 |
+
int CMS_set_detached(CMS_ContentInfo *cms, int detached);
|
| 209 |
+
|
| 210 |
+
# ifdef OPENSSL_PEM_H
|
| 211 |
+
DECLARE_PEM_rw(CMS, CMS_ContentInfo)
|
| 212 |
+
# endif
|
| 213 |
+
int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
|
| 214 |
+
CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
|
| 215 |
+
int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
|
| 216 |
+
|
| 217 |
+
BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
|
| 218 |
+
int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
|
| 219 |
+
int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
|
| 220 |
+
int flags);
|
| 221 |
+
CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
|
| 222 |
+
CMS_ContentInfo *SMIME_read_CMS_ex(BIO *bio, int flags, BIO **bcont, CMS_ContentInfo **ci);
|
| 223 |
+
int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
|
| 224 |
+
|
| 225 |
+
int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
|
| 226 |
+
unsigned int flags);
|
| 227 |
+
int CMS_final_digest(CMS_ContentInfo *cms,
|
| 228 |
+
const unsigned char *md, unsigned int mdlen, BIO *dcont,
|
| 229 |
+
unsigned int flags);
|
| 230 |
+
|
| 231 |
+
CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
|
| 232 |
+
STACK_OF(X509) *certs, BIO *data,
|
| 233 |
+
unsigned int flags);
|
| 234 |
+
CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
|
| 235 |
+
STACK_OF(X509) *certs, BIO *data,
|
| 236 |
+
unsigned int flags, OSSL_LIB_CTX *libctx,
|
| 237 |
+
const char *propq);
|
| 238 |
+
|
| 239 |
+
CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
|
| 240 |
+
X509 *signcert, EVP_PKEY *pkey,
|
| 241 |
+
STACK_OF(X509) *certs, unsigned int flags);
|
| 242 |
+
|
| 243 |
+
int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
|
| 244 |
+
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
|
| 245 |
+
CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
|
| 246 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 247 |
+
|
| 248 |
+
int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
|
| 249 |
+
unsigned int flags);
|
| 250 |
+
CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
|
| 251 |
+
unsigned int flags);
|
| 252 |
+
CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
|
| 253 |
+
unsigned int flags, OSSL_LIB_CTX *libctx,
|
| 254 |
+
const char *propq);
|
| 255 |
+
|
| 256 |
+
int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
|
| 257 |
+
const unsigned char *key, size_t keylen,
|
| 258 |
+
BIO *dcont, BIO *out, unsigned int flags);
|
| 259 |
+
CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
|
| 260 |
+
const unsigned char *key,
|
| 261 |
+
size_t keylen, unsigned int flags);
|
| 262 |
+
CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher,
|
| 263 |
+
const unsigned char *key,
|
| 264 |
+
size_t keylen, unsigned int flags,
|
| 265 |
+
OSSL_LIB_CTX *libctx,
|
| 266 |
+
const char *propq);
|
| 267 |
+
|
| 268 |
+
int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
|
| 269 |
+
const unsigned char *key, size_t keylen);
|
| 270 |
+
|
| 271 |
+
int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
|
| 272 |
+
X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
|
| 273 |
+
|
| 274 |
+
int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
|
| 275 |
+
STACK_OF(X509) *certs,
|
| 276 |
+
X509_STORE *store, unsigned int flags);
|
| 277 |
+
|
| 278 |
+
STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
|
| 279 |
+
|
| 280 |
+
CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
|
| 281 |
+
const EVP_CIPHER *cipher, unsigned int flags);
|
| 282 |
+
CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
|
| 283 |
+
const EVP_CIPHER *cipher, unsigned int flags,
|
| 284 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 285 |
+
|
| 286 |
+
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
|
| 287 |
+
BIO *dcont, BIO *out, unsigned int flags);
|
| 288 |
+
|
| 289 |
+
int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
|
| 290 |
+
int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk,
|
| 291 |
+
X509 *cert, X509 *peer);
|
| 292 |
+
int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
|
| 293 |
+
unsigned char *key, size_t keylen,
|
| 294 |
+
const unsigned char *id, size_t idlen);
|
| 295 |
+
int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
|
| 296 |
+
unsigned char *pass, ossl_ssize_t passlen);
|
| 297 |
+
|
| 298 |
+
STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
|
| 299 |
+
int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
|
| 300 |
+
EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
|
| 301 |
+
CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher);
|
| 302 |
+
CMS_ContentInfo *
|
| 303 |
+
CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
|
| 304 |
+
const char *propq);
|
| 305 |
+
CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
|
| 306 |
+
CMS_ContentInfo *CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher,
|
| 307 |
+
OSSL_LIB_CTX *libctx,
|
| 308 |
+
const char *propq);
|
| 309 |
+
BIO *CMS_EnvelopedData_decrypt(CMS_EnvelopedData *env, BIO *detached_data,
|
| 310 |
+
EVP_PKEY *pkey, X509 *cert,
|
| 311 |
+
ASN1_OCTET_STRING *secret, unsigned int flags,
|
| 312 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 313 |
+
|
| 314 |
+
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
|
| 315 |
+
X509 *recip, unsigned int flags);
|
| 316 |
+
CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip,
|
| 317 |
+
EVP_PKEY *originatorPrivKey, X509 * originator, unsigned int flags);
|
| 318 |
+
int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
|
| 319 |
+
int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
|
| 320 |
+
int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
|
| 321 |
+
EVP_PKEY **pk, X509 **recip,
|
| 322 |
+
X509_ALGOR **palg);
|
| 323 |
+
int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
|
| 324 |
+
ASN1_OCTET_STRING **keyid,
|
| 325 |
+
X509_NAME **issuer,
|
| 326 |
+
ASN1_INTEGER **sno);
|
| 327 |
+
|
| 328 |
+
CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
|
| 329 |
+
unsigned char *key, size_t keylen,
|
| 330 |
+
unsigned char *id, size_t idlen,
|
| 331 |
+
ASN1_GENERALIZEDTIME *date,
|
| 332 |
+
ASN1_OBJECT *otherTypeId,
|
| 333 |
+
ASN1_TYPE *otherType);
|
| 334 |
+
|
| 335 |
+
int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
|
| 336 |
+
X509_ALGOR **palg,
|
| 337 |
+
ASN1_OCTET_STRING **pid,
|
| 338 |
+
ASN1_GENERALIZEDTIME **pdate,
|
| 339 |
+
ASN1_OBJECT **potherid,
|
| 340 |
+
ASN1_TYPE **pothertype);
|
| 341 |
+
|
| 342 |
+
int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
|
| 343 |
+
unsigned char *key, size_t keylen);
|
| 344 |
+
|
| 345 |
+
int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
|
| 346 |
+
const unsigned char *id, size_t idlen);
|
| 347 |
+
|
| 348 |
+
int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
|
| 349 |
+
unsigned char *pass,
|
| 350 |
+
ossl_ssize_t passlen);
|
| 351 |
+
|
| 352 |
+
CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
|
| 353 |
+
int iter, int wrap_nid,
|
| 354 |
+
int pbe_nid,
|
| 355 |
+
unsigned char *pass,
|
| 356 |
+
ossl_ssize_t passlen,
|
| 357 |
+
const EVP_CIPHER *kekciph);
|
| 358 |
+
|
| 359 |
+
int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
| 360 |
+
int CMS_RecipientInfo_encrypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
| 361 |
+
|
| 362 |
+
int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
|
| 363 |
+
unsigned int flags);
|
| 364 |
+
CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
|
| 365 |
+
|
| 366 |
+
int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
|
| 367 |
+
const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
|
| 368 |
+
|
| 369 |
+
CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
|
| 370 |
+
int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
|
| 371 |
+
int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
|
| 372 |
+
STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
|
| 373 |
+
|
| 374 |
+
CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
|
| 375 |
+
int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
|
| 376 |
+
int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
|
| 377 |
+
STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
|
| 378 |
+
|
| 379 |
+
int CMS_SignedData_init(CMS_ContentInfo *cms);
|
| 380 |
+
CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
|
| 381 |
+
X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
|
| 382 |
+
unsigned int flags);
|
| 383 |
+
EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
|
| 384 |
+
EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
|
| 385 |
+
STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
|
| 386 |
+
|
| 387 |
+
void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
|
| 388 |
+
int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
|
| 389 |
+
ASN1_OCTET_STRING **keyid,
|
| 390 |
+
X509_NAME **issuer, ASN1_INTEGER **sno);
|
| 391 |
+
int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
|
| 392 |
+
int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
|
| 393 |
+
unsigned int flags);
|
| 394 |
+
void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
|
| 395 |
+
X509 **signer, X509_ALGOR **pdig,
|
| 396 |
+
X509_ALGOR **psig);
|
| 397 |
+
ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
|
| 398 |
+
int CMS_SignerInfo_sign(CMS_SignerInfo *si);
|
| 399 |
+
int CMS_SignerInfo_verify(CMS_SignerInfo *si);
|
| 400 |
+
int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
|
| 401 |
+
BIO *CMS_SignedData_verify(CMS_SignedData *sd, BIO *detached_data,
|
| 402 |
+
STACK_OF(X509) *scerts, X509_STORE *store,
|
| 403 |
+
STACK_OF(X509) *extra, STACK_OF(X509_CRL) *crls,
|
| 404 |
+
unsigned int flags,
|
| 405 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 406 |
+
|
| 407 |
+
int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
|
| 408 |
+
int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
|
| 409 |
+
int algnid, int keysize);
|
| 410 |
+
int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
|
| 411 |
+
|
| 412 |
+
int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
|
| 413 |
+
int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
|
| 414 |
+
int lastpos);
|
| 415 |
+
int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj,
|
| 416 |
+
int lastpos);
|
| 417 |
+
X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
|
| 418 |
+
X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
|
| 419 |
+
int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
|
| 420 |
+
int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
|
| 421 |
+
const ASN1_OBJECT *obj, int type,
|
| 422 |
+
const void *bytes, int len);
|
| 423 |
+
int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
|
| 424 |
+
int nid, int type,
|
| 425 |
+
const void *bytes, int len);
|
| 426 |
+
int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
|
| 427 |
+
const char *attrname, int type,
|
| 428 |
+
const void *bytes, int len);
|
| 429 |
+
void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
|
| 430 |
+
const ASN1_OBJECT *oid,
|
| 431 |
+
int lastpos, int type);
|
| 432 |
+
|
| 433 |
+
int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
|
| 434 |
+
int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
|
| 435 |
+
int lastpos);
|
| 436 |
+
int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si,
|
| 437 |
+
const ASN1_OBJECT *obj, int lastpos);
|
| 438 |
+
X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
|
| 439 |
+
X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
|
| 440 |
+
int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
|
| 441 |
+
int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
|
| 442 |
+
const ASN1_OBJECT *obj, int type,
|
| 443 |
+
const void *bytes, int len);
|
| 444 |
+
int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
|
| 445 |
+
int nid, int type,
|
| 446 |
+
const void *bytes, int len);
|
| 447 |
+
int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
|
| 448 |
+
const char *attrname, int type,
|
| 449 |
+
const void *bytes, int len);
|
| 450 |
+
void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
|
| 451 |
+
int lastpos, int type);
|
| 452 |
+
|
| 453 |
+
int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
|
| 454 |
+
CMS_ReceiptRequest *CMS_ReceiptRequest_create0(
|
| 455 |
+
unsigned char *id, int idlen, int allorfirst,
|
| 456 |
+
STACK_OF(GENERAL_NAMES) *receiptList,
|
| 457 |
+
STACK_OF(GENERAL_NAMES) *receiptsTo);
|
| 458 |
+
CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
|
| 459 |
+
unsigned char *id, int idlen, int allorfirst,
|
| 460 |
+
STACK_OF(GENERAL_NAMES) *receiptList,
|
| 461 |
+
STACK_OF(GENERAL_NAMES) *receiptsTo,
|
| 462 |
+
OSSL_LIB_CTX *libctx);
|
| 463 |
+
|
| 464 |
+
int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
|
| 465 |
+
void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
|
| 466 |
+
ASN1_STRING **pcid,
|
| 467 |
+
int *pallorfirst,
|
| 468 |
+
STACK_OF(GENERAL_NAMES) **plist,
|
| 469 |
+
STACK_OF(GENERAL_NAMES) **prto);
|
| 470 |
+
int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
|
| 471 |
+
X509_ALGOR **palg,
|
| 472 |
+
ASN1_OCTET_STRING **pukm);
|
| 473 |
+
STACK_OF(CMS_RecipientEncryptedKey)
|
| 474 |
+
*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
|
| 475 |
+
|
| 476 |
+
int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
|
| 477 |
+
X509_ALGOR **pubalg,
|
| 478 |
+
ASN1_BIT_STRING **pubkey,
|
| 479 |
+
ASN1_OCTET_STRING **keyid,
|
| 480 |
+
X509_NAME **issuer,
|
| 481 |
+
ASN1_INTEGER **sno);
|
| 482 |
+
|
| 483 |
+
int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
|
| 484 |
+
|
| 485 |
+
int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
|
| 486 |
+
ASN1_OCTET_STRING **keyid,
|
| 487 |
+
ASN1_GENERALIZEDTIME **tm,
|
| 488 |
+
CMS_OtherKeyAttribute **other,
|
| 489 |
+
X509_NAME **issuer, ASN1_INTEGER **sno);
|
| 490 |
+
int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
|
| 491 |
+
X509 *cert);
|
| 492 |
+
int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
|
| 493 |
+
int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *peer);
|
| 494 |
+
EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
|
| 495 |
+
int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
|
| 496 |
+
CMS_RecipientInfo *ri,
|
| 497 |
+
CMS_RecipientEncryptedKey *rek);
|
| 498 |
+
|
| 499 |
+
int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
|
| 500 |
+
ASN1_OCTET_STRING *ukm, int keylen);
|
| 501 |
+
|
| 502 |
+
/* Backward compatibility for spelling errors. */
|
| 503 |
+
# define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM
|
| 504 |
+
# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \
|
| 505 |
+
CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
|
| 506 |
+
|
| 507 |
+
# ifdef __cplusplus
|
| 508 |
+
}
|
| 509 |
+
# endif
|
| 510 |
+
# endif
|
| 511 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/comp.h
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#ifndef OPENSSL_COMP_H
|
| 13 |
+
# define OPENSSL_COMP_H
|
| 14 |
+
# pragma once
|
| 15 |
+
|
| 16 |
+
# include <openssl/macros.h>
|
| 17 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 18 |
+
# define HEADER_COMP_H
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
# include <openssl/opensslconf.h>
|
| 22 |
+
|
| 23 |
+
# include <openssl/crypto.h>
|
| 24 |
+
# include <openssl/comperr.h>
|
| 25 |
+
# ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
# endif
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
# ifndef OPENSSL_NO_COMP
|
| 32 |
+
|
| 33 |
+
COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
|
| 34 |
+
const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
|
| 35 |
+
int COMP_CTX_get_type(const COMP_CTX* comp);
|
| 36 |
+
int COMP_get_type(const COMP_METHOD *meth);
|
| 37 |
+
const char *COMP_get_name(const COMP_METHOD *meth);
|
| 38 |
+
void COMP_CTX_free(COMP_CTX *ctx);
|
| 39 |
+
|
| 40 |
+
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
|
| 41 |
+
unsigned char *in, int ilen);
|
| 42 |
+
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
|
| 43 |
+
unsigned char *in, int ilen);
|
| 44 |
+
|
| 45 |
+
COMP_METHOD *COMP_zlib(void);
|
| 46 |
+
COMP_METHOD *COMP_zlib_oneshot(void);
|
| 47 |
+
COMP_METHOD *COMP_brotli(void);
|
| 48 |
+
COMP_METHOD *COMP_brotli_oneshot(void);
|
| 49 |
+
COMP_METHOD *COMP_zstd(void);
|
| 50 |
+
COMP_METHOD *COMP_zstd_oneshot(void);
|
| 51 |
+
|
| 52 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 53 |
+
# define COMP_zlib_cleanup() while(0) continue
|
| 54 |
+
# endif
|
| 55 |
+
|
| 56 |
+
# ifdef OPENSSL_BIO_H
|
| 57 |
+
const BIO_METHOD *BIO_f_zlib(void);
|
| 58 |
+
const BIO_METHOD *BIO_f_brotli(void);
|
| 59 |
+
const BIO_METHOD *BIO_f_zstd(void);
|
| 60 |
+
# endif
|
| 61 |
+
|
| 62 |
+
# endif
|
| 63 |
+
|
| 64 |
+
typedef struct ssl_comp_st SSL_COMP;
|
| 65 |
+
|
| 66 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SSL_COMP, SSL_COMP, SSL_COMP)
|
| 67 |
+
#define sk_SSL_COMP_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_COMP_sk_type(sk))
|
| 68 |
+
#define sk_SSL_COMP_value(sk, idx) ((SSL_COMP *)OPENSSL_sk_value(ossl_check_const_SSL_COMP_sk_type(sk), (idx)))
|
| 69 |
+
#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)))
|
| 70 |
+
#define sk_SSL_COMP_new_null() ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new_null())
|
| 71 |
+
#define sk_SSL_COMP_new_reserve(cmp, n) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new_reserve(ossl_check_SSL_COMP_compfunc_type(cmp), (n)))
|
| 72 |
+
#define sk_SSL_COMP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SSL_COMP_sk_type(sk), (n))
|
| 73 |
+
#define sk_SSL_COMP_free(sk) OPENSSL_sk_free(ossl_check_SSL_COMP_sk_type(sk))
|
| 74 |
+
#define sk_SSL_COMP_zero(sk) OPENSSL_sk_zero(ossl_check_SSL_COMP_sk_type(sk))
|
| 75 |
+
#define sk_SSL_COMP_delete(sk, i) ((SSL_COMP *)OPENSSL_sk_delete(ossl_check_SSL_COMP_sk_type(sk), (i)))
|
| 76 |
+
#define sk_SSL_COMP_delete_ptr(sk, ptr) ((SSL_COMP *)OPENSSL_sk_delete_ptr(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr)))
|
| 77 |
+
#define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
|
| 78 |
+
#define sk_SSL_COMP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
|
| 79 |
+
#define sk_SSL_COMP_pop(sk) ((SSL_COMP *)OPENSSL_sk_pop(ossl_check_SSL_COMP_sk_type(sk)))
|
| 80 |
+
#define sk_SSL_COMP_shift(sk) ((SSL_COMP *)OPENSSL_sk_shift(ossl_check_SSL_COMP_sk_type(sk)))
|
| 81 |
+
#define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk),ossl_check_SSL_COMP_freefunc_type(freefunc))
|
| 82 |
+
#define sk_SSL_COMP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr), (idx))
|
| 83 |
+
#define sk_SSL_COMP_set(sk, idx, ptr) ((SSL_COMP *)OPENSSL_sk_set(ossl_check_SSL_COMP_sk_type(sk), (idx), ossl_check_SSL_COMP_type(ptr)))
|
| 84 |
+
#define sk_SSL_COMP_find(sk, ptr) OPENSSL_sk_find(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
|
| 85 |
+
#define sk_SSL_COMP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
|
| 86 |
+
#define sk_SSL_COMP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr), pnum)
|
| 87 |
+
#define sk_SSL_COMP_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_COMP_sk_type(sk))
|
| 88 |
+
#define sk_SSL_COMP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SSL_COMP_sk_type(sk))
|
| 89 |
+
#define sk_SSL_COMP_dup(sk) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_dup(ossl_check_const_SSL_COMP_sk_type(sk)))
|
| 90 |
+
#define sk_SSL_COMP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_deep_copy(ossl_check_const_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_copyfunc_type(copyfunc), ossl_check_SSL_COMP_freefunc_type(freefunc)))
|
| 91 |
+
#define sk_SSL_COMP_set_cmp_func(sk, cmp) ((sk_SSL_COMP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/conf.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_CONF_H
|
| 16 |
+
# define OPENSSL_CONF_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_CONF_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/bio.h>
|
| 25 |
+
# include <openssl/lhash.h>
|
| 26 |
+
# include <openssl/safestack.h>
|
| 27 |
+
# include <openssl/e_os2.h>
|
| 28 |
+
# include <openssl/types.h>
|
| 29 |
+
# include <openssl/conferr.h>
|
| 30 |
+
# ifndef OPENSSL_NO_STDIO
|
| 31 |
+
# include <stdio.h>
|
| 32 |
+
# endif
|
| 33 |
+
|
| 34 |
+
#ifdef __cplusplus
|
| 35 |
+
extern "C" {
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
typedef struct {
|
| 39 |
+
char *section;
|
| 40 |
+
char *name;
|
| 41 |
+
char *value;
|
| 42 |
+
} CONF_VALUE;
|
| 43 |
+
|
| 44 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CONF_VALUE, CONF_VALUE, CONF_VALUE)
|
| 45 |
+
#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
|
| 46 |
+
#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
|
| 47 |
+
#define sk_CONF_VALUE_new(cmp) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new(ossl_check_CONF_VALUE_compfunc_type(cmp)))
|
| 48 |
+
#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
|
| 49 |
+
#define sk_CONF_VALUE_new_reserve(cmp, n) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_CONF_VALUE_compfunc_type(cmp), (n)))
|
| 50 |
+
#define sk_CONF_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CONF_VALUE_sk_type(sk), (n))
|
| 51 |
+
#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
|
| 52 |
+
#define sk_CONF_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_CONF_VALUE_sk_type(sk))
|
| 53 |
+
#define sk_CONF_VALUE_delete(sk, i) ((CONF_VALUE *)OPENSSL_sk_delete(ossl_check_CONF_VALUE_sk_type(sk), (i)))
|
| 54 |
+
#define sk_CONF_VALUE_delete_ptr(sk, ptr) ((CONF_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)))
|
| 55 |
+
#define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
| 56 |
+
#define sk_CONF_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
| 57 |
+
#define sk_CONF_VALUE_pop(sk) ((CONF_VALUE *)OPENSSL_sk_pop(ossl_check_CONF_VALUE_sk_type(sk)))
|
| 58 |
+
#define sk_CONF_VALUE_shift(sk) ((CONF_VALUE *)OPENSSL_sk_shift(ossl_check_CONF_VALUE_sk_type(sk)))
|
| 59 |
+
#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk),ossl_check_CONF_VALUE_freefunc_type(freefunc))
|
| 60 |
+
#define sk_CONF_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), (idx))
|
| 61 |
+
#define sk_CONF_VALUE_set(sk, idx, ptr) ((CONF_VALUE *)OPENSSL_sk_set(ossl_check_CONF_VALUE_sk_type(sk), (idx), ossl_check_CONF_VALUE_type(ptr)))
|
| 62 |
+
#define sk_CONF_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
| 63 |
+
#define sk_CONF_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
| 64 |
+
#define sk_CONF_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), pnum)
|
| 65 |
+
#define sk_CONF_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_CONF_VALUE_sk_type(sk))
|
| 66 |
+
#define sk_CONF_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CONF_VALUE_sk_type(sk))
|
| 67 |
+
#define sk_CONF_VALUE_dup(sk) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_dup(ossl_check_const_CONF_VALUE_sk_type(sk)))
|
| 68 |
+
#define sk_CONF_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_copyfunc_type(copyfunc), ossl_check_CONF_VALUE_freefunc_type(freefunc)))
|
| 69 |
+
#define sk_CONF_VALUE_set_cmp_func(sk, cmp) ((sk_CONF_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_compfunc_type(cmp)))
|
| 70 |
+
DEFINE_LHASH_OF_INTERNAL(CONF_VALUE);
|
| 71 |
+
#define lh_CONF_VALUE_new(hfn, cmp) ((LHASH_OF(CONF_VALUE) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_CONF_VALUE_lh_hashfunc_type(hfn), ossl_check_CONF_VALUE_lh_compfunc_type(cmp)), lh_CONF_VALUE_hash_thunk, lh_CONF_VALUE_comp_thunk, lh_CONF_VALUE_doall_thunk, lh_CONF_VALUE_doall_arg_thunk))
|
| 72 |
+
#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
|
| 73 |
+
#define lh_CONF_VALUE_flush(lh) OPENSSL_LH_flush(ossl_check_CONF_VALUE_lh_type(lh))
|
| 74 |
+
#define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr)))
|
| 75 |
+
#define lh_CONF_VALUE_delete(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_delete(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
|
| 76 |
+
#define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
|
| 77 |
+
#define lh_CONF_VALUE_error(lh) OPENSSL_LH_error(ossl_check_CONF_VALUE_lh_type(lh))
|
| 78 |
+
#define lh_CONF_VALUE_num_items(lh) OPENSSL_LH_num_items(ossl_check_CONF_VALUE_lh_type(lh))
|
| 79 |
+
#define lh_CONF_VALUE_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
| 80 |
+
#define lh_CONF_VALUE_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
| 81 |
+
#define lh_CONF_VALUE_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
| 82 |
+
#define lh_CONF_VALUE_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_CONF_VALUE_lh_type(lh))
|
| 83 |
+
#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
|
| 84 |
+
#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
struct conf_st;
|
| 88 |
+
struct conf_method_st;
|
| 89 |
+
typedef struct conf_method_st CONF_METHOD;
|
| 90 |
+
|
| 91 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 92 |
+
# include <openssl/conftypes.h>
|
| 93 |
+
# endif
|
| 94 |
+
|
| 95 |
+
/* Module definitions */
|
| 96 |
+
typedef struct conf_imodule_st CONF_IMODULE;
|
| 97 |
+
typedef struct conf_module_st CONF_MODULE;
|
| 98 |
+
|
| 99 |
+
STACK_OF(CONF_MODULE);
|
| 100 |
+
STACK_OF(CONF_IMODULE);
|
| 101 |
+
|
| 102 |
+
/* DSO module function typedefs */
|
| 103 |
+
typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
|
| 104 |
+
typedef void conf_finish_func (CONF_IMODULE *md);
|
| 105 |
+
|
| 106 |
+
# define CONF_MFLAGS_IGNORE_ERRORS 0x1
|
| 107 |
+
# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
|
| 108 |
+
# define CONF_MFLAGS_SILENT 0x4
|
| 109 |
+
# define CONF_MFLAGS_NO_DSO 0x8
|
| 110 |
+
# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
|
| 111 |
+
# define CONF_MFLAGS_DEFAULT_SECTION 0x20
|
| 112 |
+
|
| 113 |
+
int CONF_set_default_method(CONF_METHOD *meth);
|
| 114 |
+
void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
|
| 115 |
+
LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
|
| 116 |
+
long *eline);
|
| 117 |
+
# ifndef OPENSSL_NO_STDIO
|
| 118 |
+
LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
|
| 119 |
+
long *eline);
|
| 120 |
+
# endif
|
| 121 |
+
LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
|
| 122 |
+
long *eline);
|
| 123 |
+
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
|
| 124 |
+
const char *section);
|
| 125 |
+
char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
|
| 126 |
+
const char *name);
|
| 127 |
+
long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
|
| 128 |
+
const char *name);
|
| 129 |
+
void CONF_free(LHASH_OF(CONF_VALUE) *conf);
|
| 130 |
+
#ifndef OPENSSL_NO_STDIO
|
| 131 |
+
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
|
| 132 |
+
#endif
|
| 133 |
+
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
|
| 134 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 135 |
+
OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name);
|
| 136 |
+
#endif
|
| 137 |
+
|
| 138 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 139 |
+
# define OPENSSL_no_config() \
|
| 140 |
+
OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
|
| 141 |
+
#endif
|
| 142 |
+
|
| 143 |
+
/*
|
| 144 |
+
* New conf code. The semantics are different from the functions above. If
|
| 145 |
+
* that wasn't the case, the above functions would have been replaced
|
| 146 |
+
*/
|
| 147 |
+
|
| 148 |
+
CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
|
| 149 |
+
OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf);
|
| 150 |
+
CONF *NCONF_new(CONF_METHOD *meth);
|
| 151 |
+
CONF_METHOD *NCONF_default(void);
|
| 152 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 153 |
+
OSSL_DEPRECATEDIN_3_0 CONF_METHOD *NCONF_WIN32(void);
|
| 154 |
+
#endif
|
| 155 |
+
void NCONF_free(CONF *conf);
|
| 156 |
+
void NCONF_free_data(CONF *conf);
|
| 157 |
+
|
| 158 |
+
int NCONF_load(CONF *conf, const char *file, long *eline);
|
| 159 |
+
# ifndef OPENSSL_NO_STDIO
|
| 160 |
+
int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
|
| 161 |
+
# endif
|
| 162 |
+
int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
|
| 163 |
+
STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *conf);
|
| 164 |
+
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
|
| 165 |
+
const char *section);
|
| 166 |
+
char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
|
| 167 |
+
int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
|
| 168 |
+
long *result);
|
| 169 |
+
#ifndef OPENSSL_NO_STDIO
|
| 170 |
+
int NCONF_dump_fp(const CONF *conf, FILE *out);
|
| 171 |
+
#endif
|
| 172 |
+
int NCONF_dump_bio(const CONF *conf, BIO *out);
|
| 173 |
+
|
| 174 |
+
#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
|
| 175 |
+
|
| 176 |
+
/* Module functions */
|
| 177 |
+
|
| 178 |
+
int CONF_modules_load(const CONF *cnf, const char *appname,
|
| 179 |
+
unsigned long flags);
|
| 180 |
+
int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
|
| 181 |
+
const char *appname, unsigned long flags);
|
| 182 |
+
int CONF_modules_load_file(const char *filename, const char *appname,
|
| 183 |
+
unsigned long flags);
|
| 184 |
+
void CONF_modules_unload(int all);
|
| 185 |
+
void CONF_modules_finish(void);
|
| 186 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 187 |
+
# define CONF_modules_free() while(0) continue
|
| 188 |
+
#endif
|
| 189 |
+
int CONF_module_add(const char *name, conf_init_func *ifunc,
|
| 190 |
+
conf_finish_func *ffunc);
|
| 191 |
+
|
| 192 |
+
const char *CONF_imodule_get_name(const CONF_IMODULE *md);
|
| 193 |
+
const char *CONF_imodule_get_value(const CONF_IMODULE *md);
|
| 194 |
+
void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
|
| 195 |
+
void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
|
| 196 |
+
CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
|
| 197 |
+
unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
|
| 198 |
+
void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
|
| 199 |
+
void *CONF_module_get_usr_data(CONF_MODULE *pmod);
|
| 200 |
+
void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
|
| 201 |
+
|
| 202 |
+
char *CONF_get1_default_config_file(void);
|
| 203 |
+
|
| 204 |
+
int CONF_parse_list(const char *list, int sep, int nospc,
|
| 205 |
+
int (*list_cb) (const char *elem, int len, void *usr),
|
| 206 |
+
void *arg);
|
| 207 |
+
|
| 208 |
+
void OPENSSL_load_builtin_modules(void);
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
# ifdef __cplusplus
|
| 212 |
+
}
|
| 213 |
+
# endif
|
| 214 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/configuration.h
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by configdata.pm from Configurations/common0.tmpl, Configurations/unix-Makefile.tmpl
|
| 4 |
+
* via Makefile.in
|
| 5 |
+
*
|
| 6 |
+
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 7 |
+
*
|
| 8 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 9 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 10 |
+
* in the file LICENSE in the source distribution or at
|
| 11 |
+
* https://www.openssl.org/source/license.html
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef OPENSSL_CONFIGURATION_H
|
| 15 |
+
# define OPENSSL_CONFIGURATION_H
|
| 16 |
+
# pragma once
|
| 17 |
+
|
| 18 |
+
# ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
# endif
|
| 21 |
+
|
| 22 |
+
# ifdef OPENSSL_ALGORITHM_DEFINES
|
| 23 |
+
# error OPENSSL_ALGORITHM_DEFINES no longer supported
|
| 24 |
+
# endif
|
| 25 |
+
|
| 26 |
+
/*
|
| 27 |
+
* OpenSSL was configured with the following options:
|
| 28 |
+
*/
|
| 29 |
+
|
| 30 |
+
# define OPENSSL_CONFIGURED_API 30500
|
| 31 |
+
# ifndef OPENSSL_RAND_SEED_OS
|
| 32 |
+
# define OPENSSL_RAND_SEED_OS
|
| 33 |
+
# endif
|
| 34 |
+
# ifndef OPENSSL_THREADS
|
| 35 |
+
# define OPENSSL_THREADS
|
| 36 |
+
# endif
|
| 37 |
+
# ifndef OPENSSL_NO_AFALGENG
|
| 38 |
+
# define OPENSSL_NO_AFALGENG
|
| 39 |
+
# endif
|
| 40 |
+
# ifndef OPENSSL_NO_ASAN
|
| 41 |
+
# define OPENSSL_NO_ASAN
|
| 42 |
+
# endif
|
| 43 |
+
# ifndef OPENSSL_NO_BROTLI
|
| 44 |
+
# define OPENSSL_NO_BROTLI
|
| 45 |
+
# endif
|
| 46 |
+
# ifndef OPENSSL_NO_BROTLI_DYNAMIC
|
| 47 |
+
# define OPENSSL_NO_BROTLI_DYNAMIC
|
| 48 |
+
# endif
|
| 49 |
+
# ifndef OPENSSL_NO_COMP
|
| 50 |
+
# define OPENSSL_NO_COMP
|
| 51 |
+
# endif
|
| 52 |
+
# ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
| 53 |
+
# define OPENSSL_NO_CRYPTO_MDEBUG
|
| 54 |
+
# endif
|
| 55 |
+
# ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
|
| 56 |
+
# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
|
| 57 |
+
# endif
|
| 58 |
+
# ifndef OPENSSL_NO_DEMOS
|
| 59 |
+
# define OPENSSL_NO_DEMOS
|
| 60 |
+
# endif
|
| 61 |
+
# ifndef OPENSSL_NO_DEVCRYPTOENG
|
| 62 |
+
# define OPENSSL_NO_DEVCRYPTOENG
|
| 63 |
+
# endif
|
| 64 |
+
# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
|
| 65 |
+
# define OPENSSL_NO_EC_NISTP_64_GCC_128
|
| 66 |
+
# endif
|
| 67 |
+
# ifndef OPENSSL_NO_EGD
|
| 68 |
+
# define OPENSSL_NO_EGD
|
| 69 |
+
# endif
|
| 70 |
+
# ifndef OPENSSL_NO_EXTERNAL_TESTS
|
| 71 |
+
# define OPENSSL_NO_EXTERNAL_TESTS
|
| 72 |
+
# endif
|
| 73 |
+
# ifndef OPENSSL_NO_FIPS_JITTER
|
| 74 |
+
# define OPENSSL_NO_FIPS_JITTER
|
| 75 |
+
# endif
|
| 76 |
+
# ifndef OPENSSL_NO_FUZZ_AFL
|
| 77 |
+
# define OPENSSL_NO_FUZZ_AFL
|
| 78 |
+
# endif
|
| 79 |
+
# ifndef OPENSSL_NO_FUZZ_LIBFUZZER
|
| 80 |
+
# define OPENSSL_NO_FUZZ_LIBFUZZER
|
| 81 |
+
# endif
|
| 82 |
+
# ifndef OPENSSL_NO_H3DEMO
|
| 83 |
+
# define OPENSSL_NO_H3DEMO
|
| 84 |
+
# endif
|
| 85 |
+
# ifndef OPENSSL_NO_HQINTEROP
|
| 86 |
+
# define OPENSSL_NO_HQINTEROP
|
| 87 |
+
# endif
|
| 88 |
+
# ifndef OPENSSL_NO_JITTER
|
| 89 |
+
# define OPENSSL_NO_JITTER
|
| 90 |
+
# endif
|
| 91 |
+
# ifndef OPENSSL_NO_KTLS
|
| 92 |
+
# define OPENSSL_NO_KTLS
|
| 93 |
+
# endif
|
| 94 |
+
# ifndef OPENSSL_NO_LOADERENG
|
| 95 |
+
# define OPENSSL_NO_LOADERENG
|
| 96 |
+
# endif
|
| 97 |
+
# ifndef OPENSSL_NO_MD2
|
| 98 |
+
# define OPENSSL_NO_MD2
|
| 99 |
+
# endif
|
| 100 |
+
# ifndef OPENSSL_NO_MSAN
|
| 101 |
+
# define OPENSSL_NO_MSAN
|
| 102 |
+
# endif
|
| 103 |
+
# ifndef OPENSSL_NO_PIE
|
| 104 |
+
# define OPENSSL_NO_PIE
|
| 105 |
+
# endif
|
| 106 |
+
# ifndef OPENSSL_NO_RC5
|
| 107 |
+
# define OPENSSL_NO_RC5
|
| 108 |
+
# endif
|
| 109 |
+
# ifndef OPENSSL_NO_SCTP
|
| 110 |
+
# define OPENSSL_NO_SCTP
|
| 111 |
+
# endif
|
| 112 |
+
# ifndef OPENSSL_NO_SSL3
|
| 113 |
+
# define OPENSSL_NO_SSL3
|
| 114 |
+
# endif
|
| 115 |
+
# ifndef OPENSSL_NO_SSL3_METHOD
|
| 116 |
+
# define OPENSSL_NO_SSL3_METHOD
|
| 117 |
+
# endif
|
| 118 |
+
# ifndef OPENSSL_NO_SSLKEYLOG
|
| 119 |
+
# define OPENSSL_NO_SSLKEYLOG
|
| 120 |
+
# endif
|
| 121 |
+
# ifndef OPENSSL_NO_TFO
|
| 122 |
+
# define OPENSSL_NO_TFO
|
| 123 |
+
# endif
|
| 124 |
+
# ifndef OPENSSL_NO_TRACE
|
| 125 |
+
# define OPENSSL_NO_TRACE
|
| 126 |
+
# endif
|
| 127 |
+
# ifndef OPENSSL_NO_UBSAN
|
| 128 |
+
# define OPENSSL_NO_UBSAN
|
| 129 |
+
# endif
|
| 130 |
+
# ifndef OPENSSL_NO_UNIT_TEST
|
| 131 |
+
# define OPENSSL_NO_UNIT_TEST
|
| 132 |
+
# endif
|
| 133 |
+
# ifndef OPENSSL_NO_UPLINK
|
| 134 |
+
# define OPENSSL_NO_UPLINK
|
| 135 |
+
# endif
|
| 136 |
+
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
|
| 137 |
+
# define OPENSSL_NO_WEAK_SSL_CIPHERS
|
| 138 |
+
# endif
|
| 139 |
+
# ifndef OPENSSL_NO_WINSTORE
|
| 140 |
+
# define OPENSSL_NO_WINSTORE
|
| 141 |
+
# endif
|
| 142 |
+
# ifndef OPENSSL_NO_ZLIB
|
| 143 |
+
# define OPENSSL_NO_ZLIB
|
| 144 |
+
# endif
|
| 145 |
+
# ifndef OPENSSL_NO_ZLIB_DYNAMIC
|
| 146 |
+
# define OPENSSL_NO_ZLIB_DYNAMIC
|
| 147 |
+
# endif
|
| 148 |
+
# ifndef OPENSSL_NO_ZSTD
|
| 149 |
+
# define OPENSSL_NO_ZSTD
|
| 150 |
+
# endif
|
| 151 |
+
# ifndef OPENSSL_NO_ZSTD_DYNAMIC
|
| 152 |
+
# define OPENSSL_NO_ZSTD_DYNAMIC
|
| 153 |
+
# endif
|
| 154 |
+
# ifndef OPENSSL_NO_DYNAMIC_ENGINE
|
| 155 |
+
# define OPENSSL_NO_DYNAMIC_ENGINE
|
| 156 |
+
# endif
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
/* Generate 80386 code? */
|
| 160 |
+
# undef I386_ONLY
|
| 161 |
+
|
| 162 |
+
/*
|
| 163 |
+
* The following are cipher-specific, but are part of the public API.
|
| 164 |
+
*/
|
| 165 |
+
# if !defined(OPENSSL_SYS_UEFI)
|
| 166 |
+
# undef BN_LLONG
|
| 167 |
+
/* Only one for the following should be defined */
|
| 168 |
+
# define SIXTY_FOUR_BIT_LONG
|
| 169 |
+
# undef SIXTY_FOUR_BIT
|
| 170 |
+
# undef THIRTY_TWO_BIT
|
| 171 |
+
# endif
|
| 172 |
+
|
| 173 |
+
# define RC4_INT unsigned char
|
| 174 |
+
|
| 175 |
+
# if defined(OPENSSL_NO_COMP) || (defined(OPENSSL_NO_BROTLI) && defined(OPENSSL_NO_ZSTD) && defined(OPENSSL_NO_ZLIB))
|
| 176 |
+
# define OPENSSL_NO_COMP_ALG
|
| 177 |
+
# else
|
| 178 |
+
# undef OPENSSL_NO_COMP_ALG
|
| 179 |
+
# endif
|
| 180 |
+
|
| 181 |
+
# ifdef __cplusplus
|
| 182 |
+
}
|
| 183 |
+
# endif
|
| 184 |
+
|
| 185 |
+
#endif /* OPENSSL_CONFIGURATION_H */
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/core_names.h
ADDED
|
@@ -0,0 +1,575 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/core_names.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
#ifndef OPENSSL_CORE_NAMES_H
|
| 15 |
+
# define OPENSSL_CORE_NAMES_H
|
| 16 |
+
# pragma once
|
| 17 |
+
|
| 18 |
+
# ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
# endif
|
| 21 |
+
|
| 22 |
+
/* OSSL_CIPHER_PARAM_CTS_MODE Values */
|
| 23 |
+
# define OSSL_CIPHER_CTS_MODE_CS1 "CS1"
|
| 24 |
+
# define OSSL_CIPHER_CTS_MODE_CS2 "CS2"
|
| 25 |
+
# define OSSL_CIPHER_CTS_MODE_CS3 "CS3"
|
| 26 |
+
|
| 27 |
+
/* Known CIPHER names (not a complete list) */
|
| 28 |
+
# define OSSL_CIPHER_NAME_AES_128_GCM_SIV "AES-128-GCM-SIV"
|
| 29 |
+
# define OSSL_CIPHER_NAME_AES_192_GCM_SIV "AES-192-GCM-SIV"
|
| 30 |
+
# define OSSL_CIPHER_NAME_AES_256_GCM_SIV "AES-256-GCM-SIV"
|
| 31 |
+
|
| 32 |
+
/* Known DIGEST names (not a complete list) */
|
| 33 |
+
# define OSSL_DIGEST_NAME_MD5 "MD5"
|
| 34 |
+
# define OSSL_DIGEST_NAME_MD5_SHA1 "MD5-SHA1"
|
| 35 |
+
# define OSSL_DIGEST_NAME_SHA1 "SHA1"
|
| 36 |
+
# define OSSL_DIGEST_NAME_SHA2_224 "SHA2-224"
|
| 37 |
+
# define OSSL_DIGEST_NAME_SHA2_256 "SHA2-256"
|
| 38 |
+
# define OSSL_DIGEST_NAME_SHA2_256_192 "SHA2-256/192"
|
| 39 |
+
# define OSSL_DIGEST_NAME_SHA2_384 "SHA2-384"
|
| 40 |
+
# define OSSL_DIGEST_NAME_SHA2_512 "SHA2-512"
|
| 41 |
+
# define OSSL_DIGEST_NAME_SHA2_512_224 "SHA2-512/224"
|
| 42 |
+
# define OSSL_DIGEST_NAME_SHA2_512_256 "SHA2-512/256"
|
| 43 |
+
# define OSSL_DIGEST_NAME_MD2 "MD2"
|
| 44 |
+
# define OSSL_DIGEST_NAME_MD4 "MD4"
|
| 45 |
+
# define OSSL_DIGEST_NAME_MDC2 "MDC2"
|
| 46 |
+
# define OSSL_DIGEST_NAME_RIPEMD160 "RIPEMD160"
|
| 47 |
+
# define OSSL_DIGEST_NAME_SHA3_224 "SHA3-224"
|
| 48 |
+
# define OSSL_DIGEST_NAME_SHA3_256 "SHA3-256"
|
| 49 |
+
# define OSSL_DIGEST_NAME_SHA3_384 "SHA3-384"
|
| 50 |
+
# define OSSL_DIGEST_NAME_SHA3_512 "SHA3-512"
|
| 51 |
+
# define OSSL_DIGEST_NAME_KECCAK_KMAC128 "KECCAK-KMAC-128"
|
| 52 |
+
# define OSSL_DIGEST_NAME_KECCAK_KMAC256 "KECCAK-KMAC-256"
|
| 53 |
+
# define OSSL_DIGEST_NAME_SM3 "SM3"
|
| 54 |
+
|
| 55 |
+
/* Known MAC names */
|
| 56 |
+
# define OSSL_MAC_NAME_BLAKE2BMAC "BLAKE2BMAC"
|
| 57 |
+
# define OSSL_MAC_NAME_BLAKE2SMAC "BLAKE2SMAC"
|
| 58 |
+
# define OSSL_MAC_NAME_CMAC "CMAC"
|
| 59 |
+
# define OSSL_MAC_NAME_GMAC "GMAC"
|
| 60 |
+
# define OSSL_MAC_NAME_HMAC "HMAC"
|
| 61 |
+
# define OSSL_MAC_NAME_KMAC128 "KMAC128"
|
| 62 |
+
# define OSSL_MAC_NAME_KMAC256 "KMAC256"
|
| 63 |
+
# define OSSL_MAC_NAME_POLY1305 "POLY1305"
|
| 64 |
+
# define OSSL_MAC_NAME_SIPHASH "SIPHASH"
|
| 65 |
+
|
| 66 |
+
/* Known KDF names */
|
| 67 |
+
# define OSSL_KDF_NAME_HKDF "HKDF"
|
| 68 |
+
# define OSSL_KDF_NAME_TLS1_3_KDF "TLS13-KDF"
|
| 69 |
+
# define OSSL_KDF_NAME_PBKDF1 "PBKDF1"
|
| 70 |
+
# define OSSL_KDF_NAME_PBKDF2 "PBKDF2"
|
| 71 |
+
# define OSSL_KDF_NAME_SCRYPT "SCRYPT"
|
| 72 |
+
# define OSSL_KDF_NAME_SSHKDF "SSHKDF"
|
| 73 |
+
# define OSSL_KDF_NAME_SSKDF "SSKDF"
|
| 74 |
+
# define OSSL_KDF_NAME_TLS1_PRF "TLS1-PRF"
|
| 75 |
+
# define OSSL_KDF_NAME_X942KDF_ASN1 "X942KDF-ASN1"
|
| 76 |
+
# define OSSL_KDF_NAME_X942KDF_CONCAT "X942KDF-CONCAT"
|
| 77 |
+
# define OSSL_KDF_NAME_X963KDF "X963KDF"
|
| 78 |
+
# define OSSL_KDF_NAME_KBKDF "KBKDF"
|
| 79 |
+
# define OSSL_KDF_NAME_KRB5KDF "KRB5KDF"
|
| 80 |
+
# define OSSL_KDF_NAME_HMACDRBGKDF "HMAC-DRBG-KDF"
|
| 81 |
+
|
| 82 |
+
/* RSA padding modes */
|
| 83 |
+
# define OSSL_PKEY_RSA_PAD_MODE_NONE "none"
|
| 84 |
+
# define OSSL_PKEY_RSA_PAD_MODE_PKCSV15 "pkcs1"
|
| 85 |
+
# define OSSL_PKEY_RSA_PAD_MODE_OAEP "oaep"
|
| 86 |
+
# define OSSL_PKEY_RSA_PAD_MODE_X931 "x931"
|
| 87 |
+
# define OSSL_PKEY_RSA_PAD_MODE_PSS "pss"
|
| 88 |
+
|
| 89 |
+
/* RSA pss padding salt length */
|
| 90 |
+
# define OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST "digest"
|
| 91 |
+
# define OSSL_PKEY_RSA_PSS_SALT_LEN_MAX "max"
|
| 92 |
+
# define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO "auto"
|
| 93 |
+
# define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX "auto-digestmax"
|
| 94 |
+
|
| 95 |
+
/* OSSL_PKEY_PARAM_EC_ENCODING values */
|
| 96 |
+
# define OSSL_PKEY_EC_ENCODING_EXPLICIT "explicit"
|
| 97 |
+
# define OSSL_PKEY_EC_ENCODING_GROUP "named_curve"
|
| 98 |
+
|
| 99 |
+
# define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_UNCOMPRESSED "uncompressed"
|
| 100 |
+
# define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_COMPRESSED "compressed"
|
| 101 |
+
# define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_HYBRID "hybrid"
|
| 102 |
+
|
| 103 |
+
# define OSSL_PKEY_EC_GROUP_CHECK_DEFAULT "default"
|
| 104 |
+
# define OSSL_PKEY_EC_GROUP_CHECK_NAMED "named"
|
| 105 |
+
# define OSSL_PKEY_EC_GROUP_CHECK_NAMED_NIST "named-nist"
|
| 106 |
+
|
| 107 |
+
/* PROV_SKEY well known key types */
|
| 108 |
+
# define OSSL_SKEY_TYPE_GENERIC "GENERIC-SECRET"
|
| 109 |
+
# define OSSL_SKEY_TYPE_AES "AES"
|
| 110 |
+
|
| 111 |
+
/* OSSL_KEM_PARAM_OPERATION values */
|
| 112 |
+
#define OSSL_KEM_PARAM_OPERATION_RSASVE "RSASVE"
|
| 113 |
+
#define OSSL_KEM_PARAM_OPERATION_DHKEM "DHKEM"
|
| 114 |
+
|
| 115 |
+
/* Provider configuration variables */
|
| 116 |
+
#define OSSL_PKEY_RETAIN_SEED "pkey_retain_seed"
|
| 117 |
+
|
| 118 |
+
/* Parameter name definitions - generated by util/perl/OpenSSL/paramnames.pm */
|
| 119 |
+
# define OSSL_ALG_PARAM_ALGORITHM_ID "algorithm-id"
|
| 120 |
+
# define OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS "algorithm-id-params"
|
| 121 |
+
# define OSSL_ALG_PARAM_CIPHER "cipher"
|
| 122 |
+
# define OSSL_ALG_PARAM_DIGEST "digest"
|
| 123 |
+
# define OSSL_ALG_PARAM_ENGINE "engine"
|
| 124 |
+
# define OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR "fips-indicator"
|
| 125 |
+
# define OSSL_ALG_PARAM_MAC "mac"
|
| 126 |
+
# define OSSL_ALG_PARAM_PROPERTIES "properties"
|
| 127 |
+
# define OSSL_ASYM_CIPHER_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
|
| 128 |
+
# define OSSL_ASYM_CIPHER_PARAM_ENGINE OSSL_PKEY_PARAM_ENGINE
|
| 129 |
+
# define OSSL_ASYM_CIPHER_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 130 |
+
# define OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
| 131 |
+
# define OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED
|
| 132 |
+
# define OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION "implicit-rejection"
|
| 133 |
+
# define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
|
| 134 |
+
# define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS OSSL_PKEY_PARAM_MGF1_PROPERTIES
|
| 135 |
+
# define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST OSSL_ALG_PARAM_DIGEST
|
| 136 |
+
# define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS "digest-props"
|
| 137 |
+
# define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL "oaep-label"
|
| 138 |
+
# define OSSL_ASYM_CIPHER_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE
|
| 139 |
+
# define OSSL_ASYM_CIPHER_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
|
| 140 |
+
# define OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION "tls-client-version"
|
| 141 |
+
# define OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION "tls-negotiated-version"
|
| 142 |
+
# define OSSL_CAPABILITY_TLS_GROUP_ALG "tls-group-alg"
|
| 143 |
+
# define OSSL_CAPABILITY_TLS_GROUP_ID "tls-group-id"
|
| 144 |
+
# define OSSL_CAPABILITY_TLS_GROUP_IS_KEM "tls-group-is-kem"
|
| 145 |
+
# define OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS "tls-max-dtls"
|
| 146 |
+
# define OSSL_CAPABILITY_TLS_GROUP_MAX_TLS "tls-max-tls"
|
| 147 |
+
# define OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS "tls-min-dtls"
|
| 148 |
+
# define OSSL_CAPABILITY_TLS_GROUP_MIN_TLS "tls-min-tls"
|
| 149 |
+
# define OSSL_CAPABILITY_TLS_GROUP_NAME "tls-group-name"
|
| 150 |
+
# define OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL "tls-group-name-internal"
|
| 151 |
+
# define OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS "tls-group-sec-bits"
|
| 152 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT "tls-sigalg-code-point"
|
| 153 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_HASH_NAME "tls-sigalg-hash-name"
|
| 154 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_HASH_OID "tls-sigalg-hash-oid"
|
| 155 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME "tls-sigalg-iana-name"
|
| 156 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE "tls-sigalg-keytype"
|
| 157 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE_OID "tls-sigalg-keytype-oid"
|
| 158 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS "tls-max-dtls"
|
| 159 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS "tls-max-tls"
|
| 160 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS "tls-min-dtls"
|
| 161 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS "tls-min-tls"
|
| 162 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_NAME "tls-sigalg-name"
|
| 163 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_OID "tls-sigalg-oid"
|
| 164 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS "tls-sigalg-sec-bits"
|
| 165 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_SIG_NAME "tls-sigalg-sig-name"
|
| 166 |
+
# define OSSL_CAPABILITY_TLS_SIGALG_SIG_OID "tls-sigalg-sig-oid"
|
| 167 |
+
# define OSSL_CIPHER_PARAM_AEAD "aead"
|
| 168 |
+
# define OSSL_CIPHER_PARAM_AEAD_IVLEN OSSL_CIPHER_PARAM_IVLEN
|
| 169 |
+
# define OSSL_CIPHER_PARAM_AEAD_IV_GENERATED "iv-generated"
|
| 170 |
+
# define OSSL_CIPHER_PARAM_AEAD_MAC_KEY "mackey"
|
| 171 |
+
# define OSSL_CIPHER_PARAM_AEAD_TAG "tag"
|
| 172 |
+
# define OSSL_CIPHER_PARAM_AEAD_TAGLEN "taglen"
|
| 173 |
+
# define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD "tlsaad"
|
| 174 |
+
# define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD "tlsaadpad"
|
| 175 |
+
# define OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN "tlsivgen"
|
| 176 |
+
# define OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED "tlsivfixed"
|
| 177 |
+
# define OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV "tlsivinv"
|
| 178 |
+
# define OSSL_CIPHER_PARAM_ALGORITHM_ID OSSL_ALG_PARAM_ALGORITHM_ID
|
| 179 |
+
# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS
|
| 180 |
+
# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS_OLD "alg_id_param"
|
| 181 |
+
# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
|
| 182 |
+
# define OSSL_CIPHER_PARAM_CTS "cts"
|
| 183 |
+
# define OSSL_CIPHER_PARAM_CTS_MODE "cts_mode"
|
| 184 |
+
# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
|
| 185 |
+
# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only"
|
| 186 |
+
# define OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 187 |
+
# define OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK "encrypt-check"
|
| 188 |
+
# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
|
| 189 |
+
# define OSSL_CIPHER_PARAM_IV "iv"
|
| 190 |
+
# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
|
| 191 |
+
# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
|
| 192 |
+
# define OSSL_CIPHER_PARAM_MODE "mode"
|
| 193 |
+
# define OSSL_CIPHER_PARAM_NUM "num"
|
| 194 |
+
# define OSSL_CIPHER_PARAM_PADDING "padding"
|
| 195 |
+
# define OSSL_CIPHER_PARAM_PIPELINE_AEAD_TAG "pipeline-tag"
|
| 196 |
+
# define OSSL_CIPHER_PARAM_RANDOM_KEY "randkey"
|
| 197 |
+
# define OSSL_CIPHER_PARAM_RC2_KEYBITS "keybits"
|
| 198 |
+
# define OSSL_CIPHER_PARAM_ROUNDS "rounds"
|
| 199 |
+
# define OSSL_CIPHER_PARAM_SPEED "speed"
|
| 200 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
|
| 201 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD "tls1multi_aad"
|
| 202 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN "tls1multi_aadpacklen"
|
| 203 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC "tls1multi_enc"
|
| 204 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN "tls1multi_encin"
|
| 205 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN "tls1multi_enclen"
|
| 206 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE "tls1multi_interleave"
|
| 207 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE "tls1multi_maxbufsz"
|
| 208 |
+
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT "tls1multi_maxsndfrag"
|
| 209 |
+
# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac"
|
| 210 |
+
# define OSSL_CIPHER_PARAM_TLS_MAC_SIZE "tls-mac-size"
|
| 211 |
+
# define OSSL_CIPHER_PARAM_TLS_VERSION "tls-version"
|
| 212 |
+
# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv"
|
| 213 |
+
# define OSSL_CIPHER_PARAM_USE_BITS "use-bits"
|
| 214 |
+
# define OSSL_CIPHER_PARAM_XTS_STANDARD "xts_standard"
|
| 215 |
+
# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 216 |
+
# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
|
| 217 |
+
# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
|
| 218 |
+
# define OSSL_DIGEST_PARAM_MICALG "micalg"
|
| 219 |
+
# define OSSL_DIGEST_PARAM_PAD_TYPE "pad-type"
|
| 220 |
+
# define OSSL_DIGEST_PARAM_SIZE "size"
|
| 221 |
+
# define OSSL_DIGEST_PARAM_SSL3_MS "ssl3-ms"
|
| 222 |
+
# define OSSL_DIGEST_PARAM_XOF "xof"
|
| 223 |
+
# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
|
| 224 |
+
# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
| 225 |
+
# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
| 226 |
+
# define OSSL_DRBG_PARAM_ENTROPY_REQUIRED "entropy_required"
|
| 227 |
+
# define OSSL_DRBG_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 228 |
+
# define OSSL_DRBG_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK
|
| 229 |
+
# define OSSL_DRBG_PARAM_MAC OSSL_ALG_PARAM_MAC
|
| 230 |
+
# define OSSL_DRBG_PARAM_MAX_ADINLEN "max_adinlen"
|
| 231 |
+
# define OSSL_DRBG_PARAM_MAX_ENTROPYLEN "max_entropylen"
|
| 232 |
+
# define OSSL_DRBG_PARAM_MAX_LENGTH "maxium_length"
|
| 233 |
+
# define OSSL_DRBG_PARAM_MAX_NONCELEN "max_noncelen"
|
| 234 |
+
# define OSSL_DRBG_PARAM_MAX_PERSLEN "max_perslen"
|
| 235 |
+
# define OSSL_DRBG_PARAM_MIN_ENTROPYLEN "min_entropylen"
|
| 236 |
+
# define OSSL_DRBG_PARAM_MIN_LENGTH "minium_length"
|
| 237 |
+
# define OSSL_DRBG_PARAM_MIN_NONCELEN "min_noncelen"
|
| 238 |
+
# define OSSL_DRBG_PARAM_PREDICTION_RESISTANCE "prediction_resistance"
|
| 239 |
+
# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 240 |
+
# define OSSL_DRBG_PARAM_RANDOM_DATA "random_data"
|
| 241 |
+
# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
|
| 242 |
+
# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
|
| 243 |
+
# define OSSL_DRBG_PARAM_RESEED_TIME "reseed_time"
|
| 244 |
+
# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
|
| 245 |
+
# define OSSL_DRBG_PARAM_SIZE "size"
|
| 246 |
+
# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
|
| 247 |
+
# define OSSL_ENCODER_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
| 248 |
+
# define OSSL_ENCODER_PARAM_ENCRYPT_LEVEL "encrypt-level"
|
| 249 |
+
# define OSSL_ENCODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 250 |
+
# define OSSL_ENCODER_PARAM_SAVE_PARAMETERS "save-parameters"
|
| 251 |
+
# define OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE "ecdh-cofactor-mode"
|
| 252 |
+
# define OSSL_EXCHANGE_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 253 |
+
# define OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK
|
| 254 |
+
# define OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK
|
| 255 |
+
# define OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
| 256 |
+
# define OSSL_EXCHANGE_PARAM_KDF_DIGEST "kdf-digest"
|
| 257 |
+
# define OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS "kdf-digest-props"
|
| 258 |
+
# define OSSL_EXCHANGE_PARAM_KDF_OUTLEN "kdf-outlen"
|
| 259 |
+
# define OSSL_EXCHANGE_PARAM_KDF_TYPE "kdf-type"
|
| 260 |
+
# define OSSL_EXCHANGE_PARAM_KDF_UKM "kdf-ukm"
|
| 261 |
+
# define OSSL_EXCHANGE_PARAM_PAD "pad"
|
| 262 |
+
# define OSSL_GEN_PARAM_ITERATION "iteration"
|
| 263 |
+
# define OSSL_GEN_PARAM_POTENTIAL "potential"
|
| 264 |
+
# define OSSL_KDF_PARAM_ARGON2_AD "ad"
|
| 265 |
+
# define OSSL_KDF_PARAM_ARGON2_LANES "lanes"
|
| 266 |
+
# define OSSL_KDF_PARAM_ARGON2_MEMCOST "memcost"
|
| 267 |
+
# define OSSL_KDF_PARAM_ARGON2_VERSION "version"
|
| 268 |
+
# define OSSL_KDF_PARAM_CEK_ALG "cekalg"
|
| 269 |
+
# define OSSL_KDF_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
| 270 |
+
# define OSSL_KDF_PARAM_CONSTANT "constant"
|
| 271 |
+
# define OSSL_KDF_PARAM_DATA "data"
|
| 272 |
+
# define OSSL_KDF_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
| 273 |
+
# define OSSL_KDF_PARAM_EARLY_CLEAN "early_clean"
|
| 274 |
+
# define OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 275 |
+
# define OSSL_KDF_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK
|
| 276 |
+
# define OSSL_KDF_PARAM_FIPS_EMS_CHECK "ems_check"
|
| 277 |
+
# define OSSL_KDF_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
| 278 |
+
# define OSSL_KDF_PARAM_HMACDRBG_ENTROPY "entropy"
|
| 279 |
+
# define OSSL_KDF_PARAM_HMACDRBG_NONCE "nonce"
|
| 280 |
+
# define OSSL_KDF_PARAM_INFO "info"
|
| 281 |
+
# define OSSL_KDF_PARAM_ITER "iter"
|
| 282 |
+
# define OSSL_KDF_PARAM_KBKDF_R "r"
|
| 283 |
+
# define OSSL_KDF_PARAM_KBKDF_USE_L "use-l"
|
| 284 |
+
# define OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR "use-separator"
|
| 285 |
+
# define OSSL_KDF_PARAM_KEY "key"
|
| 286 |
+
# define OSSL_KDF_PARAM_LABEL "label"
|
| 287 |
+
# define OSSL_KDF_PARAM_MAC OSSL_ALG_PARAM_MAC
|
| 288 |
+
# define OSSL_KDF_PARAM_MAC_SIZE "maclen"
|
| 289 |
+
# define OSSL_KDF_PARAM_MODE "mode"
|
| 290 |
+
# define OSSL_KDF_PARAM_PASSWORD "pass"
|
| 291 |
+
# define OSSL_KDF_PARAM_PKCS12_ID "id"
|
| 292 |
+
# define OSSL_KDF_PARAM_PKCS5 "pkcs5"
|
| 293 |
+
# define OSSL_KDF_PARAM_PREFIX "prefix"
|
| 294 |
+
# define OSSL_KDF_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 295 |
+
# define OSSL_KDF_PARAM_SALT "salt"
|
| 296 |
+
# define OSSL_KDF_PARAM_SCRYPT_MAXMEM "maxmem_bytes"
|
| 297 |
+
# define OSSL_KDF_PARAM_SCRYPT_N "n"
|
| 298 |
+
# define OSSL_KDF_PARAM_SCRYPT_P "p"
|
| 299 |
+
# define OSSL_KDF_PARAM_SCRYPT_R "r"
|
| 300 |
+
# define OSSL_KDF_PARAM_SECRET "secret"
|
| 301 |
+
# define OSSL_KDF_PARAM_SEED "seed"
|
| 302 |
+
# define OSSL_KDF_PARAM_SIZE "size"
|
| 303 |
+
# define OSSL_KDF_PARAM_SSHKDF_SESSION_ID "session_id"
|
| 304 |
+
# define OSSL_KDF_PARAM_SSHKDF_TYPE "type"
|
| 305 |
+
# define OSSL_KDF_PARAM_SSHKDF_XCGHASH "xcghash"
|
| 306 |
+
# define OSSL_KDF_PARAM_THREADS "threads"
|
| 307 |
+
# define OSSL_KDF_PARAM_UKM "ukm"
|
| 308 |
+
# define OSSL_KDF_PARAM_X942_ACVPINFO "acvp-info"
|
| 309 |
+
# define OSSL_KDF_PARAM_X942_PARTYUINFO "partyu-info"
|
| 310 |
+
# define OSSL_KDF_PARAM_X942_PARTYVINFO "partyv-info"
|
| 311 |
+
# define OSSL_KDF_PARAM_X942_SUPP_PRIVINFO "supp-privinfo"
|
| 312 |
+
# define OSSL_KDF_PARAM_X942_SUPP_PUBINFO "supp-pubinfo"
|
| 313 |
+
# define OSSL_KDF_PARAM_X942_USE_KEYBITS "use-keybits"
|
| 314 |
+
# define OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 315 |
+
# define OSSL_KEM_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
| 316 |
+
# define OSSL_KEM_PARAM_IKME "ikme"
|
| 317 |
+
# define OSSL_KEM_PARAM_OPERATION "operation"
|
| 318 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING "block_padding"
|
| 319 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_HS_PADDING "hs_padding"
|
| 320 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA "max_early_data"
|
| 321 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN "max_frag_len"
|
| 322 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE "mode"
|
| 323 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS "options"
|
| 324 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD "read_ahead"
|
| 325 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC "stream_mac"
|
| 326 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_TLSTREE "tlstree"
|
| 327 |
+
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_USE_ETM "use_etm"
|
| 328 |
+
# define OSSL_LIBSSL_RECORD_LAYER_READ_BUFFER_LEN "read_buffer_len"
|
| 329 |
+
# define OSSL_MAC_PARAM_BLOCK_SIZE "block-size"
|
| 330 |
+
# define OSSL_MAC_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
| 331 |
+
# define OSSL_MAC_PARAM_CUSTOM "custom"
|
| 332 |
+
# define OSSL_MAC_PARAM_C_ROUNDS "c-rounds"
|
| 333 |
+
# define OSSL_MAC_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
| 334 |
+
# define OSSL_MAC_PARAM_DIGEST_NOINIT "digest-noinit"
|
| 335 |
+
# define OSSL_MAC_PARAM_DIGEST_ONESHOT "digest-oneshot"
|
| 336 |
+
# define OSSL_MAC_PARAM_D_ROUNDS "d-rounds"
|
| 337 |
+
# define OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 338 |
+
# define OSSL_MAC_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
| 339 |
+
# define OSSL_MAC_PARAM_FIPS_NO_SHORT_MAC OSSL_PROV_PARAM_NO_SHORT_MAC
|
| 340 |
+
# define OSSL_MAC_PARAM_IV "iv"
|
| 341 |
+
# define OSSL_MAC_PARAM_KEY "key"
|
| 342 |
+
# define OSSL_MAC_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 343 |
+
# define OSSL_MAC_PARAM_SALT "salt"
|
| 344 |
+
# define OSSL_MAC_PARAM_SIZE "size"
|
| 345 |
+
# define OSSL_MAC_PARAM_TLS_DATA_SIZE "tls-data-size"
|
| 346 |
+
# define OSSL_MAC_PARAM_XOF "xof"
|
| 347 |
+
# define OSSL_OBJECT_PARAM_DATA "data"
|
| 348 |
+
# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
|
| 349 |
+
# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
|
| 350 |
+
# define OSSL_OBJECT_PARAM_DESC "desc"
|
| 351 |
+
# define OSSL_OBJECT_PARAM_INPUT_TYPE "input-type"
|
| 352 |
+
# define OSSL_OBJECT_PARAM_REFERENCE "reference"
|
| 353 |
+
# define OSSL_OBJECT_PARAM_TYPE "type"
|
| 354 |
+
# define OSSL_PASSPHRASE_PARAM_INFO "info"
|
| 355 |
+
# define OSSL_PKEY_PARAM_ALGORITHM_ID OSSL_ALG_PARAM_ALGORITHM_ID
|
| 356 |
+
# define OSSL_PKEY_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS
|
| 357 |
+
# define OSSL_PKEY_PARAM_BITS "bits"
|
| 358 |
+
# define OSSL_PKEY_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
| 359 |
+
# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
|
| 360 |
+
# define OSSL_PKEY_PARAM_DHKEM_IKM "dhkem-ikm"
|
| 361 |
+
# define OSSL_PKEY_PARAM_DH_GENERATOR "safeprime-generator"
|
| 362 |
+
# define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len"
|
| 363 |
+
# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
| 364 |
+
# define OSSL_PKEY_PARAM_DIGEST_SIZE "digest-size"
|
| 365 |
+
# define OSSL_PKEY_PARAM_DIST_ID "distid"
|
| 366 |
+
# define OSSL_PKEY_PARAM_EC_A "a"
|
| 367 |
+
# define OSSL_PKEY_PARAM_EC_B "b"
|
| 368 |
+
# define OSSL_PKEY_PARAM_EC_CHAR2_M "m"
|
| 369 |
+
# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1 "k1"
|
| 370 |
+
# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2 "k2"
|
| 371 |
+
# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3 "k3"
|
| 372 |
+
# define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS "tp"
|
| 373 |
+
# define OSSL_PKEY_PARAM_EC_CHAR2_TYPE "basis-type"
|
| 374 |
+
# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
|
| 375 |
+
# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
|
| 376 |
+
# define OSSL_PKEY_PARAM_EC_ENCODING "encoding"
|
| 377 |
+
# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
|
| 378 |
+
# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
|
| 379 |
+
# define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE "group-check"
|
| 380 |
+
# define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC "include-public"
|
| 381 |
+
# define OSSL_PKEY_PARAM_EC_ORDER "order"
|
| 382 |
+
# define OSSL_PKEY_PARAM_EC_P "p"
|
| 383 |
+
# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
|
| 384 |
+
# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
|
| 385 |
+
# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
|
| 386 |
+
# define OSSL_PKEY_PARAM_EC_SEED "seed"
|
| 387 |
+
# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
|
| 388 |
+
# define OSSL_PKEY_PARAM_ENGINE OSSL_ALG_PARAM_ENGINE
|
| 389 |
+
# define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
|
| 390 |
+
# define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST
|
| 391 |
+
# define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
|
| 392 |
+
# define OSSL_PKEY_PARAM_FFC_G "g"
|
| 393 |
+
# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
|
| 394 |
+
# define OSSL_PKEY_PARAM_FFC_H "hindex"
|
| 395 |
+
# define OSSL_PKEY_PARAM_FFC_P "p"
|
| 396 |
+
# define OSSL_PKEY_PARAM_FFC_PBITS "pbits"
|
| 397 |
+
# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
|
| 398 |
+
# define OSSL_PKEY_PARAM_FFC_Q "q"
|
| 399 |
+
# define OSSL_PKEY_PARAM_FFC_QBITS "qbits"
|
| 400 |
+
# define OSSL_PKEY_PARAM_FFC_SEED "seed"
|
| 401 |
+
# define OSSL_PKEY_PARAM_FFC_TYPE "type"
|
| 402 |
+
# define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g"
|
| 403 |
+
# define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
|
| 404 |
+
# define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq"
|
| 405 |
+
# define OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 406 |
+
# define OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK "digest-check"
|
| 407 |
+
# define OSSL_PKEY_PARAM_FIPS_KEY_CHECK "key-check"
|
| 408 |
+
# define OSSL_PKEY_PARAM_FIPS_SIGN_CHECK "sign-check"
|
| 409 |
+
# define OSSL_PKEY_PARAM_GROUP_NAME "group"
|
| 410 |
+
# define OSSL_PKEY_PARAM_IMPLICIT_REJECTION "implicit-rejection"
|
| 411 |
+
# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
|
| 412 |
+
# define OSSL_PKEY_PARAM_MASKGENFUNC "mgf"
|
| 413 |
+
# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
|
| 414 |
+
# define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
|
| 415 |
+
# define OSSL_PKEY_PARAM_MGF1_PROPERTIES "mgf1-properties"
|
| 416 |
+
# define OSSL_PKEY_PARAM_ML_DSA_INPUT_FORMATS "ml-dsa.input_formats"
|
| 417 |
+
# define OSSL_PKEY_PARAM_ML_DSA_OUTPUT_FORMATS "ml-dsa.output_formats"
|
| 418 |
+
# define OSSL_PKEY_PARAM_ML_DSA_PREFER_SEED "ml-dsa.prefer_seed"
|
| 419 |
+
# define OSSL_PKEY_PARAM_ML_DSA_RETAIN_SEED "ml-dsa.retain_seed"
|
| 420 |
+
# define OSSL_PKEY_PARAM_ML_DSA_SEED "seed"
|
| 421 |
+
# define OSSL_PKEY_PARAM_ML_KEM_IMPORT_PCT_TYPE "ml-kem.import_pct_type"
|
| 422 |
+
# define OSSL_PKEY_PARAM_ML_KEM_INPUT_FORMATS "ml-kem.input_formats"
|
| 423 |
+
# define OSSL_PKEY_PARAM_ML_KEM_OUTPUT_FORMATS "ml-kem.output_formats"
|
| 424 |
+
# define OSSL_PKEY_PARAM_ML_KEM_PREFER_SEED "ml-kem.prefer_seed"
|
| 425 |
+
# define OSSL_PKEY_PARAM_ML_KEM_RETAIN_SEED "ml-kem.retain_seed"
|
| 426 |
+
# define OSSL_PKEY_PARAM_ML_KEM_SEED "seed"
|
| 427 |
+
# define OSSL_PKEY_PARAM_PAD_MODE "pad-mode"
|
| 428 |
+
# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
|
| 429 |
+
# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
| 430 |
+
# define OSSL_PKEY_PARAM_PUB_KEY "pub"
|
| 431 |
+
# define OSSL_PKEY_PARAM_RSA_BITS OSSL_PKEY_PARAM_BITS
|
| 432 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT "rsa-coefficient"
|
| 433 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT1 "rsa-coefficient1"
|
| 434 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT2 "rsa-coefficient2"
|
| 435 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT3 "rsa-coefficient3"
|
| 436 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT4 "rsa-coefficient4"
|
| 437 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT5 "rsa-coefficient5"
|
| 438 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT6 "rsa-coefficient6"
|
| 439 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT7 "rsa-coefficient7"
|
| 440 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT8 "rsa-coefficient8"
|
| 441 |
+
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT9 "rsa-coefficient9"
|
| 442 |
+
# define OSSL_PKEY_PARAM_RSA_D "d"
|
| 443 |
+
# define OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ "rsa-derive-from-pq"
|
| 444 |
+
# define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST
|
| 445 |
+
# define OSSL_PKEY_PARAM_RSA_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
|
| 446 |
+
# define OSSL_PKEY_PARAM_RSA_E "e"
|
| 447 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT "rsa-exponent"
|
| 448 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT1 "rsa-exponent1"
|
| 449 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT10 "rsa-exponent10"
|
| 450 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT2 "rsa-exponent2"
|
| 451 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT3 "rsa-exponent3"
|
| 452 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT4 "rsa-exponent4"
|
| 453 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT5 "rsa-exponent5"
|
| 454 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT6 "rsa-exponent6"
|
| 455 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT7 "rsa-exponent7"
|
| 456 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT8 "rsa-exponent8"
|
| 457 |
+
# define OSSL_PKEY_PARAM_RSA_EXPONENT9 "rsa-exponent9"
|
| 458 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR "rsa-factor"
|
| 459 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR1 "rsa-factor1"
|
| 460 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR10 "rsa-factor10"
|
| 461 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR2 "rsa-factor2"
|
| 462 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR3 "rsa-factor3"
|
| 463 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR4 "rsa-factor4"
|
| 464 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR5 "rsa-factor5"
|
| 465 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR6 "rsa-factor6"
|
| 466 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR7 "rsa-factor7"
|
| 467 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR8 "rsa-factor8"
|
| 468 |
+
# define OSSL_PKEY_PARAM_RSA_FACTOR9 "rsa-factor9"
|
| 469 |
+
# define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC
|
| 470 |
+
# define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
|
| 471 |
+
# define OSSL_PKEY_PARAM_RSA_N "n"
|
| 472 |
+
# define OSSL_PKEY_PARAM_RSA_PRIMES "primes"
|
| 473 |
+
# define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN "saltlen"
|
| 474 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_P1 "p1"
|
| 475 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_P2 "p2"
|
| 476 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_Q1 "q1"
|
| 477 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_Q2 "q2"
|
| 478 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_XP "xp"
|
| 479 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_XP1 "xp1"
|
| 480 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_XP2 "xp2"
|
| 481 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_XQ "xq"
|
| 482 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_XQ1 "xq1"
|
| 483 |
+
# define OSSL_PKEY_PARAM_RSA_TEST_XQ2 "xq2"
|
| 484 |
+
# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
|
| 485 |
+
# define OSSL_PKEY_PARAM_SLH_DSA_SEED "seed"
|
| 486 |
+
# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
|
| 487 |
+
# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
|
| 488 |
+
# define OSSL_PROV_PARAM_BUILDINFO "buildinfo"
|
| 489 |
+
# define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename"
|
| 490 |
+
# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
|
| 491 |
+
# define OSSL_PROV_PARAM_CORE_VERSION "openssl-version"
|
| 492 |
+
# define OSSL_PROV_PARAM_DRBG_TRUNC_DIGEST "drbg-no-trunc-md"
|
| 493 |
+
# define OSSL_PROV_PARAM_DSA_SIGN_DISABLED "dsa-sign-disabled"
|
| 494 |
+
# define OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK "ecdh-cofactor-check"
|
| 495 |
+
# define OSSL_PROV_PARAM_HKDF_DIGEST_CHECK "hkdf-digest-check"
|
| 496 |
+
# define OSSL_PROV_PARAM_HKDF_KEY_CHECK "hkdf-key-check"
|
| 497 |
+
# define OSSL_PROV_PARAM_HMAC_KEY_CHECK "hmac-key-check"
|
| 498 |
+
# define OSSL_PROV_PARAM_KBKDF_KEY_CHECK "kbkdf-key-check"
|
| 499 |
+
# define OSSL_PROV_PARAM_KMAC_KEY_CHECK "kmac-key-check"
|
| 500 |
+
# define OSSL_PROV_PARAM_NAME "name"
|
| 501 |
+
# define OSSL_PROV_PARAM_NO_SHORT_MAC "no-short-mac"
|
| 502 |
+
# define OSSL_PROV_PARAM_PBKDF2_LOWER_BOUND_CHECK "pbkdf2-lower-bound-check"
|
| 503 |
+
# define OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED "rsa-pkcs15-pad-disabled"
|
| 504 |
+
# define OSSL_PROV_PARAM_RSA_PSS_SALTLEN_CHECK "rsa-pss-saltlen-check"
|
| 505 |
+
# define OSSL_PROV_PARAM_RSA_SIGN_X931_PAD_DISABLED "rsa-sign-x931-pad-disabled"
|
| 506 |
+
# define OSSL_PROV_PARAM_SECURITY_CHECKS "security-checks"
|
| 507 |
+
# define OSSL_PROV_PARAM_SELF_TEST_DESC "st-desc"
|
| 508 |
+
# define OSSL_PROV_PARAM_SELF_TEST_PHASE "st-phase"
|
| 509 |
+
# define OSSL_PROV_PARAM_SELF_TEST_TYPE "st-type"
|
| 510 |
+
# define OSSL_PROV_PARAM_SIGNATURE_DIGEST_CHECK "signature-digest-check"
|
| 511 |
+
# define OSSL_PROV_PARAM_SSHKDF_DIGEST_CHECK "sshkdf-digest-check"
|
| 512 |
+
# define OSSL_PROV_PARAM_SSHKDF_KEY_CHECK "sshkdf-key-check"
|
| 513 |
+
# define OSSL_PROV_PARAM_SSKDF_DIGEST_CHECK "sskdf-digest-check"
|
| 514 |
+
# define OSSL_PROV_PARAM_SSKDF_KEY_CHECK "sskdf-key-check"
|
| 515 |
+
# define OSSL_PROV_PARAM_STATUS "status"
|
| 516 |
+
# define OSSL_PROV_PARAM_TDES_ENCRYPT_DISABLED "tdes-encrypt-disabled"
|
| 517 |
+
# define OSSL_PROV_PARAM_TLS13_KDF_DIGEST_CHECK "tls13-kdf-digest-check"
|
| 518 |
+
# define OSSL_PROV_PARAM_TLS13_KDF_KEY_CHECK "tls13-kdf-key-check"
|
| 519 |
+
# define OSSL_PROV_PARAM_TLS1_PRF_DIGEST_CHECK "tls1-prf-digest-check"
|
| 520 |
+
# define OSSL_PROV_PARAM_TLS1_PRF_EMS_CHECK "tls1-prf-ems-check"
|
| 521 |
+
# define OSSL_PROV_PARAM_TLS1_PRF_KEY_CHECK "tls1-prf-key-check"
|
| 522 |
+
# define OSSL_PROV_PARAM_VERSION "version"
|
| 523 |
+
# define OSSL_PROV_PARAM_X942KDF_KEY_CHECK "x942kdf-key-check"
|
| 524 |
+
# define OSSL_PROV_PARAM_X963KDF_DIGEST_CHECK "x963kdf-digest-check"
|
| 525 |
+
# define OSSL_PROV_PARAM_X963KDF_KEY_CHECK "x963kdf-key-check"
|
| 526 |
+
# define OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 527 |
+
# define OSSL_RAND_PARAM_GENERATE "generate"
|
| 528 |
+
# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
|
| 529 |
+
# define OSSL_RAND_PARAM_STATE "state"
|
| 530 |
+
# define OSSL_RAND_PARAM_STRENGTH "strength"
|
| 531 |
+
# define OSSL_RAND_PARAM_TEST_ENTROPY "test_entropy"
|
| 532 |
+
# define OSSL_RAND_PARAM_TEST_NONCE "test_nonce"
|
| 533 |
+
# define OSSL_SIGNATURE_PARAM_ADD_RANDOM "additional-random"
|
| 534 |
+
# define OSSL_SIGNATURE_PARAM_ALGORITHM_ID OSSL_PKEY_PARAM_ALGORITHM_ID
|
| 535 |
+
# define OSSL_SIGNATURE_PARAM_ALGORITHM_ID_PARAMS OSSL_PKEY_PARAM_ALGORITHM_ID_PARAMS
|
| 536 |
+
# define OSSL_SIGNATURE_PARAM_CONTEXT_STRING "context-string"
|
| 537 |
+
# define OSSL_SIGNATURE_PARAM_DETERMINISTIC "deterministic"
|
| 538 |
+
# define OSSL_SIGNATURE_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
|
| 539 |
+
# define OSSL_SIGNATURE_PARAM_DIGEST_SIZE OSSL_PKEY_PARAM_DIGEST_SIZE
|
| 540 |
+
# define OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
| 541 |
+
# define OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK
|
| 542 |
+
# define OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
| 543 |
+
# define OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK "rsa-pss-saltlen-check"
|
| 544 |
+
# define OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK OSSL_PKEY_PARAM_FIPS_SIGN_CHECK
|
| 545 |
+
# define OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK "sign-x931-pad-check"
|
| 546 |
+
# define OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE "verify-message"
|
| 547 |
+
# define OSSL_SIGNATURE_PARAM_INSTANCE "instance"
|
| 548 |
+
# define OSSL_SIGNATURE_PARAM_KAT "kat"
|
| 549 |
+
# define OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING "message-encoding"
|
| 550 |
+
# define OSSL_SIGNATURE_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
|
| 551 |
+
# define OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES OSSL_PKEY_PARAM_MGF1_PROPERTIES
|
| 552 |
+
# define OSSL_SIGNATURE_PARAM_MU "mu"
|
| 553 |
+
# define OSSL_SIGNATURE_PARAM_NONCE_TYPE "nonce-type"
|
| 554 |
+
# define OSSL_SIGNATURE_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE
|
| 555 |
+
# define OSSL_SIGNATURE_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
|
| 556 |
+
# define OSSL_SIGNATURE_PARAM_PSS_SALTLEN "saltlen"
|
| 557 |
+
# define OSSL_SIGNATURE_PARAM_SIGNATURE "signature"
|
| 558 |
+
# define OSSL_SIGNATURE_PARAM_TEST_ENTROPY "test-entropy"
|
| 559 |
+
# define OSSL_SKEY_PARAM_KEY_LENGTH "key-length"
|
| 560 |
+
# define OSSL_SKEY_PARAM_RAW_BYTES "raw-bytes"
|
| 561 |
+
# define OSSL_STORE_PARAM_ALIAS "alias"
|
| 562 |
+
# define OSSL_STORE_PARAM_DIGEST "digest"
|
| 563 |
+
# define OSSL_STORE_PARAM_EXPECT "expect"
|
| 564 |
+
# define OSSL_STORE_PARAM_FINGERPRINT "fingerprint"
|
| 565 |
+
# define OSSL_STORE_PARAM_INPUT_TYPE "input-type"
|
| 566 |
+
# define OSSL_STORE_PARAM_ISSUER "name"
|
| 567 |
+
# define OSSL_STORE_PARAM_PROPERTIES "properties"
|
| 568 |
+
# define OSSL_STORE_PARAM_SERIAL "serial"
|
| 569 |
+
# define OSSL_STORE_PARAM_SUBJECT "subject"
|
| 570 |
+
|
| 571 |
+
# ifdef __cplusplus
|
| 572 |
+
}
|
| 573 |
+
# endif
|
| 574 |
+
|
| 575 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/crmf.h
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*-
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/crmf.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
* Copyright Nokia 2007-2019
|
| 7 |
+
* Copyright Siemens AG 2015-2019
|
| 8 |
+
*
|
| 9 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 10 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 11 |
+
* in the file LICENSE in the source distribution or at
|
| 12 |
+
* https://www.openssl.org/source/license.html
|
| 13 |
+
*
|
| 14 |
+
* CRMF (RFC 4211) implementation by M. Peylo, M. Viljanen, and D. von Oheimb.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
#ifndef OPENSSL_CRMF_H
|
| 20 |
+
# define OPENSSL_CRMF_H
|
| 21 |
+
|
| 22 |
+
# include <openssl/opensslconf.h>
|
| 23 |
+
|
| 24 |
+
# ifndef OPENSSL_NO_CRMF
|
| 25 |
+
# include <openssl/opensslv.h>
|
| 26 |
+
# include <openssl/safestack.h>
|
| 27 |
+
# include <openssl/crmferr.h>
|
| 28 |
+
# include <openssl/x509v3.h> /* for GENERAL_NAME etc. */
|
| 29 |
+
# include <openssl/cms.h>
|
| 30 |
+
|
| 31 |
+
/* explicit #includes not strictly needed since implied by the above: */
|
| 32 |
+
# include <openssl/types.h>
|
| 33 |
+
# include <openssl/x509.h>
|
| 34 |
+
|
| 35 |
+
# ifdef __cplusplus
|
| 36 |
+
extern "C" {
|
| 37 |
+
# endif
|
| 38 |
+
|
| 39 |
+
# define OSSL_CRMF_POPOPRIVKEY_THISMESSAGE 0
|
| 40 |
+
# define OSSL_CRMF_POPOPRIVKEY_SUBSEQUENTMESSAGE 1
|
| 41 |
+
# define OSSL_CRMF_POPOPRIVKEY_DHMAC 2
|
| 42 |
+
# define OSSL_CRMF_POPOPRIVKEY_AGREEMAC 3
|
| 43 |
+
# define OSSL_CRMF_POPOPRIVKEY_ENCRYPTEDKEY 4
|
| 44 |
+
|
| 45 |
+
# define OSSL_CRMF_SUBSEQUENTMESSAGE_ENCRCERT 0
|
| 46 |
+
# define OSSL_CRMF_SUBSEQUENTMESSAGE_CHALLENGERESP 1
|
| 47 |
+
typedef struct ossl_crmf_encryptedvalue_st OSSL_CRMF_ENCRYPTEDVALUE;
|
| 48 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE)
|
| 49 |
+
|
| 50 |
+
typedef struct ossl_crmf_encryptedkey_st OSSL_CRMF_ENCRYPTEDKEY;
|
| 51 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDKEY)
|
| 52 |
+
|
| 53 |
+
typedef struct ossl_crmf_msg_st OSSL_CRMF_MSG;
|
| 54 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSG)
|
| 55 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_MSG)
|
| 56 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_MSG, OSSL_CRMF_MSG, OSSL_CRMF_MSG)
|
| 57 |
+
#define sk_OSSL_CRMF_MSG_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk))
|
| 58 |
+
#define sk_OSSL_CRMF_MSG_value(sk, idx) ((OSSL_CRMF_MSG *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), (idx)))
|
| 59 |
+
#define sk_OSSL_CRMF_MSG_new(cmp) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp)))
|
| 60 |
+
#define sk_OSSL_CRMF_MSG_new_null() ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new_null())
|
| 61 |
+
#define sk_OSSL_CRMF_MSG_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp), (n)))
|
| 62 |
+
#define sk_OSSL_CRMF_MSG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (n))
|
| 63 |
+
#define sk_OSSL_CRMF_MSG_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_MSG_sk_type(sk))
|
| 64 |
+
#define sk_OSSL_CRMF_MSG_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_MSG_sk_type(sk))
|
| 65 |
+
#define sk_OSSL_CRMF_MSG_delete(sk, i) ((OSSL_CRMF_MSG *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (i)))
|
| 66 |
+
#define sk_OSSL_CRMF_MSG_delete_ptr(sk, ptr) ((OSSL_CRMF_MSG *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr)))
|
| 67 |
+
#define sk_OSSL_CRMF_MSG_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
|
| 68 |
+
#define sk_OSSL_CRMF_MSG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
|
| 69 |
+
#define sk_OSSL_CRMF_MSG_pop(sk) ((OSSL_CRMF_MSG *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_MSG_sk_type(sk)))
|
| 70 |
+
#define sk_OSSL_CRMF_MSG_shift(sk) ((OSSL_CRMF_MSG *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_MSG_sk_type(sk)))
|
| 71 |
+
#define sk_OSSL_CRMF_MSG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_MSG_sk_type(sk),ossl_check_OSSL_CRMF_MSG_freefunc_type(freefunc))
|
| 72 |
+
#define sk_OSSL_CRMF_MSG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr), (idx))
|
| 73 |
+
#define sk_OSSL_CRMF_MSG_set(sk, idx, ptr) ((OSSL_CRMF_MSG *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (idx), ossl_check_OSSL_CRMF_MSG_type(ptr)))
|
| 74 |
+
#define sk_OSSL_CRMF_MSG_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
|
| 75 |
+
#define sk_OSSL_CRMF_MSG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))
|
| 76 |
+
#define sk_OSSL_CRMF_MSG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr), pnum)
|
| 77 |
+
#define sk_OSSL_CRMF_MSG_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_MSG_sk_type(sk))
|
| 78 |
+
#define sk_OSSL_CRMF_MSG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk))
|
| 79 |
+
#define sk_OSSL_CRMF_MSG_dup(sk) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk)))
|
| 80 |
+
#define sk_OSSL_CRMF_MSG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_MSG_freefunc_type(freefunc)))
|
| 81 |
+
#define sk_OSSL_CRMF_MSG_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_MSG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp)))
|
| 82 |
+
|
| 83 |
+
typedef struct ossl_crmf_attributetypeandvalue_st OSSL_CRMF_ATTRIBUTETYPEANDVALUE;
|
| 84 |
+
void OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(OSSL_CRMF_ATTRIBUTETYPEANDVALUE *v);
|
| 85 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
|
| 86 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_ATTRIBUTETYPEANDVALUE, OSSL_CRMF_ATTRIBUTETYPEANDVALUE, OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
|
| 87 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
| 88 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_value(sk, idx) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (idx)))
|
| 89 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new(cmp) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp)))
|
| 90 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new_null() ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_new_null())
|
| 91 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp), (n)))
|
| 92 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (n))
|
| 93 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
| 94 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
| 95 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_delete(sk, i) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (i)))
|
| 96 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_delete_ptr(sk, ptr) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr)))
|
| 97 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
|
| 98 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
|
| 99 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop(sk) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)))
|
| 100 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_shift(sk) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)))
|
| 101 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk),ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_freefunc_type(freefunc))
|
| 102 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr), (idx))
|
| 103 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_set(sk, idx, ptr) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (idx), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr)))
|
| 104 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
|
| 105 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
|
| 106 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr), pnum)
|
| 107 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
| 108 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
| 109 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_dup(sk) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)))
|
| 110 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_freefunc_type(freefunc)))
|
| 111 |
+
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp)))
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
typedef struct ossl_crmf_pbmparameter_st OSSL_CRMF_PBMPARAMETER;
|
| 115 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER)
|
| 116 |
+
typedef struct ossl_crmf_poposigningkey_st OSSL_CRMF_POPOSIGNINGKEY;
|
| 117 |
+
typedef struct ossl_crmf_certrequest_st OSSL_CRMF_CERTREQUEST;
|
| 118 |
+
typedef struct ossl_crmf_certid_st OSSL_CRMF_CERTID;
|
| 119 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTID)
|
| 120 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID)
|
| 121 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_CERTID, OSSL_CRMF_CERTID, OSSL_CRMF_CERTID)
|
| 122 |
+
#define sk_OSSL_CRMF_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk))
|
| 123 |
+
#define sk_OSSL_CRMF_CERTID_value(sk, idx) ((OSSL_CRMF_CERTID *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk), (idx)))
|
| 124 |
+
#define sk_OSSL_CRMF_CERTID_new(cmp) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp)))
|
| 125 |
+
#define sk_OSSL_CRMF_CERTID_new_null() ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new_null())
|
| 126 |
+
#define sk_OSSL_CRMF_CERTID_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp), (n)))
|
| 127 |
+
#define sk_OSSL_CRMF_CERTID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (n))
|
| 128 |
+
#define sk_OSSL_CRMF_CERTID_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))
|
| 129 |
+
#define sk_OSSL_CRMF_CERTID_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))
|
| 130 |
+
#define sk_OSSL_CRMF_CERTID_delete(sk, i) ((OSSL_CRMF_CERTID *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (i)))
|
| 131 |
+
#define sk_OSSL_CRMF_CERTID_delete_ptr(sk, ptr) ((OSSL_CRMF_CERTID *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr)))
|
| 132 |
+
#define sk_OSSL_CRMF_CERTID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))
|
| 133 |
+
#define sk_OSSL_CRMF_CERTID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))
|
| 134 |
+
#define sk_OSSL_CRMF_CERTID_pop(sk) ((OSSL_CRMF_CERTID *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_CERTID_sk_type(sk)))
|
| 135 |
+
#define sk_OSSL_CRMF_CERTID_shift(sk) ((OSSL_CRMF_CERTID *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_CERTID_sk_type(sk)))
|
| 136 |
+
#define sk_OSSL_CRMF_CERTID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_CERTID_sk_type(sk),ossl_check_OSSL_CRMF_CERTID_freefunc_type(freefunc))
|
| 137 |
+
#define sk_OSSL_CRMF_CERTID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr), (idx))
|
| 138 |
+
#define sk_OSSL_CRMF_CERTID_set(sk, idx, ptr) ((OSSL_CRMF_CERTID *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (idx), ossl_check_OSSL_CRMF_CERTID_type(ptr)))
|
| 139 |
+
#define sk_OSSL_CRMF_CERTID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))
|
| 140 |
+
#define sk_OSSL_CRMF_CERTID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))
|
| 141 |
+
#define sk_OSSL_CRMF_CERTID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr), pnum)
|
| 142 |
+
#define sk_OSSL_CRMF_CERTID_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))
|
| 143 |
+
#define sk_OSSL_CRMF_CERTID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk))
|
| 144 |
+
#define sk_OSSL_CRMF_CERTID_dup(sk) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk)))
|
| 145 |
+
#define sk_OSSL_CRMF_CERTID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_CERTID_freefunc_type(freefunc)))
|
| 146 |
+
#define sk_OSSL_CRMF_CERTID_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_CERTID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp)))
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO;
|
| 150 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO)
|
| 151 |
+
typedef struct ossl_crmf_singlepubinfo_st OSSL_CRMF_SINGLEPUBINFO;
|
| 152 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_SINGLEPUBINFO)
|
| 153 |
+
typedef struct ossl_crmf_certtemplate_st OSSL_CRMF_CERTTEMPLATE;
|
| 154 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTTEMPLATE)
|
| 155 |
+
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTTEMPLATE)
|
| 156 |
+
typedef STACK_OF(OSSL_CRMF_MSG) OSSL_CRMF_MSGS;
|
| 157 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSGS)
|
| 158 |
+
|
| 159 |
+
typedef struct ossl_crmf_optionalvalidity_st OSSL_CRMF_OPTIONALVALIDITY;
|
| 160 |
+
|
| 161 |
+
/* crmf_pbm.c */
|
| 162 |
+
OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OSSL_LIB_CTX *libctx, size_t slen,
|
| 163 |
+
int owfnid, size_t itercnt,
|
| 164 |
+
int macnid);
|
| 165 |
+
int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq,
|
| 166 |
+
const OSSL_CRMF_PBMPARAMETER *pbmp,
|
| 167 |
+
const unsigned char *msg, size_t msglen,
|
| 168 |
+
const unsigned char *sec, size_t seclen,
|
| 169 |
+
unsigned char **mac, size_t *maclen);
|
| 170 |
+
|
| 171 |
+
/* crmf_lib.c */
|
| 172 |
+
int OSSL_CRMF_MSG_set1_regCtrl_regToken(OSSL_CRMF_MSG *msg,
|
| 173 |
+
const ASN1_UTF8STRING *tok);
|
| 174 |
+
ASN1_UTF8STRING
|
| 175 |
+
*OSSL_CRMF_MSG_get0_regCtrl_regToken(const OSSL_CRMF_MSG *msg);
|
| 176 |
+
int OSSL_CRMF_MSG_set1_regCtrl_authenticator(OSSL_CRMF_MSG *msg,
|
| 177 |
+
const ASN1_UTF8STRING *auth);
|
| 178 |
+
ASN1_UTF8STRING
|
| 179 |
+
*OSSL_CRMF_MSG_get0_regCtrl_authenticator(const OSSL_CRMF_MSG *msg);
|
| 180 |
+
int
|
| 181 |
+
OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo(OSSL_CRMF_PKIPUBLICATIONINFO *pi,
|
| 182 |
+
OSSL_CRMF_SINGLEPUBINFO *spi);
|
| 183 |
+
# define OSSL_CRMF_PUB_METHOD_DONTCARE 0
|
| 184 |
+
# define OSSL_CRMF_PUB_METHOD_X500 1
|
| 185 |
+
# define OSSL_CRMF_PUB_METHOD_WEB 2
|
| 186 |
+
# define OSSL_CRMF_PUB_METHOD_LDAP 3
|
| 187 |
+
int OSSL_CRMF_MSG_set0_SinglePubInfo(OSSL_CRMF_SINGLEPUBINFO *spi,
|
| 188 |
+
int method, GENERAL_NAME *nm);
|
| 189 |
+
# define OSSL_CRMF_PUB_ACTION_DONTPUBLISH 0
|
| 190 |
+
# define OSSL_CRMF_PUB_ACTION_PLEASEPUBLISH 1
|
| 191 |
+
int OSSL_CRMF_MSG_set_PKIPublicationInfo_action(OSSL_CRMF_PKIPUBLICATIONINFO *pi,
|
| 192 |
+
int action);
|
| 193 |
+
int OSSL_CRMF_MSG_set1_regCtrl_pkiPublicationInfo(OSSL_CRMF_MSG *msg,
|
| 194 |
+
const OSSL_CRMF_PKIPUBLICATIONINFO *pi);
|
| 195 |
+
OSSL_CRMF_PKIPUBLICATIONINFO
|
| 196 |
+
*OSSL_CRMF_MSG_get0_regCtrl_pkiPublicationInfo(const OSSL_CRMF_MSG *msg);
|
| 197 |
+
int OSSL_CRMF_MSG_set1_regCtrl_protocolEncrKey(OSSL_CRMF_MSG *msg,
|
| 198 |
+
const X509_PUBKEY *pubkey);
|
| 199 |
+
X509_PUBKEY
|
| 200 |
+
*OSSL_CRMF_MSG_get0_regCtrl_protocolEncrKey(const OSSL_CRMF_MSG *msg);
|
| 201 |
+
int OSSL_CRMF_MSG_set1_regCtrl_oldCertID(OSSL_CRMF_MSG *msg,
|
| 202 |
+
const OSSL_CRMF_CERTID *cid);
|
| 203 |
+
OSSL_CRMF_CERTID
|
| 204 |
+
*OSSL_CRMF_MSG_get0_regCtrl_oldCertID(const OSSL_CRMF_MSG *msg);
|
| 205 |
+
OSSL_CRMF_CERTID *OSSL_CRMF_CERTID_gen(const X509_NAME *issuer,
|
| 206 |
+
const ASN1_INTEGER *serial);
|
| 207 |
+
|
| 208 |
+
int OSSL_CRMF_MSG_set1_regInfo_utf8Pairs(OSSL_CRMF_MSG *msg,
|
| 209 |
+
const ASN1_UTF8STRING *utf8pairs);
|
| 210 |
+
ASN1_UTF8STRING
|
| 211 |
+
*OSSL_CRMF_MSG_get0_regInfo_utf8Pairs(const OSSL_CRMF_MSG *msg);
|
| 212 |
+
int OSSL_CRMF_MSG_set1_regInfo_certReq(OSSL_CRMF_MSG *msg,
|
| 213 |
+
const OSSL_CRMF_CERTREQUEST *cr);
|
| 214 |
+
OSSL_CRMF_CERTREQUEST
|
| 215 |
+
*OSSL_CRMF_MSG_get0_regInfo_certReq(const OSSL_CRMF_MSG *msg);
|
| 216 |
+
|
| 217 |
+
int OSSL_CRMF_MSG_set0_validity(OSSL_CRMF_MSG *crm,
|
| 218 |
+
ASN1_TIME *notBefore, ASN1_TIME *notAfter);
|
| 219 |
+
int OSSL_CRMF_MSG_set_certReqId(OSSL_CRMF_MSG *crm, int rid);
|
| 220 |
+
int OSSL_CRMF_MSG_get_certReqId(const OSSL_CRMF_MSG *crm);
|
| 221 |
+
int OSSL_CRMF_MSG_set0_extensions(OSSL_CRMF_MSG *crm, X509_EXTENSIONS *exts);
|
| 222 |
+
|
| 223 |
+
int OSSL_CRMF_MSG_push0_extension(OSSL_CRMF_MSG *crm, X509_EXTENSION *ext);
|
| 224 |
+
# define OSSL_CRMF_POPO_NONE -1
|
| 225 |
+
# define OSSL_CRMF_POPO_RAVERIFIED 0
|
| 226 |
+
# define OSSL_CRMF_POPO_SIGNATURE 1
|
| 227 |
+
# define OSSL_CRMF_POPO_KEYENC 2
|
| 228 |
+
# define OSSL_CRMF_POPO_KEYAGREE 3
|
| 229 |
+
int OSSL_CRMF_MSG_create_popo(int meth, OSSL_CRMF_MSG *crm,
|
| 230 |
+
EVP_PKEY *pkey, const EVP_MD *digest,
|
| 231 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 232 |
+
int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
|
| 233 |
+
int rid, int acceptRAVerified,
|
| 234 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 235 |
+
OSSL_CRMF_CERTTEMPLATE *OSSL_CRMF_MSG_get0_tmpl(const OSSL_CRMF_MSG *crm);
|
| 236 |
+
X509_PUBKEY
|
| 237 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_publicKey(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 238 |
+
const X509_NAME
|
| 239 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_subject(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 240 |
+
const X509_NAME
|
| 241 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_issuer(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 242 |
+
const ASN1_INTEGER
|
| 243 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 244 |
+
X509_EXTENSIONS
|
| 245 |
+
*OSSL_CRMF_CERTTEMPLATE_get0_extensions(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
| 246 |
+
const X509_NAME
|
| 247 |
+
*OSSL_CRMF_CERTID_get0_issuer(const OSSL_CRMF_CERTID *cid);
|
| 248 |
+
const ASN1_INTEGER
|
| 249 |
+
*OSSL_CRMF_CERTID_get0_serialNumber(const OSSL_CRMF_CERTID *cid);
|
| 250 |
+
int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl,
|
| 251 |
+
EVP_PKEY *pubkey,
|
| 252 |
+
const X509_NAME *subject,
|
| 253 |
+
const X509_NAME *issuer,
|
| 254 |
+
const ASN1_INTEGER *serial);
|
| 255 |
+
X509 *OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert,
|
| 256 |
+
OSSL_LIB_CTX *libctx, const char *propq,
|
| 257 |
+
EVP_PKEY *pkey);
|
| 258 |
+
X509 *OSSL_CRMF_ENCRYPTEDKEY_get1_encCert(const OSSL_CRMF_ENCRYPTEDKEY *ecert,
|
| 259 |
+
OSSL_LIB_CTX *libctx, const char *propq,
|
| 260 |
+
EVP_PKEY *pkey, unsigned int flags);
|
| 261 |
+
unsigned char
|
| 262 |
+
*OSSL_CRMF_ENCRYPTEDVALUE_decrypt(const OSSL_CRMF_ENCRYPTEDVALUE *enc,
|
| 263 |
+
OSSL_LIB_CTX *libctx, const char *propq,
|
| 264 |
+
EVP_PKEY *pkey, int *outlen);
|
| 265 |
+
EVP_PKEY *OSSL_CRMF_ENCRYPTEDKEY_get1_pkey(const OSSL_CRMF_ENCRYPTEDKEY *encryptedKey,
|
| 266 |
+
X509_STORE *ts, STACK_OF(X509) *extra, EVP_PKEY *pkey,
|
| 267 |
+
X509 *cert, ASN1_OCTET_STRING *secret,
|
| 268 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 269 |
+
int OSSL_CRMF_MSG_centralkeygen_requested(const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr);
|
| 270 |
+
# ifndef OPENSSL_NO_CMS
|
| 271 |
+
OSSL_CRMF_ENCRYPTEDKEY *OSSL_CRMF_ENCRYPTEDKEY_init_envdata(CMS_EnvelopedData *envdata);
|
| 272 |
+
# endif
|
| 273 |
+
|
| 274 |
+
# ifdef __cplusplus
|
| 275 |
+
}
|
| 276 |
+
# endif
|
| 277 |
+
# endif /* !defined(OPENSSL_NO_CRMF) */
|
| 278 |
+
#endif /* !defined(OPENSSL_CRMF_H) */
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/ct.h
ADDED
|
@@ -0,0 +1,573 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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include/openssl/ct.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_CT_H
|
| 16 |
+
# define OPENSSL_CT_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_CT_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/opensslconf.h>
|
| 25 |
+
|
| 26 |
+
# ifndef OPENSSL_NO_CT
|
| 27 |
+
# include <openssl/types.h>
|
| 28 |
+
# include <openssl/safestack.h>
|
| 29 |
+
# include <openssl/x509.h>
|
| 30 |
+
# include <openssl/cterr.h>
|
| 31 |
+
# ifdef __cplusplus
|
| 32 |
+
extern "C" {
|
| 33 |
+
# endif
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
/* Minimum RSA key size, from RFC6962 */
|
| 37 |
+
# define SCT_MIN_RSA_BITS 2048
|
| 38 |
+
|
| 39 |
+
/* All hashes are SHA256 in v1 of Certificate Transparency */
|
| 40 |
+
# define CT_V1_HASHLEN SHA256_DIGEST_LENGTH
|
| 41 |
+
|
| 42 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SCT, SCT, SCT)
|
| 43 |
+
#define sk_SCT_num(sk) OPENSSL_sk_num(ossl_check_const_SCT_sk_type(sk))
|
| 44 |
+
#define sk_SCT_value(sk, idx) ((SCT *)OPENSSL_sk_value(ossl_check_const_SCT_sk_type(sk), (idx)))
|
| 45 |
+
#define sk_SCT_new(cmp) ((STACK_OF(SCT) *)OPENSSL_sk_new(ossl_check_SCT_compfunc_type(cmp)))
|
| 46 |
+
#define sk_SCT_new_null() ((STACK_OF(SCT) *)OPENSSL_sk_new_null())
|
| 47 |
+
#define sk_SCT_new_reserve(cmp, n) ((STACK_OF(SCT) *)OPENSSL_sk_new_reserve(ossl_check_SCT_compfunc_type(cmp), (n)))
|
| 48 |
+
#define sk_SCT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SCT_sk_type(sk), (n))
|
| 49 |
+
#define sk_SCT_free(sk) OPENSSL_sk_free(ossl_check_SCT_sk_type(sk))
|
| 50 |
+
#define sk_SCT_zero(sk) OPENSSL_sk_zero(ossl_check_SCT_sk_type(sk))
|
| 51 |
+
#define sk_SCT_delete(sk, i) ((SCT *)OPENSSL_sk_delete(ossl_check_SCT_sk_type(sk), (i)))
|
| 52 |
+
#define sk_SCT_delete_ptr(sk, ptr) ((SCT *)OPENSSL_sk_delete_ptr(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr)))
|
| 53 |
+
#define sk_SCT_push(sk, ptr) OPENSSL_sk_push(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
| 54 |
+
#define sk_SCT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
| 55 |
+
#define sk_SCT_pop(sk) ((SCT *)OPENSSL_sk_pop(ossl_check_SCT_sk_type(sk)))
|
| 56 |
+
#define sk_SCT_shift(sk) ((SCT *)OPENSSL_sk_shift(ossl_check_SCT_sk_type(sk)))
|
| 57 |
+
#define sk_SCT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SCT_sk_type(sk),ossl_check_SCT_freefunc_type(freefunc))
|
| 58 |
+
#define sk_SCT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), (idx))
|
| 59 |
+
#define sk_SCT_set(sk, idx, ptr) ((SCT *)OPENSSL_sk_set(ossl_check_SCT_sk_type(sk), (idx), ossl_check_SCT_type(ptr)))
|
| 60 |
+
#define sk_SCT_find(sk, ptr) OPENSSL_sk_find(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
| 61 |
+
#define sk_SCT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
| 62 |
+
#define sk_SCT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), pnum)
|
| 63 |
+
#define sk_SCT_sort(sk) OPENSSL_sk_sort(ossl_check_SCT_sk_type(sk))
|
| 64 |
+
#define sk_SCT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SCT_sk_type(sk))
|
| 65 |
+
#define sk_SCT_dup(sk) ((STACK_OF(SCT) *)OPENSSL_sk_dup(ossl_check_const_SCT_sk_type(sk)))
|
| 66 |
+
#define sk_SCT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SCT) *)OPENSSL_sk_deep_copy(ossl_check_const_SCT_sk_type(sk), ossl_check_SCT_copyfunc_type(copyfunc), ossl_check_SCT_freefunc_type(freefunc)))
|
| 67 |
+
#define sk_SCT_set_cmp_func(sk, cmp) ((sk_SCT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SCT_sk_type(sk), ossl_check_SCT_compfunc_type(cmp)))
|
| 68 |
+
SKM_DEFINE_STACK_OF_INTERNAL(CTLOG, CTLOG, CTLOG)
|
| 69 |
+
#define sk_CTLOG_num(sk) OPENSSL_sk_num(ossl_check_const_CTLOG_sk_type(sk))
|
| 70 |
+
#define sk_CTLOG_value(sk, idx) ((CTLOG *)OPENSSL_sk_value(ossl_check_const_CTLOG_sk_type(sk), (idx)))
|
| 71 |
+
#define sk_CTLOG_new(cmp) ((STACK_OF(CTLOG) *)OPENSSL_sk_new(ossl_check_CTLOG_compfunc_type(cmp)))
|
| 72 |
+
#define sk_CTLOG_new_null() ((STACK_OF(CTLOG) *)OPENSSL_sk_new_null())
|
| 73 |
+
#define sk_CTLOG_new_reserve(cmp, n) ((STACK_OF(CTLOG) *)OPENSSL_sk_new_reserve(ossl_check_CTLOG_compfunc_type(cmp), (n)))
|
| 74 |
+
#define sk_CTLOG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CTLOG_sk_type(sk), (n))
|
| 75 |
+
#define sk_CTLOG_free(sk) OPENSSL_sk_free(ossl_check_CTLOG_sk_type(sk))
|
| 76 |
+
#define sk_CTLOG_zero(sk) OPENSSL_sk_zero(ossl_check_CTLOG_sk_type(sk))
|
| 77 |
+
#define sk_CTLOG_delete(sk, i) ((CTLOG *)OPENSSL_sk_delete(ossl_check_CTLOG_sk_type(sk), (i)))
|
| 78 |
+
#define sk_CTLOG_delete_ptr(sk, ptr) ((CTLOG *)OPENSSL_sk_delete_ptr(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr)))
|
| 79 |
+
#define sk_CTLOG_push(sk, ptr) OPENSSL_sk_push(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
| 80 |
+
#define sk_CTLOG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
| 81 |
+
#define sk_CTLOG_pop(sk) ((CTLOG *)OPENSSL_sk_pop(ossl_check_CTLOG_sk_type(sk)))
|
| 82 |
+
#define sk_CTLOG_shift(sk) ((CTLOG *)OPENSSL_sk_shift(ossl_check_CTLOG_sk_type(sk)))
|
| 83 |
+
#define sk_CTLOG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CTLOG_sk_type(sk),ossl_check_CTLOG_freefunc_type(freefunc))
|
| 84 |
+
#define sk_CTLOG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), (idx))
|
| 85 |
+
#define sk_CTLOG_set(sk, idx, ptr) ((CTLOG *)OPENSSL_sk_set(ossl_check_CTLOG_sk_type(sk), (idx), ossl_check_CTLOG_type(ptr)))
|
| 86 |
+
#define sk_CTLOG_find(sk, ptr) OPENSSL_sk_find(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
| 87 |
+
#define sk_CTLOG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
| 88 |
+
#define sk_CTLOG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), pnum)
|
| 89 |
+
#define sk_CTLOG_sort(sk) OPENSSL_sk_sort(ossl_check_CTLOG_sk_type(sk))
|
| 90 |
+
#define sk_CTLOG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CTLOG_sk_type(sk))
|
| 91 |
+
#define sk_CTLOG_dup(sk) ((STACK_OF(CTLOG) *)OPENSSL_sk_dup(ossl_check_const_CTLOG_sk_type(sk)))
|
| 92 |
+
#define sk_CTLOG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CTLOG) *)OPENSSL_sk_deep_copy(ossl_check_const_CTLOG_sk_type(sk), ossl_check_CTLOG_copyfunc_type(copyfunc), ossl_check_CTLOG_freefunc_type(freefunc)))
|
| 93 |
+
#define sk_CTLOG_set_cmp_func(sk, cmp) ((sk_CTLOG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_compfunc_type(cmp)))
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
typedef enum {
|
| 98 |
+
CT_LOG_ENTRY_TYPE_NOT_SET = -1,
|
| 99 |
+
CT_LOG_ENTRY_TYPE_X509 = 0,
|
| 100 |
+
CT_LOG_ENTRY_TYPE_PRECERT = 1
|
| 101 |
+
} ct_log_entry_type_t;
|
| 102 |
+
|
| 103 |
+
typedef enum {
|
| 104 |
+
SCT_VERSION_NOT_SET = -1,
|
| 105 |
+
SCT_VERSION_V1 = 0
|
| 106 |
+
} sct_version_t;
|
| 107 |
+
|
| 108 |
+
typedef enum {
|
| 109 |
+
SCT_SOURCE_UNKNOWN,
|
| 110 |
+
SCT_SOURCE_TLS_EXTENSION,
|
| 111 |
+
SCT_SOURCE_X509V3_EXTENSION,
|
| 112 |
+
SCT_SOURCE_OCSP_STAPLED_RESPONSE
|
| 113 |
+
} sct_source_t;
|
| 114 |
+
|
| 115 |
+
typedef enum {
|
| 116 |
+
SCT_VALIDATION_STATUS_NOT_SET,
|
| 117 |
+
SCT_VALIDATION_STATUS_UNKNOWN_LOG,
|
| 118 |
+
SCT_VALIDATION_STATUS_VALID,
|
| 119 |
+
SCT_VALIDATION_STATUS_INVALID,
|
| 120 |
+
SCT_VALIDATION_STATUS_UNVERIFIED,
|
| 121 |
+
SCT_VALIDATION_STATUS_UNKNOWN_VERSION
|
| 122 |
+
} sct_validation_status_t;
|
| 123 |
+
|
| 124 |
+
/******************************************
|
| 125 |
+
* CT policy evaluation context functions *
|
| 126 |
+
******************************************/
|
| 127 |
+
|
| 128 |
+
/*
|
| 129 |
+
* Creates a new, empty policy evaluation context associated with the given
|
| 130 |
+
* library context and property query string.
|
| 131 |
+
* The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished
|
| 132 |
+
* with the CT_POLICY_EVAL_CTX.
|
| 133 |
+
*/
|
| 134 |
+
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx,
|
| 135 |
+
const char *propq);
|
| 136 |
+
|
| 137 |
+
/*
|
| 138 |
+
* The same as CT_POLICY_EVAL_CTX_new_ex() but the default library
|
| 139 |
+
* context and property query string is used.
|
| 140 |
+
*/
|
| 141 |
+
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
|
| 142 |
+
|
| 143 |
+
/* Deletes a policy evaluation context and anything it owns. */
|
| 144 |
+
void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
|
| 145 |
+
|
| 146 |
+
/* Gets the peer certificate that the SCTs are for */
|
| 147 |
+
X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx);
|
| 148 |
+
|
| 149 |
+
/*
|
| 150 |
+
* Sets the certificate associated with the received SCTs.
|
| 151 |
+
* Increments the reference count of cert.
|
| 152 |
+
* Returns 1 on success, 0 otherwise.
|
| 153 |
+
*/
|
| 154 |
+
int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
|
| 155 |
+
|
| 156 |
+
/* Gets the issuer of the aforementioned certificate */
|
| 157 |
+
X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx);
|
| 158 |
+
|
| 159 |
+
/*
|
| 160 |
+
* Sets the issuer of the certificate associated with the received SCTs.
|
| 161 |
+
* Increments the reference count of issuer.
|
| 162 |
+
* Returns 1 on success, 0 otherwise.
|
| 163 |
+
*/
|
| 164 |
+
int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
|
| 165 |
+
|
| 166 |
+
/* Gets the CT logs that are trusted sources of SCTs */
|
| 167 |
+
const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx);
|
| 168 |
+
|
| 169 |
+
/* Sets the log store that is in use. It must outlive the CT_POLICY_EVAL_CTX. */
|
| 170 |
+
void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx,
|
| 171 |
+
CTLOG_STORE *log_store);
|
| 172 |
+
|
| 173 |
+
/*
|
| 174 |
+
* Gets the time, in milliseconds since the Unix epoch, that will be used as the
|
| 175 |
+
* current time when checking whether an SCT was issued in the future.
|
| 176 |
+
* Such SCTs will fail validation, as required by RFC6962.
|
| 177 |
+
*/
|
| 178 |
+
uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx);
|
| 179 |
+
|
| 180 |
+
/*
|
| 181 |
+
* Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch.
|
| 182 |
+
* If an SCT's timestamp is after this time, it will be interpreted as having
|
| 183 |
+
* been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs
|
| 184 |
+
* whose timestamp is in the future", so an SCT will not validate in this case.
|
| 185 |
+
*/
|
| 186 |
+
void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms);
|
| 187 |
+
|
| 188 |
+
/*****************
|
| 189 |
+
* SCT functions *
|
| 190 |
+
*****************/
|
| 191 |
+
|
| 192 |
+
/*
|
| 193 |
+
* Creates a new, blank SCT.
|
| 194 |
+
* The caller is responsible for calling SCT_free when finished with the SCT.
|
| 195 |
+
*/
|
| 196 |
+
SCT *SCT_new(void);
|
| 197 |
+
|
| 198 |
+
/*
|
| 199 |
+
* Creates a new SCT from some base64-encoded strings.
|
| 200 |
+
* The caller is responsible for calling SCT_free when finished with the SCT.
|
| 201 |
+
*/
|
| 202 |
+
SCT *SCT_new_from_base64(unsigned char version,
|
| 203 |
+
const char *logid_base64,
|
| 204 |
+
ct_log_entry_type_t entry_type,
|
| 205 |
+
uint64_t timestamp,
|
| 206 |
+
const char *extensions_base64,
|
| 207 |
+
const char *signature_base64);
|
| 208 |
+
|
| 209 |
+
/*
|
| 210 |
+
* Frees the SCT and the underlying data structures.
|
| 211 |
+
*/
|
| 212 |
+
void SCT_free(SCT *sct);
|
| 213 |
+
|
| 214 |
+
/*
|
| 215 |
+
* Free a stack of SCTs, and the underlying SCTs themselves.
|
| 216 |
+
* Intended to be compatible with X509V3_EXT_FREE.
|
| 217 |
+
*/
|
| 218 |
+
void SCT_LIST_free(STACK_OF(SCT) *a);
|
| 219 |
+
|
| 220 |
+
/*
|
| 221 |
+
* Returns the version of the SCT.
|
| 222 |
+
*/
|
| 223 |
+
sct_version_t SCT_get_version(const SCT *sct);
|
| 224 |
+
|
| 225 |
+
/*
|
| 226 |
+
* Set the version of an SCT.
|
| 227 |
+
* Returns 1 on success, 0 if the version is unrecognized.
|
| 228 |
+
*/
|
| 229 |
+
__owur int SCT_set_version(SCT *sct, sct_version_t version);
|
| 230 |
+
|
| 231 |
+
/*
|
| 232 |
+
* Returns the log entry type of the SCT.
|
| 233 |
+
*/
|
| 234 |
+
ct_log_entry_type_t SCT_get_log_entry_type(const SCT *sct);
|
| 235 |
+
|
| 236 |
+
/*
|
| 237 |
+
* Set the log entry type of an SCT.
|
| 238 |
+
* Returns 1 on success, 0 otherwise.
|
| 239 |
+
*/
|
| 240 |
+
__owur int SCT_set_log_entry_type(SCT *sct, ct_log_entry_type_t entry_type);
|
| 241 |
+
|
| 242 |
+
/*
|
| 243 |
+
* Gets the ID of the log that an SCT came from.
|
| 244 |
+
* Ownership of the log ID remains with the SCT.
|
| 245 |
+
* Returns the length of the log ID.
|
| 246 |
+
*/
|
| 247 |
+
size_t SCT_get0_log_id(const SCT *sct, unsigned char **log_id);
|
| 248 |
+
|
| 249 |
+
/*
|
| 250 |
+
* Set the log ID of an SCT to point directly to the *log_id specified.
|
| 251 |
+
* The SCT takes ownership of the specified pointer.
|
| 252 |
+
* Returns 1 on success, 0 otherwise.
|
| 253 |
+
*/
|
| 254 |
+
__owur int SCT_set0_log_id(SCT *sct, unsigned char *log_id, size_t log_id_len);
|
| 255 |
+
|
| 256 |
+
/*
|
| 257 |
+
* Set the log ID of an SCT.
|
| 258 |
+
* This makes a copy of the log_id.
|
| 259 |
+
* Returns 1 on success, 0 otherwise.
|
| 260 |
+
*/
|
| 261 |
+
__owur int SCT_set1_log_id(SCT *sct, const unsigned char *log_id,
|
| 262 |
+
size_t log_id_len);
|
| 263 |
+
|
| 264 |
+
/*
|
| 265 |
+
* Returns the timestamp for the SCT (epoch time in milliseconds).
|
| 266 |
+
*/
|
| 267 |
+
uint64_t SCT_get_timestamp(const SCT *sct);
|
| 268 |
+
|
| 269 |
+
/*
|
| 270 |
+
* Set the timestamp of an SCT (epoch time in milliseconds).
|
| 271 |
+
*/
|
| 272 |
+
void SCT_set_timestamp(SCT *sct, uint64_t timestamp);
|
| 273 |
+
|
| 274 |
+
/*
|
| 275 |
+
* Return the NID for the signature used by the SCT.
|
| 276 |
+
* For CT v1, this will be either NID_sha256WithRSAEncryption or
|
| 277 |
+
* NID_ecdsa_with_SHA256 (or NID_undef if incorrect/unset).
|
| 278 |
+
*/
|
| 279 |
+
int SCT_get_signature_nid(const SCT *sct);
|
| 280 |
+
|
| 281 |
+
/*
|
| 282 |
+
* Set the signature type of an SCT
|
| 283 |
+
* For CT v1, this should be either NID_sha256WithRSAEncryption or
|
| 284 |
+
* NID_ecdsa_with_SHA256.
|
| 285 |
+
* Returns 1 on success, 0 otherwise.
|
| 286 |
+
*/
|
| 287 |
+
__owur int SCT_set_signature_nid(SCT *sct, int nid);
|
| 288 |
+
|
| 289 |
+
/*
|
| 290 |
+
* Set *ext to point to the extension data for the SCT. ext must not be NULL.
|
| 291 |
+
* The SCT retains ownership of this pointer.
|
| 292 |
+
* Returns length of the data pointed to.
|
| 293 |
+
*/
|
| 294 |
+
size_t SCT_get0_extensions(const SCT *sct, unsigned char **ext);
|
| 295 |
+
|
| 296 |
+
/*
|
| 297 |
+
* Set the extensions of an SCT to point directly to the *ext specified.
|
| 298 |
+
* The SCT takes ownership of the specified pointer.
|
| 299 |
+
*/
|
| 300 |
+
void SCT_set0_extensions(SCT *sct, unsigned char *ext, size_t ext_len);
|
| 301 |
+
|
| 302 |
+
/*
|
| 303 |
+
* Set the extensions of an SCT.
|
| 304 |
+
* This takes a copy of the ext.
|
| 305 |
+
* Returns 1 on success, 0 otherwise.
|
| 306 |
+
*/
|
| 307 |
+
__owur int SCT_set1_extensions(SCT *sct, const unsigned char *ext,
|
| 308 |
+
size_t ext_len);
|
| 309 |
+
|
| 310 |
+
/*
|
| 311 |
+
* Set *sig to point to the signature for the SCT. sig must not be NULL.
|
| 312 |
+
* The SCT retains ownership of this pointer.
|
| 313 |
+
* Returns length of the data pointed to.
|
| 314 |
+
*/
|
| 315 |
+
size_t SCT_get0_signature(const SCT *sct, unsigned char **sig);
|
| 316 |
+
|
| 317 |
+
/*
|
| 318 |
+
* Set the signature of an SCT to point directly to the *sig specified.
|
| 319 |
+
* The SCT takes ownership of the specified pointer.
|
| 320 |
+
*/
|
| 321 |
+
void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len);
|
| 322 |
+
|
| 323 |
+
/*
|
| 324 |
+
* Set the signature of an SCT to be a copy of the *sig specified.
|
| 325 |
+
* Returns 1 on success, 0 otherwise.
|
| 326 |
+
*/
|
| 327 |
+
__owur int SCT_set1_signature(SCT *sct, const unsigned char *sig,
|
| 328 |
+
size_t sig_len);
|
| 329 |
+
|
| 330 |
+
/*
|
| 331 |
+
* The origin of this SCT, e.g. TLS extension, OCSP response, etc.
|
| 332 |
+
*/
|
| 333 |
+
sct_source_t SCT_get_source(const SCT *sct);
|
| 334 |
+
|
| 335 |
+
/*
|
| 336 |
+
* Set the origin of this SCT, e.g. TLS extension, OCSP response, etc.
|
| 337 |
+
* Returns 1 on success, 0 otherwise.
|
| 338 |
+
*/
|
| 339 |
+
__owur int SCT_set_source(SCT *sct, sct_source_t source);
|
| 340 |
+
|
| 341 |
+
/*
|
| 342 |
+
* Returns a text string describing the validation status of |sct|.
|
| 343 |
+
*/
|
| 344 |
+
const char *SCT_validation_status_string(const SCT *sct);
|
| 345 |
+
|
| 346 |
+
/*
|
| 347 |
+
* Pretty-prints an |sct| to |out|.
|
| 348 |
+
* It will be indented by the number of spaces specified by |indent|.
|
| 349 |
+
* If |logs| is not NULL, it will be used to lookup the CT log that the SCT came
|
| 350 |
+
* from, so that the log name can be printed.
|
| 351 |
+
*/
|
| 352 |
+
void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG_STORE *logs);
|
| 353 |
+
|
| 354 |
+
/*
|
| 355 |
+
* Pretty-prints an |sct_list| to |out|.
|
| 356 |
+
* It will be indented by the number of spaces specified by |indent|.
|
| 357 |
+
* SCTs will be delimited by |separator|.
|
| 358 |
+
* If |logs| is not NULL, it will be used to lookup the CT log that each SCT
|
| 359 |
+
* came from, so that the log names can be printed.
|
| 360 |
+
*/
|
| 361 |
+
void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent,
|
| 362 |
+
const char *separator, const CTLOG_STORE *logs);
|
| 363 |
+
|
| 364 |
+
/*
|
| 365 |
+
* Gets the last result of validating this SCT.
|
| 366 |
+
* If it has not been validated yet, returns SCT_VALIDATION_STATUS_NOT_SET.
|
| 367 |
+
*/
|
| 368 |
+
sct_validation_status_t SCT_get_validation_status(const SCT *sct);
|
| 369 |
+
|
| 370 |
+
/*
|
| 371 |
+
* Validates the given SCT with the provided context.
|
| 372 |
+
* Sets the "validation_status" field of the SCT.
|
| 373 |
+
* Returns 1 if the SCT is valid and the signature verifies.
|
| 374 |
+
* Returns 0 if the SCT is invalid or could not be verified.
|
| 375 |
+
* Returns -1 if an error occurs.
|
| 376 |
+
*/
|
| 377 |
+
__owur int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx);
|
| 378 |
+
|
| 379 |
+
/*
|
| 380 |
+
* Validates the given list of SCTs with the provided context.
|
| 381 |
+
* Sets the "validation_status" field of each SCT.
|
| 382 |
+
* Returns 1 if there are no invalid SCTs and all signatures verify.
|
| 383 |
+
* Returns 0 if at least one SCT is invalid or could not be verified.
|
| 384 |
+
* Returns a negative integer if an error occurs.
|
| 385 |
+
*/
|
| 386 |
+
__owur int SCT_LIST_validate(const STACK_OF(SCT) *scts,
|
| 387 |
+
CT_POLICY_EVAL_CTX *ctx);
|
| 388 |
+
|
| 389 |
+
|
| 390 |
+
/*********************************
|
| 391 |
+
* SCT parsing and serialization *
|
| 392 |
+
*********************************/
|
| 393 |
+
|
| 394 |
+
/*
|
| 395 |
+
* Serialize (to TLS format) a stack of SCTs and return the length.
|
| 396 |
+
* "a" must not be NULL.
|
| 397 |
+
* If "pp" is NULL, just return the length of what would have been serialized.
|
| 398 |
+
* If "pp" is not NULL and "*pp" is null, function will allocate a new pointer
|
| 399 |
+
* for data that caller is responsible for freeing (only if function returns
|
| 400 |
+
* successfully).
|
| 401 |
+
* If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring
|
| 402 |
+
* that "*pp" is large enough to accept all of the serialized data.
|
| 403 |
+
* Returns < 0 on error, >= 0 indicating bytes written (or would have been)
|
| 404 |
+
* on success.
|
| 405 |
+
*/
|
| 406 |
+
__owur int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp);
|
| 407 |
+
|
| 408 |
+
/*
|
| 409 |
+
* Convert TLS format SCT list to a stack of SCTs.
|
| 410 |
+
* If "a" or "*a" is NULL, a new stack will be created that the caller is
|
| 411 |
+
* responsible for freeing (by calling SCT_LIST_free).
|
| 412 |
+
* "**pp" and "*pp" must not be NULL.
|
| 413 |
+
* Upon success, "*pp" will point to after the last bytes read, and a stack
|
| 414 |
+
* will be returned.
|
| 415 |
+
* Upon failure, a NULL pointer will be returned, and the position of "*pp" is
|
| 416 |
+
* not defined.
|
| 417 |
+
*/
|
| 418 |
+
STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
|
| 419 |
+
size_t len);
|
| 420 |
+
|
| 421 |
+
/*
|
| 422 |
+
* Serialize (to DER format) a stack of SCTs and return the length.
|
| 423 |
+
* "a" must not be NULL.
|
| 424 |
+
* If "pp" is NULL, just returns the length of what would have been serialized.
|
| 425 |
+
* If "pp" is not NULL and "*pp" is null, function will allocate a new pointer
|
| 426 |
+
* for data that caller is responsible for freeing (only if function returns
|
| 427 |
+
* successfully).
|
| 428 |
+
* If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring
|
| 429 |
+
* that "*pp" is large enough to accept all of the serialized data.
|
| 430 |
+
* Returns < 0 on error, >= 0 indicating bytes written (or would have been)
|
| 431 |
+
* on success.
|
| 432 |
+
*/
|
| 433 |
+
__owur int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp);
|
| 434 |
+
|
| 435 |
+
/*
|
| 436 |
+
* Parses an SCT list in DER format and returns it.
|
| 437 |
+
* If "a" or "*a" is NULL, a new stack will be created that the caller is
|
| 438 |
+
* responsible for freeing (by calling SCT_LIST_free).
|
| 439 |
+
* "**pp" and "*pp" must not be NULL.
|
| 440 |
+
* Upon success, "*pp" will point to after the last bytes read, and a stack
|
| 441 |
+
* will be returned.
|
| 442 |
+
* Upon failure, a NULL pointer will be returned, and the position of "*pp" is
|
| 443 |
+
* not defined.
|
| 444 |
+
*/
|
| 445 |
+
STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp,
|
| 446 |
+
long len);
|
| 447 |
+
|
| 448 |
+
/*
|
| 449 |
+
* Serialize (to TLS format) an |sct| and write it to |out|.
|
| 450 |
+
* If |out| is null, no SCT will be output but the length will still be returned.
|
| 451 |
+
* If |out| points to a null pointer, a string will be allocated to hold the
|
| 452 |
+
* TLS-format SCT. It is the responsibility of the caller to free it.
|
| 453 |
+
* If |out| points to an allocated string, the TLS-format SCT will be written
|
| 454 |
+
* to it.
|
| 455 |
+
* The length of the SCT in TLS format will be returned.
|
| 456 |
+
*/
|
| 457 |
+
__owur int i2o_SCT(const SCT *sct, unsigned char **out);
|
| 458 |
+
|
| 459 |
+
/*
|
| 460 |
+
* Parses an SCT in TLS format and returns it.
|
| 461 |
+
* If |psct| is not null, it will end up pointing to the parsed SCT. If it
|
| 462 |
+
* already points to a non-null pointer, the pointer will be free'd.
|
| 463 |
+
* |in| should be a pointer to a string containing the TLS-format SCT.
|
| 464 |
+
* |in| will be advanced to the end of the SCT if parsing succeeds.
|
| 465 |
+
* |len| should be the length of the SCT in |in|.
|
| 466 |
+
* Returns NULL if an error occurs.
|
| 467 |
+
* If the SCT is an unsupported version, only the SCT's 'sct' and 'sct_len'
|
| 468 |
+
* fields will be populated (with |in| and |len| respectively).
|
| 469 |
+
*/
|
| 470 |
+
SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len);
|
| 471 |
+
|
| 472 |
+
/********************
|
| 473 |
+
* CT log functions *
|
| 474 |
+
********************/
|
| 475 |
+
|
| 476 |
+
/*
|
| 477 |
+
* Creates a new CT log instance with the given |public_key| and |name| and
|
| 478 |
+
* associates it with the give library context |libctx| and property query
|
| 479 |
+
* string |propq|.
|
| 480 |
+
* Takes ownership of |public_key| but copies |name|.
|
| 481 |
+
* Returns NULL if malloc fails or if |public_key| cannot be converted to DER.
|
| 482 |
+
* Should be deleted by the caller using CTLOG_free when no longer needed.
|
| 483 |
+
*/
|
| 484 |
+
CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OSSL_LIB_CTX *libctx,
|
| 485 |
+
const char *propq);
|
| 486 |
+
|
| 487 |
+
/*
|
| 488 |
+
* The same as CTLOG_new_ex except that the default library context and
|
| 489 |
+
* property query string are used.
|
| 490 |
+
*/
|
| 491 |
+
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
|
| 492 |
+
|
| 493 |
+
/*
|
| 494 |
+
* Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER
|
| 495 |
+
* in |pkey_base64| and associated with the given library context |libctx| and
|
| 496 |
+
* property query string |propq|. The |name| is a string to help users identify
|
| 497 |
+
* this log.
|
| 498 |
+
* Returns 1 on success, 0 on failure.
|
| 499 |
+
* Should be deleted by the caller using CTLOG_free when no longer needed.
|
| 500 |
+
*/
|
| 501 |
+
int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
|
| 502 |
+
const char *name, OSSL_LIB_CTX *libctx,
|
| 503 |
+
const char *propq);
|
| 504 |
+
|
| 505 |
+
/*
|
| 506 |
+
* The same as CTLOG_new_from_base64_ex() except that the default
|
| 507 |
+
* library context and property query string are used.
|
| 508 |
+
* Returns 1 on success, 0 on failure.
|
| 509 |
+
*/
|
| 510 |
+
int CTLOG_new_from_base64(CTLOG ** ct_log,
|
| 511 |
+
const char *pkey_base64, const char *name);
|
| 512 |
+
|
| 513 |
+
/*
|
| 514 |
+
* Deletes a CT log instance and its fields.
|
| 515 |
+
*/
|
| 516 |
+
void CTLOG_free(CTLOG *log);
|
| 517 |
+
|
| 518 |
+
/* Gets the name of the CT log */
|
| 519 |
+
const char *CTLOG_get0_name(const CTLOG *log);
|
| 520 |
+
/* Gets the ID of the CT log */
|
| 521 |
+
void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id,
|
| 522 |
+
size_t *log_id_len);
|
| 523 |
+
/* Gets the public key of the CT log */
|
| 524 |
+
EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
|
| 525 |
+
|
| 526 |
+
/**************************
|
| 527 |
+
* CT log store functions *
|
| 528 |
+
**************************/
|
| 529 |
+
|
| 530 |
+
/*
|
| 531 |
+
* Creates a new CT log store and associates it with the given libctx and
|
| 532 |
+
* property query string.
|
| 533 |
+
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
|
| 534 |
+
*/
|
| 535 |
+
CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 536 |
+
|
| 537 |
+
/*
|
| 538 |
+
* Same as CTLOG_STORE_new_ex except that the default libctx and
|
| 539 |
+
* property query string are used.
|
| 540 |
+
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
|
| 541 |
+
*/
|
| 542 |
+
CTLOG_STORE *CTLOG_STORE_new(void);
|
| 543 |
+
|
| 544 |
+
/*
|
| 545 |
+
* Deletes a CT log store and all of the CT log instances held within.
|
| 546 |
+
*/
|
| 547 |
+
void CTLOG_STORE_free(CTLOG_STORE *store);
|
| 548 |
+
|
| 549 |
+
/*
|
| 550 |
+
* Finds a CT log in the store based on its log ID.
|
| 551 |
+
* Returns the CT log, or NULL if no match is found.
|
| 552 |
+
*/
|
| 553 |
+
const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store,
|
| 554 |
+
const uint8_t *log_id,
|
| 555 |
+
size_t log_id_len);
|
| 556 |
+
|
| 557 |
+
/*
|
| 558 |
+
* Loads a CT log list into a |store| from a |file|.
|
| 559 |
+
* Returns 1 if loading is successful, or 0 otherwise.
|
| 560 |
+
*/
|
| 561 |
+
__owur int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file);
|
| 562 |
+
|
| 563 |
+
/*
|
| 564 |
+
* Loads the default CT log list into a |store|.
|
| 565 |
+
* Returns 1 if loading is successful, or 0 otherwise.
|
| 566 |
+
*/
|
| 567 |
+
__owur int CTLOG_STORE_load_default_file(CTLOG_STORE *store);
|
| 568 |
+
|
| 569 |
+
# ifdef __cplusplus
|
| 570 |
+
}
|
| 571 |
+
# endif
|
| 572 |
+
# endif
|
| 573 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/err.h
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#ifndef OPENSSL_ERR_H
|
| 13 |
+
# define OPENSSL_ERR_H
|
| 14 |
+
# pragma once
|
| 15 |
+
|
| 16 |
+
# include <openssl/macros.h>
|
| 17 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 18 |
+
# define HEADER_ERR_H
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
# include <openssl/e_os2.h>
|
| 22 |
+
|
| 23 |
+
# ifndef OPENSSL_NO_STDIO
|
| 24 |
+
# include <stdio.h>
|
| 25 |
+
# include <stdlib.h>
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
# include <openssl/types.h>
|
| 29 |
+
# include <openssl/bio.h>
|
| 30 |
+
# include <openssl/lhash.h>
|
| 31 |
+
# include <openssl/cryptoerr_legacy.h>
|
| 32 |
+
|
| 33 |
+
#ifdef __cplusplus
|
| 34 |
+
extern "C" {
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 38 |
+
# ifndef OPENSSL_NO_FILENAMES
|
| 39 |
+
# define ERR_PUT_error(l,f,r,fn,ln) ERR_put_error(l,f,r,fn,ln)
|
| 40 |
+
# else
|
| 41 |
+
# define ERR_PUT_error(l,f,r,fn,ln) ERR_put_error(l,f,r,NULL,0)
|
| 42 |
+
# endif
|
| 43 |
+
# endif
|
| 44 |
+
|
| 45 |
+
# include <limits.h>
|
| 46 |
+
# include <errno.h>
|
| 47 |
+
|
| 48 |
+
# define ERR_TXT_MALLOCED 0x01
|
| 49 |
+
# define ERR_TXT_STRING 0x02
|
| 50 |
+
|
| 51 |
+
# if !defined(OPENSSL_NO_DEPRECATED_3_0) || defined(OSSL_FORCE_ERR_STATE)
|
| 52 |
+
# define ERR_FLAG_MARK 0x01
|
| 53 |
+
# define ERR_FLAG_CLEAR 0x02
|
| 54 |
+
|
| 55 |
+
# define ERR_NUM_ERRORS 16
|
| 56 |
+
struct err_state_st {
|
| 57 |
+
int err_flags[ERR_NUM_ERRORS];
|
| 58 |
+
int err_marks[ERR_NUM_ERRORS];
|
| 59 |
+
unsigned long err_buffer[ERR_NUM_ERRORS];
|
| 60 |
+
char *err_data[ERR_NUM_ERRORS];
|
| 61 |
+
size_t err_data_size[ERR_NUM_ERRORS];
|
| 62 |
+
int err_data_flags[ERR_NUM_ERRORS];
|
| 63 |
+
char *err_file[ERR_NUM_ERRORS];
|
| 64 |
+
int err_line[ERR_NUM_ERRORS];
|
| 65 |
+
char *err_func[ERR_NUM_ERRORS];
|
| 66 |
+
int top, bottom;
|
| 67 |
+
};
|
| 68 |
+
# endif
|
| 69 |
+
|
| 70 |
+
/* library */
|
| 71 |
+
# define ERR_LIB_NONE 1
|
| 72 |
+
# define ERR_LIB_SYS 2
|
| 73 |
+
# define ERR_LIB_BN 3
|
| 74 |
+
# define ERR_LIB_RSA 4
|
| 75 |
+
# define ERR_LIB_DH 5
|
| 76 |
+
# define ERR_LIB_EVP 6
|
| 77 |
+
# define ERR_LIB_BUF 7
|
| 78 |
+
# define ERR_LIB_OBJ 8
|
| 79 |
+
# define ERR_LIB_PEM 9
|
| 80 |
+
# define ERR_LIB_DSA 10
|
| 81 |
+
# define ERR_LIB_X509 11
|
| 82 |
+
/* #define ERR_LIB_METH 12 */
|
| 83 |
+
# define ERR_LIB_ASN1 13
|
| 84 |
+
# define ERR_LIB_CONF 14
|
| 85 |
+
# define ERR_LIB_CRYPTO 15
|
| 86 |
+
# define ERR_LIB_EC 16
|
| 87 |
+
# define ERR_LIB_SSL 20
|
| 88 |
+
/* #define ERR_LIB_SSL23 21 */
|
| 89 |
+
/* #define ERR_LIB_SSL2 22 */
|
| 90 |
+
/* #define ERR_LIB_SSL3 23 */
|
| 91 |
+
/* #define ERR_LIB_RSAREF 30 */
|
| 92 |
+
/* #define ERR_LIB_PROXY 31 */
|
| 93 |
+
# define ERR_LIB_BIO 32
|
| 94 |
+
# define ERR_LIB_PKCS7 33
|
| 95 |
+
# define ERR_LIB_X509V3 34
|
| 96 |
+
# define ERR_LIB_PKCS12 35
|
| 97 |
+
# define ERR_LIB_RAND 36
|
| 98 |
+
# define ERR_LIB_DSO 37
|
| 99 |
+
# define ERR_LIB_ENGINE 38
|
| 100 |
+
# define ERR_LIB_OCSP 39
|
| 101 |
+
# define ERR_LIB_UI 40
|
| 102 |
+
# define ERR_LIB_COMP 41
|
| 103 |
+
# define ERR_LIB_ECDSA 42
|
| 104 |
+
# define ERR_LIB_ECDH 43
|
| 105 |
+
# define ERR_LIB_OSSL_STORE 44
|
| 106 |
+
# define ERR_LIB_FIPS 45
|
| 107 |
+
# define ERR_LIB_CMS 46
|
| 108 |
+
# define ERR_LIB_TS 47
|
| 109 |
+
# define ERR_LIB_HMAC 48
|
| 110 |
+
/* # define ERR_LIB_JPAKE 49 */
|
| 111 |
+
# define ERR_LIB_CT 50
|
| 112 |
+
# define ERR_LIB_ASYNC 51
|
| 113 |
+
# define ERR_LIB_KDF 52
|
| 114 |
+
# define ERR_LIB_SM2 53
|
| 115 |
+
# define ERR_LIB_ESS 54
|
| 116 |
+
# define ERR_LIB_PROP 55
|
| 117 |
+
# define ERR_LIB_CRMF 56
|
| 118 |
+
# define ERR_LIB_PROV 57
|
| 119 |
+
# define ERR_LIB_CMP 58
|
| 120 |
+
# define ERR_LIB_OSSL_ENCODER 59
|
| 121 |
+
# define ERR_LIB_OSSL_DECODER 60
|
| 122 |
+
# define ERR_LIB_HTTP 61
|
| 123 |
+
|
| 124 |
+
# define ERR_LIB_USER 128
|
| 125 |
+
|
| 126 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 127 |
+
# define ASN1err(f, r) ERR_raise_data(ERR_LIB_ASN1, (r), NULL)
|
| 128 |
+
# define ASYNCerr(f, r) ERR_raise_data(ERR_LIB_ASYNC, (r), NULL)
|
| 129 |
+
# define BIOerr(f, r) ERR_raise_data(ERR_LIB_BIO, (r), NULL)
|
| 130 |
+
# define BNerr(f, r) ERR_raise_data(ERR_LIB_BN, (r), NULL)
|
| 131 |
+
# define BUFerr(f, r) ERR_raise_data(ERR_LIB_BUF, (r), NULL)
|
| 132 |
+
# define CMPerr(f, r) ERR_raise_data(ERR_LIB_CMP, (r), NULL)
|
| 133 |
+
# define CMSerr(f, r) ERR_raise_data(ERR_LIB_CMS, (r), NULL)
|
| 134 |
+
# define COMPerr(f, r) ERR_raise_data(ERR_LIB_COMP, (r), NULL)
|
| 135 |
+
# define CONFerr(f, r) ERR_raise_data(ERR_LIB_CONF, (r), NULL)
|
| 136 |
+
# define CRMFerr(f, r) ERR_raise_data(ERR_LIB_CRMF, (r), NULL)
|
| 137 |
+
# define CRYPTOerr(f, r) ERR_raise_data(ERR_LIB_CRYPTO, (r), NULL)
|
| 138 |
+
# define CTerr(f, r) ERR_raise_data(ERR_LIB_CT, (r), NULL)
|
| 139 |
+
# define DHerr(f, r) ERR_raise_data(ERR_LIB_DH, (r), NULL)
|
| 140 |
+
# define DSAerr(f, r) ERR_raise_data(ERR_LIB_DSA, (r), NULL)
|
| 141 |
+
# define DSOerr(f, r) ERR_raise_data(ERR_LIB_DSO, (r), NULL)
|
| 142 |
+
# define ECDHerr(f, r) ERR_raise_data(ERR_LIB_ECDH, (r), NULL)
|
| 143 |
+
# define ECDSAerr(f, r) ERR_raise_data(ERR_LIB_ECDSA, (r), NULL)
|
| 144 |
+
# define ECerr(f, r) ERR_raise_data(ERR_LIB_EC, (r), NULL)
|
| 145 |
+
# define ENGINEerr(f, r) ERR_raise_data(ERR_LIB_ENGINE, (r), NULL)
|
| 146 |
+
# define ESSerr(f, r) ERR_raise_data(ERR_LIB_ESS, (r), NULL)
|
| 147 |
+
# define EVPerr(f, r) ERR_raise_data(ERR_LIB_EVP, (r), NULL)
|
| 148 |
+
# define FIPSerr(f, r) ERR_raise_data(ERR_LIB_FIPS, (r), NULL)
|
| 149 |
+
# define HMACerr(f, r) ERR_raise_data(ERR_LIB_HMAC, (r), NULL)
|
| 150 |
+
# define HTTPerr(f, r) ERR_raise_data(ERR_LIB_HTTP, (r), NULL)
|
| 151 |
+
# define KDFerr(f, r) ERR_raise_data(ERR_LIB_KDF, (r), NULL)
|
| 152 |
+
# define OBJerr(f, r) ERR_raise_data(ERR_LIB_OBJ, (r), NULL)
|
| 153 |
+
# define OCSPerr(f, r) ERR_raise_data(ERR_LIB_OCSP, (r), NULL)
|
| 154 |
+
# define OSSL_STOREerr(f, r) ERR_raise_data(ERR_LIB_OSSL_STORE, (r), NULL)
|
| 155 |
+
# define PEMerr(f, r) ERR_raise_data(ERR_LIB_PEM, (r), NULL)
|
| 156 |
+
# define PKCS12err(f, r) ERR_raise_data(ERR_LIB_PKCS12, (r), NULL)
|
| 157 |
+
# define PKCS7err(f, r) ERR_raise_data(ERR_LIB_PKCS7, (r), NULL)
|
| 158 |
+
# define PROPerr(f, r) ERR_raise_data(ERR_LIB_PROP, (r), NULL)
|
| 159 |
+
# define PROVerr(f, r) ERR_raise_data(ERR_LIB_PROV, (r), NULL)
|
| 160 |
+
# define RANDerr(f, r) ERR_raise_data(ERR_LIB_RAND, (r), NULL)
|
| 161 |
+
# define RSAerr(f, r) ERR_raise_data(ERR_LIB_RSA, (r), NULL)
|
| 162 |
+
# define KDFerr(f, r) ERR_raise_data(ERR_LIB_KDF, (r), NULL)
|
| 163 |
+
# define SM2err(f, r) ERR_raise_data(ERR_LIB_SM2, (r), NULL)
|
| 164 |
+
# define SSLerr(f, r) ERR_raise_data(ERR_LIB_SSL, (r), NULL)
|
| 165 |
+
# define SYSerr(f, r) ERR_raise_data(ERR_LIB_SYS, (r), NULL)
|
| 166 |
+
# define TSerr(f, r) ERR_raise_data(ERR_LIB_TS, (r), NULL)
|
| 167 |
+
# define UIerr(f, r) ERR_raise_data(ERR_LIB_UI, (r), NULL)
|
| 168 |
+
# define X509V3err(f, r) ERR_raise_data(ERR_LIB_X509V3, (r), NULL)
|
| 169 |
+
# define X509err(f, r) ERR_raise_data(ERR_LIB_X509, (r), NULL)
|
| 170 |
+
# endif
|
| 171 |
+
|
| 172 |
+
/*-
|
| 173 |
+
* The error code packs differently depending on if it records a system
|
| 174 |
+
* error or an OpenSSL error.
|
| 175 |
+
*
|
| 176 |
+
* A system error packs like this (we follow POSIX and only allow positive
|
| 177 |
+
* numbers that fit in an |int|):
|
| 178 |
+
*
|
| 179 |
+
* +-+-------------------------------------------------------------+
|
| 180 |
+
* |1| system error number |
|
| 181 |
+
* +-+-------------------------------------------------------------+
|
| 182 |
+
*
|
| 183 |
+
* An OpenSSL error packs like this:
|
| 184 |
+
*
|
| 185 |
+
* <---------------------------- 32 bits -------------------------->
|
| 186 |
+
* <--- 8 bits ---><------------------ 23 bits ----------------->
|
| 187 |
+
* +-+---------------+---------------------------------------------+
|
| 188 |
+
* |0| library | reason |
|
| 189 |
+
* +-+---------------+---------------------------------------------+
|
| 190 |
+
*
|
| 191 |
+
* A few of the reason bits are reserved as flags with special meaning:
|
| 192 |
+
*
|
| 193 |
+
* <5 bits-<>--------- 19 bits ----------------->
|
| 194 |
+
* +-------+-+-----------------------------------+
|
| 195 |
+
* | rflags| | reason |
|
| 196 |
+
* +-------+-+-----------------------------------+
|
| 197 |
+
* ^
|
| 198 |
+
* |
|
| 199 |
+
* ERR_RFLAG_FATAL = ERR_R_FATAL
|
| 200 |
+
*
|
| 201 |
+
* The reason flags are part of the overall reason code for practical
|
| 202 |
+
* reasons, as they provide an easy way to place different types of
|
| 203 |
+
* reason codes in different numeric ranges.
|
| 204 |
+
*
|
| 205 |
+
* The currently known reason flags are:
|
| 206 |
+
*
|
| 207 |
+
* ERR_RFLAG_FATAL Flags that the reason code is considered fatal.
|
| 208 |
+
* For backward compatibility reasons, this flag
|
| 209 |
+
* is also the code for ERR_R_FATAL (that reason
|
| 210 |
+
* code served the dual purpose of flag and reason
|
| 211 |
+
* code in one in pre-3.0 OpenSSL).
|
| 212 |
+
* ERR_RFLAG_COMMON Flags that the reason code is common to all
|
| 213 |
+
* libraries. All ERR_R_ macros must use this flag,
|
| 214 |
+
* and no other _R_ macro is allowed to use it.
|
| 215 |
+
*/
|
| 216 |
+
|
| 217 |
+
/* Macros to help decode recorded system errors */
|
| 218 |
+
# define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
|
| 219 |
+
# define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
|
| 220 |
+
|
| 221 |
+
/*
|
| 222 |
+
* Macros to help decode recorded OpenSSL errors
|
| 223 |
+
* As expressed above, RFLAGS and REASON overlap by one bit to allow
|
| 224 |
+
* ERR_R_FATAL to use ERR_RFLAG_FATAL as its reason code.
|
| 225 |
+
*/
|
| 226 |
+
# define ERR_LIB_OFFSET 23L
|
| 227 |
+
# define ERR_LIB_MASK 0xFF
|
| 228 |
+
# define ERR_RFLAGS_OFFSET 18L
|
| 229 |
+
# define ERR_RFLAGS_MASK 0x1F
|
| 230 |
+
# define ERR_REASON_MASK 0X7FFFFF
|
| 231 |
+
|
| 232 |
+
/*
|
| 233 |
+
* Reason flags are defined pre-shifted to easily combine with the reason
|
| 234 |
+
* number.
|
| 235 |
+
*/
|
| 236 |
+
# define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
|
| 237 |
+
# define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
|
| 238 |
+
|
| 239 |
+
# define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
|
| 240 |
+
|
| 241 |
+
static ossl_unused ossl_inline int ERR_GET_LIB(unsigned long errcode)
|
| 242 |
+
{
|
| 243 |
+
if (ERR_SYSTEM_ERROR(errcode))
|
| 244 |
+
return ERR_LIB_SYS;
|
| 245 |
+
return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
static ossl_unused ossl_inline int ERR_GET_RFLAGS(unsigned long errcode)
|
| 249 |
+
{
|
| 250 |
+
if (ERR_SYSTEM_ERROR(errcode))
|
| 251 |
+
return 0;
|
| 252 |
+
return errcode & (ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET);
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
static ossl_unused ossl_inline int ERR_GET_REASON(unsigned long errcode)
|
| 256 |
+
{
|
| 257 |
+
if (ERR_SYSTEM_ERROR(errcode))
|
| 258 |
+
return errcode & ERR_SYSTEM_MASK;
|
| 259 |
+
return errcode & ERR_REASON_MASK;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
static ossl_unused ossl_inline int ERR_FATAL_ERROR(unsigned long errcode)
|
| 263 |
+
{
|
| 264 |
+
return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_FATAL) != 0;
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
static ossl_unused ossl_inline int ERR_COMMON_ERROR(unsigned long errcode)
|
| 268 |
+
{
|
| 269 |
+
return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_COMMON) != 0;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
/*
|
| 273 |
+
* ERR_PACK is a helper macro to properly pack OpenSSL error codes and may
|
| 274 |
+
* only be used for that purpose. System errors are packed internally.
|
| 275 |
+
* ERR_PACK takes reason flags and reason code combined in |reason|.
|
| 276 |
+
* ERR_PACK ignores |func|, that parameter is just legacy from pre-3.0 OpenSSL.
|
| 277 |
+
*/
|
| 278 |
+
# define ERR_PACK(lib,func,reason) \
|
| 279 |
+
( (((unsigned long)(lib) & ERR_LIB_MASK ) << ERR_LIB_OFFSET) | \
|
| 280 |
+
(((unsigned long)(reason) & ERR_REASON_MASK)) )
|
| 281 |
+
|
| 282 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 283 |
+
# define SYS_F_FOPEN 0
|
| 284 |
+
# define SYS_F_CONNECT 0
|
| 285 |
+
# define SYS_F_GETSERVBYNAME 0
|
| 286 |
+
# define SYS_F_SOCKET 0
|
| 287 |
+
# define SYS_F_IOCTLSOCKET 0
|
| 288 |
+
# define SYS_F_BIND 0
|
| 289 |
+
# define SYS_F_LISTEN 0
|
| 290 |
+
# define SYS_F_ACCEPT 0
|
| 291 |
+
# define SYS_F_WSASTARTUP 0
|
| 292 |
+
# define SYS_F_OPENDIR 0
|
| 293 |
+
# define SYS_F_FREAD 0
|
| 294 |
+
# define SYS_F_GETADDRINFO 0
|
| 295 |
+
# define SYS_F_GETNAMEINFO 0
|
| 296 |
+
# define SYS_F_SETSOCKOPT 0
|
| 297 |
+
# define SYS_F_GETSOCKOPT 0
|
| 298 |
+
# define SYS_F_GETSOCKNAME 0
|
| 299 |
+
# define SYS_F_GETHOSTBYNAME 0
|
| 300 |
+
# define SYS_F_FFLUSH 0
|
| 301 |
+
# define SYS_F_OPEN 0
|
| 302 |
+
# define SYS_F_CLOSE 0
|
| 303 |
+
# define SYS_F_IOCTL 0
|
| 304 |
+
# define SYS_F_STAT 0
|
| 305 |
+
# define SYS_F_FCNTL 0
|
| 306 |
+
# define SYS_F_FSTAT 0
|
| 307 |
+
# define SYS_F_SENDFILE 0
|
| 308 |
+
# endif
|
| 309 |
+
|
| 310 |
+
/*
|
| 311 |
+
* All ERR_R_ codes must be combined with ERR_RFLAG_COMMON.
|
| 312 |
+
*/
|
| 313 |
+
|
| 314 |
+
/* "we came from here" global reason codes, range 1..255 */
|
| 315 |
+
# define ERR_R_SYS_LIB (ERR_LIB_SYS/* 2 */ | ERR_RFLAG_COMMON)
|
| 316 |
+
# define ERR_R_BN_LIB (ERR_LIB_BN/* 3 */ | ERR_RFLAG_COMMON)
|
| 317 |
+
# define ERR_R_RSA_LIB (ERR_LIB_RSA/* 4 */ | ERR_RFLAG_COMMON)
|
| 318 |
+
# define ERR_R_DH_LIB (ERR_LIB_DH/* 5 */ | ERR_RFLAG_COMMON)
|
| 319 |
+
# define ERR_R_EVP_LIB (ERR_LIB_EVP/* 6 */ | ERR_RFLAG_COMMON)
|
| 320 |
+
# define ERR_R_BUF_LIB (ERR_LIB_BUF/* 7 */ | ERR_RFLAG_COMMON)
|
| 321 |
+
# define ERR_R_OBJ_LIB (ERR_LIB_OBJ/* 8 */ | ERR_RFLAG_COMMON)
|
| 322 |
+
# define ERR_R_PEM_LIB (ERR_LIB_PEM/* 9 */ | ERR_RFLAG_COMMON)
|
| 323 |
+
# define ERR_R_DSA_LIB (ERR_LIB_DSA/* 10 */ | ERR_RFLAG_COMMON)
|
| 324 |
+
# define ERR_R_X509_LIB (ERR_LIB_X509/* 11 */ | ERR_RFLAG_COMMON)
|
| 325 |
+
# define ERR_R_ASN1_LIB (ERR_LIB_ASN1/* 13 */ | ERR_RFLAG_COMMON)
|
| 326 |
+
# define ERR_R_CONF_LIB (ERR_LIB_CONF/* 14 */ | ERR_RFLAG_COMMON)
|
| 327 |
+
# define ERR_R_CRYPTO_LIB (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
|
| 328 |
+
# define ERR_R_EC_LIB (ERR_LIB_EC/* 16 */ | ERR_RFLAG_COMMON)
|
| 329 |
+
# define ERR_R_SSL_LIB (ERR_LIB_SSL/* 20 */ | ERR_RFLAG_COMMON)
|
| 330 |
+
# define ERR_R_BIO_LIB (ERR_LIB_BIO/* 32 */ | ERR_RFLAG_COMMON)
|
| 331 |
+
# define ERR_R_PKCS7_LIB (ERR_LIB_PKCS7/* 33 */ | ERR_RFLAG_COMMON)
|
| 332 |
+
# define ERR_R_X509V3_LIB (ERR_LIB_X509V3/* 34 */ | ERR_RFLAG_COMMON)
|
| 333 |
+
# define ERR_R_PKCS12_LIB (ERR_LIB_PKCS12/* 35 */ | ERR_RFLAG_COMMON)
|
| 334 |
+
# define ERR_R_RAND_LIB (ERR_LIB_RAND/* 36 */ | ERR_RFLAG_COMMON)
|
| 335 |
+
# define ERR_R_DSO_LIB (ERR_LIB_DSO/* 37 */ | ERR_RFLAG_COMMON)
|
| 336 |
+
# define ERR_R_ENGINE_LIB (ERR_LIB_ENGINE/* 38 */ | ERR_RFLAG_COMMON)
|
| 337 |
+
# define ERR_R_UI_LIB (ERR_LIB_UI/* 40 */ | ERR_RFLAG_COMMON)
|
| 338 |
+
# define ERR_R_ECDSA_LIB (ERR_LIB_ECDSA/* 42 */ | ERR_RFLAG_COMMON)
|
| 339 |
+
# define ERR_R_OSSL_STORE_LIB (ERR_LIB_OSSL_STORE/* 44 */ | ERR_RFLAG_COMMON)
|
| 340 |
+
# define ERR_R_CMS_LIB (ERR_LIB_CMS/* 46 */ | ERR_RFLAG_COMMON)
|
| 341 |
+
# define ERR_R_TS_LIB (ERR_LIB_TS/* 47 */ | ERR_RFLAG_COMMON)
|
| 342 |
+
# define ERR_R_CT_LIB (ERR_LIB_CT/* 50 */ | ERR_RFLAG_COMMON)
|
| 343 |
+
# define ERR_R_PROV_LIB (ERR_LIB_PROV/* 57 */ | ERR_RFLAG_COMMON)
|
| 344 |
+
# define ERR_R_ESS_LIB (ERR_LIB_ESS/* 54 */ | ERR_RFLAG_COMMON)
|
| 345 |
+
# define ERR_R_CMP_LIB (ERR_LIB_CMP/* 58 */ | ERR_RFLAG_COMMON)
|
| 346 |
+
# define ERR_R_OSSL_ENCODER_LIB (ERR_LIB_OSSL_ENCODER/* 59 */ | ERR_RFLAG_COMMON)
|
| 347 |
+
# define ERR_R_OSSL_DECODER_LIB (ERR_LIB_OSSL_DECODER/* 60 */ | ERR_RFLAG_COMMON)
|
| 348 |
+
|
| 349 |
+
/* Other common error codes, range 256..2^ERR_RFLAGS_OFFSET-1 */
|
| 350 |
+
# define ERR_R_FATAL (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
|
| 351 |
+
# define ERR_R_MALLOC_FAILURE (256|ERR_R_FATAL)
|
| 352 |
+
# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (257|ERR_R_FATAL)
|
| 353 |
+
# define ERR_R_PASSED_NULL_PARAMETER (258|ERR_R_FATAL)
|
| 354 |
+
# define ERR_R_INTERNAL_ERROR (259|ERR_R_FATAL)
|
| 355 |
+
# define ERR_R_DISABLED (260|ERR_R_FATAL)
|
| 356 |
+
# define ERR_R_INIT_FAIL (261|ERR_R_FATAL)
|
| 357 |
+
# define ERR_R_PASSED_INVALID_ARGUMENT (262|ERR_RFLAG_COMMON)
|
| 358 |
+
# define ERR_R_OPERATION_FAIL (263|ERR_R_FATAL)
|
| 359 |
+
# define ERR_R_INVALID_PROVIDER_FUNCTIONS (264|ERR_R_FATAL)
|
| 360 |
+
# define ERR_R_INTERRUPTED_OR_CANCELLED (265|ERR_RFLAG_COMMON)
|
| 361 |
+
# define ERR_R_NESTED_ASN1_ERROR (266|ERR_RFLAG_COMMON)
|
| 362 |
+
# define ERR_R_MISSING_ASN1_EOS (267|ERR_RFLAG_COMMON)
|
| 363 |
+
# define ERR_R_UNSUPPORTED (268|ERR_RFLAG_COMMON)
|
| 364 |
+
# define ERR_R_FETCH_FAILED (269|ERR_RFLAG_COMMON)
|
| 365 |
+
# define ERR_R_INVALID_PROPERTY_DEFINITION (270|ERR_RFLAG_COMMON)
|
| 366 |
+
# define ERR_R_UNABLE_TO_GET_READ_LOCK (271|ERR_R_FATAL)
|
| 367 |
+
# define ERR_R_UNABLE_TO_GET_WRITE_LOCK (272|ERR_R_FATAL)
|
| 368 |
+
|
| 369 |
+
typedef struct ERR_string_data_st {
|
| 370 |
+
unsigned long error;
|
| 371 |
+
const char *string;
|
| 372 |
+
} ERR_STRING_DATA;
|
| 373 |
+
|
| 374 |
+
DEFINE_LHASH_OF_INTERNAL(ERR_STRING_DATA);
|
| 375 |
+
#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk))
|
| 376 |
+
#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 377 |
+
#define lh_ERR_STRING_DATA_flush(lh) OPENSSL_LH_flush(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 378 |
+
#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
|
| 379 |
+
#define lh_ERR_STRING_DATA_delete(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_delete(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
|
| 380 |
+
#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
|
| 381 |
+
#define lh_ERR_STRING_DATA_error(lh) OPENSSL_LH_error(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 382 |
+
#define lh_ERR_STRING_DATA_num_items(lh) OPENSSL_LH_num_items(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 383 |
+
#define lh_ERR_STRING_DATA_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
| 384 |
+
#define lh_ERR_STRING_DATA_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
| 385 |
+
#define lh_ERR_STRING_DATA_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out)
|
| 386 |
+
#define lh_ERR_STRING_DATA_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_ERR_STRING_DATA_lh_type(lh))
|
| 387 |
+
#define lh_ERR_STRING_DATA_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_ERR_STRING_DATA_lh_type(lh), dl)
|
| 388 |
+
#define lh_ERR_STRING_DATA_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_doallfunc_type(dfn))
|
| 389 |
+
|
| 390 |
+
|
| 391 |
+
/* 12 lines and some on an 80 column terminal */
|
| 392 |
+
#define ERR_MAX_DATA_SIZE 1024
|
| 393 |
+
|
| 394 |
+
/* Building blocks */
|
| 395 |
+
void ERR_new(void);
|
| 396 |
+
void ERR_set_debug(const char *file, int line, const char *func);
|
| 397 |
+
void ERR_set_error(int lib, int reason, const char *fmt, ...);
|
| 398 |
+
void ERR_vset_error(int lib, int reason, const char *fmt, va_list args);
|
| 399 |
+
|
| 400 |
+
/* Main error raising functions */
|
| 401 |
+
# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
|
| 402 |
+
# define ERR_raise_data \
|
| 403 |
+
(ERR_new(), \
|
| 404 |
+
ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC), \
|
| 405 |
+
ERR_set_error)
|
| 406 |
+
|
| 407 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 408 |
+
/* Backward compatibility */
|
| 409 |
+
# define ERR_put_error(lib, func, reason, file, line) \
|
| 410 |
+
(ERR_new(), \
|
| 411 |
+
ERR_set_debug((file), (line), OPENSSL_FUNC), \
|
| 412 |
+
ERR_set_error((lib), (reason), NULL))
|
| 413 |
+
# endif
|
| 414 |
+
|
| 415 |
+
void ERR_set_error_data(char *data, int flags);
|
| 416 |
+
|
| 417 |
+
unsigned long ERR_get_error(void);
|
| 418 |
+
unsigned long ERR_get_error_all(const char **file, int *line,
|
| 419 |
+
const char **func,
|
| 420 |
+
const char **data, int *flags);
|
| 421 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 422 |
+
OSSL_DEPRECATEDIN_3_0
|
| 423 |
+
unsigned long ERR_get_error_line(const char **file, int *line);
|
| 424 |
+
OSSL_DEPRECATEDIN_3_0
|
| 425 |
+
unsigned long ERR_get_error_line_data(const char **file, int *line,
|
| 426 |
+
const char **data, int *flags);
|
| 427 |
+
#endif
|
| 428 |
+
unsigned long ERR_peek_error(void);
|
| 429 |
+
unsigned long ERR_peek_error_line(const char **file, int *line);
|
| 430 |
+
unsigned long ERR_peek_error_func(const char **func);
|
| 431 |
+
unsigned long ERR_peek_error_data(const char **data, int *flags);
|
| 432 |
+
unsigned long ERR_peek_error_all(const char **file, int *line,
|
| 433 |
+
const char **func,
|
| 434 |
+
const char **data, int *flags);
|
| 435 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 436 |
+
OSSL_DEPRECATEDIN_3_0
|
| 437 |
+
unsigned long ERR_peek_error_line_data(const char **file, int *line,
|
| 438 |
+
const char **data, int *flags);
|
| 439 |
+
# endif
|
| 440 |
+
unsigned long ERR_peek_last_error(void);
|
| 441 |
+
unsigned long ERR_peek_last_error_line(const char **file, int *line);
|
| 442 |
+
unsigned long ERR_peek_last_error_func(const char **func);
|
| 443 |
+
unsigned long ERR_peek_last_error_data(const char **data, int *flags);
|
| 444 |
+
unsigned long ERR_peek_last_error_all(const char **file, int *line,
|
| 445 |
+
const char **func,
|
| 446 |
+
const char **data, int *flags);
|
| 447 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 448 |
+
OSSL_DEPRECATEDIN_3_0
|
| 449 |
+
unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
|
| 450 |
+
const char **data, int *flags);
|
| 451 |
+
# endif
|
| 452 |
+
|
| 453 |
+
void ERR_clear_error(void);
|
| 454 |
+
|
| 455 |
+
char *ERR_error_string(unsigned long e, char *buf);
|
| 456 |
+
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
|
| 457 |
+
const char *ERR_lib_error_string(unsigned long e);
|
| 458 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 459 |
+
OSSL_DEPRECATEDIN_3_0 const char *ERR_func_error_string(unsigned long e);
|
| 460 |
+
# endif
|
| 461 |
+
const char *ERR_reason_error_string(unsigned long e);
|
| 462 |
+
|
| 463 |
+
void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
|
| 464 |
+
void *u);
|
| 465 |
+
# ifndef OPENSSL_NO_STDIO
|
| 466 |
+
void ERR_print_errors_fp(FILE *fp);
|
| 467 |
+
# endif
|
| 468 |
+
void ERR_print_errors(BIO *bp);
|
| 469 |
+
|
| 470 |
+
void ERR_add_error_data(int num, ...);
|
| 471 |
+
void ERR_add_error_vdata(int num, va_list args);
|
| 472 |
+
void ERR_add_error_txt(const char *sepr, const char *txt);
|
| 473 |
+
void ERR_add_error_mem_bio(const char *sep, BIO *bio);
|
| 474 |
+
|
| 475 |
+
int ERR_load_strings(int lib, ERR_STRING_DATA *str);
|
| 476 |
+
int ERR_load_strings_const(const ERR_STRING_DATA *str);
|
| 477 |
+
int ERR_unload_strings(int lib, ERR_STRING_DATA *str);
|
| 478 |
+
|
| 479 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 480 |
+
# define ERR_load_crypto_strings() \
|
| 481 |
+
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
|
| 482 |
+
# define ERR_free_strings() while(0) continue
|
| 483 |
+
#endif
|
| 484 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 485 |
+
OSSL_DEPRECATEDIN_1_1_0 void ERR_remove_thread_state(void *);
|
| 486 |
+
#endif
|
| 487 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_0_0
|
| 488 |
+
OSSL_DEPRECATEDIN_1_0_0 void ERR_remove_state(unsigned long pid);
|
| 489 |
+
#endif
|
| 490 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 491 |
+
OSSL_DEPRECATEDIN_3_0 ERR_STATE *ERR_get_state(void);
|
| 492 |
+
#endif
|
| 493 |
+
|
| 494 |
+
int ERR_get_next_error_library(void);
|
| 495 |
+
|
| 496 |
+
int ERR_set_mark(void);
|
| 497 |
+
int ERR_pop_to_mark(void);
|
| 498 |
+
int ERR_clear_last_mark(void);
|
| 499 |
+
int ERR_count_to_mark(void);
|
| 500 |
+
int ERR_pop(void);
|
| 501 |
+
|
| 502 |
+
ERR_STATE *OSSL_ERR_STATE_new(void);
|
| 503 |
+
void OSSL_ERR_STATE_save(ERR_STATE *es);
|
| 504 |
+
void OSSL_ERR_STATE_save_to_mark(ERR_STATE *es);
|
| 505 |
+
void OSSL_ERR_STATE_restore(const ERR_STATE *es);
|
| 506 |
+
void OSSL_ERR_STATE_free(ERR_STATE *es);
|
| 507 |
+
|
| 508 |
+
#ifdef __cplusplus
|
| 509 |
+
}
|
| 510 |
+
#endif
|
| 511 |
+
|
| 512 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/ess.h
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/ess.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_ESS_H
|
| 16 |
+
# define OPENSSL_ESS_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/opensslconf.h>
|
| 20 |
+
|
| 21 |
+
# include <openssl/safestack.h>
|
| 22 |
+
# include <openssl/x509.h>
|
| 23 |
+
# include <openssl/esserr.h>
|
| 24 |
+
|
| 25 |
+
# ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
# endif
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL;
|
| 31 |
+
typedef struct ESS_cert_id ESS_CERT_ID;
|
| 32 |
+
typedef struct ESS_signing_cert ESS_SIGNING_CERT;
|
| 33 |
+
|
| 34 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ESS_CERT_ID, ESS_CERT_ID, ESS_CERT_ID)
|
| 35 |
+
#define sk_ESS_CERT_ID_num(sk) OPENSSL_sk_num(ossl_check_const_ESS_CERT_ID_sk_type(sk))
|
| 36 |
+
#define sk_ESS_CERT_ID_value(sk, idx) ((ESS_CERT_ID *)OPENSSL_sk_value(ossl_check_const_ESS_CERT_ID_sk_type(sk), (idx)))
|
| 37 |
+
#define sk_ESS_CERT_ID_new(cmp) ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_new(ossl_check_ESS_CERT_ID_compfunc_type(cmp)))
|
| 38 |
+
#define sk_ESS_CERT_ID_new_null() ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_new_null())
|
| 39 |
+
#define sk_ESS_CERT_ID_new_reserve(cmp, n) ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_new_reserve(ossl_check_ESS_CERT_ID_compfunc_type(cmp), (n)))
|
| 40 |
+
#define sk_ESS_CERT_ID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ESS_CERT_ID_sk_type(sk), (n))
|
| 41 |
+
#define sk_ESS_CERT_ID_free(sk) OPENSSL_sk_free(ossl_check_ESS_CERT_ID_sk_type(sk))
|
| 42 |
+
#define sk_ESS_CERT_ID_zero(sk) OPENSSL_sk_zero(ossl_check_ESS_CERT_ID_sk_type(sk))
|
| 43 |
+
#define sk_ESS_CERT_ID_delete(sk, i) ((ESS_CERT_ID *)OPENSSL_sk_delete(ossl_check_ESS_CERT_ID_sk_type(sk), (i)))
|
| 44 |
+
#define sk_ESS_CERT_ID_delete_ptr(sk, ptr) ((ESS_CERT_ID *)OPENSSL_sk_delete_ptr(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr)))
|
| 45 |
+
#define sk_ESS_CERT_ID_push(sk, ptr) OPENSSL_sk_push(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr))
|
| 46 |
+
#define sk_ESS_CERT_ID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr))
|
| 47 |
+
#define sk_ESS_CERT_ID_pop(sk) ((ESS_CERT_ID *)OPENSSL_sk_pop(ossl_check_ESS_CERT_ID_sk_type(sk)))
|
| 48 |
+
#define sk_ESS_CERT_ID_shift(sk) ((ESS_CERT_ID *)OPENSSL_sk_shift(ossl_check_ESS_CERT_ID_sk_type(sk)))
|
| 49 |
+
#define sk_ESS_CERT_ID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ESS_CERT_ID_sk_type(sk),ossl_check_ESS_CERT_ID_freefunc_type(freefunc))
|
| 50 |
+
#define sk_ESS_CERT_ID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr), (idx))
|
| 51 |
+
#define sk_ESS_CERT_ID_set(sk, idx, ptr) ((ESS_CERT_ID *)OPENSSL_sk_set(ossl_check_ESS_CERT_ID_sk_type(sk), (idx), ossl_check_ESS_CERT_ID_type(ptr)))
|
| 52 |
+
#define sk_ESS_CERT_ID_find(sk, ptr) OPENSSL_sk_find(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr))
|
| 53 |
+
#define sk_ESS_CERT_ID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr))
|
| 54 |
+
#define sk_ESS_CERT_ID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr), pnum)
|
| 55 |
+
#define sk_ESS_CERT_ID_sort(sk) OPENSSL_sk_sort(ossl_check_ESS_CERT_ID_sk_type(sk))
|
| 56 |
+
#define sk_ESS_CERT_ID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ESS_CERT_ID_sk_type(sk))
|
| 57 |
+
#define sk_ESS_CERT_ID_dup(sk) ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_dup(ossl_check_const_ESS_CERT_ID_sk_type(sk)))
|
| 58 |
+
#define sk_ESS_CERT_ID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_deep_copy(ossl_check_const_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_copyfunc_type(copyfunc), ossl_check_ESS_CERT_ID_freefunc_type(freefunc)))
|
| 59 |
+
#define sk_ESS_CERT_ID_set_cmp_func(sk, cmp) ((sk_ESS_CERT_ID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_compfunc_type(cmp)))
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2;
|
| 64 |
+
typedef struct ESS_cert_id_v2_st ESS_CERT_ID_V2;
|
| 65 |
+
|
| 66 |
+
SKM_DEFINE_STACK_OF_INTERNAL(ESS_CERT_ID_V2, ESS_CERT_ID_V2, ESS_CERT_ID_V2)
|
| 67 |
+
#define sk_ESS_CERT_ID_V2_num(sk) OPENSSL_sk_num(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk))
|
| 68 |
+
#define sk_ESS_CERT_ID_V2_value(sk, idx) ((ESS_CERT_ID_V2 *)OPENSSL_sk_value(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk), (idx)))
|
| 69 |
+
#define sk_ESS_CERT_ID_V2_new(cmp) ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_new(ossl_check_ESS_CERT_ID_V2_compfunc_type(cmp)))
|
| 70 |
+
#define sk_ESS_CERT_ID_V2_new_null() ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_new_null())
|
| 71 |
+
#define sk_ESS_CERT_ID_V2_new_reserve(cmp, n) ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_new_reserve(ossl_check_ESS_CERT_ID_V2_compfunc_type(cmp), (n)))
|
| 72 |
+
#define sk_ESS_CERT_ID_V2_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ESS_CERT_ID_V2_sk_type(sk), (n))
|
| 73 |
+
#define sk_ESS_CERT_ID_V2_free(sk) OPENSSL_sk_free(ossl_check_ESS_CERT_ID_V2_sk_type(sk))
|
| 74 |
+
#define sk_ESS_CERT_ID_V2_zero(sk) OPENSSL_sk_zero(ossl_check_ESS_CERT_ID_V2_sk_type(sk))
|
| 75 |
+
#define sk_ESS_CERT_ID_V2_delete(sk, i) ((ESS_CERT_ID_V2 *)OPENSSL_sk_delete(ossl_check_ESS_CERT_ID_V2_sk_type(sk), (i)))
|
| 76 |
+
#define sk_ESS_CERT_ID_V2_delete_ptr(sk, ptr) ((ESS_CERT_ID_V2 *)OPENSSL_sk_delete_ptr(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr)))
|
| 77 |
+
#define sk_ESS_CERT_ID_V2_push(sk, ptr) OPENSSL_sk_push(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr))
|
| 78 |
+
#define sk_ESS_CERT_ID_V2_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr))
|
| 79 |
+
#define sk_ESS_CERT_ID_V2_pop(sk) ((ESS_CERT_ID_V2 *)OPENSSL_sk_pop(ossl_check_ESS_CERT_ID_V2_sk_type(sk)))
|
| 80 |
+
#define sk_ESS_CERT_ID_V2_shift(sk) ((ESS_CERT_ID_V2 *)OPENSSL_sk_shift(ossl_check_ESS_CERT_ID_V2_sk_type(sk)))
|
| 81 |
+
#define sk_ESS_CERT_ID_V2_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ESS_CERT_ID_V2_sk_type(sk),ossl_check_ESS_CERT_ID_V2_freefunc_type(freefunc))
|
| 82 |
+
#define sk_ESS_CERT_ID_V2_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr), (idx))
|
| 83 |
+
#define sk_ESS_CERT_ID_V2_set(sk, idx, ptr) ((ESS_CERT_ID_V2 *)OPENSSL_sk_set(ossl_check_ESS_CERT_ID_V2_sk_type(sk), (idx), ossl_check_ESS_CERT_ID_V2_type(ptr)))
|
| 84 |
+
#define sk_ESS_CERT_ID_V2_find(sk, ptr) OPENSSL_sk_find(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr))
|
| 85 |
+
#define sk_ESS_CERT_ID_V2_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr))
|
| 86 |
+
#define sk_ESS_CERT_ID_V2_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr), pnum)
|
| 87 |
+
#define sk_ESS_CERT_ID_V2_sort(sk) OPENSSL_sk_sort(ossl_check_ESS_CERT_ID_V2_sk_type(sk))
|
| 88 |
+
#define sk_ESS_CERT_ID_V2_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk))
|
| 89 |
+
#define sk_ESS_CERT_ID_V2_dup(sk) ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_dup(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk)))
|
| 90 |
+
#define sk_ESS_CERT_ID_V2_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_deep_copy(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_copyfunc_type(copyfunc), ossl_check_ESS_CERT_ID_V2_freefunc_type(freefunc)))
|
| 91 |
+
#define sk_ESS_CERT_ID_V2_set_cmp_func(sk, cmp) ((sk_ESS_CERT_ID_V2_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_compfunc_type(cmp)))
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_ISSUER_SERIAL)
|
| 95 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_ISSUER_SERIAL, ESS_ISSUER_SERIAL)
|
| 96 |
+
DECLARE_ASN1_DUP_FUNCTION(ESS_ISSUER_SERIAL)
|
| 97 |
+
|
| 98 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_CERT_ID)
|
| 99 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_CERT_ID, ESS_CERT_ID)
|
| 100 |
+
DECLARE_ASN1_DUP_FUNCTION(ESS_CERT_ID)
|
| 101 |
+
|
| 102 |
+
DECLARE_ASN1_FUNCTIONS(ESS_SIGNING_CERT)
|
| 103 |
+
DECLARE_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT)
|
| 104 |
+
|
| 105 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_CERT_ID_V2)
|
| 106 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_CERT_ID_V2, ESS_CERT_ID_V2)
|
| 107 |
+
DECLARE_ASN1_DUP_FUNCTION(ESS_CERT_ID_V2)
|
| 108 |
+
|
| 109 |
+
DECLARE_ASN1_FUNCTIONS(ESS_SIGNING_CERT_V2)
|
| 110 |
+
DECLARE_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT_V2)
|
| 111 |
+
|
| 112 |
+
ESS_SIGNING_CERT *OSSL_ESS_signing_cert_new_init(const X509 *signcert,
|
| 113 |
+
const STACK_OF(X509) *certs,
|
| 114 |
+
int set_issuer_serial);
|
| 115 |
+
ESS_SIGNING_CERT_V2 *OSSL_ESS_signing_cert_v2_new_init(const EVP_MD *hash_alg,
|
| 116 |
+
const X509 *signcert,
|
| 117 |
+
const
|
| 118 |
+
STACK_OF(X509) *certs,
|
| 119 |
+
int set_issuer_serial);
|
| 120 |
+
int OSSL_ESS_check_signing_certs(const ESS_SIGNING_CERT *ss,
|
| 121 |
+
const ESS_SIGNING_CERT_V2 *ssv2,
|
| 122 |
+
const STACK_OF(X509) *chain,
|
| 123 |
+
int require_signing_cert);
|
| 124 |
+
|
| 125 |
+
# ifdef __cplusplus
|
| 126 |
+
}
|
| 127 |
+
# endif
|
| 128 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/fipskey.h
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/fipskey.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef OPENSSL_FIPSKEY_H
|
| 14 |
+
# define OPENSSL_FIPSKEY_H
|
| 15 |
+
# pragma once
|
| 16 |
+
|
| 17 |
+
# ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* The FIPS validation HMAC key, usable as an array initializer.
|
| 23 |
+
*/
|
| 24 |
+
#define FIPS_KEY_ELEMENTS \
|
| 25 |
+
0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13
|
| 26 |
+
|
| 27 |
+
/*
|
| 28 |
+
* The FIPS validation key, as a string.
|
| 29 |
+
*/
|
| 30 |
+
#define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813"
|
| 31 |
+
|
| 32 |
+
/*
|
| 33 |
+
* The FIPS provider vendor name, as a string.
|
| 34 |
+
*/
|
| 35 |
+
#define FIPS_VENDOR "OpenSSL FIPS Provider"
|
| 36 |
+
|
| 37 |
+
# ifdef __cplusplus
|
| 38 |
+
}
|
| 39 |
+
# endif
|
| 40 |
+
|
| 41 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/lhash.h
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 5 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 6 |
+
* in the file LICENSE in the source distribution or at
|
| 7 |
+
* https://www.openssl.org/source/license.html
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
/*
|
| 13 |
+
* Header for dynamic hash table routines Author - Eric Young
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#ifndef OPENSSL_LHASH_H
|
| 17 |
+
# define OPENSSL_LHASH_H
|
| 18 |
+
# pragma once
|
| 19 |
+
|
| 20 |
+
# include <openssl/macros.h>
|
| 21 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 22 |
+
# define HEADER_LHASH_H
|
| 23 |
+
# endif
|
| 24 |
+
|
| 25 |
+
# include <openssl/e_os2.h>
|
| 26 |
+
# include <openssl/bio.h>
|
| 27 |
+
# ifndef OPENSSL_NO_STDIO
|
| 28 |
+
# include <stdio.h>
|
| 29 |
+
# endif
|
| 30 |
+
|
| 31 |
+
#ifdef __cplusplus
|
| 32 |
+
extern "C" {
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
typedef struct lhash_node_st OPENSSL_LH_NODE;
|
| 36 |
+
typedef int (*OPENSSL_LH_COMPFUNC) (const void *, const void *);
|
| 37 |
+
typedef int (*OPENSSL_LH_COMPFUNCTHUNK) (const void *, const void *, OPENSSL_LH_COMPFUNC cfn);
|
| 38 |
+
typedef unsigned long (*OPENSSL_LH_HASHFUNC) (const void *);
|
| 39 |
+
typedef unsigned long (*OPENSSL_LH_HASHFUNCTHUNK) (const void *, OPENSSL_LH_HASHFUNC hfn);
|
| 40 |
+
typedef void (*OPENSSL_LH_DOALL_FUNC) (void *);
|
| 41 |
+
typedef void (*OPENSSL_LH_DOALL_FUNC_THUNK) (void *, OPENSSL_LH_DOALL_FUNC doall);
|
| 42 |
+
typedef void (*OPENSSL_LH_DOALL_FUNCARG) (void *, void *);
|
| 43 |
+
typedef void (*OPENSSL_LH_DOALL_FUNCARG_THUNK) (void *, void *, OPENSSL_LH_DOALL_FUNCARG doall);
|
| 44 |
+
typedef struct lhash_st OPENSSL_LHASH;
|
| 45 |
+
|
| 46 |
+
/*
|
| 47 |
+
* Macros for declaring and implementing type-safe wrappers for LHASH
|
| 48 |
+
* callbacks. This way, callbacks can be provided to LHASH structures without
|
| 49 |
+
* function pointer casting and the macro-defined callbacks provide
|
| 50 |
+
* per-variable casting before deferring to the underlying type-specific
|
| 51 |
+
* callbacks. NB: It is possible to place a "static" in front of both the
|
| 52 |
+
* DECLARE and IMPLEMENT macros if the functions are strictly internal.
|
| 53 |
+
*/
|
| 54 |
+
|
| 55 |
+
/* First: "hash" functions */
|
| 56 |
+
# define DECLARE_LHASH_HASH_FN(name, o_type) \
|
| 57 |
+
unsigned long name##_LHASH_HASH(const void *);
|
| 58 |
+
# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
|
| 59 |
+
unsigned long name##_LHASH_HASH(const void *arg) { \
|
| 60 |
+
const o_type *a = arg; \
|
| 61 |
+
return name##_hash(a); }
|
| 62 |
+
# define LHASH_HASH_FN(name) name##_LHASH_HASH
|
| 63 |
+
|
| 64 |
+
/* Second: "compare" functions */
|
| 65 |
+
# define DECLARE_LHASH_COMP_FN(name, o_type) \
|
| 66 |
+
int name##_LHASH_COMP(const void *, const void *);
|
| 67 |
+
# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
|
| 68 |
+
int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
|
| 69 |
+
const o_type *a = arg1; \
|
| 70 |
+
const o_type *b = arg2; \
|
| 71 |
+
return name##_cmp(a,b); }
|
| 72 |
+
# define LHASH_COMP_FN(name) name##_LHASH_COMP
|
| 73 |
+
|
| 74 |
+
/* Fourth: "doall_arg" functions */
|
| 75 |
+
# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
| 76 |
+
void name##_LHASH_DOALL_ARG(void *, void *);
|
| 77 |
+
# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
| 78 |
+
void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
|
| 79 |
+
o_type *a = arg1; \
|
| 80 |
+
a_type *b = arg2; \
|
| 81 |
+
name##_doall_arg(a, b); }
|
| 82 |
+
# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
# define LH_LOAD_MULT 256
|
| 86 |
+
|
| 87 |
+
int OPENSSL_LH_error(OPENSSL_LHASH *lh);
|
| 88 |
+
OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c);
|
| 89 |
+
OPENSSL_LHASH *OPENSSL_LH_set_thunks(OPENSSL_LHASH *lh,
|
| 90 |
+
OPENSSL_LH_HASHFUNCTHUNK hw,
|
| 91 |
+
OPENSSL_LH_COMPFUNCTHUNK cw,
|
| 92 |
+
OPENSSL_LH_DOALL_FUNC_THUNK daw,
|
| 93 |
+
OPENSSL_LH_DOALL_FUNCARG_THUNK daaw);
|
| 94 |
+
void OPENSSL_LH_free(OPENSSL_LHASH *lh);
|
| 95 |
+
void OPENSSL_LH_flush(OPENSSL_LHASH *lh);
|
| 96 |
+
void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data);
|
| 97 |
+
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data);
|
| 98 |
+
void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data);
|
| 99 |
+
void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func);
|
| 100 |
+
void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh,
|
| 101 |
+
OPENSSL_LH_DOALL_FUNCARG func, void *arg);
|
| 102 |
+
void OPENSSL_LH_doall_arg_thunk(OPENSSL_LHASH *lh,
|
| 103 |
+
OPENSSL_LH_DOALL_FUNCARG_THUNK daaw,
|
| 104 |
+
OPENSSL_LH_DOALL_FUNCARG fn, void *arg);
|
| 105 |
+
|
| 106 |
+
unsigned long OPENSSL_LH_strhash(const char *c);
|
| 107 |
+
unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh);
|
| 108 |
+
unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh);
|
| 109 |
+
void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load);
|
| 110 |
+
|
| 111 |
+
# ifndef OPENSSL_NO_STDIO
|
| 112 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_1
|
| 113 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 114 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 115 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp);
|
| 116 |
+
# endif
|
| 117 |
+
# endif
|
| 118 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_1
|
| 119 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 120 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 121 |
+
OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out);
|
| 122 |
+
# endif
|
| 123 |
+
|
| 124 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 125 |
+
# define _LHASH OPENSSL_LHASH
|
| 126 |
+
# define LHASH_NODE OPENSSL_LH_NODE
|
| 127 |
+
# define lh_error OPENSSL_LH_error
|
| 128 |
+
# define lh_new OPENSSL_LH_new
|
| 129 |
+
# define lh_free OPENSSL_LH_free
|
| 130 |
+
# define lh_insert OPENSSL_LH_insert
|
| 131 |
+
# define lh_delete OPENSSL_LH_delete
|
| 132 |
+
# define lh_retrieve OPENSSL_LH_retrieve
|
| 133 |
+
# define lh_doall OPENSSL_LH_doall
|
| 134 |
+
# define lh_doall_arg OPENSSL_LH_doall_arg
|
| 135 |
+
# define lh_strhash OPENSSL_LH_strhash
|
| 136 |
+
# define lh_num_items OPENSSL_LH_num_items
|
| 137 |
+
# ifndef OPENSSL_NO_STDIO
|
| 138 |
+
# define lh_stats OPENSSL_LH_stats
|
| 139 |
+
# define lh_node_stats OPENSSL_LH_node_stats
|
| 140 |
+
# define lh_node_usage_stats OPENSSL_LH_node_usage_stats
|
| 141 |
+
# endif
|
| 142 |
+
# define lh_stats_bio OPENSSL_LH_stats_bio
|
| 143 |
+
# define lh_node_stats_bio OPENSSL_LH_node_stats_bio
|
| 144 |
+
# define lh_node_usage_stats_bio OPENSSL_LH_node_usage_stats_bio
|
| 145 |
+
# endif
|
| 146 |
+
|
| 147 |
+
/* Type checking... */
|
| 148 |
+
|
| 149 |
+
# define LHASH_OF(type) struct lhash_st_##type
|
| 150 |
+
|
| 151 |
+
/* Helper macro for internal use */
|
| 152 |
+
# define DEFINE_LHASH_OF_INTERNAL(type) \
|
| 153 |
+
LHASH_OF(type) { \
|
| 154 |
+
union lh_##type##_dummy { void* d1; unsigned long d2; int d3; } dummy; \
|
| 155 |
+
}; \
|
| 156 |
+
typedef int (*lh_##type##_compfunc)(const type *a, const type *b); \
|
| 157 |
+
typedef unsigned long (*lh_##type##_hashfunc)(const type *a); \
|
| 158 |
+
typedef void (*lh_##type##_doallfunc)(type *a); \
|
| 159 |
+
static ossl_inline unsigned long lh_##type##_hash_thunk(const void *data, OPENSSL_LH_HASHFUNC hfn) \
|
| 160 |
+
{ \
|
| 161 |
+
unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
|
| 162 |
+
return hfn_conv((const type *)data); \
|
| 163 |
+
} \
|
| 164 |
+
static ossl_inline int lh_##type##_comp_thunk(const void *da, const void *db, OPENSSL_LH_COMPFUNC cfn) \
|
| 165 |
+
{ \
|
| 166 |
+
int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
|
| 167 |
+
return cfn_conv((const type *)da, (const type *)db); \
|
| 168 |
+
} \
|
| 169 |
+
static ossl_inline void lh_##type##_doall_thunk(void *node, OPENSSL_LH_DOALL_FUNC doall) \
|
| 170 |
+
{ \
|
| 171 |
+
void (*doall_conv)(type *) = (void (*)(type *))doall; \
|
| 172 |
+
doall_conv((type *)node); \
|
| 173 |
+
} \
|
| 174 |
+
static ossl_inline void lh_##type##_doall_arg_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG doall) \
|
| 175 |
+
{ \
|
| 176 |
+
void (*doall_conv)(type *, void *) = (void (*)(type *, void *))doall; \
|
| 177 |
+
doall_conv((type *)node, arg); \
|
| 178 |
+
} \
|
| 179 |
+
static ossl_unused ossl_inline type *\
|
| 180 |
+
ossl_check_##type##_lh_plain_type(type *ptr) \
|
| 181 |
+
{ \
|
| 182 |
+
return ptr; \
|
| 183 |
+
} \
|
| 184 |
+
static ossl_unused ossl_inline const type * \
|
| 185 |
+
ossl_check_const_##type##_lh_plain_type(const type *ptr) \
|
| 186 |
+
{ \
|
| 187 |
+
return ptr; \
|
| 188 |
+
} \
|
| 189 |
+
static ossl_unused ossl_inline const OPENSSL_LHASH * \
|
| 190 |
+
ossl_check_const_##type##_lh_type(const LHASH_OF(type) *lh) \
|
| 191 |
+
{ \
|
| 192 |
+
return (const OPENSSL_LHASH *)lh; \
|
| 193 |
+
} \
|
| 194 |
+
static ossl_unused ossl_inline OPENSSL_LHASH * \
|
| 195 |
+
ossl_check_##type##_lh_type(LHASH_OF(type) *lh) \
|
| 196 |
+
{ \
|
| 197 |
+
return (OPENSSL_LHASH *)lh; \
|
| 198 |
+
} \
|
| 199 |
+
static ossl_unused ossl_inline OPENSSL_LH_COMPFUNC \
|
| 200 |
+
ossl_check_##type##_lh_compfunc_type(lh_##type##_compfunc cmp) \
|
| 201 |
+
{ \
|
| 202 |
+
return (OPENSSL_LH_COMPFUNC)cmp; \
|
| 203 |
+
} \
|
| 204 |
+
static ossl_unused ossl_inline OPENSSL_LH_HASHFUNC \
|
| 205 |
+
ossl_check_##type##_lh_hashfunc_type(lh_##type##_hashfunc hfn) \
|
| 206 |
+
{ \
|
| 207 |
+
return (OPENSSL_LH_HASHFUNC)hfn; \
|
| 208 |
+
} \
|
| 209 |
+
static ossl_unused ossl_inline OPENSSL_LH_DOALL_FUNC \
|
| 210 |
+
ossl_check_##type##_lh_doallfunc_type(lh_##type##_doallfunc dfn) \
|
| 211 |
+
{ \
|
| 212 |
+
return (OPENSSL_LH_DOALL_FUNC)dfn; \
|
| 213 |
+
} \
|
| 214 |
+
LHASH_OF(type)
|
| 215 |
+
|
| 216 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_1
|
| 217 |
+
# define DEFINE_LHASH_OF_DEPRECATED(type) \
|
| 218 |
+
static ossl_unused ossl_inline void \
|
| 219 |
+
lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 220 |
+
{ \
|
| 221 |
+
OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 222 |
+
} \
|
| 223 |
+
static ossl_unused ossl_inline void \
|
| 224 |
+
lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 225 |
+
{ \
|
| 226 |
+
OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 227 |
+
} \
|
| 228 |
+
static ossl_unused ossl_inline void \
|
| 229 |
+
lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \
|
| 230 |
+
{ \
|
| 231 |
+
OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); \
|
| 232 |
+
}
|
| 233 |
+
# else
|
| 234 |
+
# define DEFINE_LHASH_OF_DEPRECATED(type)
|
| 235 |
+
# endif
|
| 236 |
+
|
| 237 |
+
# define DEFINE_LHASH_OF_EX(type) \
|
| 238 |
+
LHASH_OF(type) { \
|
| 239 |
+
union lh_##type##_dummy { void* d1; unsigned long d2; int d3; } dummy; \
|
| 240 |
+
}; \
|
| 241 |
+
static unsigned long \
|
| 242 |
+
lh_##type##_hfn_thunk(const void *data, OPENSSL_LH_HASHFUNC hfn) \
|
| 243 |
+
{ \
|
| 244 |
+
unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
|
| 245 |
+
return hfn_conv((const type *)data); \
|
| 246 |
+
} \
|
| 247 |
+
static int lh_##type##_cfn_thunk(const void *da, const void *db, OPENSSL_LH_COMPFUNC cfn) \
|
| 248 |
+
{ \
|
| 249 |
+
int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
|
| 250 |
+
return cfn_conv((const type *)da, (const type *)db); \
|
| 251 |
+
} \
|
| 252 |
+
static ossl_unused ossl_inline void \
|
| 253 |
+
lh_##type##_free(LHASH_OF(type) *lh) \
|
| 254 |
+
{ \
|
| 255 |
+
OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
|
| 256 |
+
} \
|
| 257 |
+
static ossl_unused ossl_inline void \
|
| 258 |
+
lh_##type##_flush(LHASH_OF(type) *lh) \
|
| 259 |
+
{ \
|
| 260 |
+
OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
|
| 261 |
+
} \
|
| 262 |
+
static ossl_unused ossl_inline type * \
|
| 263 |
+
lh_##type##_insert(LHASH_OF(type) *lh, type *d) \
|
| 264 |
+
{ \
|
| 265 |
+
return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
|
| 266 |
+
} \
|
| 267 |
+
static ossl_unused ossl_inline type * \
|
| 268 |
+
lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \
|
| 269 |
+
{ \
|
| 270 |
+
return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
|
| 271 |
+
} \
|
| 272 |
+
static ossl_unused ossl_inline type * \
|
| 273 |
+
lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \
|
| 274 |
+
{ \
|
| 275 |
+
return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
|
| 276 |
+
} \
|
| 277 |
+
static ossl_unused ossl_inline int \
|
| 278 |
+
lh_##type##_error(LHASH_OF(type) *lh) \
|
| 279 |
+
{ \
|
| 280 |
+
return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
|
| 281 |
+
} \
|
| 282 |
+
static ossl_unused ossl_inline unsigned long \
|
| 283 |
+
lh_##type##_num_items(LHASH_OF(type) *lh) \
|
| 284 |
+
{ \
|
| 285 |
+
return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
|
| 286 |
+
} \
|
| 287 |
+
static ossl_unused ossl_inline unsigned long \
|
| 288 |
+
lh_##type##_get_down_load(LHASH_OF(type) *lh) \
|
| 289 |
+
{ \
|
| 290 |
+
return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
|
| 291 |
+
} \
|
| 292 |
+
static ossl_unused ossl_inline void \
|
| 293 |
+
lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \
|
| 294 |
+
{ \
|
| 295 |
+
OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
|
| 296 |
+
} \
|
| 297 |
+
static ossl_unused ossl_inline void \
|
| 298 |
+
lh_##type##_doall_thunk(void *node, OPENSSL_LH_DOALL_FUNC doall) \
|
| 299 |
+
{ \
|
| 300 |
+
void (*doall_conv)(type *) = (void (*)(type *))doall; \
|
| 301 |
+
doall_conv((type *)node); \
|
| 302 |
+
} \
|
| 303 |
+
static ossl_unused ossl_inline void \
|
| 304 |
+
lh_##type##_doall_arg_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG doall) \
|
| 305 |
+
{ \
|
| 306 |
+
void (*doall_conv)(type *, void *) = (void (*)(type *, void *))doall; \
|
| 307 |
+
doall_conv((type *)node, arg); \
|
| 308 |
+
} \
|
| 309 |
+
static ossl_unused ossl_inline void \
|
| 310 |
+
lh_##type##_doall(LHASH_OF(type) *lh, void (*doall)(type *)) \
|
| 311 |
+
{ \
|
| 312 |
+
OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
|
| 313 |
+
} \
|
| 314 |
+
static ossl_unused ossl_inline LHASH_OF(type) * \
|
| 315 |
+
lh_##type##_new(unsigned long (*hfn)(const type *), \
|
| 316 |
+
int (*cfn)(const type *, const type *)) \
|
| 317 |
+
{ \
|
| 318 |
+
return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
|
| 319 |
+
lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
|
| 320 |
+
lh_##type##_doall_thunk, \
|
| 321 |
+
lh_##type##_doall_arg_thunk); \
|
| 322 |
+
} \
|
| 323 |
+
static ossl_unused ossl_inline void \
|
| 324 |
+
lh_##type##_doall_arg(LHASH_OF(type) *lh, \
|
| 325 |
+
void (*doallarg)(type *, void *), void *arg) \
|
| 326 |
+
{ \
|
| 327 |
+
OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
|
| 328 |
+
(OPENSSL_LH_DOALL_FUNCARG)doallarg, arg); \
|
| 329 |
+
} \
|
| 330 |
+
LHASH_OF(type)
|
| 331 |
+
|
| 332 |
+
# define DEFINE_LHASH_OF(type) \
|
| 333 |
+
DEFINE_LHASH_OF_EX(type); \
|
| 334 |
+
DEFINE_LHASH_OF_DEPRECATED(type) \
|
| 335 |
+
LHASH_OF(type)
|
| 336 |
+
|
| 337 |
+
#define IMPLEMENT_LHASH_DOALL_ARG_CONST(type, argtype) \
|
| 338 |
+
int_implement_lhash_doall(type, argtype, const type)
|
| 339 |
+
|
| 340 |
+
#define IMPLEMENT_LHASH_DOALL_ARG(type, argtype) \
|
| 341 |
+
int_implement_lhash_doall(type, argtype, type)
|
| 342 |
+
|
| 343 |
+
#define int_implement_lhash_doall(type, argtype, cbargtype) \
|
| 344 |
+
static ossl_unused ossl_inline void \
|
| 345 |
+
lh_##type##_doall_##argtype##_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG fn) \
|
| 346 |
+
{ \
|
| 347 |
+
void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
|
| 348 |
+
fn_conv((cbargtype *)node, (argtype *)arg); \
|
| 349 |
+
} \
|
| 350 |
+
static ossl_unused ossl_inline void \
|
| 351 |
+
lh_##type##_doall_##argtype(LHASH_OF(type) *lh, \
|
| 352 |
+
void (*fn)(cbargtype *, argtype *), \
|
| 353 |
+
argtype *arg) \
|
| 354 |
+
{ \
|
| 355 |
+
OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
|
| 356 |
+
lh_##type##_doall_##argtype##_thunk, \
|
| 357 |
+
(OPENSSL_LH_DOALL_FUNCARG)fn, \
|
| 358 |
+
(void *)arg); \
|
| 359 |
+
} \
|
| 360 |
+
LHASH_OF(type)
|
| 361 |
+
|
| 362 |
+
DEFINE_LHASH_OF_INTERNAL(OPENSSL_STRING);
|
| 363 |
+
#define lh_OPENSSL_STRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_STRING) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_OPENSSL_STRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_STRING_lh_compfunc_type(cmp)), lh_OPENSSL_STRING_hash_thunk, lh_OPENSSL_STRING_comp_thunk, lh_OPENSSL_STRING_doall_thunk, lh_OPENSSL_STRING_doall_arg_thunk))
|
| 364 |
+
#define lh_OPENSSL_STRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 365 |
+
#define lh_OPENSSL_STRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 366 |
+
#define lh_OPENSSL_STRING_insert(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_insert(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_OPENSSL_STRING_lh_plain_type(ptr)))
|
| 367 |
+
#define lh_OPENSSL_STRING_delete(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_delete(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_const_OPENSSL_STRING_lh_plain_type(ptr)))
|
| 368 |
+
#define lh_OPENSSL_STRING_retrieve(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_retrieve(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_const_OPENSSL_STRING_lh_plain_type(ptr)))
|
| 369 |
+
#define lh_OPENSSL_STRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 370 |
+
#define lh_OPENSSL_STRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 371 |
+
#define lh_OPENSSL_STRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
| 372 |
+
#define lh_OPENSSL_STRING_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
| 373 |
+
#define lh_OPENSSL_STRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out)
|
| 374 |
+
#define lh_OPENSSL_STRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_STRING_lh_type(lh))
|
| 375 |
+
#define lh_OPENSSL_STRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_STRING_lh_type(lh), dl)
|
| 376 |
+
#define lh_OPENSSL_STRING_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_OPENSSL_STRING_lh_doallfunc_type(dfn))
|
| 377 |
+
DEFINE_LHASH_OF_INTERNAL(OPENSSL_CSTRING);
|
| 378 |
+
#define lh_OPENSSL_CSTRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_CSTRING) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_OPENSSL_CSTRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_CSTRING_lh_compfunc_type(cmp)), lh_OPENSSL_CSTRING_hash_thunk, lh_OPENSSL_CSTRING_comp_thunk, lh_OPENSSL_CSTRING_doall_thunk, lh_OPENSSL_CSTRING_doall_arg_thunk))
|
| 379 |
+
#define lh_OPENSSL_CSTRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 380 |
+
#define lh_OPENSSL_CSTRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 381 |
+
#define lh_OPENSSL_CSTRING_insert(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_insert(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
| 382 |
+
#define lh_OPENSSL_CSTRING_delete(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_delete(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_const_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
| 383 |
+
#define lh_OPENSSL_CSTRING_retrieve(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_retrieve(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_const_OPENSSL_CSTRING_lh_plain_type(ptr)))
|
| 384 |
+
#define lh_OPENSSL_CSTRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 385 |
+
#define lh_OPENSSL_CSTRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 386 |
+
#define lh_OPENSSL_CSTRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
| 387 |
+
#define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
| 388 |
+
#define lh_OPENSSL_CSTRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out)
|
| 389 |
+
#define lh_OPENSSL_CSTRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh))
|
| 390 |
+
#define lh_OPENSSL_CSTRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh), dl)
|
| 391 |
+
#define lh_OPENSSL_CSTRING_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_OPENSSL_CSTRING_lh_doallfunc_type(dfn))
|
| 392 |
+
|
| 393 |
+
|
| 394 |
+
#ifdef __cplusplus
|
| 395 |
+
}
|
| 396 |
+
#endif
|
| 397 |
+
|
| 398 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/ocsp.h
ADDED
|
@@ -0,0 +1,483 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/ocsp.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_OCSP_H
|
| 16 |
+
# define OPENSSL_OCSP_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_OCSP_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/opensslconf.h>
|
| 25 |
+
# include <openssl/http.h>
|
| 26 |
+
# include <openssl/asn1.h>
|
| 27 |
+
|
| 28 |
+
/*
|
| 29 |
+
* These definitions are outside the OPENSSL_NO_OCSP guard because although for
|
| 30 |
+
* historical reasons they have OCSP_* names, they can actually be used
|
| 31 |
+
* independently of OCSP. E.g. see RFC5280
|
| 32 |
+
*/
|
| 33 |
+
/*-
|
| 34 |
+
* CRLReason ::= ENUMERATED {
|
| 35 |
+
* unspecified (0),
|
| 36 |
+
* keyCompromise (1),
|
| 37 |
+
* cACompromise (2),
|
| 38 |
+
* affiliationChanged (3),
|
| 39 |
+
* superseded (4),
|
| 40 |
+
* cessationOfOperation (5),
|
| 41 |
+
* certificateHold (6),
|
| 42 |
+
* -- value 7 is not used
|
| 43 |
+
* removeFromCRL (8),
|
| 44 |
+
* privilegeWithdrawn (9),
|
| 45 |
+
* aACompromise (10) }
|
| 46 |
+
*/
|
| 47 |
+
# define OCSP_REVOKED_STATUS_NOSTATUS -1
|
| 48 |
+
# define OCSP_REVOKED_STATUS_UNSPECIFIED 0
|
| 49 |
+
# define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1
|
| 50 |
+
# define OCSP_REVOKED_STATUS_CACOMPROMISE 2
|
| 51 |
+
# define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3
|
| 52 |
+
# define OCSP_REVOKED_STATUS_SUPERSEDED 4
|
| 53 |
+
# define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5
|
| 54 |
+
# define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6
|
| 55 |
+
# define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8
|
| 56 |
+
# define OCSP_REVOKED_STATUS_PRIVILEGEWITHDRAWN 9
|
| 57 |
+
# define OCSP_REVOKED_STATUS_AACOMPROMISE 10
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
# ifndef OPENSSL_NO_OCSP
|
| 61 |
+
|
| 62 |
+
# include <openssl/x509.h>
|
| 63 |
+
# include <openssl/x509v3.h>
|
| 64 |
+
# include <openssl/safestack.h>
|
| 65 |
+
# include <openssl/ocsperr.h>
|
| 66 |
+
|
| 67 |
+
# ifdef __cplusplus
|
| 68 |
+
extern "C" {
|
| 69 |
+
# endif
|
| 70 |
+
|
| 71 |
+
/* Various flags and values */
|
| 72 |
+
|
| 73 |
+
# define OCSP_DEFAULT_NONCE_LENGTH 16
|
| 74 |
+
|
| 75 |
+
# define OCSP_NOCERTS 0x1
|
| 76 |
+
# define OCSP_NOINTERN 0x2
|
| 77 |
+
# define OCSP_NOSIGS 0x4
|
| 78 |
+
# define OCSP_NOCHAIN 0x8
|
| 79 |
+
# define OCSP_NOVERIFY 0x10
|
| 80 |
+
# define OCSP_NOEXPLICIT 0x20
|
| 81 |
+
# define OCSP_NOCASIGN 0x40
|
| 82 |
+
# define OCSP_NODELEGATED 0x80
|
| 83 |
+
# define OCSP_NOCHECKS 0x100
|
| 84 |
+
# define OCSP_TRUSTOTHER 0x200
|
| 85 |
+
# define OCSP_RESPID_KEY 0x400
|
| 86 |
+
# define OCSP_NOTIME 0x800
|
| 87 |
+
# define OCSP_PARTIAL_CHAIN 0x1000
|
| 88 |
+
|
| 89 |
+
typedef struct ocsp_cert_id_st OCSP_CERTID;
|
| 90 |
+
typedef struct ocsp_one_request_st OCSP_ONEREQ;
|
| 91 |
+
typedef struct ocsp_req_info_st OCSP_REQINFO;
|
| 92 |
+
typedef struct ocsp_signature_st OCSP_SIGNATURE;
|
| 93 |
+
typedef struct ocsp_request_st OCSP_REQUEST;
|
| 94 |
+
|
| 95 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OCSP_CERTID, OCSP_CERTID, OCSP_CERTID)
|
| 96 |
+
#define sk_OCSP_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_CERTID_sk_type(sk))
|
| 97 |
+
#define sk_OCSP_CERTID_value(sk, idx) ((OCSP_CERTID *)OPENSSL_sk_value(ossl_check_const_OCSP_CERTID_sk_type(sk), (idx)))
|
| 98 |
+
#define sk_OCSP_CERTID_new(cmp) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new(ossl_check_OCSP_CERTID_compfunc_type(cmp)))
|
| 99 |
+
#define sk_OCSP_CERTID_new_null() ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new_null())
|
| 100 |
+
#define sk_OCSP_CERTID_new_reserve(cmp, n) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_CERTID_compfunc_type(cmp), (n)))
|
| 101 |
+
#define sk_OCSP_CERTID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_CERTID_sk_type(sk), (n))
|
| 102 |
+
#define sk_OCSP_CERTID_free(sk) OPENSSL_sk_free(ossl_check_OCSP_CERTID_sk_type(sk))
|
| 103 |
+
#define sk_OCSP_CERTID_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_CERTID_sk_type(sk))
|
| 104 |
+
#define sk_OCSP_CERTID_delete(sk, i) ((OCSP_CERTID *)OPENSSL_sk_delete(ossl_check_OCSP_CERTID_sk_type(sk), (i)))
|
| 105 |
+
#define sk_OCSP_CERTID_delete_ptr(sk, ptr) ((OCSP_CERTID *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr)))
|
| 106 |
+
#define sk_OCSP_CERTID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))
|
| 107 |
+
#define sk_OCSP_CERTID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))
|
| 108 |
+
#define sk_OCSP_CERTID_pop(sk) ((OCSP_CERTID *)OPENSSL_sk_pop(ossl_check_OCSP_CERTID_sk_type(sk)))
|
| 109 |
+
#define sk_OCSP_CERTID_shift(sk) ((OCSP_CERTID *)OPENSSL_sk_shift(ossl_check_OCSP_CERTID_sk_type(sk)))
|
| 110 |
+
#define sk_OCSP_CERTID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_CERTID_sk_type(sk),ossl_check_OCSP_CERTID_freefunc_type(freefunc))
|
| 111 |
+
#define sk_OCSP_CERTID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr), (idx))
|
| 112 |
+
#define sk_OCSP_CERTID_set(sk, idx, ptr) ((OCSP_CERTID *)OPENSSL_sk_set(ossl_check_OCSP_CERTID_sk_type(sk), (idx), ossl_check_OCSP_CERTID_type(ptr)))
|
| 113 |
+
#define sk_OCSP_CERTID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))
|
| 114 |
+
#define sk_OCSP_CERTID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))
|
| 115 |
+
#define sk_OCSP_CERTID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr), pnum)
|
| 116 |
+
#define sk_OCSP_CERTID_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_CERTID_sk_type(sk))
|
| 117 |
+
#define sk_OCSP_CERTID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_CERTID_sk_type(sk))
|
| 118 |
+
#define sk_OCSP_CERTID_dup(sk) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_dup(ossl_check_const_OCSP_CERTID_sk_type(sk)))
|
| 119 |
+
#define sk_OCSP_CERTID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_copyfunc_type(copyfunc), ossl_check_OCSP_CERTID_freefunc_type(freefunc)))
|
| 120 |
+
#define sk_OCSP_CERTID_set_cmp_func(sk, cmp) ((sk_OCSP_CERTID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_compfunc_type(cmp)))
|
| 121 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OCSP_ONEREQ, OCSP_ONEREQ, OCSP_ONEREQ)
|
| 122 |
+
#define sk_OCSP_ONEREQ_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_ONEREQ_sk_type(sk))
|
| 123 |
+
#define sk_OCSP_ONEREQ_value(sk, idx) ((OCSP_ONEREQ *)OPENSSL_sk_value(ossl_check_const_OCSP_ONEREQ_sk_type(sk), (idx)))
|
| 124 |
+
#define sk_OCSP_ONEREQ_new(cmp) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new(ossl_check_OCSP_ONEREQ_compfunc_type(cmp)))
|
| 125 |
+
#define sk_OCSP_ONEREQ_new_null() ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new_null())
|
| 126 |
+
#define sk_OCSP_ONEREQ_new_reserve(cmp, n) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_ONEREQ_compfunc_type(cmp), (n)))
|
| 127 |
+
#define sk_OCSP_ONEREQ_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_ONEREQ_sk_type(sk), (n))
|
| 128 |
+
#define sk_OCSP_ONEREQ_free(sk) OPENSSL_sk_free(ossl_check_OCSP_ONEREQ_sk_type(sk))
|
| 129 |
+
#define sk_OCSP_ONEREQ_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_ONEREQ_sk_type(sk))
|
| 130 |
+
#define sk_OCSP_ONEREQ_delete(sk, i) ((OCSP_ONEREQ *)OPENSSL_sk_delete(ossl_check_OCSP_ONEREQ_sk_type(sk), (i)))
|
| 131 |
+
#define sk_OCSP_ONEREQ_delete_ptr(sk, ptr) ((OCSP_ONEREQ *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr)))
|
| 132 |
+
#define sk_OCSP_ONEREQ_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))
|
| 133 |
+
#define sk_OCSP_ONEREQ_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))
|
| 134 |
+
#define sk_OCSP_ONEREQ_pop(sk) ((OCSP_ONEREQ *)OPENSSL_sk_pop(ossl_check_OCSP_ONEREQ_sk_type(sk)))
|
| 135 |
+
#define sk_OCSP_ONEREQ_shift(sk) ((OCSP_ONEREQ *)OPENSSL_sk_shift(ossl_check_OCSP_ONEREQ_sk_type(sk)))
|
| 136 |
+
#define sk_OCSP_ONEREQ_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_ONEREQ_sk_type(sk),ossl_check_OCSP_ONEREQ_freefunc_type(freefunc))
|
| 137 |
+
#define sk_OCSP_ONEREQ_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr), (idx))
|
| 138 |
+
#define sk_OCSP_ONEREQ_set(sk, idx, ptr) ((OCSP_ONEREQ *)OPENSSL_sk_set(ossl_check_OCSP_ONEREQ_sk_type(sk), (idx), ossl_check_OCSP_ONEREQ_type(ptr)))
|
| 139 |
+
#define sk_OCSP_ONEREQ_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))
|
| 140 |
+
#define sk_OCSP_ONEREQ_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))
|
| 141 |
+
#define sk_OCSP_ONEREQ_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr), pnum)
|
| 142 |
+
#define sk_OCSP_ONEREQ_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_ONEREQ_sk_type(sk))
|
| 143 |
+
#define sk_OCSP_ONEREQ_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_ONEREQ_sk_type(sk))
|
| 144 |
+
#define sk_OCSP_ONEREQ_dup(sk) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_dup(ossl_check_const_OCSP_ONEREQ_sk_type(sk)))
|
| 145 |
+
#define sk_OCSP_ONEREQ_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_copyfunc_type(copyfunc), ossl_check_OCSP_ONEREQ_freefunc_type(freefunc)))
|
| 146 |
+
#define sk_OCSP_ONEREQ_set_cmp_func(sk, cmp) ((sk_OCSP_ONEREQ_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_compfunc_type(cmp)))
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
# define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
|
| 150 |
+
# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
|
| 151 |
+
# define OCSP_RESPONSE_STATUS_INTERNALERROR 2
|
| 152 |
+
# define OCSP_RESPONSE_STATUS_TRYLATER 3
|
| 153 |
+
# define OCSP_RESPONSE_STATUS_SIGREQUIRED 5
|
| 154 |
+
# define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6
|
| 155 |
+
|
| 156 |
+
typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
|
| 157 |
+
|
| 158 |
+
# define V_OCSP_RESPID_NAME 0
|
| 159 |
+
# define V_OCSP_RESPID_KEY 1
|
| 160 |
+
|
| 161 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OCSP_RESPID, OCSP_RESPID, OCSP_RESPID)
|
| 162 |
+
#define sk_OCSP_RESPID_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_RESPID_sk_type(sk))
|
| 163 |
+
#define sk_OCSP_RESPID_value(sk, idx) ((OCSP_RESPID *)OPENSSL_sk_value(ossl_check_const_OCSP_RESPID_sk_type(sk), (idx)))
|
| 164 |
+
#define sk_OCSP_RESPID_new(cmp) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new(ossl_check_OCSP_RESPID_compfunc_type(cmp)))
|
| 165 |
+
#define sk_OCSP_RESPID_new_null() ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new_null())
|
| 166 |
+
#define sk_OCSP_RESPID_new_reserve(cmp, n) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_RESPID_compfunc_type(cmp), (n)))
|
| 167 |
+
#define sk_OCSP_RESPID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_RESPID_sk_type(sk), (n))
|
| 168 |
+
#define sk_OCSP_RESPID_free(sk) OPENSSL_sk_free(ossl_check_OCSP_RESPID_sk_type(sk))
|
| 169 |
+
#define sk_OCSP_RESPID_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_RESPID_sk_type(sk))
|
| 170 |
+
#define sk_OCSP_RESPID_delete(sk, i) ((OCSP_RESPID *)OPENSSL_sk_delete(ossl_check_OCSP_RESPID_sk_type(sk), (i)))
|
| 171 |
+
#define sk_OCSP_RESPID_delete_ptr(sk, ptr) ((OCSP_RESPID *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr)))
|
| 172 |
+
#define sk_OCSP_RESPID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))
|
| 173 |
+
#define sk_OCSP_RESPID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))
|
| 174 |
+
#define sk_OCSP_RESPID_pop(sk) ((OCSP_RESPID *)OPENSSL_sk_pop(ossl_check_OCSP_RESPID_sk_type(sk)))
|
| 175 |
+
#define sk_OCSP_RESPID_shift(sk) ((OCSP_RESPID *)OPENSSL_sk_shift(ossl_check_OCSP_RESPID_sk_type(sk)))
|
| 176 |
+
#define sk_OCSP_RESPID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_RESPID_sk_type(sk),ossl_check_OCSP_RESPID_freefunc_type(freefunc))
|
| 177 |
+
#define sk_OCSP_RESPID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr), (idx))
|
| 178 |
+
#define sk_OCSP_RESPID_set(sk, idx, ptr) ((OCSP_RESPID *)OPENSSL_sk_set(ossl_check_OCSP_RESPID_sk_type(sk), (idx), ossl_check_OCSP_RESPID_type(ptr)))
|
| 179 |
+
#define sk_OCSP_RESPID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))
|
| 180 |
+
#define sk_OCSP_RESPID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))
|
| 181 |
+
#define sk_OCSP_RESPID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr), pnum)
|
| 182 |
+
#define sk_OCSP_RESPID_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_RESPID_sk_type(sk))
|
| 183 |
+
#define sk_OCSP_RESPID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_RESPID_sk_type(sk))
|
| 184 |
+
#define sk_OCSP_RESPID_dup(sk) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_dup(ossl_check_const_OCSP_RESPID_sk_type(sk)))
|
| 185 |
+
#define sk_OCSP_RESPID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_copyfunc_type(copyfunc), ossl_check_OCSP_RESPID_freefunc_type(freefunc)))
|
| 186 |
+
#define sk_OCSP_RESPID_set_cmp_func(sk, cmp) ((sk_OCSP_RESPID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_compfunc_type(cmp)))
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
|
| 190 |
+
|
| 191 |
+
# define V_OCSP_CERTSTATUS_GOOD 0
|
| 192 |
+
# define V_OCSP_CERTSTATUS_REVOKED 1
|
| 193 |
+
# define V_OCSP_CERTSTATUS_UNKNOWN 2
|
| 194 |
+
|
| 195 |
+
typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
|
| 196 |
+
typedef struct ocsp_single_response_st OCSP_SINGLERESP;
|
| 197 |
+
|
| 198 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OCSP_SINGLERESP, OCSP_SINGLERESP, OCSP_SINGLERESP)
|
| 199 |
+
#define sk_OCSP_SINGLERESP_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_SINGLERESP_sk_type(sk))
|
| 200 |
+
#define sk_OCSP_SINGLERESP_value(sk, idx) ((OCSP_SINGLERESP *)OPENSSL_sk_value(ossl_check_const_OCSP_SINGLERESP_sk_type(sk), (idx)))
|
| 201 |
+
#define sk_OCSP_SINGLERESP_new(cmp) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new(ossl_check_OCSP_SINGLERESP_compfunc_type(cmp)))
|
| 202 |
+
#define sk_OCSP_SINGLERESP_new_null() ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new_null())
|
| 203 |
+
#define sk_OCSP_SINGLERESP_new_reserve(cmp, n) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_SINGLERESP_compfunc_type(cmp), (n)))
|
| 204 |
+
#define sk_OCSP_SINGLERESP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_SINGLERESP_sk_type(sk), (n))
|
| 205 |
+
#define sk_OCSP_SINGLERESP_free(sk) OPENSSL_sk_free(ossl_check_OCSP_SINGLERESP_sk_type(sk))
|
| 206 |
+
#define sk_OCSP_SINGLERESP_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_SINGLERESP_sk_type(sk))
|
| 207 |
+
#define sk_OCSP_SINGLERESP_delete(sk, i) ((OCSP_SINGLERESP *)OPENSSL_sk_delete(ossl_check_OCSP_SINGLERESP_sk_type(sk), (i)))
|
| 208 |
+
#define sk_OCSP_SINGLERESP_delete_ptr(sk, ptr) ((OCSP_SINGLERESP *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr)))
|
| 209 |
+
#define sk_OCSP_SINGLERESP_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))
|
| 210 |
+
#define sk_OCSP_SINGLERESP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))
|
| 211 |
+
#define sk_OCSP_SINGLERESP_pop(sk) ((OCSP_SINGLERESP *)OPENSSL_sk_pop(ossl_check_OCSP_SINGLERESP_sk_type(sk)))
|
| 212 |
+
#define sk_OCSP_SINGLERESP_shift(sk) ((OCSP_SINGLERESP *)OPENSSL_sk_shift(ossl_check_OCSP_SINGLERESP_sk_type(sk)))
|
| 213 |
+
#define sk_OCSP_SINGLERESP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_SINGLERESP_sk_type(sk),ossl_check_OCSP_SINGLERESP_freefunc_type(freefunc))
|
| 214 |
+
#define sk_OCSP_SINGLERESP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr), (idx))
|
| 215 |
+
#define sk_OCSP_SINGLERESP_set(sk, idx, ptr) ((OCSP_SINGLERESP *)OPENSSL_sk_set(ossl_check_OCSP_SINGLERESP_sk_type(sk), (idx), ossl_check_OCSP_SINGLERESP_type(ptr)))
|
| 216 |
+
#define sk_OCSP_SINGLERESP_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))
|
| 217 |
+
#define sk_OCSP_SINGLERESP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))
|
| 218 |
+
#define sk_OCSP_SINGLERESP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr), pnum)
|
| 219 |
+
#define sk_OCSP_SINGLERESP_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_SINGLERESP_sk_type(sk))
|
| 220 |
+
#define sk_OCSP_SINGLERESP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_SINGLERESP_sk_type(sk))
|
| 221 |
+
#define sk_OCSP_SINGLERESP_dup(sk) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_dup(ossl_check_const_OCSP_SINGLERESP_sk_type(sk)))
|
| 222 |
+
#define sk_OCSP_SINGLERESP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_copyfunc_type(copyfunc), ossl_check_OCSP_SINGLERESP_freefunc_type(freefunc)))
|
| 223 |
+
#define sk_OCSP_SINGLERESP_set_cmp_func(sk, cmp) ((sk_OCSP_SINGLERESP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_compfunc_type(cmp)))
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
typedef struct ocsp_response_data_st OCSP_RESPDATA;
|
| 227 |
+
|
| 228 |
+
typedef struct ocsp_basic_response_st OCSP_BASICRESP;
|
| 229 |
+
|
| 230 |
+
typedef struct ocsp_crl_id_st OCSP_CRLID;
|
| 231 |
+
typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
|
| 232 |
+
|
| 233 |
+
# define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
|
| 234 |
+
# define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
|
| 235 |
+
|
| 236 |
+
# define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
|
| 237 |
+
|
| 238 |
+
# define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
|
| 239 |
+
|
| 240 |
+
# define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
|
| 241 |
+
(char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST, \
|
| 242 |
+
bp,(char **)(x),cb,NULL)
|
| 243 |
+
|
| 244 |
+
# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb) (OCSP_RESPONSE *)PEM_ASN1_read_bio(\
|
| 245 |
+
(char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE, \
|
| 246 |
+
bp,(char **)(x),cb,NULL)
|
| 247 |
+
|
| 248 |
+
# define PEM_write_bio_OCSP_REQUEST(bp,o) \
|
| 249 |
+
PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
|
| 250 |
+
bp,(char *)(o), NULL,NULL,0,NULL,NULL)
|
| 251 |
+
|
| 252 |
+
# define PEM_write_bio_OCSP_RESPONSE(bp,o) \
|
| 253 |
+
PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
|
| 254 |
+
bp,(char *)(o), NULL,NULL,0,NULL,NULL)
|
| 255 |
+
|
| 256 |
+
# define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
|
| 257 |
+
|
| 258 |
+
# define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
|
| 259 |
+
|
| 260 |
+
# define ASN1_BIT_STRING_digest(data,type,md,len) \
|
| 261 |
+
ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
|
| 262 |
+
|
| 263 |
+
# define OCSP_CERTSTATUS_dup(cs)\
|
| 264 |
+
(OCSP_CERTSTATUS*)ASN1_dup((i2d_of_void *)i2d_OCSP_CERTSTATUS,\
|
| 265 |
+
(d2i_of_void *)d2i_OCSP_CERTSTATUS,(char *)(cs))
|
| 266 |
+
|
| 267 |
+
DECLARE_ASN1_DUP_FUNCTION(OCSP_CERTID)
|
| 268 |
+
|
| 269 |
+
OSSL_HTTP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path,
|
| 270 |
+
const OCSP_REQUEST *req, int buf_size);
|
| 271 |
+
OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
|
| 272 |
+
|
| 273 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 274 |
+
typedef OSSL_HTTP_REQ_CTX OCSP_REQ_CTX;
|
| 275 |
+
# define OCSP_REQ_CTX_new(io, buf_size) \
|
| 276 |
+
OSSL_HTTP_REQ_CTX_new(io, io, buf_size)
|
| 277 |
+
# define OCSP_REQ_CTX_free OSSL_HTTP_REQ_CTX_free
|
| 278 |
+
# define OCSP_REQ_CTX_http(rctx, op, path) \
|
| 279 |
+
(OSSL_HTTP_REQ_CTX_set_expected(rctx, NULL, 1 /* asn1 */, 0, 0) && \
|
| 280 |
+
OSSL_HTTP_REQ_CTX_set_request_line(rctx, strcmp(op, "POST") == 0, \
|
| 281 |
+
NULL, NULL, path))
|
| 282 |
+
# define OCSP_REQ_CTX_add1_header OSSL_HTTP_REQ_CTX_add1_header
|
| 283 |
+
# define OCSP_REQ_CTX_i2d(r, it, req) \
|
| 284 |
+
OSSL_HTTP_REQ_CTX_set1_req(r, "application/ocsp-request", it, req)
|
| 285 |
+
# define OCSP_REQ_CTX_set1_req(r, req) \
|
| 286 |
+
OCSP_REQ_CTX_i2d(r, ASN1_ITEM_rptr(OCSP_REQUEST), (ASN1_VALUE *)(req))
|
| 287 |
+
# define OCSP_REQ_CTX_nbio OSSL_HTTP_REQ_CTX_nbio
|
| 288 |
+
# define OCSP_REQ_CTX_nbio_d2i OSSL_HTTP_REQ_CTX_nbio_d2i
|
| 289 |
+
# define OCSP_sendreq_nbio(p, r) \
|
| 290 |
+
OSSL_HTTP_REQ_CTX_nbio_d2i(r, (ASN1_VALUE **)(p), \
|
| 291 |
+
ASN1_ITEM_rptr(OCSP_RESPONSE))
|
| 292 |
+
# define OCSP_REQ_CTX_get0_mem_bio OSSL_HTTP_REQ_CTX_get0_mem_bio
|
| 293 |
+
# define OCSP_set_max_response_length OSSL_HTTP_REQ_CTX_set_max_response_length
|
| 294 |
+
# endif
|
| 295 |
+
|
| 296 |
+
OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject,
|
| 297 |
+
const X509 *issuer);
|
| 298 |
+
|
| 299 |
+
OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
|
| 300 |
+
const X509_NAME *issuerName,
|
| 301 |
+
const ASN1_BIT_STRING *issuerKey,
|
| 302 |
+
const ASN1_INTEGER *serialNumber);
|
| 303 |
+
|
| 304 |
+
OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
|
| 305 |
+
|
| 306 |
+
int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
|
| 307 |
+
int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
|
| 308 |
+
int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
|
| 309 |
+
int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
|
| 310 |
+
|
| 311 |
+
int OCSP_request_set1_name(OCSP_REQUEST *req, const X509_NAME *nm);
|
| 312 |
+
int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
|
| 313 |
+
|
| 314 |
+
int OCSP_request_sign(OCSP_REQUEST *req,
|
| 315 |
+
X509 *signer,
|
| 316 |
+
EVP_PKEY *key,
|
| 317 |
+
const EVP_MD *dgst,
|
| 318 |
+
STACK_OF(X509) *certs, unsigned long flags);
|
| 319 |
+
|
| 320 |
+
int OCSP_response_status(OCSP_RESPONSE *resp);
|
| 321 |
+
OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
|
| 322 |
+
|
| 323 |
+
const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs);
|
| 324 |
+
const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs);
|
| 325 |
+
const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs);
|
| 326 |
+
int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer,
|
| 327 |
+
STACK_OF(X509) *extra_certs);
|
| 328 |
+
|
| 329 |
+
int OCSP_resp_count(OCSP_BASICRESP *bs);
|
| 330 |
+
OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
|
| 331 |
+
const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP* bs);
|
| 332 |
+
const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs);
|
| 333 |
+
int OCSP_resp_get0_id(const OCSP_BASICRESP *bs,
|
| 334 |
+
const ASN1_OCTET_STRING **pid,
|
| 335 |
+
const X509_NAME **pname);
|
| 336 |
+
int OCSP_resp_get1_id(const OCSP_BASICRESP *bs,
|
| 337 |
+
ASN1_OCTET_STRING **pid,
|
| 338 |
+
X509_NAME **pname);
|
| 339 |
+
|
| 340 |
+
int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
|
| 341 |
+
int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
|
| 342 |
+
ASN1_GENERALIZEDTIME **revtime,
|
| 343 |
+
ASN1_GENERALIZEDTIME **thisupd,
|
| 344 |
+
ASN1_GENERALIZEDTIME **nextupd);
|
| 345 |
+
int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
|
| 346 |
+
int *reason,
|
| 347 |
+
ASN1_GENERALIZEDTIME **revtime,
|
| 348 |
+
ASN1_GENERALIZEDTIME **thisupd,
|
| 349 |
+
ASN1_GENERALIZEDTIME **nextupd);
|
| 350 |
+
int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
|
| 351 |
+
ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);
|
| 352 |
+
|
| 353 |
+
int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
|
| 354 |
+
X509_STORE *store, unsigned long flags);
|
| 355 |
+
|
| 356 |
+
# define OCSP_parse_url(url, host, port, path, ssl) \
|
| 357 |
+
OSSL_HTTP_parse_url(url, ssl, NULL, host, port, NULL, path, NULL, NULL)
|
| 358 |
+
|
| 359 |
+
int OCSP_id_issuer_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
|
| 360 |
+
int OCSP_id_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
|
| 361 |
+
|
| 362 |
+
int OCSP_request_onereq_count(OCSP_REQUEST *req);
|
| 363 |
+
OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
|
| 364 |
+
OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
|
| 365 |
+
int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
|
| 366 |
+
ASN1_OCTET_STRING **pikeyHash,
|
| 367 |
+
ASN1_INTEGER **pserial, OCSP_CERTID *cid);
|
| 368 |
+
int OCSP_request_is_signed(OCSP_REQUEST *req);
|
| 369 |
+
OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
|
| 370 |
+
OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
|
| 371 |
+
OCSP_CERTID *cid,
|
| 372 |
+
int status, int reason,
|
| 373 |
+
ASN1_TIME *revtime,
|
| 374 |
+
ASN1_TIME *thisupd,
|
| 375 |
+
ASN1_TIME *nextupd);
|
| 376 |
+
int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
|
| 377 |
+
int OCSP_basic_sign(OCSP_BASICRESP *brsp,
|
| 378 |
+
X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
|
| 379 |
+
STACK_OF(X509) *certs, unsigned long flags);
|
| 380 |
+
int OCSP_basic_sign_ctx(OCSP_BASICRESP *brsp,
|
| 381 |
+
X509 *signer, EVP_MD_CTX *ctx,
|
| 382 |
+
STACK_OF(X509) *certs, unsigned long flags);
|
| 383 |
+
int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert);
|
| 384 |
+
int OCSP_RESPID_set_by_key_ex(OCSP_RESPID *respid, X509 *cert,
|
| 385 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 386 |
+
int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert);
|
| 387 |
+
int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OSSL_LIB_CTX *libctx,
|
| 388 |
+
const char *propq);
|
| 389 |
+
int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert);
|
| 390 |
+
|
| 391 |
+
X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim);
|
| 392 |
+
|
| 393 |
+
X509_EXTENSION *OCSP_accept_responses_new(char **oids);
|
| 394 |
+
|
| 395 |
+
X509_EXTENSION *OCSP_archive_cutoff_new(char *tim);
|
| 396 |
+
|
| 397 |
+
X509_EXTENSION *OCSP_url_svcloc_new(const X509_NAME *issuer, const char **urls);
|
| 398 |
+
|
| 399 |
+
int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
|
| 400 |
+
int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
|
| 401 |
+
int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj,
|
| 402 |
+
int lastpos);
|
| 403 |
+
int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
|
| 404 |
+
X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
|
| 405 |
+
X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
|
| 406 |
+
void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,
|
| 407 |
+
int *idx);
|
| 408 |
+
int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
|
| 409 |
+
unsigned long flags);
|
| 410 |
+
int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
|
| 411 |
+
|
| 412 |
+
int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
|
| 413 |
+
int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
|
| 414 |
+
int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos);
|
| 415 |
+
int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
|
| 416 |
+
X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
|
| 417 |
+
X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
|
| 418 |
+
void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
|
| 419 |
+
int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
|
| 420 |
+
unsigned long flags);
|
| 421 |
+
int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
|
| 422 |
+
|
| 423 |
+
int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
|
| 424 |
+
int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
|
| 425 |
+
int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj,
|
| 426 |
+
int lastpos);
|
| 427 |
+
int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
|
| 428 |
+
int lastpos);
|
| 429 |
+
X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
|
| 430 |
+
X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
|
| 431 |
+
void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
|
| 432 |
+
int *idx);
|
| 433 |
+
int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
|
| 434 |
+
int crit, unsigned long flags);
|
| 435 |
+
int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
|
| 436 |
+
|
| 437 |
+
int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
|
| 438 |
+
int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
|
| 439 |
+
int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, const ASN1_OBJECT *obj,
|
| 440 |
+
int lastpos);
|
| 441 |
+
int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
|
| 442 |
+
int lastpos);
|
| 443 |
+
X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
|
| 444 |
+
X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
|
| 445 |
+
void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
|
| 446 |
+
int *idx);
|
| 447 |
+
int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
|
| 448 |
+
int crit, unsigned long flags);
|
| 449 |
+
int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
|
| 450 |
+
const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x);
|
| 451 |
+
|
| 452 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
|
| 453 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
|
| 454 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
|
| 455 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
|
| 456 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
|
| 457 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
|
| 458 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
|
| 459 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
|
| 460 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
|
| 461 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
|
| 462 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
|
| 463 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
|
| 464 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
|
| 465 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
|
| 466 |
+
DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
|
| 467 |
+
|
| 468 |
+
const char *OCSP_response_status_str(long s);
|
| 469 |
+
const char *OCSP_cert_status_str(long s);
|
| 470 |
+
const char *OCSP_crl_reason_str(long s);
|
| 471 |
+
|
| 472 |
+
int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);
|
| 473 |
+
int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);
|
| 474 |
+
|
| 475 |
+
int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
|
| 476 |
+
X509_STORE *st, unsigned long flags);
|
| 477 |
+
|
| 478 |
+
|
| 479 |
+
# ifdef __cplusplus
|
| 480 |
+
}
|
| 481 |
+
# endif
|
| 482 |
+
# endif /* !defined(OPENSSL_NO_OCSP) */
|
| 483 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslv.h
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/opensslv.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef OPENSSL_OPENSSLV_H
|
| 14 |
+
# define OPENSSL_OPENSSLV_H
|
| 15 |
+
# pragma once
|
| 16 |
+
|
| 17 |
+
# ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
# endif
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* SECTION 1: VERSION DATA. These will change for each release
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
/*
|
| 26 |
+
* Base version macros
|
| 27 |
+
*
|
| 28 |
+
* These macros express version number MAJOR.MINOR.PATCH exactly
|
| 29 |
+
*/
|
| 30 |
+
# define OPENSSL_VERSION_MAJOR 3
|
| 31 |
+
# define OPENSSL_VERSION_MINOR 5
|
| 32 |
+
# define OPENSSL_VERSION_PATCH 4
|
| 33 |
+
|
| 34 |
+
/*
|
| 35 |
+
* Additional version information
|
| 36 |
+
*
|
| 37 |
+
* These are also part of the new version scheme, but aren't part
|
| 38 |
+
* of the version number itself.
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
/* Could be: #define OPENSSL_VERSION_PRE_RELEASE "-alpha.1" */
|
| 42 |
+
# define OPENSSL_VERSION_PRE_RELEASE ""
|
| 43 |
+
/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+fips" */
|
| 44 |
+
/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+vendor.1" */
|
| 45 |
+
# define OPENSSL_VERSION_BUILD_METADATA ""
|
| 46 |
+
|
| 47 |
+
/*
|
| 48 |
+
* Note: The OpenSSL Project will never define OPENSSL_VERSION_BUILD_METADATA
|
| 49 |
+
* to be anything but the empty string. Its use is entirely reserved for
|
| 50 |
+
* others
|
| 51 |
+
*/
|
| 52 |
+
|
| 53 |
+
/*
|
| 54 |
+
* Shared library version
|
| 55 |
+
*
|
| 56 |
+
* This is strictly to express ABI version, which may or may not
|
| 57 |
+
* be related to the API version expressed with the macros above.
|
| 58 |
+
* This is defined in free form.
|
| 59 |
+
*/
|
| 60 |
+
# define OPENSSL_SHLIB_VERSION 3
|
| 61 |
+
|
| 62 |
+
/*
|
| 63 |
+
* SECTION 2: USEFUL MACROS
|
| 64 |
+
*/
|
| 65 |
+
|
| 66 |
+
/* For checking general API compatibility when preprocessing */
|
| 67 |
+
# define OPENSSL_VERSION_PREREQ(maj,min) \
|
| 68 |
+
((OPENSSL_VERSION_MAJOR << 16) + OPENSSL_VERSION_MINOR >= ((maj) << 16) + (min))
|
| 69 |
+
|
| 70 |
+
/*
|
| 71 |
+
* Macros to get the version in easily digested string form, both the short
|
| 72 |
+
* "MAJOR.MINOR.PATCH" variant (where MAJOR, MINOR and PATCH are replaced
|
| 73 |
+
* with the values from the corresponding OPENSSL_VERSION_ macros) and the
|
| 74 |
+
* longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
|
| 75 |
+
* OPENSSL_VERSION_BUILD_METADATA_STR appended.
|
| 76 |
+
*/
|
| 77 |
+
# define OPENSSL_VERSION_STR "3.5.4"
|
| 78 |
+
# define OPENSSL_FULL_VERSION_STR "3.5.4"
|
| 79 |
+
|
| 80 |
+
/*
|
| 81 |
+
* SECTION 3: ADDITIONAL METADATA
|
| 82 |
+
*
|
| 83 |
+
* These strings are defined separately to allow them to be parsable.
|
| 84 |
+
*/
|
| 85 |
+
# define OPENSSL_RELEASE_DATE "30 Sep 2025"
|
| 86 |
+
|
| 87 |
+
/*
|
| 88 |
+
* SECTION 4: BACKWARD COMPATIBILITY
|
| 89 |
+
*/
|
| 90 |
+
|
| 91 |
+
# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.4 30 Sep 2025"
|
| 92 |
+
|
| 93 |
+
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PP0L */
|
| 94 |
+
# define OPENSSL_VERSION_NUMBER \
|
| 95 |
+
( (OPENSSL_VERSION_MAJOR<<28) \
|
| 96 |
+
|(OPENSSL_VERSION_MINOR<<20) \
|
| 97 |
+
|(OPENSSL_VERSION_PATCH<<4) \
|
| 98 |
+
|0x0L )
|
| 99 |
+
|
| 100 |
+
# ifdef __cplusplus
|
| 101 |
+
}
|
| 102 |
+
# endif
|
| 103 |
+
|
| 104 |
+
# include <openssl/macros.h>
|
| 105 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 106 |
+
# define HEADER_OPENSSLV_H
|
| 107 |
+
# endif
|
| 108 |
+
|
| 109 |
+
#endif /* OPENSSL_OPENSSLV_H */
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/pkcs12.h
ADDED
|
@@ -0,0 +1,366 @@
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/pkcs12.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_PKCS12_H
|
| 16 |
+
# define OPENSSL_PKCS12_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_PKCS12_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/bio.h>
|
| 25 |
+
# include <openssl/core.h>
|
| 26 |
+
# include <openssl/x509.h>
|
| 27 |
+
# include <openssl/pkcs12err.h>
|
| 28 |
+
# ifndef OPENSSL_NO_STDIO
|
| 29 |
+
# include <stdio.h>
|
| 30 |
+
# endif
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
extern "C" {
|
| 34 |
+
#endif
|
| 35 |
+
|
| 36 |
+
# define PKCS12_KEY_ID 1
|
| 37 |
+
# define PKCS12_IV_ID 2
|
| 38 |
+
# define PKCS12_MAC_ID 3
|
| 39 |
+
|
| 40 |
+
/* Default iteration count */
|
| 41 |
+
# ifndef PKCS12_DEFAULT_ITER
|
| 42 |
+
# define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
|
| 43 |
+
# endif
|
| 44 |
+
|
| 45 |
+
# define PKCS12_MAC_KEY_LENGTH 20
|
| 46 |
+
|
| 47 |
+
/* The macro is expected to be used only internally. Kept for backwards compatibility. */
|
| 48 |
+
# define PKCS12_SALT_LEN 8
|
| 49 |
+
|
| 50 |
+
/* It's not clear if these are actually needed... */
|
| 51 |
+
# define PKCS12_key_gen PKCS12_key_gen_utf8
|
| 52 |
+
# define PKCS12_add_friendlyname PKCS12_add_friendlyname_utf8
|
| 53 |
+
|
| 54 |
+
/* MS key usage constants */
|
| 55 |
+
|
| 56 |
+
# define KEY_EX 0x10
|
| 57 |
+
# define KEY_SIG 0x80
|
| 58 |
+
|
| 59 |
+
typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA;
|
| 60 |
+
|
| 61 |
+
typedef struct PKCS12_st PKCS12;
|
| 62 |
+
|
| 63 |
+
typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG;
|
| 64 |
+
|
| 65 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS12_SAFEBAG, PKCS12_SAFEBAG, PKCS12_SAFEBAG)
|
| 66 |
+
#define sk_PKCS12_SAFEBAG_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))
|
| 67 |
+
#define sk_PKCS12_SAFEBAG_value(sk, idx) ((PKCS12_SAFEBAG *)OPENSSL_sk_value(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), (idx)))
|
| 68 |
+
#define sk_PKCS12_SAFEBAG_new(cmp) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp)))
|
| 69 |
+
#define sk_PKCS12_SAFEBAG_new_null() ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_null())
|
| 70 |
+
#define sk_PKCS12_SAFEBAG_new_reserve(cmp, n) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_reserve(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp), (n)))
|
| 71 |
+
#define sk_PKCS12_SAFEBAG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (n))
|
| 72 |
+
#define sk_PKCS12_SAFEBAG_free(sk) OPENSSL_sk_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 73 |
+
#define sk_PKCS12_SAFEBAG_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 74 |
+
#define sk_PKCS12_SAFEBAG_delete(sk, i) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (i)))
|
| 75 |
+
#define sk_PKCS12_SAFEBAG_delete_ptr(sk, ptr) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete_ptr(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr)))
|
| 76 |
+
#define sk_PKCS12_SAFEBAG_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 77 |
+
#define sk_PKCS12_SAFEBAG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 78 |
+
#define sk_PKCS12_SAFEBAG_pop(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_pop(ossl_check_PKCS12_SAFEBAG_sk_type(sk)))
|
| 79 |
+
#define sk_PKCS12_SAFEBAG_shift(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_shift(ossl_check_PKCS12_SAFEBAG_sk_type(sk)))
|
| 80 |
+
#define sk_PKCS12_SAFEBAG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk),ossl_check_PKCS12_SAFEBAG_freefunc_type(freefunc))
|
| 81 |
+
#define sk_PKCS12_SAFEBAG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr), (idx))
|
| 82 |
+
#define sk_PKCS12_SAFEBAG_set(sk, idx, ptr) ((PKCS12_SAFEBAG *)OPENSSL_sk_set(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (idx), ossl_check_PKCS12_SAFEBAG_type(ptr)))
|
| 83 |
+
#define sk_PKCS12_SAFEBAG_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 84 |
+
#define sk_PKCS12_SAFEBAG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))
|
| 85 |
+
#define sk_PKCS12_SAFEBAG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr), pnum)
|
| 86 |
+
#define sk_PKCS12_SAFEBAG_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS12_SAFEBAG_sk_type(sk))
|
| 87 |
+
#define sk_PKCS12_SAFEBAG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))
|
| 88 |
+
#define sk_PKCS12_SAFEBAG_dup(sk) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_dup(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk)))
|
| 89 |
+
#define sk_PKCS12_SAFEBAG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_copyfunc_type(copyfunc), ossl_check_PKCS12_SAFEBAG_freefunc_type(freefunc)))
|
| 90 |
+
#define sk_PKCS12_SAFEBAG_set_cmp_func(sk, cmp) ((sk_PKCS12_SAFEBAG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp)))
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
typedef struct pkcs12_bag_st PKCS12_BAGS;
|
| 94 |
+
|
| 95 |
+
# define PKCS12_ERROR 0
|
| 96 |
+
# define PKCS12_OK 1
|
| 97 |
+
|
| 98 |
+
/* Compatibility macros */
|
| 99 |
+
|
| 100 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 101 |
+
|
| 102 |
+
# define M_PKCS12_bag_type PKCS12_bag_type
|
| 103 |
+
# define M_PKCS12_cert_bag_type PKCS12_cert_bag_type
|
| 104 |
+
# define M_PKCS12_crl_bag_type PKCS12_cert_bag_type
|
| 105 |
+
|
| 106 |
+
# define PKCS12_certbag2x509 PKCS12_SAFEBAG_get1_cert
|
| 107 |
+
# define PKCS12_certbag2scrl PKCS12_SAFEBAG_get1_crl
|
| 108 |
+
# define PKCS12_bag_type PKCS12_SAFEBAG_get_nid
|
| 109 |
+
# define PKCS12_cert_bag_type PKCS12_SAFEBAG_get_bag_nid
|
| 110 |
+
# define PKCS12_x5092certbag PKCS12_SAFEBAG_create_cert
|
| 111 |
+
# define PKCS12_x509crl2certbag PKCS12_SAFEBAG_create_crl
|
| 112 |
+
# define PKCS12_MAKE_KEYBAG PKCS12_SAFEBAG_create0_p8inf
|
| 113 |
+
# define PKCS12_MAKE_SHKEYBAG PKCS12_SAFEBAG_create_pkcs8_encrypt
|
| 114 |
+
|
| 115 |
+
#endif
|
| 116 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 117 |
+
OSSL_DEPRECATEDIN_1_1_0 ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag,
|
| 118 |
+
int attr_nid);
|
| 119 |
+
#endif
|
| 120 |
+
|
| 121 |
+
ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
|
| 122 |
+
int PKCS12_mac_present(const PKCS12 *p12);
|
| 123 |
+
void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac,
|
| 124 |
+
const X509_ALGOR **pmacalg,
|
| 125 |
+
const ASN1_OCTET_STRING **psalt,
|
| 126 |
+
const ASN1_INTEGER **piter,
|
| 127 |
+
const PKCS12 *p12);
|
| 128 |
+
|
| 129 |
+
const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag,
|
| 130 |
+
int attr_nid);
|
| 131 |
+
const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const PKCS12_SAFEBAG *bag);
|
| 132 |
+
int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag);
|
| 133 |
+
int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag);
|
| 134 |
+
const ASN1_TYPE *PKCS12_SAFEBAG_get0_bag_obj(const PKCS12_SAFEBAG *bag);
|
| 135 |
+
const ASN1_OBJECT *PKCS12_SAFEBAG_get0_bag_type(const PKCS12_SAFEBAG *bag);
|
| 136 |
+
|
| 137 |
+
X509 *PKCS12_SAFEBAG_get1_cert_ex(const PKCS12_SAFEBAG *bag, OSSL_LIB_CTX *libctx, const char *propq);
|
| 138 |
+
X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag);
|
| 139 |
+
X509_CRL *PKCS12_SAFEBAG_get1_crl_ex(const PKCS12_SAFEBAG *bag, OSSL_LIB_CTX *libctx, const char *propq);
|
| 140 |
+
X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag);
|
| 141 |
+
const STACK_OF(PKCS12_SAFEBAG) *
|
| 142 |
+
PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag);
|
| 143 |
+
const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag);
|
| 144 |
+
const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag);
|
| 145 |
+
|
| 146 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509);
|
| 147 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl);
|
| 148 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_secret(int type, int vtype, const unsigned char *value, int len);
|
| 149 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8);
|
| 150 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8);
|
| 151 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid,
|
| 152 |
+
const char *pass,
|
| 153 |
+
int passlen,
|
| 154 |
+
unsigned char *salt,
|
| 155 |
+
int saltlen, int iter,
|
| 156 |
+
PKCS8_PRIV_KEY_INFO *p8inf);
|
| 157 |
+
PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid,
|
| 158 |
+
const char *pass,
|
| 159 |
+
int passlen,
|
| 160 |
+
unsigned char *salt,
|
| 161 |
+
int saltlen, int iter,
|
| 162 |
+
PKCS8_PRIV_KEY_INFO *p8inf,
|
| 163 |
+
OSSL_LIB_CTX *ctx,
|
| 164 |
+
const char *propq);
|
| 165 |
+
|
| 166 |
+
PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
|
| 167 |
+
int nid1, int nid2);
|
| 168 |
+
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass,
|
| 169 |
+
int passlen);
|
| 170 |
+
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt_ex(const X509_SIG *p8, const char *pass,
|
| 171 |
+
int passlen, OSSL_LIB_CTX *ctx,
|
| 172 |
+
const char *propq);
|
| 173 |
+
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag,
|
| 174 |
+
const char *pass, int passlen);
|
| 175 |
+
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey_ex(const PKCS12_SAFEBAG *bag,
|
| 176 |
+
const char *pass, int passlen,
|
| 177 |
+
OSSL_LIB_CTX *ctx,
|
| 178 |
+
const char *propq);
|
| 179 |
+
X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
|
| 180 |
+
const char *pass, int passlen, unsigned char *salt,
|
| 181 |
+
int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
|
| 182 |
+
X509_SIG *PKCS8_encrypt_ex(int pbe_nid, const EVP_CIPHER *cipher,
|
| 183 |
+
const char *pass, int passlen, unsigned char *salt,
|
| 184 |
+
int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8,
|
| 185 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 186 |
+
X509_SIG *PKCS8_set0_pbe(const char *pass, int passlen,
|
| 187 |
+
PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe);
|
| 188 |
+
X509_SIG *PKCS8_set0_pbe_ex(const char *pass, int passlen,
|
| 189 |
+
PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe,
|
| 190 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 191 |
+
PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
|
| 192 |
+
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
|
| 193 |
+
PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
|
| 194 |
+
unsigned char *salt, int saltlen, int iter,
|
| 195 |
+
STACK_OF(PKCS12_SAFEBAG) *bags);
|
| 196 |
+
PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen,
|
| 197 |
+
unsigned char *salt, int saltlen, int iter,
|
| 198 |
+
STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 199 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 200 |
+
|
| 201 |
+
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
|
| 202 |
+
int passlen);
|
| 203 |
+
|
| 204 |
+
int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
|
| 205 |
+
STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12);
|
| 206 |
+
|
| 207 |
+
int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
|
| 208 |
+
int namelen);
|
| 209 |
+
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
|
| 210 |
+
int namelen);
|
| 211 |
+
int PKCS12_add_friendlyname_utf8(PKCS12_SAFEBAG *bag, const char *name,
|
| 212 |
+
int namelen);
|
| 213 |
+
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
|
| 214 |
+
int namelen);
|
| 215 |
+
int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
|
| 216 |
+
const unsigned char *name, int namelen);
|
| 217 |
+
int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type,
|
| 218 |
+
const unsigned char *bytes, int len);
|
| 219 |
+
int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
|
| 220 |
+
const unsigned char *bytes, int len);
|
| 221 |
+
int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
|
| 222 |
+
ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
|
| 223 |
+
int attr_nid);
|
| 224 |
+
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
|
| 225 |
+
const STACK_OF(X509_ATTRIBUTE) *
|
| 226 |
+
PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
|
| 227 |
+
void PKCS12_SAFEBAG_set0_attrs(PKCS12_SAFEBAG *bag, STACK_OF(X509_ATTRIBUTE) *attrs);
|
| 228 |
+
unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor,
|
| 229 |
+
const char *pass, int passlen,
|
| 230 |
+
const unsigned char *in, int inlen,
|
| 231 |
+
unsigned char **data, int *datalen,
|
| 232 |
+
int en_de);
|
| 233 |
+
unsigned char *PKCS12_pbe_crypt_ex(const X509_ALGOR *algor,
|
| 234 |
+
const char *pass, int passlen,
|
| 235 |
+
const unsigned char *in, int inlen,
|
| 236 |
+
unsigned char **data, int *datalen,
|
| 237 |
+
int en_de, OSSL_LIB_CTX *libctx,
|
| 238 |
+
const char *propq);
|
| 239 |
+
void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
|
| 240 |
+
const char *pass, int passlen,
|
| 241 |
+
const ASN1_OCTET_STRING *oct, int zbuf);
|
| 242 |
+
void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it,
|
| 243 |
+
const char *pass, int passlen,
|
| 244 |
+
const ASN1_OCTET_STRING *oct, int zbuf,
|
| 245 |
+
OSSL_LIB_CTX *libctx,
|
| 246 |
+
const char *propq);
|
| 247 |
+
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
|
| 248 |
+
const ASN1_ITEM *it,
|
| 249 |
+
const char *pass, int passlen,
|
| 250 |
+
void *obj, int zbuf);
|
| 251 |
+
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt_ex(X509_ALGOR *algor,
|
| 252 |
+
const ASN1_ITEM *it,
|
| 253 |
+
const char *pass, int passlen,
|
| 254 |
+
void *obj, int zbuf,
|
| 255 |
+
OSSL_LIB_CTX *ctx,
|
| 256 |
+
const char *propq);
|
| 257 |
+
PKCS12 *PKCS12_init(int mode);
|
| 258 |
+
PKCS12 *PKCS12_init_ex(int mode, OSSL_LIB_CTX *ctx, const char *propq);
|
| 259 |
+
|
| 260 |
+
int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
|
| 261 |
+
int saltlen, int id, int iter, int n,
|
| 262 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 263 |
+
int PKCS12_key_gen_asc_ex(const char *pass, int passlen, unsigned char *salt,
|
| 264 |
+
int saltlen, int id, int iter, int n,
|
| 265 |
+
unsigned char *out, const EVP_MD *md_type,
|
| 266 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 267 |
+
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
|
| 268 |
+
int saltlen, int id, int iter, int n,
|
| 269 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 270 |
+
int PKCS12_key_gen_uni_ex(unsigned char *pass, int passlen, unsigned char *salt,
|
| 271 |
+
int saltlen, int id, int iter, int n,
|
| 272 |
+
unsigned char *out, const EVP_MD *md_type,
|
| 273 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 274 |
+
int PKCS12_key_gen_utf8(const char *pass, int passlen, unsigned char *salt,
|
| 275 |
+
int saltlen, int id, int iter, int n,
|
| 276 |
+
unsigned char *out, const EVP_MD *md_type);
|
| 277 |
+
int PKCS12_key_gen_utf8_ex(const char *pass, int passlen, unsigned char *salt,
|
| 278 |
+
int saltlen, int id, int iter, int n,
|
| 279 |
+
unsigned char *out, const EVP_MD *md_type,
|
| 280 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 281 |
+
|
| 282 |
+
int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
| 283 |
+
ASN1_TYPE *param, const EVP_CIPHER *cipher,
|
| 284 |
+
const EVP_MD *md_type, int en_de);
|
| 285 |
+
int PKCS12_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
|
| 286 |
+
ASN1_TYPE *param, const EVP_CIPHER *cipher,
|
| 287 |
+
const EVP_MD *md_type, int en_de,
|
| 288 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 289 |
+
int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
|
| 290 |
+
unsigned char *mac, unsigned int *maclen);
|
| 291 |
+
int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
|
| 292 |
+
int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
|
| 293 |
+
unsigned char *salt, int saltlen, int iter,
|
| 294 |
+
const EVP_MD *md_type);
|
| 295 |
+
int PKCS12_set_pbmac1_pbkdf2(PKCS12 *p12, const char *pass, int passlen,
|
| 296 |
+
unsigned char *salt, int saltlen, int iter,
|
| 297 |
+
const EVP_MD *md_type, const char *prf_md_name);
|
| 298 |
+
int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
|
| 299 |
+
int saltlen, const EVP_MD *md_type);
|
| 300 |
+
unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
|
| 301 |
+
unsigned char **uni, int *unilen);
|
| 302 |
+
char *OPENSSL_uni2asc(const unsigned char *uni, int unilen);
|
| 303 |
+
unsigned char *OPENSSL_utf82uni(const char *asc, int asclen,
|
| 304 |
+
unsigned char **uni, int *unilen);
|
| 305 |
+
char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen);
|
| 306 |
+
|
| 307 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12)
|
| 308 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
|
| 309 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
|
| 310 |
+
DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
|
| 311 |
+
|
| 312 |
+
DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
|
| 313 |
+
DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
|
| 314 |
+
|
| 315 |
+
void PKCS12_PBE_add(void);
|
| 316 |
+
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
|
| 317 |
+
STACK_OF(X509) **ca);
|
| 318 |
+
typedef int PKCS12_create_cb(PKCS12_SAFEBAG *bag, void *cbarg);
|
| 319 |
+
PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey,
|
| 320 |
+
X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
| 321 |
+
int iter, int mac_iter, int keytype);
|
| 322 |
+
PKCS12 *PKCS12_create_ex(const char *pass, const char *name, EVP_PKEY *pkey,
|
| 323 |
+
X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
| 324 |
+
int iter, int mac_iter, int keytype,
|
| 325 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 326 |
+
PKCS12 *PKCS12_create_ex2(const char *pass, const char *name, EVP_PKEY *pkey,
|
| 327 |
+
X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
|
| 328 |
+
int iter, int mac_iter, int keytype,
|
| 329 |
+
OSSL_LIB_CTX *ctx, const char *propq,
|
| 330 |
+
PKCS12_create_cb *cb, void *cbarg);
|
| 331 |
+
|
| 332 |
+
PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
|
| 333 |
+
PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 334 |
+
EVP_PKEY *key, int key_usage, int iter,
|
| 335 |
+
int key_nid, const char *pass);
|
| 336 |
+
PKCS12_SAFEBAG *PKCS12_add_key_ex(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 337 |
+
EVP_PKEY *key, int key_usage, int iter,
|
| 338 |
+
int key_nid, const char *pass,
|
| 339 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 340 |
+
|
| 341 |
+
PKCS12_SAFEBAG *PKCS12_add_secret(STACK_OF(PKCS12_SAFEBAG) **pbags,
|
| 342 |
+
int nid_type, const unsigned char *value, int len);
|
| 343 |
+
int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 344 |
+
int safe_nid, int iter, const char *pass);
|
| 345 |
+
int PKCS12_add_safe_ex(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
|
| 346 |
+
int safe_nid, int iter, const char *pass,
|
| 347 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 348 |
+
|
| 349 |
+
PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
|
| 350 |
+
PKCS12 *PKCS12_add_safes_ex(STACK_OF(PKCS7) *safes, int p7_nid,
|
| 351 |
+
OSSL_LIB_CTX *ctx, const char *propq);
|
| 352 |
+
|
| 353 |
+
int i2d_PKCS12_bio(BIO *bp, const PKCS12 *p12);
|
| 354 |
+
# ifndef OPENSSL_NO_STDIO
|
| 355 |
+
int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12);
|
| 356 |
+
# endif
|
| 357 |
+
PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
|
| 358 |
+
# ifndef OPENSSL_NO_STDIO
|
| 359 |
+
PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
|
| 360 |
+
# endif
|
| 361 |
+
int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass);
|
| 362 |
+
|
| 363 |
+
# ifdef __cplusplus
|
| 364 |
+
}
|
| 365 |
+
# endif
|
| 366 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/pkcs7.h
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/pkcs7.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_PKCS7_H
|
| 16 |
+
# define OPENSSL_PKCS7_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_PKCS7_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/asn1.h>
|
| 25 |
+
# include <openssl/bio.h>
|
| 26 |
+
# include <openssl/e_os2.h>
|
| 27 |
+
|
| 28 |
+
# include <openssl/symhacks.h>
|
| 29 |
+
# include <openssl/types.h>
|
| 30 |
+
# include <openssl/pkcs7err.h>
|
| 31 |
+
# ifndef OPENSSL_NO_STDIO
|
| 32 |
+
# include <stdio.h>
|
| 33 |
+
# endif
|
| 34 |
+
|
| 35 |
+
#ifdef __cplusplus
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
/*-
|
| 41 |
+
Encryption_ID DES-CBC
|
| 42 |
+
Digest_ID MD5
|
| 43 |
+
Digest_Encryption_ID rsaEncryption
|
| 44 |
+
Key_Encryption_ID rsaEncryption
|
| 45 |
+
*/
|
| 46 |
+
|
| 47 |
+
typedef struct PKCS7_CTX_st {
|
| 48 |
+
OSSL_LIB_CTX *libctx;
|
| 49 |
+
char *propq;
|
| 50 |
+
} PKCS7_CTX;
|
| 51 |
+
|
| 52 |
+
typedef struct pkcs7_issuer_and_serial_st {
|
| 53 |
+
X509_NAME *issuer;
|
| 54 |
+
ASN1_INTEGER *serial;
|
| 55 |
+
} PKCS7_ISSUER_AND_SERIAL;
|
| 56 |
+
|
| 57 |
+
typedef struct pkcs7_signer_info_st {
|
| 58 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 59 |
+
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
|
| 60 |
+
X509_ALGOR *digest_alg;
|
| 61 |
+
STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
|
| 62 |
+
X509_ALGOR *digest_enc_alg; /* confusing name, actually used for signing */
|
| 63 |
+
ASN1_OCTET_STRING *enc_digest; /* confusing name, actually signature */
|
| 64 |
+
STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
|
| 65 |
+
/* The private key to sign with */
|
| 66 |
+
EVP_PKEY *pkey;
|
| 67 |
+
const PKCS7_CTX *ctx;
|
| 68 |
+
} PKCS7_SIGNER_INFO;
|
| 69 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO)
|
| 70 |
+
#define sk_PKCS7_SIGNER_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 71 |
+
#define sk_PKCS7_SIGNER_INFO_value(sk, idx) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), (idx)))
|
| 72 |
+
#define sk_PKCS7_SIGNER_INFO_new(cmp) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp)))
|
| 73 |
+
#define sk_PKCS7_SIGNER_INFO_new_null() ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_null())
|
| 74 |
+
#define sk_PKCS7_SIGNER_INFO_new_reserve(cmp, n) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp), (n)))
|
| 75 |
+
#define sk_PKCS7_SIGNER_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (n))
|
| 76 |
+
#define sk_PKCS7_SIGNER_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 77 |
+
#define sk_PKCS7_SIGNER_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 78 |
+
#define sk_PKCS7_SIGNER_INFO_delete(sk, i) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (i)))
|
| 79 |
+
#define sk_PKCS7_SIGNER_INFO_delete_ptr(sk, ptr) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr)))
|
| 80 |
+
#define sk_PKCS7_SIGNER_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
| 81 |
+
#define sk_PKCS7_SIGNER_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
| 82 |
+
#define sk_PKCS7_SIGNER_INFO_pop(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 83 |
+
#define sk_PKCS7_SIGNER_INFO_shift(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 84 |
+
#define sk_PKCS7_SIGNER_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk),ossl_check_PKCS7_SIGNER_INFO_freefunc_type(freefunc))
|
| 85 |
+
#define sk_PKCS7_SIGNER_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr), (idx))
|
| 86 |
+
#define sk_PKCS7_SIGNER_INFO_set(sk, idx, ptr) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_set(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (idx), ossl_check_PKCS7_SIGNER_INFO_type(ptr)))
|
| 87 |
+
#define sk_PKCS7_SIGNER_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
| 88 |
+
#define sk_PKCS7_SIGNER_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))
|
| 89 |
+
#define sk_PKCS7_SIGNER_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr), pnum)
|
| 90 |
+
#define sk_PKCS7_SIGNER_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 91 |
+
#define sk_PKCS7_SIGNER_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))
|
| 92 |
+
#define sk_PKCS7_SIGNER_INFO_dup(sk) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk)))
|
| 93 |
+
#define sk_PKCS7_SIGNER_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_copyfunc_type(copyfunc), ossl_check_PKCS7_SIGNER_INFO_freefunc_type(freefunc)))
|
| 94 |
+
#define sk_PKCS7_SIGNER_INFO_set_cmp_func(sk, cmp) ((sk_PKCS7_SIGNER_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp)))
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
typedef struct pkcs7_recip_info_st {
|
| 98 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 99 |
+
PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
|
| 100 |
+
X509_ALGOR *key_enc_algor;
|
| 101 |
+
ASN1_OCTET_STRING *enc_key;
|
| 102 |
+
X509 *cert; /* get the pub-key from this */
|
| 103 |
+
const PKCS7_CTX *ctx;
|
| 104 |
+
} PKCS7_RECIP_INFO;
|
| 105 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_RECIP_INFO, PKCS7_RECIP_INFO, PKCS7_RECIP_INFO)
|
| 106 |
+
#define sk_PKCS7_RECIP_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))
|
| 107 |
+
#define sk_PKCS7_RECIP_INFO_value(sk, idx) ((PKCS7_RECIP_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), (idx)))
|
| 108 |
+
#define sk_PKCS7_RECIP_INFO_new(cmp) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp)))
|
| 109 |
+
#define sk_PKCS7_RECIP_INFO_new_null() ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_null())
|
| 110 |
+
#define sk_PKCS7_RECIP_INFO_new_reserve(cmp, n) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp), (n)))
|
| 111 |
+
#define sk_PKCS7_RECIP_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (n))
|
| 112 |
+
#define sk_PKCS7_RECIP_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 113 |
+
#define sk_PKCS7_RECIP_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 114 |
+
#define sk_PKCS7_RECIP_INFO_delete(sk, i) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (i)))
|
| 115 |
+
#define sk_PKCS7_RECIP_INFO_delete_ptr(sk, ptr) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr)))
|
| 116 |
+
#define sk_PKCS7_RECIP_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
| 117 |
+
#define sk_PKCS7_RECIP_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
| 118 |
+
#define sk_PKCS7_RECIP_INFO_pop(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 119 |
+
#define sk_PKCS7_RECIP_INFO_shift(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 120 |
+
#define sk_PKCS7_RECIP_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk),ossl_check_PKCS7_RECIP_INFO_freefunc_type(freefunc))
|
| 121 |
+
#define sk_PKCS7_RECIP_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr), (idx))
|
| 122 |
+
#define sk_PKCS7_RECIP_INFO_set(sk, idx, ptr) ((PKCS7_RECIP_INFO *)OPENSSL_sk_set(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (idx), ossl_check_PKCS7_RECIP_INFO_type(ptr)))
|
| 123 |
+
#define sk_PKCS7_RECIP_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
| 124 |
+
#define sk_PKCS7_RECIP_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))
|
| 125 |
+
#define sk_PKCS7_RECIP_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr), pnum)
|
| 126 |
+
#define sk_PKCS7_RECIP_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))
|
| 127 |
+
#define sk_PKCS7_RECIP_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))
|
| 128 |
+
#define sk_PKCS7_RECIP_INFO_dup(sk) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk)))
|
| 129 |
+
#define sk_PKCS7_RECIP_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_copyfunc_type(copyfunc), ossl_check_PKCS7_RECIP_INFO_freefunc_type(freefunc)))
|
| 130 |
+
#define sk_PKCS7_RECIP_INFO_set_cmp_func(sk, cmp) ((sk_PKCS7_RECIP_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp)))
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
typedef struct pkcs7_signed_st {
|
| 135 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 136 |
+
STACK_OF(X509_ALGOR) *md_algs; /* md used */
|
| 137 |
+
STACK_OF(X509) *cert; /* [ 0 ] */ /* name should be 'certificates' */
|
| 138 |
+
STACK_OF(X509_CRL) *crl; /* [ 1 ] */ /* name should be 'crls' */
|
| 139 |
+
STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
|
| 140 |
+
struct pkcs7_st *contents;
|
| 141 |
+
} PKCS7_SIGNED;
|
| 142 |
+
/*
|
| 143 |
+
* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about
|
| 144 |
+
* merging the two
|
| 145 |
+
*/
|
| 146 |
+
|
| 147 |
+
typedef struct pkcs7_enc_content_st {
|
| 148 |
+
ASN1_OBJECT *content_type;
|
| 149 |
+
X509_ALGOR *algorithm;
|
| 150 |
+
ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
|
| 151 |
+
const EVP_CIPHER *cipher;
|
| 152 |
+
const PKCS7_CTX *ctx;
|
| 153 |
+
} PKCS7_ENC_CONTENT;
|
| 154 |
+
|
| 155 |
+
typedef struct pkcs7_enveloped_st {
|
| 156 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 157 |
+
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
|
| 158 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 159 |
+
} PKCS7_ENVELOPE;
|
| 160 |
+
|
| 161 |
+
typedef struct pkcs7_signedandenveloped_st {
|
| 162 |
+
ASN1_INTEGER *version; /* version 1 */
|
| 163 |
+
STACK_OF(X509_ALGOR) *md_algs; /* md used */
|
| 164 |
+
STACK_OF(X509) *cert; /* [ 0 ] */ /* name should be 'certificates' */
|
| 165 |
+
STACK_OF(X509_CRL) *crl; /* [ 1 ] */ /* name should be 'crls' */
|
| 166 |
+
STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
|
| 167 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 168 |
+
STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
|
| 169 |
+
} PKCS7_SIGN_ENVELOPE;
|
| 170 |
+
|
| 171 |
+
typedef struct pkcs7_digest_st {
|
| 172 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 173 |
+
X509_ALGOR *md; /* md used */
|
| 174 |
+
struct pkcs7_st *contents;
|
| 175 |
+
ASN1_OCTET_STRING *digest;
|
| 176 |
+
} PKCS7_DIGEST;
|
| 177 |
+
|
| 178 |
+
typedef struct pkcs7_encrypted_st {
|
| 179 |
+
ASN1_INTEGER *version; /* version 0 */
|
| 180 |
+
PKCS7_ENC_CONTENT *enc_data;
|
| 181 |
+
} PKCS7_ENCRYPT;
|
| 182 |
+
|
| 183 |
+
typedef struct pkcs7_st {
|
| 184 |
+
/*
|
| 185 |
+
* The following is non NULL if it contains ASN1 encoding of this
|
| 186 |
+
* structure
|
| 187 |
+
*/
|
| 188 |
+
unsigned char *asn1;
|
| 189 |
+
long length;
|
| 190 |
+
# define PKCS7_S_HEADER 0
|
| 191 |
+
# define PKCS7_S_BODY 1
|
| 192 |
+
# define PKCS7_S_TAIL 2
|
| 193 |
+
int state; /* used during processing */
|
| 194 |
+
int detached;
|
| 195 |
+
ASN1_OBJECT *type;
|
| 196 |
+
/* content as defined by the type */
|
| 197 |
+
/*
|
| 198 |
+
* all encryption/message digests are applied to the 'contents', leaving
|
| 199 |
+
* out the 'type' field.
|
| 200 |
+
*/
|
| 201 |
+
union {
|
| 202 |
+
char *ptr;
|
| 203 |
+
/* NID_pkcs7_data */
|
| 204 |
+
ASN1_OCTET_STRING *data;
|
| 205 |
+
/* NID_pkcs7_signed */
|
| 206 |
+
PKCS7_SIGNED *sign; /* field name 'signed' would clash with C keyword */
|
| 207 |
+
/* NID_pkcs7_enveloped */
|
| 208 |
+
PKCS7_ENVELOPE *enveloped;
|
| 209 |
+
/* NID_pkcs7_signedAndEnveloped */
|
| 210 |
+
PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
|
| 211 |
+
/* NID_pkcs7_digest */
|
| 212 |
+
PKCS7_DIGEST *digest;
|
| 213 |
+
/* NID_pkcs7_encrypted */
|
| 214 |
+
PKCS7_ENCRYPT *encrypted;
|
| 215 |
+
/* Anything else */
|
| 216 |
+
ASN1_TYPE *other;
|
| 217 |
+
} d;
|
| 218 |
+
PKCS7_CTX ctx;
|
| 219 |
+
} PKCS7;
|
| 220 |
+
SKM_DEFINE_STACK_OF_INTERNAL(PKCS7, PKCS7, PKCS7)
|
| 221 |
+
#define sk_PKCS7_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_sk_type(sk))
|
| 222 |
+
#define sk_PKCS7_value(sk, idx) ((PKCS7 *)OPENSSL_sk_value(ossl_check_const_PKCS7_sk_type(sk), (idx)))
|
| 223 |
+
#define sk_PKCS7_new(cmp) ((STACK_OF(PKCS7) *)OPENSSL_sk_new(ossl_check_PKCS7_compfunc_type(cmp)))
|
| 224 |
+
#define sk_PKCS7_new_null() ((STACK_OF(PKCS7) *)OPENSSL_sk_new_null())
|
| 225 |
+
#define sk_PKCS7_new_reserve(cmp, n) ((STACK_OF(PKCS7) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_compfunc_type(cmp), (n)))
|
| 226 |
+
#define sk_PKCS7_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_sk_type(sk), (n))
|
| 227 |
+
#define sk_PKCS7_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_sk_type(sk))
|
| 228 |
+
#define sk_PKCS7_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_sk_type(sk))
|
| 229 |
+
#define sk_PKCS7_delete(sk, i) ((PKCS7 *)OPENSSL_sk_delete(ossl_check_PKCS7_sk_type(sk), (i)))
|
| 230 |
+
#define sk_PKCS7_delete_ptr(sk, ptr) ((PKCS7 *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr)))
|
| 231 |
+
#define sk_PKCS7_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 232 |
+
#define sk_PKCS7_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 233 |
+
#define sk_PKCS7_pop(sk) ((PKCS7 *)OPENSSL_sk_pop(ossl_check_PKCS7_sk_type(sk)))
|
| 234 |
+
#define sk_PKCS7_shift(sk) ((PKCS7 *)OPENSSL_sk_shift(ossl_check_PKCS7_sk_type(sk)))
|
| 235 |
+
#define sk_PKCS7_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_sk_type(sk),ossl_check_PKCS7_freefunc_type(freefunc))
|
| 236 |
+
#define sk_PKCS7_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), (idx))
|
| 237 |
+
#define sk_PKCS7_set(sk, idx, ptr) ((PKCS7 *)OPENSSL_sk_set(ossl_check_PKCS7_sk_type(sk), (idx), ossl_check_PKCS7_type(ptr)))
|
| 238 |
+
#define sk_PKCS7_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 239 |
+
#define sk_PKCS7_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))
|
| 240 |
+
#define sk_PKCS7_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), pnum)
|
| 241 |
+
#define sk_PKCS7_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_sk_type(sk))
|
| 242 |
+
#define sk_PKCS7_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_sk_type(sk))
|
| 243 |
+
#define sk_PKCS7_dup(sk) ((STACK_OF(PKCS7) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_sk_type(sk)))
|
| 244 |
+
#define sk_PKCS7_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_sk_type(sk), ossl_check_PKCS7_copyfunc_type(copyfunc), ossl_check_PKCS7_freefunc_type(freefunc)))
|
| 245 |
+
#define sk_PKCS7_set_cmp_func(sk, cmp) ((sk_PKCS7_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_compfunc_type(cmp)))
|
| 246 |
+
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
# define PKCS7_OP_SET_DETACHED_SIGNATURE 1
|
| 250 |
+
# define PKCS7_OP_GET_DETACHED_SIGNATURE 2
|
| 251 |
+
|
| 252 |
+
# define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
|
| 253 |
+
# define PKCS7_get_attributes(si) ((si)->unauth_attr)
|
| 254 |
+
|
| 255 |
+
# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
|
| 256 |
+
# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
|
| 257 |
+
# define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
|
| 258 |
+
# define PKCS7_type_is_signedAndEnveloped(a) \
|
| 259 |
+
(OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
|
| 260 |
+
# define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
|
| 261 |
+
# define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
|
| 262 |
+
|
| 263 |
+
# define PKCS7_set_detached(p,v) \
|
| 264 |
+
PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
|
| 265 |
+
# define PKCS7_get_detached(p) \
|
| 266 |
+
PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
|
| 267 |
+
|
| 268 |
+
# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
|
| 269 |
+
|
| 270 |
+
/* S/MIME related flags */
|
| 271 |
+
|
| 272 |
+
# define PKCS7_TEXT 0x1
|
| 273 |
+
# define PKCS7_NOCERTS 0x2
|
| 274 |
+
# define PKCS7_NOSIGS 0x4
|
| 275 |
+
# define PKCS7_NOCHAIN 0x8
|
| 276 |
+
# define PKCS7_NOINTERN 0x10
|
| 277 |
+
# define PKCS7_NOVERIFY 0x20
|
| 278 |
+
# define PKCS7_DETACHED 0x40
|
| 279 |
+
# define PKCS7_BINARY 0x80
|
| 280 |
+
# define PKCS7_NOATTR 0x100
|
| 281 |
+
# define PKCS7_NOSMIMECAP 0x200
|
| 282 |
+
# define PKCS7_NOOLDMIMETYPE 0x400
|
| 283 |
+
# define PKCS7_CRLFEOL 0x800
|
| 284 |
+
# define PKCS7_STREAM 0x1000
|
| 285 |
+
# define PKCS7_NOCRL 0x2000
|
| 286 |
+
# define PKCS7_PARTIAL 0x4000
|
| 287 |
+
# define PKCS7_REUSE_DIGEST 0x8000
|
| 288 |
+
# define PKCS7_NO_DUAL_CONTENT 0x10000
|
| 289 |
+
|
| 290 |
+
/* Flags: for compatibility with older code */
|
| 291 |
+
|
| 292 |
+
# define SMIME_TEXT PKCS7_TEXT
|
| 293 |
+
# define SMIME_NOCERTS PKCS7_NOCERTS
|
| 294 |
+
# define SMIME_NOSIGS PKCS7_NOSIGS
|
| 295 |
+
# define SMIME_NOCHAIN PKCS7_NOCHAIN
|
| 296 |
+
# define SMIME_NOINTERN PKCS7_NOINTERN
|
| 297 |
+
# define SMIME_NOVERIFY PKCS7_NOVERIFY
|
| 298 |
+
# define SMIME_DETACHED PKCS7_DETACHED
|
| 299 |
+
# define SMIME_BINARY PKCS7_BINARY
|
| 300 |
+
# define SMIME_NOATTR PKCS7_NOATTR
|
| 301 |
+
|
| 302 |
+
/* CRLF ASCII canonicalisation */
|
| 303 |
+
# define SMIME_ASCIICRLF 0x80000
|
| 304 |
+
|
| 305 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
|
| 306 |
+
|
| 307 |
+
int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
|
| 308 |
+
const EVP_MD *type, unsigned char *md,
|
| 309 |
+
unsigned int *len);
|
| 310 |
+
# ifndef OPENSSL_NO_STDIO
|
| 311 |
+
PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
|
| 312 |
+
int i2d_PKCS7_fp(FILE *fp, const PKCS7 *p7);
|
| 313 |
+
# endif
|
| 314 |
+
DECLARE_ASN1_DUP_FUNCTION(PKCS7)
|
| 315 |
+
PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
|
| 316 |
+
int i2d_PKCS7_bio(BIO *bp, const PKCS7 *p7);
|
| 317 |
+
int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
|
| 318 |
+
int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
|
| 319 |
+
|
| 320 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
|
| 321 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
|
| 322 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
|
| 323 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
|
| 324 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
|
| 325 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
|
| 326 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
|
| 327 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
|
| 328 |
+
DECLARE_ASN1_FUNCTIONS(PKCS7)
|
| 329 |
+
PKCS7 *PKCS7_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 330 |
+
|
| 331 |
+
DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
|
| 332 |
+
DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
|
| 333 |
+
|
| 334 |
+
DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
|
| 335 |
+
DECLARE_ASN1_PRINT_FUNCTION(PKCS7)
|
| 336 |
+
|
| 337 |
+
long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
|
| 338 |
+
|
| 339 |
+
int PKCS7_type_is_other(PKCS7 *p7);
|
| 340 |
+
int PKCS7_set_type(PKCS7 *p7, int type);
|
| 341 |
+
int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
|
| 342 |
+
int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
|
| 343 |
+
int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
|
| 344 |
+
const EVP_MD *dgst);
|
| 345 |
+
int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
|
| 346 |
+
int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
|
| 347 |
+
int PKCS7_add_certificate(PKCS7 *p7, X509 *cert);
|
| 348 |
+
int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl);
|
| 349 |
+
int PKCS7_content_new(PKCS7 *p7, int nid);
|
| 350 |
+
int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
|
| 351 |
+
BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
|
| 352 |
+
int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
|
| 353 |
+
X509 *signer);
|
| 354 |
+
|
| 355 |
+
BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
|
| 356 |
+
int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
|
| 357 |
+
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
|
| 358 |
+
|
| 359 |
+
PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
|
| 360 |
+
EVP_PKEY *pkey, const EVP_MD *dgst);
|
| 361 |
+
X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
|
| 362 |
+
int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
|
| 363 |
+
STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
|
| 364 |
+
|
| 365 |
+
PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
|
| 366 |
+
void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
|
| 367 |
+
X509_ALGOR **pdig, X509_ALGOR **psig);
|
| 368 |
+
void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
|
| 369 |
+
int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
|
| 370 |
+
int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
|
| 371 |
+
int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
|
| 372 |
+
int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
|
| 373 |
+
|
| 374 |
+
PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
|
| 375 |
+
ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7);
|
| 376 |
+
ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
|
| 377 |
+
int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
|
| 378 |
+
void *data);
|
| 379 |
+
int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
|
| 380 |
+
void *value);
|
| 381 |
+
ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid);
|
| 382 |
+
ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid);
|
| 383 |
+
int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
|
| 384 |
+
STACK_OF(X509_ATTRIBUTE) *sk);
|
| 385 |
+
int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
|
| 386 |
+
STACK_OF(X509_ATTRIBUTE) *sk);
|
| 387 |
+
|
| 388 |
+
PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
| 389 |
+
BIO *data, int flags);
|
| 390 |
+
PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
|
| 391 |
+
BIO *data, int flags, OSSL_LIB_CTX *libctx,
|
| 392 |
+
const char *propq);
|
| 393 |
+
|
| 394 |
+
PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
|
| 395 |
+
X509 *signcert, EVP_PKEY *pkey,
|
| 396 |
+
const EVP_MD *md, int flags);
|
| 397 |
+
|
| 398 |
+
int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
|
| 399 |
+
int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
|
| 400 |
+
BIO *indata, BIO *out, int flags);
|
| 401 |
+
STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
|
| 402 |
+
int flags);
|
| 403 |
+
PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
|
| 404 |
+
int flags);
|
| 405 |
+
PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
|
| 406 |
+
const EVP_CIPHER *cipher, int flags,
|
| 407 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 408 |
+
int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
|
| 409 |
+
int flags);
|
| 410 |
+
|
| 411 |
+
int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
|
| 412 |
+
STACK_OF(X509_ALGOR) *cap);
|
| 413 |
+
STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
|
| 414 |
+
int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
|
| 415 |
+
|
| 416 |
+
int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
|
| 417 |
+
int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
|
| 418 |
+
int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
|
| 419 |
+
const unsigned char *md, int mdlen);
|
| 420 |
+
|
| 421 |
+
int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
|
| 422 |
+
PKCS7 *SMIME_read_PKCS7_ex(BIO *bio, BIO **bcont, PKCS7 **p7);
|
| 423 |
+
PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
|
| 424 |
+
|
| 425 |
+
BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
|
| 426 |
+
|
| 427 |
+
# ifdef __cplusplus
|
| 428 |
+
}
|
| 429 |
+
# endif
|
| 430 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/safestack.h
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/safestack.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_SAFESTACK_H
|
| 16 |
+
# define OPENSSL_SAFESTACK_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_SAFESTACK_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/stack.h>
|
| 25 |
+
# include <openssl/e_os2.h>
|
| 26 |
+
|
| 27 |
+
#ifdef __cplusplus
|
| 28 |
+
extern "C" {
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
# define STACK_OF(type) struct stack_st_##type
|
| 32 |
+
|
| 33 |
+
/* Helper macro for internal use */
|
| 34 |
+
# define SKM_DEFINE_STACK_OF_INTERNAL(t1, t2, t3) \
|
| 35 |
+
STACK_OF(t1); \
|
| 36 |
+
typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \
|
| 37 |
+
typedef void (*sk_##t1##_freefunc)(t3 *a); \
|
| 38 |
+
typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \
|
| 39 |
+
static ossl_unused ossl_inline t2 *ossl_check_##t1##_type(t2 *ptr) \
|
| 40 |
+
{ \
|
| 41 |
+
return ptr; \
|
| 42 |
+
} \
|
| 43 |
+
static ossl_unused ossl_inline const OPENSSL_STACK *ossl_check_const_##t1##_sk_type(const STACK_OF(t1) *sk) \
|
| 44 |
+
{ \
|
| 45 |
+
return (const OPENSSL_STACK *)sk; \
|
| 46 |
+
} \
|
| 47 |
+
static ossl_unused ossl_inline OPENSSL_STACK *ossl_check_##t1##_sk_type(STACK_OF(t1) *sk) \
|
| 48 |
+
{ \
|
| 49 |
+
return (OPENSSL_STACK *)sk; \
|
| 50 |
+
} \
|
| 51 |
+
static ossl_unused ossl_inline OPENSSL_sk_compfunc ossl_check_##t1##_compfunc_type(sk_##t1##_compfunc cmp) \
|
| 52 |
+
{ \
|
| 53 |
+
return (OPENSSL_sk_compfunc)cmp; \
|
| 54 |
+
} \
|
| 55 |
+
static ossl_unused ossl_inline OPENSSL_sk_copyfunc ossl_check_##t1##_copyfunc_type(sk_##t1##_copyfunc cpy) \
|
| 56 |
+
{ \
|
| 57 |
+
return (OPENSSL_sk_copyfunc)cpy; \
|
| 58 |
+
} \
|
| 59 |
+
static ossl_unused ossl_inline OPENSSL_sk_freefunc ossl_check_##t1##_freefunc_type(sk_##t1##_freefunc fr) \
|
| 60 |
+
{ \
|
| 61 |
+
return (OPENSSL_sk_freefunc)fr; \
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
# define SKM_DEFINE_STACK_OF(t1, t2, t3) \
|
| 65 |
+
STACK_OF(t1); \
|
| 66 |
+
typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \
|
| 67 |
+
typedef void (*sk_##t1##_freefunc)(t3 *a); \
|
| 68 |
+
typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \
|
| 69 |
+
static ossl_unused ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \
|
| 70 |
+
{ \
|
| 71 |
+
return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
|
| 72 |
+
} \
|
| 73 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
|
| 74 |
+
{ \
|
| 75 |
+
return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
|
| 76 |
+
} \
|
| 77 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \
|
| 78 |
+
{ \
|
| 79 |
+
return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
|
| 80 |
+
} \
|
| 81 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \
|
| 82 |
+
{ \
|
| 83 |
+
return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
|
| 84 |
+
} \
|
| 85 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n) \
|
| 86 |
+
{ \
|
| 87 |
+
return (STACK_OF(t1) *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
|
| 88 |
+
} \
|
| 89 |
+
static ossl_unused ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n) \
|
| 90 |
+
{ \
|
| 91 |
+
return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); \
|
| 92 |
+
} \
|
| 93 |
+
static ossl_unused ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \
|
| 94 |
+
{ \
|
| 95 |
+
OPENSSL_sk_free((OPENSSL_STACK *)sk); \
|
| 96 |
+
} \
|
| 97 |
+
static ossl_unused ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \
|
| 98 |
+
{ \
|
| 99 |
+
OPENSSL_sk_zero((OPENSSL_STACK *)sk); \
|
| 100 |
+
} \
|
| 101 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \
|
| 102 |
+
{ \
|
| 103 |
+
return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
|
| 104 |
+
} \
|
| 105 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \
|
| 106 |
+
{ \
|
| 107 |
+
return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \
|
| 108 |
+
(const void *)ptr); \
|
| 109 |
+
} \
|
| 110 |
+
static ossl_unused ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \
|
| 111 |
+
{ \
|
| 112 |
+
return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 113 |
+
} \
|
| 114 |
+
static ossl_unused ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \
|
| 115 |
+
{ \
|
| 116 |
+
return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 117 |
+
} \
|
| 118 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \
|
| 119 |
+
{ \
|
| 120 |
+
return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \
|
| 121 |
+
} \
|
| 122 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \
|
| 123 |
+
{ \
|
| 124 |
+
return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \
|
| 125 |
+
} \
|
| 126 |
+
static ossl_unused ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \
|
| 127 |
+
{ \
|
| 128 |
+
OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
|
| 129 |
+
} \
|
| 130 |
+
static ossl_unused ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \
|
| 131 |
+
{ \
|
| 132 |
+
return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); \
|
| 133 |
+
} \
|
| 134 |
+
static ossl_unused ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \
|
| 135 |
+
{ \
|
| 136 |
+
return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
|
| 137 |
+
} \
|
| 138 |
+
static ossl_unused ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \
|
| 139 |
+
{ \
|
| 140 |
+
return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 141 |
+
} \
|
| 142 |
+
static ossl_unused ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \
|
| 143 |
+
{ \
|
| 144 |
+
return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \
|
| 145 |
+
} \
|
| 146 |
+
static ossl_unused ossl_inline int sk_##t1##_find_all(STACK_OF(t1) *sk, t2 *ptr, int *pnum) \
|
| 147 |
+
{ \
|
| 148 |
+
return OPENSSL_sk_find_all((OPENSSL_STACK *)sk, (const void *)ptr, pnum); \
|
| 149 |
+
} \
|
| 150 |
+
static ossl_unused ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \
|
| 151 |
+
{ \
|
| 152 |
+
OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
|
| 153 |
+
} \
|
| 154 |
+
static ossl_unused ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \
|
| 155 |
+
{ \
|
| 156 |
+
return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \
|
| 157 |
+
} \
|
| 158 |
+
static ossl_unused ossl_inline STACK_OF(t1) * sk_##t1##_dup(const STACK_OF(t1) *sk) \
|
| 159 |
+
{ \
|
| 160 |
+
return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
|
| 161 |
+
} \
|
| 162 |
+
static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \
|
| 163 |
+
sk_##t1##_copyfunc copyfunc, \
|
| 164 |
+
sk_##t1##_freefunc freefunc) \
|
| 165 |
+
{ \
|
| 166 |
+
return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
|
| 167 |
+
(OPENSSL_sk_copyfunc)copyfunc, \
|
| 168 |
+
(OPENSSL_sk_freefunc)freefunc); \
|
| 169 |
+
} \
|
| 170 |
+
static ossl_unused ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \
|
| 171 |
+
{ \
|
| 172 |
+
return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
# define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t)
|
| 176 |
+
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
|
| 177 |
+
# define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2)
|
| 178 |
+
# define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \
|
| 179 |
+
SKM_DEFINE_STACK_OF(t1, const t2, t2)
|
| 180 |
+
|
| 181 |
+
/*-
|
| 182 |
+
* Strings are special: normally an lhash entry will point to a single
|
| 183 |
+
* (somewhat) mutable object. In the case of strings:
|
| 184 |
+
*
|
| 185 |
+
* a) Instead of a single char, there is an array of chars, NUL-terminated.
|
| 186 |
+
* b) The string may have be immutable.
|
| 187 |
+
*
|
| 188 |
+
* So, they need their own declarations. Especially important for
|
| 189 |
+
* type-checking tools, such as Deputy.
|
| 190 |
+
*
|
| 191 |
+
* In practice, however, it appears to be hard to have a const
|
| 192 |
+
* string. For now, I'm settling for dealing with the fact it is a
|
| 193 |
+
* string at all.
|
| 194 |
+
*/
|
| 195 |
+
typedef char *OPENSSL_STRING;
|
| 196 |
+
typedef const char *OPENSSL_CSTRING;
|
| 197 |
+
|
| 198 |
+
/*-
|
| 199 |
+
* Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
|
| 200 |
+
* STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
|
| 201 |
+
* above, instead of a single char each entry is a NUL-terminated array of
|
| 202 |
+
* chars. So, we have to implement STRING specially for STACK_OF. This is
|
| 203 |
+
* dealt with in the autogenerated macros below.
|
| 204 |
+
*/
|
| 205 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_STRING, char, char)
|
| 206 |
+
#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
|
| 207 |
+
#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
|
| 208 |
+
#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_STRING_compfunc_type(cmp)))
|
| 209 |
+
#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
|
| 210 |
+
#define sk_OPENSSL_STRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_STRING_compfunc_type(cmp), (n)))
|
| 211 |
+
#define sk_OPENSSL_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_STRING_sk_type(sk), (n))
|
| 212 |
+
#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 213 |
+
#define sk_OPENSSL_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 214 |
+
#define sk_OPENSSL_STRING_delete(sk, i) ((char *)OPENSSL_sk_delete(ossl_check_OPENSSL_STRING_sk_type(sk), (i)))
|
| 215 |
+
#define sk_OPENSSL_STRING_delete_ptr(sk, ptr) ((char *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr)))
|
| 216 |
+
#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 217 |
+
#define sk_OPENSSL_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 218 |
+
#define sk_OPENSSL_STRING_pop(sk) ((char *)OPENSSL_sk_pop(ossl_check_OPENSSL_STRING_sk_type(sk)))
|
| 219 |
+
#define sk_OPENSSL_STRING_shift(sk) ((char *)OPENSSL_sk_shift(ossl_check_OPENSSL_STRING_sk_type(sk)))
|
| 220 |
+
#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk),ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
|
| 221 |
+
#define sk_OPENSSL_STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr), (idx))
|
| 222 |
+
#define sk_OPENSSL_STRING_set(sk, idx, ptr) ((char *)OPENSSL_sk_set(ossl_check_OPENSSL_STRING_sk_type(sk), (idx), ossl_check_OPENSSL_STRING_type(ptr)))
|
| 223 |
+
#define sk_OPENSSL_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 224 |
+
#define sk_OPENSSL_STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
|
| 225 |
+
#define sk_OPENSSL_STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr), pnum)
|
| 226 |
+
#define sk_OPENSSL_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_STRING_sk_type(sk))
|
| 227 |
+
#define sk_OPENSSL_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_STRING_sk_type(sk))
|
| 228 |
+
#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
|
| 229 |
+
#define sk_OPENSSL_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_STRING_freefunc_type(freefunc)))
|
| 230 |
+
#define sk_OPENSSL_STRING_set_cmp_func(sk, cmp) ((sk_OPENSSL_STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_compfunc_type(cmp)))
|
| 231 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_CSTRING, const char, char)
|
| 232 |
+
#define sk_OPENSSL_CSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
|
| 233 |
+
#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
|
| 234 |
+
#define sk_OPENSSL_CSTRING_new(cmp) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp)))
|
| 235 |
+
#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
|
| 236 |
+
#define sk_OPENSSL_CSTRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp), (n)))
|
| 237 |
+
#define sk_OPENSSL_CSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_CSTRING_sk_type(sk), (n))
|
| 238 |
+
#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 239 |
+
#define sk_OPENSSL_CSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 240 |
+
#define sk_OPENSSL_CSTRING_delete(sk, i) ((const char *)OPENSSL_sk_delete(ossl_check_OPENSSL_CSTRING_sk_type(sk), (i)))
|
| 241 |
+
#define sk_OPENSSL_CSTRING_delete_ptr(sk, ptr) ((const char *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr)))
|
| 242 |
+
#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 243 |
+
#define sk_OPENSSL_CSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 244 |
+
#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
|
| 245 |
+
#define sk_OPENSSL_CSTRING_shift(sk) ((const char *)OPENSSL_sk_shift(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
|
| 246 |
+
#define sk_OPENSSL_CSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_CSTRING_sk_type(sk),ossl_check_OPENSSL_CSTRING_freefunc_type(freefunc))
|
| 247 |
+
#define sk_OPENSSL_CSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr), (idx))
|
| 248 |
+
#define sk_OPENSSL_CSTRING_set(sk, idx, ptr) ((const char *)OPENSSL_sk_set(ossl_check_OPENSSL_CSTRING_sk_type(sk), (idx), ossl_check_OPENSSL_CSTRING_type(ptr)))
|
| 249 |
+
#define sk_OPENSSL_CSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 250 |
+
#define sk_OPENSSL_CSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
|
| 251 |
+
#define sk_OPENSSL_CSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr), pnum)
|
| 252 |
+
#define sk_OPENSSL_CSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_CSTRING_sk_type(sk))
|
| 253 |
+
#define sk_OPENSSL_CSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))
|
| 254 |
+
#define sk_OPENSSL_CSTRING_dup(sk) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_CSTRING_sk_type(sk)))
|
| 255 |
+
#define sk_OPENSSL_CSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_CSTRING_freefunc_type(freefunc)))
|
| 256 |
+
#define sk_OPENSSL_CSTRING_set_cmp_func(sk, cmp) ((sk_OPENSSL_CSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_compfunc_type(cmp)))
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
#if !defined(OPENSSL_NO_DEPRECATED_3_0)
|
| 260 |
+
/*
|
| 261 |
+
* This is not used by OpenSSL. A block of bytes, NOT nul-terminated.
|
| 262 |
+
* These should also be distinguished from "normal" stacks.
|
| 263 |
+
*/
|
| 264 |
+
typedef void *OPENSSL_BLOCK;
|
| 265 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_BLOCK, void, void)
|
| 266 |
+
#define sk_OPENSSL_BLOCK_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))
|
| 267 |
+
#define sk_OPENSSL_BLOCK_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), (idx)))
|
| 268 |
+
#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp)))
|
| 269 |
+
#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_null())
|
| 270 |
+
#define sk_OPENSSL_BLOCK_new_reserve(cmp, n) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp), (n)))
|
| 271 |
+
#define sk_OPENSSL_BLOCK_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_BLOCK_sk_type(sk), (n))
|
| 272 |
+
#define sk_OPENSSL_BLOCK_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 273 |
+
#define sk_OPENSSL_BLOCK_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 274 |
+
#define sk_OPENSSL_BLOCK_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_OPENSSL_BLOCK_sk_type(sk), (i)))
|
| 275 |
+
#define sk_OPENSSL_BLOCK_delete_ptr(sk, ptr) ((void *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr)))
|
| 276 |
+
#define sk_OPENSSL_BLOCK_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 277 |
+
#define sk_OPENSSL_BLOCK_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 278 |
+
#define sk_OPENSSL_BLOCK_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_OPENSSL_BLOCK_sk_type(sk)))
|
| 279 |
+
#define sk_OPENSSL_BLOCK_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_OPENSSL_BLOCK_sk_type(sk)))
|
| 280 |
+
#define sk_OPENSSL_BLOCK_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_BLOCK_sk_type(sk),ossl_check_OPENSSL_BLOCK_freefunc_type(freefunc))
|
| 281 |
+
#define sk_OPENSSL_BLOCK_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr), (idx))
|
| 282 |
+
#define sk_OPENSSL_BLOCK_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_OPENSSL_BLOCK_sk_type(sk), (idx), ossl_check_OPENSSL_BLOCK_type(ptr)))
|
| 283 |
+
#define sk_OPENSSL_BLOCK_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 284 |
+
#define sk_OPENSSL_BLOCK_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))
|
| 285 |
+
#define sk_OPENSSL_BLOCK_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr), pnum)
|
| 286 |
+
#define sk_OPENSSL_BLOCK_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_BLOCK_sk_type(sk))
|
| 287 |
+
#define sk_OPENSSL_BLOCK_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))
|
| 288 |
+
#define sk_OPENSSL_BLOCK_dup(sk) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_BLOCK_sk_type(sk)))
|
| 289 |
+
#define sk_OPENSSL_BLOCK_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_copyfunc_type(copyfunc), ossl_check_OPENSSL_BLOCK_freefunc_type(freefunc)))
|
| 290 |
+
#define sk_OPENSSL_BLOCK_set_cmp_func(sk, cmp) ((sk_OPENSSL_BLOCK_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_compfunc_type(cmp)))
|
| 291 |
+
|
| 292 |
+
#endif
|
| 293 |
+
|
| 294 |
+
# ifdef __cplusplus
|
| 295 |
+
}
|
| 296 |
+
# endif
|
| 297 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/srp.h
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/srp.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
* Copyright (c) 2004, EdelKey Project. All Rights Reserved.
|
| 7 |
+
*
|
| 8 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 9 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 10 |
+
* in the file LICENSE in the source distribution or at
|
| 11 |
+
* https://www.openssl.org/source/license.html
|
| 12 |
+
*
|
| 13 |
+
* Originally written by Christophe Renou and Peter Sylvester,
|
| 14 |
+
* for the EdelKey project.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
#ifndef OPENSSL_SRP_H
|
| 20 |
+
# define OPENSSL_SRP_H
|
| 21 |
+
# pragma once
|
| 22 |
+
|
| 23 |
+
# include <openssl/macros.h>
|
| 24 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 25 |
+
# define HEADER_SRP_H
|
| 26 |
+
# endif
|
| 27 |
+
|
| 28 |
+
#include <openssl/opensslconf.h>
|
| 29 |
+
|
| 30 |
+
#ifndef OPENSSL_NO_SRP
|
| 31 |
+
# include <stdio.h>
|
| 32 |
+
# include <string.h>
|
| 33 |
+
# include <openssl/safestack.h>
|
| 34 |
+
# include <openssl/bn.h>
|
| 35 |
+
# include <openssl/crypto.h>
|
| 36 |
+
|
| 37 |
+
# ifdef __cplusplus
|
| 38 |
+
extern "C" {
|
| 39 |
+
# endif
|
| 40 |
+
|
| 41 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 42 |
+
|
| 43 |
+
typedef struct SRP_gN_cache_st {
|
| 44 |
+
char *b64_bn;
|
| 45 |
+
BIGNUM *bn;
|
| 46 |
+
} SRP_gN_cache;
|
| 47 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_gN_cache, SRP_gN_cache, SRP_gN_cache)
|
| 48 |
+
#define sk_SRP_gN_cache_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_gN_cache_sk_type(sk))
|
| 49 |
+
#define sk_SRP_gN_cache_value(sk, idx) ((SRP_gN_cache *)OPENSSL_sk_value(ossl_check_const_SRP_gN_cache_sk_type(sk), (idx)))
|
| 50 |
+
#define sk_SRP_gN_cache_new(cmp) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new(ossl_check_SRP_gN_cache_compfunc_type(cmp)))
|
| 51 |
+
#define sk_SRP_gN_cache_new_null() ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new_null())
|
| 52 |
+
#define sk_SRP_gN_cache_new_reserve(cmp, n) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new_reserve(ossl_check_SRP_gN_cache_compfunc_type(cmp), (n)))
|
| 53 |
+
#define sk_SRP_gN_cache_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_gN_cache_sk_type(sk), (n))
|
| 54 |
+
#define sk_SRP_gN_cache_free(sk) OPENSSL_sk_free(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 55 |
+
#define sk_SRP_gN_cache_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 56 |
+
#define sk_SRP_gN_cache_delete(sk, i) ((SRP_gN_cache *)OPENSSL_sk_delete(ossl_check_SRP_gN_cache_sk_type(sk), (i)))
|
| 57 |
+
#define sk_SRP_gN_cache_delete_ptr(sk, ptr) ((SRP_gN_cache *)OPENSSL_sk_delete_ptr(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr)))
|
| 58 |
+
#define sk_SRP_gN_cache_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))
|
| 59 |
+
#define sk_SRP_gN_cache_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))
|
| 60 |
+
#define sk_SRP_gN_cache_pop(sk) ((SRP_gN_cache *)OPENSSL_sk_pop(ossl_check_SRP_gN_cache_sk_type(sk)))
|
| 61 |
+
#define sk_SRP_gN_cache_shift(sk) ((SRP_gN_cache *)OPENSSL_sk_shift(ossl_check_SRP_gN_cache_sk_type(sk)))
|
| 62 |
+
#define sk_SRP_gN_cache_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_gN_cache_sk_type(sk),ossl_check_SRP_gN_cache_freefunc_type(freefunc))
|
| 63 |
+
#define sk_SRP_gN_cache_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr), (idx))
|
| 64 |
+
#define sk_SRP_gN_cache_set(sk, idx, ptr) ((SRP_gN_cache *)OPENSSL_sk_set(ossl_check_SRP_gN_cache_sk_type(sk), (idx), ossl_check_SRP_gN_cache_type(ptr)))
|
| 65 |
+
#define sk_SRP_gN_cache_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))
|
| 66 |
+
#define sk_SRP_gN_cache_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))
|
| 67 |
+
#define sk_SRP_gN_cache_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr), pnum)
|
| 68 |
+
#define sk_SRP_gN_cache_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_gN_cache_sk_type(sk))
|
| 69 |
+
#define sk_SRP_gN_cache_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_gN_cache_sk_type(sk))
|
| 70 |
+
#define sk_SRP_gN_cache_dup(sk) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_dup(ossl_check_const_SRP_gN_cache_sk_type(sk)))
|
| 71 |
+
#define sk_SRP_gN_cache_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_copyfunc_type(copyfunc), ossl_check_SRP_gN_cache_freefunc_type(freefunc)))
|
| 72 |
+
#define sk_SRP_gN_cache_set_cmp_func(sk, cmp) ((sk_SRP_gN_cache_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_compfunc_type(cmp)))
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
typedef struct SRP_user_pwd_st {
|
| 77 |
+
/* Owned by us. */
|
| 78 |
+
char *id;
|
| 79 |
+
BIGNUM *s;
|
| 80 |
+
BIGNUM *v;
|
| 81 |
+
/* Not owned by us. */
|
| 82 |
+
const BIGNUM *g;
|
| 83 |
+
const BIGNUM *N;
|
| 84 |
+
/* Owned by us. */
|
| 85 |
+
char *info;
|
| 86 |
+
} SRP_user_pwd;
|
| 87 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_user_pwd, SRP_user_pwd, SRP_user_pwd)
|
| 88 |
+
#define sk_SRP_user_pwd_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_user_pwd_sk_type(sk))
|
| 89 |
+
#define sk_SRP_user_pwd_value(sk, idx) ((SRP_user_pwd *)OPENSSL_sk_value(ossl_check_const_SRP_user_pwd_sk_type(sk), (idx)))
|
| 90 |
+
#define sk_SRP_user_pwd_new(cmp) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new(ossl_check_SRP_user_pwd_compfunc_type(cmp)))
|
| 91 |
+
#define sk_SRP_user_pwd_new_null() ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new_null())
|
| 92 |
+
#define sk_SRP_user_pwd_new_reserve(cmp, n) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new_reserve(ossl_check_SRP_user_pwd_compfunc_type(cmp), (n)))
|
| 93 |
+
#define sk_SRP_user_pwd_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_user_pwd_sk_type(sk), (n))
|
| 94 |
+
#define sk_SRP_user_pwd_free(sk) OPENSSL_sk_free(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 95 |
+
#define sk_SRP_user_pwd_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 96 |
+
#define sk_SRP_user_pwd_delete(sk, i) ((SRP_user_pwd *)OPENSSL_sk_delete(ossl_check_SRP_user_pwd_sk_type(sk), (i)))
|
| 97 |
+
#define sk_SRP_user_pwd_delete_ptr(sk, ptr) ((SRP_user_pwd *)OPENSSL_sk_delete_ptr(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr)))
|
| 98 |
+
#define sk_SRP_user_pwd_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))
|
| 99 |
+
#define sk_SRP_user_pwd_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))
|
| 100 |
+
#define sk_SRP_user_pwd_pop(sk) ((SRP_user_pwd *)OPENSSL_sk_pop(ossl_check_SRP_user_pwd_sk_type(sk)))
|
| 101 |
+
#define sk_SRP_user_pwd_shift(sk) ((SRP_user_pwd *)OPENSSL_sk_shift(ossl_check_SRP_user_pwd_sk_type(sk)))
|
| 102 |
+
#define sk_SRP_user_pwd_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_user_pwd_sk_type(sk),ossl_check_SRP_user_pwd_freefunc_type(freefunc))
|
| 103 |
+
#define sk_SRP_user_pwd_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr), (idx))
|
| 104 |
+
#define sk_SRP_user_pwd_set(sk, idx, ptr) ((SRP_user_pwd *)OPENSSL_sk_set(ossl_check_SRP_user_pwd_sk_type(sk), (idx), ossl_check_SRP_user_pwd_type(ptr)))
|
| 105 |
+
#define sk_SRP_user_pwd_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))
|
| 106 |
+
#define sk_SRP_user_pwd_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))
|
| 107 |
+
#define sk_SRP_user_pwd_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr), pnum)
|
| 108 |
+
#define sk_SRP_user_pwd_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_user_pwd_sk_type(sk))
|
| 109 |
+
#define sk_SRP_user_pwd_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_user_pwd_sk_type(sk))
|
| 110 |
+
#define sk_SRP_user_pwd_dup(sk) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_dup(ossl_check_const_SRP_user_pwd_sk_type(sk)))
|
| 111 |
+
#define sk_SRP_user_pwd_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_copyfunc_type(copyfunc), ossl_check_SRP_user_pwd_freefunc_type(freefunc)))
|
| 112 |
+
#define sk_SRP_user_pwd_set_cmp_func(sk, cmp) ((sk_SRP_user_pwd_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_compfunc_type(cmp)))
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
OSSL_DEPRECATEDIN_3_0
|
| 116 |
+
SRP_user_pwd *SRP_user_pwd_new(void);
|
| 117 |
+
OSSL_DEPRECATEDIN_3_0
|
| 118 |
+
void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
|
| 119 |
+
|
| 120 |
+
OSSL_DEPRECATEDIN_3_0
|
| 121 |
+
void SRP_user_pwd_set_gN(SRP_user_pwd *user_pwd, const BIGNUM *g,
|
| 122 |
+
const BIGNUM *N);
|
| 123 |
+
OSSL_DEPRECATEDIN_3_0
|
| 124 |
+
int SRP_user_pwd_set1_ids(SRP_user_pwd *user_pwd, const char *id,
|
| 125 |
+
const char *info);
|
| 126 |
+
OSSL_DEPRECATEDIN_3_0
|
| 127 |
+
int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v);
|
| 128 |
+
|
| 129 |
+
typedef struct SRP_VBASE_st {
|
| 130 |
+
STACK_OF(SRP_user_pwd) *users_pwd;
|
| 131 |
+
STACK_OF(SRP_gN_cache) *gN_cache;
|
| 132 |
+
/* to simulate a user */
|
| 133 |
+
char *seed_key;
|
| 134 |
+
const BIGNUM *default_g;
|
| 135 |
+
const BIGNUM *default_N;
|
| 136 |
+
} SRP_VBASE;
|
| 137 |
+
|
| 138 |
+
/*
|
| 139 |
+
* Internal structure storing N and g pair
|
| 140 |
+
*/
|
| 141 |
+
typedef struct SRP_gN_st {
|
| 142 |
+
char *id;
|
| 143 |
+
const BIGNUM *g;
|
| 144 |
+
const BIGNUM *N;
|
| 145 |
+
} SRP_gN;
|
| 146 |
+
SKM_DEFINE_STACK_OF_INTERNAL(SRP_gN, SRP_gN, SRP_gN)
|
| 147 |
+
#define sk_SRP_gN_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_gN_sk_type(sk))
|
| 148 |
+
#define sk_SRP_gN_value(sk, idx) ((SRP_gN *)OPENSSL_sk_value(ossl_check_const_SRP_gN_sk_type(sk), (idx)))
|
| 149 |
+
#define sk_SRP_gN_new(cmp) ((STACK_OF(SRP_gN) *)OPENSSL_sk_new(ossl_check_SRP_gN_compfunc_type(cmp)))
|
| 150 |
+
#define sk_SRP_gN_new_null() ((STACK_OF(SRP_gN) *)OPENSSL_sk_new_null())
|
| 151 |
+
#define sk_SRP_gN_new_reserve(cmp, n) ((STACK_OF(SRP_gN) *)OPENSSL_sk_new_reserve(ossl_check_SRP_gN_compfunc_type(cmp), (n)))
|
| 152 |
+
#define sk_SRP_gN_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_gN_sk_type(sk), (n))
|
| 153 |
+
#define sk_SRP_gN_free(sk) OPENSSL_sk_free(ossl_check_SRP_gN_sk_type(sk))
|
| 154 |
+
#define sk_SRP_gN_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_gN_sk_type(sk))
|
| 155 |
+
#define sk_SRP_gN_delete(sk, i) ((SRP_gN *)OPENSSL_sk_delete(ossl_check_SRP_gN_sk_type(sk), (i)))
|
| 156 |
+
#define sk_SRP_gN_delete_ptr(sk, ptr) ((SRP_gN *)OPENSSL_sk_delete_ptr(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr)))
|
| 157 |
+
#define sk_SRP_gN_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 158 |
+
#define sk_SRP_gN_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 159 |
+
#define sk_SRP_gN_pop(sk) ((SRP_gN *)OPENSSL_sk_pop(ossl_check_SRP_gN_sk_type(sk)))
|
| 160 |
+
#define sk_SRP_gN_shift(sk) ((SRP_gN *)OPENSSL_sk_shift(ossl_check_SRP_gN_sk_type(sk)))
|
| 161 |
+
#define sk_SRP_gN_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_gN_sk_type(sk),ossl_check_SRP_gN_freefunc_type(freefunc))
|
| 162 |
+
#define sk_SRP_gN_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr), (idx))
|
| 163 |
+
#define sk_SRP_gN_set(sk, idx, ptr) ((SRP_gN *)OPENSSL_sk_set(ossl_check_SRP_gN_sk_type(sk), (idx), ossl_check_SRP_gN_type(ptr)))
|
| 164 |
+
#define sk_SRP_gN_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 165 |
+
#define sk_SRP_gN_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))
|
| 166 |
+
#define sk_SRP_gN_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr), pnum)
|
| 167 |
+
#define sk_SRP_gN_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_gN_sk_type(sk))
|
| 168 |
+
#define sk_SRP_gN_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_gN_sk_type(sk))
|
| 169 |
+
#define sk_SRP_gN_dup(sk) ((STACK_OF(SRP_gN) *)OPENSSL_sk_dup(ossl_check_const_SRP_gN_sk_type(sk)))
|
| 170 |
+
#define sk_SRP_gN_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_gN) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_gN_sk_type(sk), ossl_check_SRP_gN_copyfunc_type(copyfunc), ossl_check_SRP_gN_freefunc_type(freefunc)))
|
| 171 |
+
#define sk_SRP_gN_set_cmp_func(sk, cmp) ((sk_SRP_gN_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_compfunc_type(cmp)))
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
OSSL_DEPRECATEDIN_3_0
|
| 176 |
+
SRP_VBASE *SRP_VBASE_new(char *seed_key);
|
| 177 |
+
OSSL_DEPRECATEDIN_3_0
|
| 178 |
+
void SRP_VBASE_free(SRP_VBASE *vb);
|
| 179 |
+
OSSL_DEPRECATEDIN_3_0
|
| 180 |
+
int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
|
| 181 |
+
|
| 182 |
+
OSSL_DEPRECATEDIN_3_0
|
| 183 |
+
int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
|
| 184 |
+
|
| 185 |
+
/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/
|
| 186 |
+
OSSL_DEPRECATEDIN_3_0
|
| 187 |
+
SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
|
| 188 |
+
|
| 189 |
+
OSSL_DEPRECATEDIN_3_0
|
| 190 |
+
char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
|
| 191 |
+
char **verifier, const char *N, const char *g,
|
| 192 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 193 |
+
OSSL_DEPRECATEDIN_3_0
|
| 194 |
+
char *SRP_create_verifier(const char *user, const char *pass, char **salt,
|
| 195 |
+
char **verifier, const char *N, const char *g);
|
| 196 |
+
OSSL_DEPRECATEDIN_3_0
|
| 197 |
+
int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt,
|
| 198 |
+
BIGNUM **verifier, const BIGNUM *N,
|
| 199 |
+
const BIGNUM *g, OSSL_LIB_CTX *libctx,
|
| 200 |
+
const char *propq);
|
| 201 |
+
OSSL_DEPRECATEDIN_3_0
|
| 202 |
+
int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
|
| 203 |
+
BIGNUM **verifier, const BIGNUM *N,
|
| 204 |
+
const BIGNUM *g);
|
| 205 |
+
|
| 206 |
+
# define SRP_NO_ERROR 0
|
| 207 |
+
# define SRP_ERR_VBASE_INCOMPLETE_FILE 1
|
| 208 |
+
# define SRP_ERR_VBASE_BN_LIB 2
|
| 209 |
+
# define SRP_ERR_OPEN_FILE 3
|
| 210 |
+
# define SRP_ERR_MEMORY 4
|
| 211 |
+
|
| 212 |
+
# define DB_srptype 0
|
| 213 |
+
# define DB_srpverifier 1
|
| 214 |
+
# define DB_srpsalt 2
|
| 215 |
+
# define DB_srpid 3
|
| 216 |
+
# define DB_srpgN 4
|
| 217 |
+
# define DB_srpinfo 5
|
| 218 |
+
# undef DB_NUMBER
|
| 219 |
+
# define DB_NUMBER 6
|
| 220 |
+
|
| 221 |
+
# define DB_SRP_INDEX 'I'
|
| 222 |
+
# define DB_SRP_VALID 'V'
|
| 223 |
+
# define DB_SRP_REVOKED 'R'
|
| 224 |
+
# define DB_SRP_MODIF 'v'
|
| 225 |
+
|
| 226 |
+
/* see srp.c */
|
| 227 |
+
OSSL_DEPRECATEDIN_3_0
|
| 228 |
+
char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N);
|
| 229 |
+
OSSL_DEPRECATEDIN_3_0
|
| 230 |
+
SRP_gN *SRP_get_default_gN(const char *id);
|
| 231 |
+
|
| 232 |
+
/* server side .... */
|
| 233 |
+
OSSL_DEPRECATEDIN_3_0
|
| 234 |
+
BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u,
|
| 235 |
+
const BIGNUM *b, const BIGNUM *N);
|
| 236 |
+
OSSL_DEPRECATEDIN_3_0
|
| 237 |
+
BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
|
| 238 |
+
const BIGNUM *v, OSSL_LIB_CTX *libctx, const char *propq);
|
| 239 |
+
OSSL_DEPRECATEDIN_3_0
|
| 240 |
+
BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
|
| 241 |
+
const BIGNUM *v);
|
| 242 |
+
|
| 243 |
+
OSSL_DEPRECATEDIN_3_0
|
| 244 |
+
int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N);
|
| 245 |
+
OSSL_DEPRECATEDIN_3_0
|
| 246 |
+
BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N,
|
| 247 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 248 |
+
OSSL_DEPRECATEDIN_3_0
|
| 249 |
+
BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N);
|
| 250 |
+
|
| 251 |
+
/* client side .... */
|
| 252 |
+
|
| 253 |
+
OSSL_DEPRECATEDIN_3_0
|
| 254 |
+
BIGNUM *SRP_Calc_x_ex(const BIGNUM *s, const char *user, const char *pass,
|
| 255 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 256 |
+
OSSL_DEPRECATEDIN_3_0
|
| 257 |
+
BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass);
|
| 258 |
+
OSSL_DEPRECATEDIN_3_0
|
| 259 |
+
BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g);
|
| 260 |
+
OSSL_DEPRECATEDIN_3_0
|
| 261 |
+
BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
| 262 |
+
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u,
|
| 263 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 264 |
+
OSSL_DEPRECATEDIN_3_0
|
| 265 |
+
BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
| 266 |
+
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u);
|
| 267 |
+
OSSL_DEPRECATEDIN_3_0
|
| 268 |
+
int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N);
|
| 269 |
+
|
| 270 |
+
# define SRP_MINIMAL_N 1024
|
| 271 |
+
|
| 272 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 273 |
+
|
| 274 |
+
/* This method ignores the configured seed and fails for an unknown user. */
|
| 275 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 276 |
+
OSSL_DEPRECATEDIN_1_1_0
|
| 277 |
+
SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
|
| 278 |
+
# endif
|
| 279 |
+
|
| 280 |
+
# ifdef __cplusplus
|
| 281 |
+
}
|
| 282 |
+
# endif
|
| 283 |
+
# endif
|
| 284 |
+
|
| 285 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/ui.h
ADDED
|
@@ -0,0 +1,407 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/ui.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_UI_H
|
| 16 |
+
# define OPENSSL_UI_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_UI_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
# include <openssl/opensslconf.h>
|
| 25 |
+
|
| 26 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 27 |
+
# include <openssl/crypto.h>
|
| 28 |
+
# endif
|
| 29 |
+
# include <openssl/safestack.h>
|
| 30 |
+
# include <openssl/pem.h>
|
| 31 |
+
# include <openssl/types.h>
|
| 32 |
+
# include <openssl/uierr.h>
|
| 33 |
+
|
| 34 |
+
/* For compatibility reasons, the macro OPENSSL_NO_UI is currently retained */
|
| 35 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 36 |
+
# ifdef OPENSSL_NO_UI_CONSOLE
|
| 37 |
+
# define OPENSSL_NO_UI
|
| 38 |
+
# endif
|
| 39 |
+
# endif
|
| 40 |
+
|
| 41 |
+
# ifdef __cplusplus
|
| 42 |
+
extern "C" {
|
| 43 |
+
# endif
|
| 44 |
+
|
| 45 |
+
/*
|
| 46 |
+
* All the following functions return -1 or NULL on error and in some cases
|
| 47 |
+
* (UI_process()) -2 if interrupted or in some other way cancelled. When
|
| 48 |
+
* everything is fine, they return 0, a positive value or a non-NULL pointer,
|
| 49 |
+
* all depending on their purpose.
|
| 50 |
+
*/
|
| 51 |
+
|
| 52 |
+
/* Creators and destructor. */
|
| 53 |
+
UI *UI_new(void);
|
| 54 |
+
UI *UI_new_method(const UI_METHOD *method);
|
| 55 |
+
void UI_free(UI *ui);
|
| 56 |
+
|
| 57 |
+
/*-
|
| 58 |
+
The following functions are used to add strings to be printed and prompt
|
| 59 |
+
strings to prompt for data. The names are UI_{add,dup}_<function>_string
|
| 60 |
+
and UI_{add,dup}_input_boolean.
|
| 61 |
+
|
| 62 |
+
UI_{add,dup}_<function>_string have the following meanings:
|
| 63 |
+
add add a text or prompt string. The pointers given to these
|
| 64 |
+
functions are used verbatim, no copying is done.
|
| 65 |
+
dup make a copy of the text or prompt string, then add the copy
|
| 66 |
+
to the collection of strings in the user interface.
|
| 67 |
+
<function>
|
| 68 |
+
The function is a name for the functionality that the given
|
| 69 |
+
string shall be used for. It can be one of:
|
| 70 |
+
input use the string as data prompt.
|
| 71 |
+
verify use the string as verification prompt. This
|
| 72 |
+
is used to verify a previous input.
|
| 73 |
+
info use the string for informational output.
|
| 74 |
+
error use the string for error output.
|
| 75 |
+
Honestly, there's currently no difference between info and error for the
|
| 76 |
+
moment.
|
| 77 |
+
|
| 78 |
+
UI_{add,dup}_input_boolean have the same semantics for "add" and "dup",
|
| 79 |
+
and are typically used when one wants to prompt for a yes/no response.
|
| 80 |
+
|
| 81 |
+
All of the functions in this group take a UI and a prompt string.
|
| 82 |
+
The string input and verify addition functions also take a flag argument,
|
| 83 |
+
a buffer for the result to end up with, a minimum input size and a maximum
|
| 84 |
+
input size (the result buffer MUST be large enough to be able to contain
|
| 85 |
+
the maximum number of characters). Additionally, the verify addition
|
| 86 |
+
functions takes another buffer to compare the result against.
|
| 87 |
+
The boolean input functions take an action description string (which should
|
| 88 |
+
be safe to ignore if the expected user action is obvious, for example with
|
| 89 |
+
a dialog box with an OK button and a Cancel button), a string of acceptable
|
| 90 |
+
characters to mean OK and to mean Cancel. The two last strings are checked
|
| 91 |
+
to make sure they don't have common characters. Additionally, the same
|
| 92 |
+
flag argument as for the string input is taken, as well as a result buffer.
|
| 93 |
+
The result buffer is required to be at least one byte long. Depending on
|
| 94 |
+
the answer, the first character from the OK or the Cancel character strings
|
| 95 |
+
will be stored in the first byte of the result buffer. No NUL will be
|
| 96 |
+
added, so the result is *not* a string.
|
| 97 |
+
|
| 98 |
+
On success, the all return an index of the added information. That index
|
| 99 |
+
is useful when retrieving results with UI_get0_result(). */
|
| 100 |
+
int UI_add_input_string(UI *ui, const char *prompt, int flags,
|
| 101 |
+
char *result_buf, int minsize, int maxsize);
|
| 102 |
+
int UI_dup_input_string(UI *ui, const char *prompt, int flags,
|
| 103 |
+
char *result_buf, int minsize, int maxsize);
|
| 104 |
+
int UI_add_verify_string(UI *ui, const char *prompt, int flags,
|
| 105 |
+
char *result_buf, int minsize, int maxsize,
|
| 106 |
+
const char *test_buf);
|
| 107 |
+
int UI_dup_verify_string(UI *ui, const char *prompt, int flags,
|
| 108 |
+
char *result_buf, int minsize, int maxsize,
|
| 109 |
+
const char *test_buf);
|
| 110 |
+
int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc,
|
| 111 |
+
const char *ok_chars, const char *cancel_chars,
|
| 112 |
+
int flags, char *result_buf);
|
| 113 |
+
int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
|
| 114 |
+
const char *ok_chars, const char *cancel_chars,
|
| 115 |
+
int flags, char *result_buf);
|
| 116 |
+
int UI_add_info_string(UI *ui, const char *text);
|
| 117 |
+
int UI_dup_info_string(UI *ui, const char *text);
|
| 118 |
+
int UI_add_error_string(UI *ui, const char *text);
|
| 119 |
+
int UI_dup_error_string(UI *ui, const char *text);
|
| 120 |
+
|
| 121 |
+
/* These are the possible flags. They can be or'ed together. */
|
| 122 |
+
/* Use to have echoing of input */
|
| 123 |
+
# define UI_INPUT_FLAG_ECHO 0x01
|
| 124 |
+
/*
|
| 125 |
+
* Use a default password. Where that password is found is completely up to
|
| 126 |
+
* the application, it might for example be in the user data set with
|
| 127 |
+
* UI_add_user_data(). It is not recommended to have more than one input in
|
| 128 |
+
* each UI being marked with this flag, or the application might get
|
| 129 |
+
* confused.
|
| 130 |
+
*/
|
| 131 |
+
# define UI_INPUT_FLAG_DEFAULT_PWD 0x02
|
| 132 |
+
|
| 133 |
+
/*-
|
| 134 |
+
* The user of these routines may want to define flags of their own. The core
|
| 135 |
+
* UI won't look at those, but will pass them on to the method routines. They
|
| 136 |
+
* must use higher bits so they don't get confused with the UI bits above.
|
| 137 |
+
* UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good
|
| 138 |
+
* example of use is this:
|
| 139 |
+
*
|
| 140 |
+
* #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE)
|
| 141 |
+
*
|
| 142 |
+
*/
|
| 143 |
+
# define UI_INPUT_FLAG_USER_BASE 16
|
| 144 |
+
|
| 145 |
+
/*-
|
| 146 |
+
* The following function helps construct a prompt.
|
| 147 |
+
* phrase_desc is a textual short description of the phrase to enter,
|
| 148 |
+
* for example "pass phrase", and
|
| 149 |
+
* object_name is the name of the object
|
| 150 |
+
* (which might be a card name or a file name) or NULL.
|
| 151 |
+
* The returned string shall always be allocated on the heap with
|
| 152 |
+
* OPENSSL_malloc(), and need to be free'd with OPENSSL_free().
|
| 153 |
+
*
|
| 154 |
+
* If the ui_method doesn't contain a pointer to a user-defined prompt
|
| 155 |
+
* constructor, a default string is built, looking like this:
|
| 156 |
+
*
|
| 157 |
+
* "Enter {phrase_desc} for {object_name}:"
|
| 158 |
+
*
|
| 159 |
+
* So, if phrase_desc has the value "pass phrase" and object_name has
|
| 160 |
+
* the value "foo.key", the resulting string is:
|
| 161 |
+
*
|
| 162 |
+
* "Enter pass phrase for foo.key:"
|
| 163 |
+
*/
|
| 164 |
+
char *UI_construct_prompt(UI *ui_method,
|
| 165 |
+
const char *phrase_desc, const char *object_name);
|
| 166 |
+
|
| 167 |
+
/*
|
| 168 |
+
* The following function is used to store a pointer to user-specific data.
|
| 169 |
+
* Any previous such pointer will be returned and replaced.
|
| 170 |
+
*
|
| 171 |
+
* For callback purposes, this function makes a lot more sense than using
|
| 172 |
+
* ex_data, since the latter requires that different parts of OpenSSL or
|
| 173 |
+
* applications share the same ex_data index.
|
| 174 |
+
*
|
| 175 |
+
* Note that the UI_OpenSSL() method completely ignores the user data. Other
|
| 176 |
+
* methods may not, however.
|
| 177 |
+
*/
|
| 178 |
+
void *UI_add_user_data(UI *ui, void *user_data);
|
| 179 |
+
/*
|
| 180 |
+
* Alternatively, this function is used to duplicate the user data.
|
| 181 |
+
* This uses the duplicator method function. The destroy function will
|
| 182 |
+
* be used to free the user data in this case.
|
| 183 |
+
*/
|
| 184 |
+
int UI_dup_user_data(UI *ui, void *user_data);
|
| 185 |
+
/* We need a user data retrieving function as well. */
|
| 186 |
+
void *UI_get0_user_data(UI *ui);
|
| 187 |
+
|
| 188 |
+
/* Return the result associated with a prompt given with the index i. */
|
| 189 |
+
const char *UI_get0_result(UI *ui, int i);
|
| 190 |
+
int UI_get_result_length(UI *ui, int i);
|
| 191 |
+
|
| 192 |
+
/* When all strings have been added, process the whole thing. */
|
| 193 |
+
int UI_process(UI *ui);
|
| 194 |
+
|
| 195 |
+
/*
|
| 196 |
+
* Give a user interface parameterised control commands. This can be used to
|
| 197 |
+
* send down an integer, a data pointer or a function pointer, as well as be
|
| 198 |
+
* used to get information from a UI.
|
| 199 |
+
*/
|
| 200 |
+
int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f) (void));
|
| 201 |
+
|
| 202 |
+
/* The commands */
|
| 203 |
+
/*
|
| 204 |
+
* Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the
|
| 205 |
+
* OpenSSL error stack before printing any info or added error messages and
|
| 206 |
+
* before any prompting.
|
| 207 |
+
*/
|
| 208 |
+
# define UI_CTRL_PRINT_ERRORS 1
|
| 209 |
+
/*
|
| 210 |
+
* Check if a UI_process() is possible to do again with the same instance of
|
| 211 |
+
* a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0
|
| 212 |
+
* if not.
|
| 213 |
+
*/
|
| 214 |
+
# define UI_CTRL_IS_REDOABLE 2
|
| 215 |
+
|
| 216 |
+
/* Some methods may use extra data */
|
| 217 |
+
# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg)
|
| 218 |
+
# define UI_get_app_data(s) UI_get_ex_data(s,0)
|
| 219 |
+
|
| 220 |
+
# define UI_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 221 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef)
|
| 222 |
+
int UI_set_ex_data(UI *r, int idx, void *arg);
|
| 223 |
+
void *UI_get_ex_data(const UI *r, int idx);
|
| 224 |
+
|
| 225 |
+
/* Use specific methods instead of the built-in one */
|
| 226 |
+
void UI_set_default_method(const UI_METHOD *meth);
|
| 227 |
+
const UI_METHOD *UI_get_default_method(void);
|
| 228 |
+
const UI_METHOD *UI_get_method(UI *ui);
|
| 229 |
+
const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth);
|
| 230 |
+
|
| 231 |
+
# ifndef OPENSSL_NO_UI_CONSOLE
|
| 232 |
+
|
| 233 |
+
/* The method with all the built-in thingies */
|
| 234 |
+
UI_METHOD *UI_OpenSSL(void);
|
| 235 |
+
|
| 236 |
+
# endif
|
| 237 |
+
|
| 238 |
+
/*
|
| 239 |
+
* NULL method. Literally does nothing, but may serve as a placeholder
|
| 240 |
+
* to avoid internal default.
|
| 241 |
+
*/
|
| 242 |
+
const UI_METHOD *UI_null(void);
|
| 243 |
+
|
| 244 |
+
/* ---------- For method writers ---------- */
|
| 245 |
+
/*-
|
| 246 |
+
A method contains a number of functions that implement the low level
|
| 247 |
+
of the User Interface. The functions are:
|
| 248 |
+
|
| 249 |
+
an opener This function starts a session, maybe by opening
|
| 250 |
+
a channel to a tty, or by opening a window.
|
| 251 |
+
a writer This function is called to write a given string,
|
| 252 |
+
maybe to the tty, maybe as a field label in a
|
| 253 |
+
window.
|
| 254 |
+
a flusher This function is called to flush everything that
|
| 255 |
+
has been output so far. It can be used to actually
|
| 256 |
+
display a dialog box after it has been built.
|
| 257 |
+
a reader This function is called to read a given prompt,
|
| 258 |
+
maybe from the tty, maybe from a field in a
|
| 259 |
+
window. Note that it's called with all string
|
| 260 |
+
structures, not only the prompt ones, so it must
|
| 261 |
+
check such things itself.
|
| 262 |
+
a closer This function closes the session, maybe by closing
|
| 263 |
+
the channel to the tty, or closing the window.
|
| 264 |
+
|
| 265 |
+
All these functions are expected to return:
|
| 266 |
+
|
| 267 |
+
0 on error.
|
| 268 |
+
1 on success.
|
| 269 |
+
-1 on out-of-band events, for example if some prompting has
|
| 270 |
+
been canceled (by pressing Ctrl-C, for example). This is
|
| 271 |
+
only checked when returned by the flusher or the reader.
|
| 272 |
+
|
| 273 |
+
The way this is used, the opener is first called, then the writer for all
|
| 274 |
+
strings, then the flusher, then the reader for all strings and finally the
|
| 275 |
+
closer. Note that if you want to prompt from a terminal or other command
|
| 276 |
+
line interface, the best is to have the reader also write the prompts
|
| 277 |
+
instead of having the writer do it. If you want to prompt from a dialog
|
| 278 |
+
box, the writer can be used to build up the contents of the box, and the
|
| 279 |
+
flusher to actually display the box and run the event loop until all data
|
| 280 |
+
has been given, after which the reader only grabs the given data and puts
|
| 281 |
+
them back into the UI strings.
|
| 282 |
+
|
| 283 |
+
All method functions take a UI as argument. Additionally, the writer and
|
| 284 |
+
the reader take a UI_STRING.
|
| 285 |
+
*/
|
| 286 |
+
|
| 287 |
+
/*
|
| 288 |
+
* The UI_STRING type is the data structure that contains all the needed info
|
| 289 |
+
* about a string or a prompt, including test data for a verification prompt.
|
| 290 |
+
*/
|
| 291 |
+
typedef struct ui_string_st UI_STRING;
|
| 292 |
+
|
| 293 |
+
SKM_DEFINE_STACK_OF_INTERNAL(UI_STRING, UI_STRING, UI_STRING)
|
| 294 |
+
#define sk_UI_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_UI_STRING_sk_type(sk))
|
| 295 |
+
#define sk_UI_STRING_value(sk, idx) ((UI_STRING *)OPENSSL_sk_value(ossl_check_const_UI_STRING_sk_type(sk), (idx)))
|
| 296 |
+
#define sk_UI_STRING_new(cmp) ((STACK_OF(UI_STRING) *)OPENSSL_sk_new(ossl_check_UI_STRING_compfunc_type(cmp)))
|
| 297 |
+
#define sk_UI_STRING_new_null() ((STACK_OF(UI_STRING) *)OPENSSL_sk_new_null())
|
| 298 |
+
#define sk_UI_STRING_new_reserve(cmp, n) ((STACK_OF(UI_STRING) *)OPENSSL_sk_new_reserve(ossl_check_UI_STRING_compfunc_type(cmp), (n)))
|
| 299 |
+
#define sk_UI_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_UI_STRING_sk_type(sk), (n))
|
| 300 |
+
#define sk_UI_STRING_free(sk) OPENSSL_sk_free(ossl_check_UI_STRING_sk_type(sk))
|
| 301 |
+
#define sk_UI_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_UI_STRING_sk_type(sk))
|
| 302 |
+
#define sk_UI_STRING_delete(sk, i) ((UI_STRING *)OPENSSL_sk_delete(ossl_check_UI_STRING_sk_type(sk), (i)))
|
| 303 |
+
#define sk_UI_STRING_delete_ptr(sk, ptr) ((UI_STRING *)OPENSSL_sk_delete_ptr(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr)))
|
| 304 |
+
#define sk_UI_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))
|
| 305 |
+
#define sk_UI_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))
|
| 306 |
+
#define sk_UI_STRING_pop(sk) ((UI_STRING *)OPENSSL_sk_pop(ossl_check_UI_STRING_sk_type(sk)))
|
| 307 |
+
#define sk_UI_STRING_shift(sk) ((UI_STRING *)OPENSSL_sk_shift(ossl_check_UI_STRING_sk_type(sk)))
|
| 308 |
+
#define sk_UI_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_UI_STRING_sk_type(sk),ossl_check_UI_STRING_freefunc_type(freefunc))
|
| 309 |
+
#define sk_UI_STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr), (idx))
|
| 310 |
+
#define sk_UI_STRING_set(sk, idx, ptr) ((UI_STRING *)OPENSSL_sk_set(ossl_check_UI_STRING_sk_type(sk), (idx), ossl_check_UI_STRING_type(ptr)))
|
| 311 |
+
#define sk_UI_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))
|
| 312 |
+
#define sk_UI_STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))
|
| 313 |
+
#define sk_UI_STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr), pnum)
|
| 314 |
+
#define sk_UI_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_UI_STRING_sk_type(sk))
|
| 315 |
+
#define sk_UI_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_UI_STRING_sk_type(sk))
|
| 316 |
+
#define sk_UI_STRING_dup(sk) ((STACK_OF(UI_STRING) *)OPENSSL_sk_dup(ossl_check_const_UI_STRING_sk_type(sk)))
|
| 317 |
+
#define sk_UI_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(UI_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_UI_STRING_sk_type(sk), ossl_check_UI_STRING_copyfunc_type(copyfunc), ossl_check_UI_STRING_freefunc_type(freefunc)))
|
| 318 |
+
#define sk_UI_STRING_set_cmp_func(sk, cmp) ((sk_UI_STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_compfunc_type(cmp)))
|
| 319 |
+
|
| 320 |
+
|
| 321 |
+
/*
|
| 322 |
+
* The different types of strings that are currently supported. This is only
|
| 323 |
+
* needed by method authors.
|
| 324 |
+
*/
|
| 325 |
+
enum UI_string_types {
|
| 326 |
+
UIT_NONE = 0,
|
| 327 |
+
UIT_PROMPT, /* Prompt for a string */
|
| 328 |
+
UIT_VERIFY, /* Prompt for a string and verify */
|
| 329 |
+
UIT_BOOLEAN, /* Prompt for a yes/no response */
|
| 330 |
+
UIT_INFO, /* Send info to the user */
|
| 331 |
+
UIT_ERROR /* Send an error message to the user */
|
| 332 |
+
};
|
| 333 |
+
|
| 334 |
+
/* Create and manipulate methods */
|
| 335 |
+
UI_METHOD *UI_create_method(const char *name);
|
| 336 |
+
void UI_destroy_method(UI_METHOD *ui_method);
|
| 337 |
+
int UI_method_set_opener(UI_METHOD *method, int (*opener) (UI *ui));
|
| 338 |
+
int UI_method_set_writer(UI_METHOD *method,
|
| 339 |
+
int (*writer) (UI *ui, UI_STRING *uis));
|
| 340 |
+
int UI_method_set_flusher(UI_METHOD *method, int (*flusher) (UI *ui));
|
| 341 |
+
int UI_method_set_reader(UI_METHOD *method,
|
| 342 |
+
int (*reader) (UI *ui, UI_STRING *uis));
|
| 343 |
+
int UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui));
|
| 344 |
+
int UI_method_set_data_duplicator(UI_METHOD *method,
|
| 345 |
+
void *(*duplicator) (UI *ui, void *ui_data),
|
| 346 |
+
void (*destructor)(UI *ui, void *ui_data));
|
| 347 |
+
int UI_method_set_prompt_constructor(UI_METHOD *method,
|
| 348 |
+
char *(*prompt_constructor) (UI *ui,
|
| 349 |
+
const char
|
| 350 |
+
*phrase_desc,
|
| 351 |
+
const char
|
| 352 |
+
*object_name));
|
| 353 |
+
int UI_method_set_ex_data(UI_METHOD *method, int idx, void *data);
|
| 354 |
+
int (*UI_method_get_opener(const UI_METHOD *method)) (UI *);
|
| 355 |
+
int (*UI_method_get_writer(const UI_METHOD *method)) (UI *, UI_STRING *);
|
| 356 |
+
int (*UI_method_get_flusher(const UI_METHOD *method)) (UI *);
|
| 357 |
+
int (*UI_method_get_reader(const UI_METHOD *method)) (UI *, UI_STRING *);
|
| 358 |
+
int (*UI_method_get_closer(const UI_METHOD *method)) (UI *);
|
| 359 |
+
char *(*UI_method_get_prompt_constructor(const UI_METHOD *method))
|
| 360 |
+
(UI *, const char *, const char *);
|
| 361 |
+
void *(*UI_method_get_data_duplicator(const UI_METHOD *method)) (UI *, void *);
|
| 362 |
+
void (*UI_method_get_data_destructor(const UI_METHOD *method)) (UI *, void *);
|
| 363 |
+
const void *UI_method_get_ex_data(const UI_METHOD *method, int idx);
|
| 364 |
+
|
| 365 |
+
/*
|
| 366 |
+
* The following functions are helpers for method writers to access relevant
|
| 367 |
+
* data from a UI_STRING.
|
| 368 |
+
*/
|
| 369 |
+
|
| 370 |
+
/* Return type of the UI_STRING */
|
| 371 |
+
enum UI_string_types UI_get_string_type(UI_STRING *uis);
|
| 372 |
+
/* Return input flags of the UI_STRING */
|
| 373 |
+
int UI_get_input_flags(UI_STRING *uis);
|
| 374 |
+
/* Return the actual string to output (the prompt, info or error) */
|
| 375 |
+
const char *UI_get0_output_string(UI_STRING *uis);
|
| 376 |
+
/*
|
| 377 |
+
* Return the optional action string to output (the boolean prompt
|
| 378 |
+
* instruction)
|
| 379 |
+
*/
|
| 380 |
+
const char *UI_get0_action_string(UI_STRING *uis);
|
| 381 |
+
/* Return the result of a prompt */
|
| 382 |
+
const char *UI_get0_result_string(UI_STRING *uis);
|
| 383 |
+
int UI_get_result_string_length(UI_STRING *uis);
|
| 384 |
+
/*
|
| 385 |
+
* Return the string to test the result against. Only useful with verifies.
|
| 386 |
+
*/
|
| 387 |
+
const char *UI_get0_test_string(UI_STRING *uis);
|
| 388 |
+
/* Return the required minimum size of the result */
|
| 389 |
+
int UI_get_result_minsize(UI_STRING *uis);
|
| 390 |
+
/* Return the required maximum size of the result */
|
| 391 |
+
int UI_get_result_maxsize(UI_STRING *uis);
|
| 392 |
+
/* Set the result of a UI_STRING. */
|
| 393 |
+
int UI_set_result(UI *ui, UI_STRING *uis, const char *result);
|
| 394 |
+
int UI_set_result_ex(UI *ui, UI_STRING *uis, const char *result, int len);
|
| 395 |
+
|
| 396 |
+
/* A couple of popular utility functions */
|
| 397 |
+
int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,
|
| 398 |
+
int verify);
|
| 399 |
+
int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt,
|
| 400 |
+
int verify);
|
| 401 |
+
UI_METHOD *UI_UTIL_wrap_read_pem_callback(pem_password_cb *cb, int rwflag);
|
| 402 |
+
|
| 403 |
+
|
| 404 |
+
# ifdef __cplusplus
|
| 405 |
+
}
|
| 406 |
+
# endif
|
| 407 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/x509.h
ADDED
|
@@ -0,0 +1,1303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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+
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
| 7 |
+
*
|
| 8 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 9 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 10 |
+
* in the file LICENSE in the source distribution or at
|
| 11 |
+
* https://www.openssl.org/source/license.html
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
#ifndef OPENSSL_X509_H
|
| 17 |
+
# define OPENSSL_X509_H
|
| 18 |
+
# pragma once
|
| 19 |
+
|
| 20 |
+
# include <openssl/macros.h>
|
| 21 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 22 |
+
# define HEADER_X509_H
|
| 23 |
+
# endif
|
| 24 |
+
|
| 25 |
+
# include <openssl/e_os2.h>
|
| 26 |
+
# include <openssl/types.h>
|
| 27 |
+
# include <openssl/symhacks.h>
|
| 28 |
+
# include <openssl/buffer.h>
|
| 29 |
+
# include <openssl/evp.h>
|
| 30 |
+
# include <openssl/bio.h>
|
| 31 |
+
# include <openssl/asn1.h>
|
| 32 |
+
# include <openssl/safestack.h>
|
| 33 |
+
# include <openssl/ec.h>
|
| 34 |
+
|
| 35 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 36 |
+
# include <openssl/rsa.h>
|
| 37 |
+
# include <openssl/dsa.h>
|
| 38 |
+
# include <openssl/dh.h>
|
| 39 |
+
# endif
|
| 40 |
+
|
| 41 |
+
# include <openssl/sha.h>
|
| 42 |
+
# include <openssl/x509err.h>
|
| 43 |
+
# ifndef OPENSSL_NO_STDIO
|
| 44 |
+
# include <stdio.h>
|
| 45 |
+
# endif
|
| 46 |
+
|
| 47 |
+
#ifdef __cplusplus
|
| 48 |
+
extern "C" {
|
| 49 |
+
#endif
|
| 50 |
+
|
| 51 |
+
/* Needed stacks for types defined in other headers */
|
| 52 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME, X509_NAME, X509_NAME)
|
| 53 |
+
#define sk_X509_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_sk_type(sk))
|
| 54 |
+
#define sk_X509_NAME_value(sk, idx) ((X509_NAME *)OPENSSL_sk_value(ossl_check_const_X509_NAME_sk_type(sk), (idx)))
|
| 55 |
+
#define sk_X509_NAME_new(cmp) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new(ossl_check_X509_NAME_compfunc_type(cmp)))
|
| 56 |
+
#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null())
|
| 57 |
+
#define sk_X509_NAME_new_reserve(cmp, n) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_compfunc_type(cmp), (n)))
|
| 58 |
+
#define sk_X509_NAME_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_sk_type(sk), (n))
|
| 59 |
+
#define sk_X509_NAME_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_sk_type(sk))
|
| 60 |
+
#define sk_X509_NAME_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_sk_type(sk))
|
| 61 |
+
#define sk_X509_NAME_delete(sk, i) ((X509_NAME *)OPENSSL_sk_delete(ossl_check_X509_NAME_sk_type(sk), (i)))
|
| 62 |
+
#define sk_X509_NAME_delete_ptr(sk, ptr) ((X509_NAME *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)))
|
| 63 |
+
#define sk_X509_NAME_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
|
| 64 |
+
#define sk_X509_NAME_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
|
| 65 |
+
#define sk_X509_NAME_pop(sk) ((X509_NAME *)OPENSSL_sk_pop(ossl_check_X509_NAME_sk_type(sk)))
|
| 66 |
+
#define sk_X509_NAME_shift(sk) ((X509_NAME *)OPENSSL_sk_shift(ossl_check_X509_NAME_sk_type(sk)))
|
| 67 |
+
#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk),ossl_check_X509_NAME_freefunc_type(freefunc))
|
| 68 |
+
#define sk_X509_NAME_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), (idx))
|
| 69 |
+
#define sk_X509_NAME_set(sk, idx, ptr) ((X509_NAME *)OPENSSL_sk_set(ossl_check_X509_NAME_sk_type(sk), (idx), ossl_check_X509_NAME_type(ptr)))
|
| 70 |
+
#define sk_X509_NAME_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
|
| 71 |
+
#define sk_X509_NAME_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
|
| 72 |
+
#define sk_X509_NAME_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), pnum)
|
| 73 |
+
#define sk_X509_NAME_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_sk_type(sk))
|
| 74 |
+
#define sk_X509_NAME_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_sk_type(sk))
|
| 75 |
+
#define sk_X509_NAME_dup(sk) ((STACK_OF(X509_NAME) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_sk_type(sk)))
|
| 76 |
+
#define sk_X509_NAME_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_sk_type(sk), ossl_check_X509_NAME_copyfunc_type(copyfunc), ossl_check_X509_NAME_freefunc_type(freefunc)))
|
| 77 |
+
#define sk_X509_NAME_set_cmp_func(sk, cmp) ((sk_X509_NAME_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_compfunc_type(cmp)))
|
| 78 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509, X509, X509)
|
| 79 |
+
#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
|
| 80 |
+
#define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx)))
|
| 81 |
+
#define sk_X509_new(cmp) ((STACK_OF(X509) *)OPENSSL_sk_new(ossl_check_X509_compfunc_type(cmp)))
|
| 82 |
+
#define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null())
|
| 83 |
+
#define sk_X509_new_reserve(cmp, n) ((STACK_OF(X509) *)OPENSSL_sk_new_reserve(ossl_check_X509_compfunc_type(cmp), (n)))
|
| 84 |
+
#define sk_X509_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_sk_type(sk), (n))
|
| 85 |
+
#define sk_X509_free(sk) OPENSSL_sk_free(ossl_check_X509_sk_type(sk))
|
| 86 |
+
#define sk_X509_zero(sk) OPENSSL_sk_zero(ossl_check_X509_sk_type(sk))
|
| 87 |
+
#define sk_X509_delete(sk, i) ((X509 *)OPENSSL_sk_delete(ossl_check_X509_sk_type(sk), (i)))
|
| 88 |
+
#define sk_X509_delete_ptr(sk, ptr) ((X509 *)OPENSSL_sk_delete_ptr(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)))
|
| 89 |
+
#define sk_X509_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
|
| 90 |
+
#define sk_X509_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
|
| 91 |
+
#define sk_X509_pop(sk) ((X509 *)OPENSSL_sk_pop(ossl_check_X509_sk_type(sk)))
|
| 92 |
+
#define sk_X509_shift(sk) ((X509 *)OPENSSL_sk_shift(ossl_check_X509_sk_type(sk)))
|
| 93 |
+
#define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk),ossl_check_X509_freefunc_type(freefunc))
|
| 94 |
+
#define sk_X509_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), (idx))
|
| 95 |
+
#define sk_X509_set(sk, idx, ptr) ((X509 *)OPENSSL_sk_set(ossl_check_X509_sk_type(sk), (idx), ossl_check_X509_type(ptr)))
|
| 96 |
+
#define sk_X509_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
|
| 97 |
+
#define sk_X509_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
|
| 98 |
+
#define sk_X509_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), pnum)
|
| 99 |
+
#define sk_X509_sort(sk) OPENSSL_sk_sort(ossl_check_X509_sk_type(sk))
|
| 100 |
+
#define sk_X509_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_sk_type(sk))
|
| 101 |
+
#define sk_X509_dup(sk) ((STACK_OF(X509) *)OPENSSL_sk_dup(ossl_check_const_X509_sk_type(sk)))
|
| 102 |
+
#define sk_X509_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_sk_type(sk), ossl_check_X509_copyfunc_type(copyfunc), ossl_check_X509_freefunc_type(freefunc)))
|
| 103 |
+
#define sk_X509_set_cmp_func(sk, cmp) ((sk_X509_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_sk_type(sk), ossl_check_X509_compfunc_type(cmp)))
|
| 104 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_REVOKED, X509_REVOKED, X509_REVOKED)
|
| 105 |
+
#define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk))
|
| 106 |
+
#define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx)))
|
| 107 |
+
#define sk_X509_REVOKED_new(cmp) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new(ossl_check_X509_REVOKED_compfunc_type(cmp)))
|
| 108 |
+
#define sk_X509_REVOKED_new_null() ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_null())
|
| 109 |
+
#define sk_X509_REVOKED_new_reserve(cmp, n) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_reserve(ossl_check_X509_REVOKED_compfunc_type(cmp), (n)))
|
| 110 |
+
#define sk_X509_REVOKED_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_REVOKED_sk_type(sk), (n))
|
| 111 |
+
#define sk_X509_REVOKED_free(sk) OPENSSL_sk_free(ossl_check_X509_REVOKED_sk_type(sk))
|
| 112 |
+
#define sk_X509_REVOKED_zero(sk) OPENSSL_sk_zero(ossl_check_X509_REVOKED_sk_type(sk))
|
| 113 |
+
#define sk_X509_REVOKED_delete(sk, i) ((X509_REVOKED *)OPENSSL_sk_delete(ossl_check_X509_REVOKED_sk_type(sk), (i)))
|
| 114 |
+
#define sk_X509_REVOKED_delete_ptr(sk, ptr) ((X509_REVOKED *)OPENSSL_sk_delete_ptr(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)))
|
| 115 |
+
#define sk_X509_REVOKED_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
|
| 116 |
+
#define sk_X509_REVOKED_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
|
| 117 |
+
#define sk_X509_REVOKED_pop(sk) ((X509_REVOKED *)OPENSSL_sk_pop(ossl_check_X509_REVOKED_sk_type(sk)))
|
| 118 |
+
#define sk_X509_REVOKED_shift(sk) ((X509_REVOKED *)OPENSSL_sk_shift(ossl_check_X509_REVOKED_sk_type(sk)))
|
| 119 |
+
#define sk_X509_REVOKED_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_REVOKED_sk_type(sk),ossl_check_X509_REVOKED_freefunc_type(freefunc))
|
| 120 |
+
#define sk_X509_REVOKED_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), (idx))
|
| 121 |
+
#define sk_X509_REVOKED_set(sk, idx, ptr) ((X509_REVOKED *)OPENSSL_sk_set(ossl_check_X509_REVOKED_sk_type(sk), (idx), ossl_check_X509_REVOKED_type(ptr)))
|
| 122 |
+
#define sk_X509_REVOKED_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
|
| 123 |
+
#define sk_X509_REVOKED_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
|
| 124 |
+
#define sk_X509_REVOKED_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), pnum)
|
| 125 |
+
#define sk_X509_REVOKED_sort(sk) OPENSSL_sk_sort(ossl_check_X509_REVOKED_sk_type(sk))
|
| 126 |
+
#define sk_X509_REVOKED_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_REVOKED_sk_type(sk))
|
| 127 |
+
#define sk_X509_REVOKED_dup(sk) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_dup(ossl_check_const_X509_REVOKED_sk_type(sk)))
|
| 128 |
+
#define sk_X509_REVOKED_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_copyfunc_type(copyfunc), ossl_check_X509_REVOKED_freefunc_type(freefunc)))
|
| 129 |
+
#define sk_X509_REVOKED_set_cmp_func(sk, cmp) ((sk_X509_REVOKED_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_compfunc_type(cmp)))
|
| 130 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_CRL, X509_CRL, X509_CRL)
|
| 131 |
+
#define sk_X509_CRL_num(sk) OPENSSL_sk_num(ossl_check_const_X509_CRL_sk_type(sk))
|
| 132 |
+
#define sk_X509_CRL_value(sk, idx) ((X509_CRL *)OPENSSL_sk_value(ossl_check_const_X509_CRL_sk_type(sk), (idx)))
|
| 133 |
+
#define sk_X509_CRL_new(cmp) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new(ossl_check_X509_CRL_compfunc_type(cmp)))
|
| 134 |
+
#define sk_X509_CRL_new_null() ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_null())
|
| 135 |
+
#define sk_X509_CRL_new_reserve(cmp, n) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_reserve(ossl_check_X509_CRL_compfunc_type(cmp), (n)))
|
| 136 |
+
#define sk_X509_CRL_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_CRL_sk_type(sk), (n))
|
| 137 |
+
#define sk_X509_CRL_free(sk) OPENSSL_sk_free(ossl_check_X509_CRL_sk_type(sk))
|
| 138 |
+
#define sk_X509_CRL_zero(sk) OPENSSL_sk_zero(ossl_check_X509_CRL_sk_type(sk))
|
| 139 |
+
#define sk_X509_CRL_delete(sk, i) ((X509_CRL *)OPENSSL_sk_delete(ossl_check_X509_CRL_sk_type(sk), (i)))
|
| 140 |
+
#define sk_X509_CRL_delete_ptr(sk, ptr) ((X509_CRL *)OPENSSL_sk_delete_ptr(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)))
|
| 141 |
+
#define sk_X509_CRL_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
|
| 142 |
+
#define sk_X509_CRL_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
|
| 143 |
+
#define sk_X509_CRL_pop(sk) ((X509_CRL *)OPENSSL_sk_pop(ossl_check_X509_CRL_sk_type(sk)))
|
| 144 |
+
#define sk_X509_CRL_shift(sk) ((X509_CRL *)OPENSSL_sk_shift(ossl_check_X509_CRL_sk_type(sk)))
|
| 145 |
+
#define sk_X509_CRL_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_CRL_sk_type(sk),ossl_check_X509_CRL_freefunc_type(freefunc))
|
| 146 |
+
#define sk_X509_CRL_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), (idx))
|
| 147 |
+
#define sk_X509_CRL_set(sk, idx, ptr) ((X509_CRL *)OPENSSL_sk_set(ossl_check_X509_CRL_sk_type(sk), (idx), ossl_check_X509_CRL_type(ptr)))
|
| 148 |
+
#define sk_X509_CRL_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
|
| 149 |
+
#define sk_X509_CRL_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
|
| 150 |
+
#define sk_X509_CRL_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), pnum)
|
| 151 |
+
#define sk_X509_CRL_sort(sk) OPENSSL_sk_sort(ossl_check_X509_CRL_sk_type(sk))
|
| 152 |
+
#define sk_X509_CRL_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_CRL_sk_type(sk))
|
| 153 |
+
#define sk_X509_CRL_dup(sk) ((STACK_OF(X509_CRL) *)OPENSSL_sk_dup(ossl_check_const_X509_CRL_sk_type(sk)))
|
| 154 |
+
#define sk_X509_CRL_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_CRL) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_CRL_sk_type(sk), ossl_check_X509_CRL_copyfunc_type(copyfunc), ossl_check_X509_CRL_freefunc_type(freefunc)))
|
| 155 |
+
#define sk_X509_CRL_set_cmp_func(sk, cmp) ((sk_X509_CRL_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_compfunc_type(cmp)))
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
/* Flags for X509_get_signature_info() */
|
| 159 |
+
/* Signature info is valid */
|
| 160 |
+
# define X509_SIG_INFO_VALID 0x1
|
| 161 |
+
/* Signature is suitable for TLS use */
|
| 162 |
+
# define X509_SIG_INFO_TLS 0x2
|
| 163 |
+
|
| 164 |
+
# define X509_FILETYPE_PEM 1
|
| 165 |
+
# define X509_FILETYPE_ASN1 2
|
| 166 |
+
# define X509_FILETYPE_DEFAULT 3
|
| 167 |
+
|
| 168 |
+
/*-
|
| 169 |
+
* <https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.3>:
|
| 170 |
+
* The KeyUsage BITSTRING is treated as a little-endian integer, hence bit `0`
|
| 171 |
+
* is 0x80, while bit `7` is 0x01 (the LSB of the integer value), bit `8` is
|
| 172 |
+
* then the MSB of the second octet, or 0x8000.
|
| 173 |
+
*/
|
| 174 |
+
# define X509v3_KU_DIGITAL_SIGNATURE 0x0080 /* (0) */
|
| 175 |
+
# define X509v3_KU_NON_REPUDIATION 0x0040 /* (1) */
|
| 176 |
+
# define X509v3_KU_KEY_ENCIPHERMENT 0x0020 /* (2) */
|
| 177 |
+
# define X509v3_KU_DATA_ENCIPHERMENT 0x0010 /* (3) */
|
| 178 |
+
# define X509v3_KU_KEY_AGREEMENT 0x0008 /* (4) */
|
| 179 |
+
# define X509v3_KU_KEY_CERT_SIGN 0x0004 /* (5) */
|
| 180 |
+
# define X509v3_KU_CRL_SIGN 0x0002 /* (6) */
|
| 181 |
+
# define X509v3_KU_ENCIPHER_ONLY 0x0001 /* (7) */
|
| 182 |
+
# define X509v3_KU_DECIPHER_ONLY 0x8000 /* (8) */
|
| 183 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_4
|
| 184 |
+
# define X509v3_KU_UNDEF 0xffff /* vestigial, not used */
|
| 185 |
+
# endif
|
| 186 |
+
|
| 187 |
+
struct X509_algor_st {
|
| 188 |
+
ASN1_OBJECT *algorithm;
|
| 189 |
+
ASN1_TYPE *parameter;
|
| 190 |
+
} /* X509_ALGOR */ ;
|
| 191 |
+
|
| 192 |
+
typedef STACK_OF(X509_ALGOR) X509_ALGORS;
|
| 193 |
+
|
| 194 |
+
typedef struct X509_val_st {
|
| 195 |
+
ASN1_TIME *notBefore;
|
| 196 |
+
ASN1_TIME *notAfter;
|
| 197 |
+
} X509_VAL;
|
| 198 |
+
|
| 199 |
+
typedef struct X509_sig_st X509_SIG;
|
| 200 |
+
|
| 201 |
+
typedef struct X509_name_entry_st X509_NAME_ENTRY;
|
| 202 |
+
|
| 203 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME_ENTRY, X509_NAME_ENTRY, X509_NAME_ENTRY)
|
| 204 |
+
#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
|
| 205 |
+
#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
|
| 206 |
+
#define sk_X509_NAME_ENTRY_new(cmp) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp)))
|
| 207 |
+
#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
|
| 208 |
+
#define sk_X509_NAME_ENTRY_new_reserve(cmp, n) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp), (n)))
|
| 209 |
+
#define sk_X509_NAME_ENTRY_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_ENTRY_sk_type(sk), (n))
|
| 210 |
+
#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
|
| 211 |
+
#define sk_X509_NAME_ENTRY_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_ENTRY_sk_type(sk))
|
| 212 |
+
#define sk_X509_NAME_ENTRY_delete(sk, i) ((X509_NAME_ENTRY *)OPENSSL_sk_delete(ossl_check_X509_NAME_ENTRY_sk_type(sk), (i)))
|
| 213 |
+
#define sk_X509_NAME_ENTRY_delete_ptr(sk, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)))
|
| 214 |
+
#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
|
| 215 |
+
#define sk_X509_NAME_ENTRY_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
|
| 216 |
+
#define sk_X509_NAME_ENTRY_pop(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_pop(ossl_check_X509_NAME_ENTRY_sk_type(sk)))
|
| 217 |
+
#define sk_X509_NAME_ENTRY_shift(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_shift(ossl_check_X509_NAME_ENTRY_sk_type(sk)))
|
| 218 |
+
#define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk),ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))
|
| 219 |
+
#define sk_X509_NAME_ENTRY_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), (idx))
|
| 220 |
+
#define sk_X509_NAME_ENTRY_set(sk, idx, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_set(ossl_check_X509_NAME_ENTRY_sk_type(sk), (idx), ossl_check_X509_NAME_ENTRY_type(ptr)))
|
| 221 |
+
#define sk_X509_NAME_ENTRY_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
|
| 222 |
+
#define sk_X509_NAME_ENTRY_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
|
| 223 |
+
#define sk_X509_NAME_ENTRY_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), pnum)
|
| 224 |
+
#define sk_X509_NAME_ENTRY_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_ENTRY_sk_type(sk))
|
| 225 |
+
#define sk_X509_NAME_ENTRY_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
|
| 226 |
+
#define sk_X509_NAME_ENTRY_dup(sk) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_ENTRY_sk_type(sk)))
|
| 227 |
+
#define sk_X509_NAME_ENTRY_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_copyfunc_type(copyfunc), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc)))
|
| 228 |
+
#define sk_X509_NAME_ENTRY_set_cmp_func(sk, cmp) ((sk_X509_NAME_ENTRY_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_compfunc_type(cmp)))
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
# define X509_EX_V_NETSCAPE_HACK 0x8000
|
| 232 |
+
# define X509_EX_V_INIT 0x0001
|
| 233 |
+
typedef struct X509_extension_st X509_EXTENSION;
|
| 234 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_EXTENSION, X509_EXTENSION, X509_EXTENSION)
|
| 235 |
+
#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
|
| 236 |
+
#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
|
| 237 |
+
#define sk_X509_EXTENSION_new(cmp) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new(ossl_check_X509_EXTENSION_compfunc_type(cmp)))
|
| 238 |
+
#define sk_X509_EXTENSION_new_null() ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_null())
|
| 239 |
+
#define sk_X509_EXTENSION_new_reserve(cmp, n) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_reserve(ossl_check_X509_EXTENSION_compfunc_type(cmp), (n)))
|
| 240 |
+
#define sk_X509_EXTENSION_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_EXTENSION_sk_type(sk), (n))
|
| 241 |
+
#define sk_X509_EXTENSION_free(sk) OPENSSL_sk_free(ossl_check_X509_EXTENSION_sk_type(sk))
|
| 242 |
+
#define sk_X509_EXTENSION_zero(sk) OPENSSL_sk_zero(ossl_check_X509_EXTENSION_sk_type(sk))
|
| 243 |
+
#define sk_X509_EXTENSION_delete(sk, i) ((X509_EXTENSION *)OPENSSL_sk_delete(ossl_check_X509_EXTENSION_sk_type(sk), (i)))
|
| 244 |
+
#define sk_X509_EXTENSION_delete_ptr(sk, ptr) ((X509_EXTENSION *)OPENSSL_sk_delete_ptr(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)))
|
| 245 |
+
#define sk_X509_EXTENSION_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
|
| 246 |
+
#define sk_X509_EXTENSION_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
|
| 247 |
+
#define sk_X509_EXTENSION_pop(sk) ((X509_EXTENSION *)OPENSSL_sk_pop(ossl_check_X509_EXTENSION_sk_type(sk)))
|
| 248 |
+
#define sk_X509_EXTENSION_shift(sk) ((X509_EXTENSION *)OPENSSL_sk_shift(ossl_check_X509_EXTENSION_sk_type(sk)))
|
| 249 |
+
#define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk),ossl_check_X509_EXTENSION_freefunc_type(freefunc))
|
| 250 |
+
#define sk_X509_EXTENSION_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), (idx))
|
| 251 |
+
#define sk_X509_EXTENSION_set(sk, idx, ptr) ((X509_EXTENSION *)OPENSSL_sk_set(ossl_check_X509_EXTENSION_sk_type(sk), (idx), ossl_check_X509_EXTENSION_type(ptr)))
|
| 252 |
+
#define sk_X509_EXTENSION_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
|
| 253 |
+
#define sk_X509_EXTENSION_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
|
| 254 |
+
#define sk_X509_EXTENSION_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), pnum)
|
| 255 |
+
#define sk_X509_EXTENSION_sort(sk) OPENSSL_sk_sort(ossl_check_X509_EXTENSION_sk_type(sk))
|
| 256 |
+
#define sk_X509_EXTENSION_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_EXTENSION_sk_type(sk))
|
| 257 |
+
#define sk_X509_EXTENSION_dup(sk) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_dup(ossl_check_const_X509_EXTENSION_sk_type(sk)))
|
| 258 |
+
#define sk_X509_EXTENSION_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_copyfunc_type(copyfunc), ossl_check_X509_EXTENSION_freefunc_type(freefunc)))
|
| 259 |
+
#define sk_X509_EXTENSION_set_cmp_func(sk, cmp) ((sk_X509_EXTENSION_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_compfunc_type(cmp)))
|
| 260 |
+
|
| 261 |
+
typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
|
| 262 |
+
typedef struct x509_attributes_st X509_ATTRIBUTE;
|
| 263 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_ATTRIBUTE, X509_ATTRIBUTE, X509_ATTRIBUTE)
|
| 264 |
+
#define sk_X509_ATTRIBUTE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))
|
| 265 |
+
#define sk_X509_ATTRIBUTE_value(sk, idx) ((X509_ATTRIBUTE *)OPENSSL_sk_value(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), (idx)))
|
| 266 |
+
#define sk_X509_ATTRIBUTE_new(cmp) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp)))
|
| 267 |
+
#define sk_X509_ATTRIBUTE_new_null() ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_null())
|
| 268 |
+
#define sk_X509_ATTRIBUTE_new_reserve(cmp, n) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_reserve(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp), (n)))
|
| 269 |
+
#define sk_X509_ATTRIBUTE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ATTRIBUTE_sk_type(sk), (n))
|
| 270 |
+
#define sk_X509_ATTRIBUTE_free(sk) OPENSSL_sk_free(ossl_check_X509_ATTRIBUTE_sk_type(sk))
|
| 271 |
+
#define sk_X509_ATTRIBUTE_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ATTRIBUTE_sk_type(sk))
|
| 272 |
+
#define sk_X509_ATTRIBUTE_delete(sk, i) ((X509_ATTRIBUTE *)OPENSSL_sk_delete(ossl_check_X509_ATTRIBUTE_sk_type(sk), (i)))
|
| 273 |
+
#define sk_X509_ATTRIBUTE_delete_ptr(sk, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_delete_ptr(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)))
|
| 274 |
+
#define sk_X509_ATTRIBUTE_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
|
| 275 |
+
#define sk_X509_ATTRIBUTE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
|
| 276 |
+
#define sk_X509_ATTRIBUTE_pop(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_pop(ossl_check_X509_ATTRIBUTE_sk_type(sk)))
|
| 277 |
+
#define sk_X509_ATTRIBUTE_shift(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_shift(ossl_check_X509_ATTRIBUTE_sk_type(sk)))
|
| 278 |
+
#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk),ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))
|
| 279 |
+
#define sk_X509_ATTRIBUTE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), (idx))
|
| 280 |
+
#define sk_X509_ATTRIBUTE_set(sk, idx, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_set(ossl_check_X509_ATTRIBUTE_sk_type(sk), (idx), ossl_check_X509_ATTRIBUTE_type(ptr)))
|
| 281 |
+
#define sk_X509_ATTRIBUTE_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
|
| 282 |
+
#define sk_X509_ATTRIBUTE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
|
| 283 |
+
#define sk_X509_ATTRIBUTE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), pnum)
|
| 284 |
+
#define sk_X509_ATTRIBUTE_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ATTRIBUTE_sk_type(sk))
|
| 285 |
+
#define sk_X509_ATTRIBUTE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))
|
| 286 |
+
#define sk_X509_ATTRIBUTE_dup(sk) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_dup(ossl_check_const_X509_ATTRIBUTE_sk_type(sk)))
|
| 287 |
+
#define sk_X509_ATTRIBUTE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_copyfunc_type(copyfunc), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc)))
|
| 288 |
+
#define sk_X509_ATTRIBUTE_set_cmp_func(sk, cmp) ((sk_X509_ATTRIBUTE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_compfunc_type(cmp)))
|
| 289 |
+
|
| 290 |
+
typedef struct X509_req_info_st X509_REQ_INFO;
|
| 291 |
+
typedef struct X509_req_st X509_REQ;
|
| 292 |
+
typedef struct x509_cert_aux_st X509_CERT_AUX;
|
| 293 |
+
typedef struct x509_cinf_st X509_CINF;
|
| 294 |
+
|
| 295 |
+
/* Flags for X509_print_ex() */
|
| 296 |
+
|
| 297 |
+
# define X509_FLAG_COMPAT 0
|
| 298 |
+
# define X509_FLAG_NO_HEADER 1L
|
| 299 |
+
# define X509_FLAG_NO_VERSION (1L << 1)
|
| 300 |
+
# define X509_FLAG_NO_SERIAL (1L << 2)
|
| 301 |
+
# define X509_FLAG_NO_SIGNAME (1L << 3)
|
| 302 |
+
# define X509_FLAG_NO_ISSUER (1L << 4)
|
| 303 |
+
# define X509_FLAG_NO_VALIDITY (1L << 5)
|
| 304 |
+
# define X509_FLAG_NO_SUBJECT (1L << 6)
|
| 305 |
+
# define X509_FLAG_NO_PUBKEY (1L << 7)
|
| 306 |
+
# define X509_FLAG_NO_EXTENSIONS (1L << 8)
|
| 307 |
+
# define X509_FLAG_NO_SIGDUMP (1L << 9)
|
| 308 |
+
# define X509_FLAG_NO_AUX (1L << 10)
|
| 309 |
+
# define X509_FLAG_NO_ATTRIBUTES (1L << 11)
|
| 310 |
+
# define X509_FLAG_NO_IDS (1L << 12)
|
| 311 |
+
# define X509_FLAG_EXTENSIONS_ONLY_KID (1L << 13)
|
| 312 |
+
|
| 313 |
+
/* Flags specific to X509_NAME_print_ex() */
|
| 314 |
+
|
| 315 |
+
/* The field separator information */
|
| 316 |
+
|
| 317 |
+
# define XN_FLAG_SEP_MASK (0xf << 16)
|
| 318 |
+
|
| 319 |
+
# define XN_FLAG_COMPAT 0/* Traditional; use old X509_NAME_print */
|
| 320 |
+
# define XN_FLAG_SEP_COMMA_PLUS (1 << 16)/* RFC2253 ,+ */
|
| 321 |
+
# define XN_FLAG_SEP_CPLUS_SPC (2 << 16)/* ,+ spaced: more readable */
|
| 322 |
+
# define XN_FLAG_SEP_SPLUS_SPC (3 << 16)/* ;+ spaced */
|
| 323 |
+
# define XN_FLAG_SEP_MULTILINE (4 << 16)/* One line per field */
|
| 324 |
+
|
| 325 |
+
# define XN_FLAG_DN_REV (1 << 20)/* Reverse DN order */
|
| 326 |
+
|
| 327 |
+
/* How the field name is shown */
|
| 328 |
+
|
| 329 |
+
# define XN_FLAG_FN_MASK (0x3 << 21)
|
| 330 |
+
|
| 331 |
+
# define XN_FLAG_FN_SN 0/* Object short name */
|
| 332 |
+
# define XN_FLAG_FN_LN (1 << 21)/* Object long name */
|
| 333 |
+
# define XN_FLAG_FN_OID (2 << 21)/* Always use OIDs */
|
| 334 |
+
# define XN_FLAG_FN_NONE (3 << 21)/* No field names */
|
| 335 |
+
|
| 336 |
+
# define XN_FLAG_SPC_EQ (1 << 23)/* Put spaces round '=' */
|
| 337 |
+
|
| 338 |
+
/*
|
| 339 |
+
* This determines if we dump fields we don't recognise: RFC2253 requires
|
| 340 |
+
* this.
|
| 341 |
+
*/
|
| 342 |
+
|
| 343 |
+
# define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
|
| 344 |
+
|
| 345 |
+
# define XN_FLAG_FN_ALIGN (1 << 25)/* Align field names to 20
|
| 346 |
+
* characters */
|
| 347 |
+
|
| 348 |
+
/* Complete set of RFC2253 flags */
|
| 349 |
+
|
| 350 |
+
# define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
|
| 351 |
+
XN_FLAG_SEP_COMMA_PLUS | \
|
| 352 |
+
XN_FLAG_DN_REV | \
|
| 353 |
+
XN_FLAG_FN_SN | \
|
| 354 |
+
XN_FLAG_DUMP_UNKNOWN_FIELDS)
|
| 355 |
+
|
| 356 |
+
/* readable oneline form */
|
| 357 |
+
|
| 358 |
+
# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
|
| 359 |
+
ASN1_STRFLGS_ESC_QUOTE | \
|
| 360 |
+
XN_FLAG_SEP_CPLUS_SPC | \
|
| 361 |
+
XN_FLAG_SPC_EQ | \
|
| 362 |
+
XN_FLAG_FN_SN)
|
| 363 |
+
|
| 364 |
+
/* readable multiline form */
|
| 365 |
+
|
| 366 |
+
# define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
|
| 367 |
+
ASN1_STRFLGS_ESC_MSB | \
|
| 368 |
+
XN_FLAG_SEP_MULTILINE | \
|
| 369 |
+
XN_FLAG_SPC_EQ | \
|
| 370 |
+
XN_FLAG_FN_LN | \
|
| 371 |
+
XN_FLAG_FN_ALIGN)
|
| 372 |
+
|
| 373 |
+
typedef struct X509_crl_info_st X509_CRL_INFO;
|
| 374 |
+
|
| 375 |
+
typedef struct private_key_st {
|
| 376 |
+
int version;
|
| 377 |
+
/* The PKCS#8 data types */
|
| 378 |
+
X509_ALGOR *enc_algor;
|
| 379 |
+
ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */
|
| 380 |
+
/* When decrypted, the following will not be NULL */
|
| 381 |
+
EVP_PKEY *dec_pkey;
|
| 382 |
+
/* used to encrypt and decrypt */
|
| 383 |
+
int key_length;
|
| 384 |
+
char *key_data;
|
| 385 |
+
int key_free; /* true if we should auto free key_data */
|
| 386 |
+
/* expanded version of 'enc_algor' */
|
| 387 |
+
EVP_CIPHER_INFO cipher;
|
| 388 |
+
} X509_PKEY;
|
| 389 |
+
|
| 390 |
+
typedef struct X509_info_st {
|
| 391 |
+
X509 *x509;
|
| 392 |
+
X509_CRL *crl;
|
| 393 |
+
X509_PKEY *x_pkey;
|
| 394 |
+
EVP_CIPHER_INFO enc_cipher;
|
| 395 |
+
int enc_len;
|
| 396 |
+
char *enc_data;
|
| 397 |
+
} X509_INFO;
|
| 398 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_INFO, X509_INFO, X509_INFO)
|
| 399 |
+
#define sk_X509_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_X509_INFO_sk_type(sk))
|
| 400 |
+
#define sk_X509_INFO_value(sk, idx) ((X509_INFO *)OPENSSL_sk_value(ossl_check_const_X509_INFO_sk_type(sk), (idx)))
|
| 401 |
+
#define sk_X509_INFO_new(cmp) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new(ossl_check_X509_INFO_compfunc_type(cmp)))
|
| 402 |
+
#define sk_X509_INFO_new_null() ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_null())
|
| 403 |
+
#define sk_X509_INFO_new_reserve(cmp, n) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_reserve(ossl_check_X509_INFO_compfunc_type(cmp), (n)))
|
| 404 |
+
#define sk_X509_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_INFO_sk_type(sk), (n))
|
| 405 |
+
#define sk_X509_INFO_free(sk) OPENSSL_sk_free(ossl_check_X509_INFO_sk_type(sk))
|
| 406 |
+
#define sk_X509_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_X509_INFO_sk_type(sk))
|
| 407 |
+
#define sk_X509_INFO_delete(sk, i) ((X509_INFO *)OPENSSL_sk_delete(ossl_check_X509_INFO_sk_type(sk), (i)))
|
| 408 |
+
#define sk_X509_INFO_delete_ptr(sk, ptr) ((X509_INFO *)OPENSSL_sk_delete_ptr(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)))
|
| 409 |
+
#define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
|
| 410 |
+
#define sk_X509_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
|
| 411 |
+
#define sk_X509_INFO_pop(sk) ((X509_INFO *)OPENSSL_sk_pop(ossl_check_X509_INFO_sk_type(sk)))
|
| 412 |
+
#define sk_X509_INFO_shift(sk) ((X509_INFO *)OPENSSL_sk_shift(ossl_check_X509_INFO_sk_type(sk)))
|
| 413 |
+
#define sk_X509_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_INFO_sk_type(sk),ossl_check_X509_INFO_freefunc_type(freefunc))
|
| 414 |
+
#define sk_X509_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), (idx))
|
| 415 |
+
#define sk_X509_INFO_set(sk, idx, ptr) ((X509_INFO *)OPENSSL_sk_set(ossl_check_X509_INFO_sk_type(sk), (idx), ossl_check_X509_INFO_type(ptr)))
|
| 416 |
+
#define sk_X509_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
|
| 417 |
+
#define sk_X509_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
|
| 418 |
+
#define sk_X509_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), pnum)
|
| 419 |
+
#define sk_X509_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_X509_INFO_sk_type(sk))
|
| 420 |
+
#define sk_X509_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_INFO_sk_type(sk))
|
| 421 |
+
#define sk_X509_INFO_dup(sk) ((STACK_OF(X509_INFO) *)OPENSSL_sk_dup(ossl_check_const_X509_INFO_sk_type(sk)))
|
| 422 |
+
#define sk_X509_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_INFO_sk_type(sk), ossl_check_X509_INFO_copyfunc_type(copyfunc), ossl_check_X509_INFO_freefunc_type(freefunc)))
|
| 423 |
+
#define sk_X509_INFO_set_cmp_func(sk, cmp) ((sk_X509_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_compfunc_type(cmp)))
|
| 424 |
+
|
| 425 |
+
|
| 426 |
+
/*
|
| 427 |
+
* The next 2 structures and their 8 routines are used to manipulate Netscape's
|
| 428 |
+
* spki structures - useful if you are writing a CA web page
|
| 429 |
+
*/
|
| 430 |
+
typedef struct Netscape_spkac_st {
|
| 431 |
+
X509_PUBKEY *pubkey;
|
| 432 |
+
ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */
|
| 433 |
+
} NETSCAPE_SPKAC;
|
| 434 |
+
|
| 435 |
+
typedef struct Netscape_spki_st {
|
| 436 |
+
NETSCAPE_SPKAC *spkac; /* signed public key and challenge */
|
| 437 |
+
X509_ALGOR sig_algor;
|
| 438 |
+
ASN1_BIT_STRING *signature;
|
| 439 |
+
} NETSCAPE_SPKI;
|
| 440 |
+
|
| 441 |
+
/* Netscape certificate sequence structure */
|
| 442 |
+
typedef struct Netscape_certificate_sequence {
|
| 443 |
+
ASN1_OBJECT *type;
|
| 444 |
+
STACK_OF(X509) *certs;
|
| 445 |
+
} NETSCAPE_CERT_SEQUENCE;
|
| 446 |
+
|
| 447 |
+
/*- Unused (and iv length is wrong)
|
| 448 |
+
typedef struct CBCParameter_st
|
| 449 |
+
{
|
| 450 |
+
unsigned char iv[8];
|
| 451 |
+
} CBC_PARAM;
|
| 452 |
+
*/
|
| 453 |
+
|
| 454 |
+
/* Password based encryption structure */
|
| 455 |
+
|
| 456 |
+
typedef struct PBEPARAM_st {
|
| 457 |
+
ASN1_OCTET_STRING *salt;
|
| 458 |
+
ASN1_INTEGER *iter;
|
| 459 |
+
} PBEPARAM;
|
| 460 |
+
|
| 461 |
+
/* Password based encryption V2 structures */
|
| 462 |
+
|
| 463 |
+
typedef struct PBE2PARAM_st {
|
| 464 |
+
X509_ALGOR *keyfunc;
|
| 465 |
+
X509_ALGOR *encryption;
|
| 466 |
+
} PBE2PARAM;
|
| 467 |
+
|
| 468 |
+
typedef struct PBKDF2PARAM_st {
|
| 469 |
+
/* Usually OCTET STRING but could be anything */
|
| 470 |
+
ASN1_TYPE *salt;
|
| 471 |
+
ASN1_INTEGER *iter;
|
| 472 |
+
ASN1_INTEGER *keylength;
|
| 473 |
+
X509_ALGOR *prf;
|
| 474 |
+
} PBKDF2PARAM;
|
| 475 |
+
|
| 476 |
+
typedef struct {
|
| 477 |
+
X509_ALGOR *keyDerivationFunc;
|
| 478 |
+
X509_ALGOR *messageAuthScheme;
|
| 479 |
+
} PBMAC1PARAM;
|
| 480 |
+
|
| 481 |
+
# ifndef OPENSSL_NO_SCRYPT
|
| 482 |
+
typedef struct SCRYPT_PARAMS_st {
|
| 483 |
+
ASN1_OCTET_STRING *salt;
|
| 484 |
+
ASN1_INTEGER *costParameter;
|
| 485 |
+
ASN1_INTEGER *blockSize;
|
| 486 |
+
ASN1_INTEGER *parallelizationParameter;
|
| 487 |
+
ASN1_INTEGER *keyLength;
|
| 488 |
+
} SCRYPT_PARAMS;
|
| 489 |
+
# endif
|
| 490 |
+
|
| 491 |
+
#ifdef __cplusplus
|
| 492 |
+
}
|
| 493 |
+
#endif
|
| 494 |
+
|
| 495 |
+
# include <openssl/x509_vfy.h>
|
| 496 |
+
# include <openssl/pkcs7.h>
|
| 497 |
+
|
| 498 |
+
#ifdef __cplusplus
|
| 499 |
+
extern "C" {
|
| 500 |
+
#endif
|
| 501 |
+
|
| 502 |
+
# define X509_EXT_PACK_UNKNOWN 1
|
| 503 |
+
# define X509_EXT_PACK_STRING 2
|
| 504 |
+
|
| 505 |
+
# define X509_extract_key(x) X509_get_pubkey(x)/*****/
|
| 506 |
+
# define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
|
| 507 |
+
# define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
|
| 508 |
+
|
| 509 |
+
void X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
|
| 510 |
+
X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl),
|
| 511 |
+
int (*crl_free) (X509_CRL *crl),
|
| 512 |
+
int (*crl_lookup) (X509_CRL *crl,
|
| 513 |
+
X509_REVOKED **ret,
|
| 514 |
+
const
|
| 515 |
+
ASN1_INTEGER *serial,
|
| 516 |
+
const
|
| 517 |
+
X509_NAME *issuer),
|
| 518 |
+
int (*crl_verify) (X509_CRL *crl,
|
| 519 |
+
EVP_PKEY *pk));
|
| 520 |
+
void X509_CRL_METHOD_free(X509_CRL_METHOD *m);
|
| 521 |
+
|
| 522 |
+
void X509_CRL_set_meth_data(X509_CRL *crl, void *dat);
|
| 523 |
+
void *X509_CRL_get_meth_data(X509_CRL *crl);
|
| 524 |
+
|
| 525 |
+
const char *X509_verify_cert_error_string(long n);
|
| 526 |
+
|
| 527 |
+
int X509_verify(X509 *a, EVP_PKEY *r);
|
| 528 |
+
int X509_self_signed(X509 *cert, int verify_signature);
|
| 529 |
+
|
| 530 |
+
int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OSSL_LIB_CTX *libctx,
|
| 531 |
+
const char *propq);
|
| 532 |
+
int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
|
| 533 |
+
int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
|
| 534 |
+
int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
|
| 535 |
+
|
| 536 |
+
NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len);
|
| 537 |
+
char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
|
| 538 |
+
EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
|
| 539 |
+
int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
|
| 540 |
+
|
| 541 |
+
int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
|
| 542 |
+
|
| 543 |
+
int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent);
|
| 544 |
+
int X509_signature_print(BIO *bp, const X509_ALGOR *alg,
|
| 545 |
+
const ASN1_STRING *sig);
|
| 546 |
+
|
| 547 |
+
int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 548 |
+
int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
|
| 549 |
+
int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 550 |
+
int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
|
| 551 |
+
int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 552 |
+
int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
|
| 553 |
+
int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 554 |
+
|
| 555 |
+
int X509_pubkey_digest(const X509 *data, const EVP_MD *type,
|
| 556 |
+
unsigned char *md, unsigned int *len);
|
| 557 |
+
int X509_digest(const X509 *data, const EVP_MD *type,
|
| 558 |
+
unsigned char *md, unsigned int *len);
|
| 559 |
+
ASN1_OCTET_STRING *X509_digest_sig(const X509 *cert,
|
| 560 |
+
EVP_MD **md_used, int *md_is_fallback);
|
| 561 |
+
int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type,
|
| 562 |
+
unsigned char *md, unsigned int *len);
|
| 563 |
+
int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type,
|
| 564 |
+
unsigned char *md, unsigned int *len);
|
| 565 |
+
int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type,
|
| 566 |
+
unsigned char *md, unsigned int *len);
|
| 567 |
+
|
| 568 |
+
X509 *X509_load_http(const char *url, BIO *bio, BIO *rbio, int timeout);
|
| 569 |
+
X509_CRL *X509_CRL_load_http(const char *url, BIO *bio, BIO *rbio, int timeout);
|
| 570 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 571 |
+
# include <openssl/http.h> /* OSSL_HTTP_REQ_CTX_nbio_d2i */
|
| 572 |
+
# define X509_http_nbio(rctx, pcert) \
|
| 573 |
+
OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcert, ASN1_ITEM_rptr(X509))
|
| 574 |
+
# define X509_CRL_http_nbio(rctx, pcrl) \
|
| 575 |
+
OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcrl, ASN1_ITEM_rptr(X509_CRL))
|
| 576 |
+
# endif
|
| 577 |
+
|
| 578 |
+
# ifndef OPENSSL_NO_STDIO
|
| 579 |
+
X509 *d2i_X509_fp(FILE *fp, X509 **x509);
|
| 580 |
+
int i2d_X509_fp(FILE *fp, const X509 *x509);
|
| 581 |
+
X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl);
|
| 582 |
+
int i2d_X509_CRL_fp(FILE *fp, const X509_CRL *crl);
|
| 583 |
+
X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req);
|
| 584 |
+
int i2d_X509_REQ_fp(FILE *fp, const X509_REQ *req);
|
| 585 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 586 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa);
|
| 587 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSAPrivateKey_fp(FILE *fp, const RSA *rsa);
|
| 588 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa);
|
| 589 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSAPublicKey_fp(FILE *fp, const RSA *rsa);
|
| 590 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa);
|
| 591 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSA_PUBKEY_fp(FILE *fp, const RSA *rsa);
|
| 592 |
+
# endif
|
| 593 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 594 |
+
# ifndef OPENSSL_NO_DSA
|
| 595 |
+
OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
|
| 596 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_DSA_PUBKEY_fp(FILE *fp, const DSA *dsa);
|
| 597 |
+
OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
|
| 598 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_DSAPrivateKey_fp(FILE *fp, const DSA *dsa);
|
| 599 |
+
# endif
|
| 600 |
+
# endif
|
| 601 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 602 |
+
# ifndef OPENSSL_NO_EC
|
| 603 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey);
|
| 604 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_EC_PUBKEY_fp(FILE *fp, const EC_KEY *eckey);
|
| 605 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey);
|
| 606 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey_fp(FILE *fp, const EC_KEY *eckey);
|
| 607 |
+
# endif /* OPENSSL_NO_EC */
|
| 608 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 609 |
+
X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8);
|
| 610 |
+
int i2d_PKCS8_fp(FILE *fp, const X509_SIG *p8);
|
| 611 |
+
X509_PUBKEY *d2i_X509_PUBKEY_fp(FILE *fp, X509_PUBKEY **xpk);
|
| 612 |
+
int i2d_X509_PUBKEY_fp(FILE *fp, const X509_PUBKEY *xpk);
|
| 613 |
+
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
|
| 614 |
+
PKCS8_PRIV_KEY_INFO **p8inf);
|
| 615 |
+
int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, const PKCS8_PRIV_KEY_INFO *p8inf);
|
| 616 |
+
int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, const EVP_PKEY *key);
|
| 617 |
+
int i2d_PrivateKey_fp(FILE *fp, const EVP_PKEY *pkey);
|
| 618 |
+
EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
|
| 619 |
+
const char *propq);
|
| 620 |
+
EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
|
| 621 |
+
int i2d_PUBKEY_fp(FILE *fp, const EVP_PKEY *pkey);
|
| 622 |
+
EVP_PKEY *d2i_PUBKEY_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
|
| 623 |
+
const char *propq);
|
| 624 |
+
EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
|
| 625 |
+
# endif
|
| 626 |
+
|
| 627 |
+
X509 *d2i_X509_bio(BIO *bp, X509 **x509);
|
| 628 |
+
int i2d_X509_bio(BIO *bp, const X509 *x509);
|
| 629 |
+
X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl);
|
| 630 |
+
int i2d_X509_CRL_bio(BIO *bp, const X509_CRL *crl);
|
| 631 |
+
X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req);
|
| 632 |
+
int i2d_X509_REQ_bio(BIO *bp, const X509_REQ *req);
|
| 633 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 634 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa);
|
| 635 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSAPrivateKey_bio(BIO *bp, const RSA *rsa);
|
| 636 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa);
|
| 637 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSAPublicKey_bio(BIO *bp, const RSA *rsa);
|
| 638 |
+
OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa);
|
| 639 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_RSA_PUBKEY_bio(BIO *bp, const RSA *rsa);
|
| 640 |
+
# endif
|
| 641 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 642 |
+
# ifndef OPENSSL_NO_DSA
|
| 643 |
+
OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
|
| 644 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_DSA_PUBKEY_bio(BIO *bp, const DSA *dsa);
|
| 645 |
+
OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
|
| 646 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_DSAPrivateKey_bio(BIO *bp, const DSA *dsa);
|
| 647 |
+
# endif
|
| 648 |
+
# endif
|
| 649 |
+
|
| 650 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 651 |
+
# ifndef OPENSSL_NO_EC
|
| 652 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey);
|
| 653 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_EC_PUBKEY_bio(BIO *bp, const EC_KEY *eckey);
|
| 654 |
+
OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey);
|
| 655 |
+
OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey_bio(BIO *bp, const EC_KEY *eckey);
|
| 656 |
+
# endif /* OPENSSL_NO_EC */
|
| 657 |
+
# endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
| 658 |
+
|
| 659 |
+
X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8);
|
| 660 |
+
int i2d_PKCS8_bio(BIO *bp, const X509_SIG *p8);
|
| 661 |
+
X509_PUBKEY *d2i_X509_PUBKEY_bio(BIO *bp, X509_PUBKEY **xpk);
|
| 662 |
+
int i2d_X509_PUBKEY_bio(BIO *bp, const X509_PUBKEY *xpk);
|
| 663 |
+
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
|
| 664 |
+
PKCS8_PRIV_KEY_INFO **p8inf);
|
| 665 |
+
int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, const PKCS8_PRIV_KEY_INFO *p8inf);
|
| 666 |
+
int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, const EVP_PKEY *key);
|
| 667 |
+
int i2d_PrivateKey_bio(BIO *bp, const EVP_PKEY *pkey);
|
| 668 |
+
EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
|
| 669 |
+
const char *propq);
|
| 670 |
+
EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
|
| 671 |
+
int i2d_PUBKEY_bio(BIO *bp, const EVP_PKEY *pkey);
|
| 672 |
+
EVP_PKEY *d2i_PUBKEY_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
|
| 673 |
+
const char *propq);
|
| 674 |
+
EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
|
| 675 |
+
|
| 676 |
+
DECLARE_ASN1_DUP_FUNCTION(X509)
|
| 677 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_ALGOR)
|
| 678 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_ATTRIBUTE)
|
| 679 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_CRL)
|
| 680 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_EXTENSION)
|
| 681 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_PUBKEY)
|
| 682 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_REQ)
|
| 683 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_REVOKED)
|
| 684 |
+
int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype,
|
| 685 |
+
void *pval);
|
| 686 |
+
void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype,
|
| 687 |
+
const void **ppval, const X509_ALGOR *algor);
|
| 688 |
+
void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
|
| 689 |
+
int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
|
| 690 |
+
int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src);
|
| 691 |
+
|
| 692 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_NAME)
|
| 693 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_NAME_ENTRY)
|
| 694 |
+
|
| 695 |
+
int X509_cmp_time(const ASN1_TIME *s, time_t *t);
|
| 696 |
+
int X509_cmp_current_time(const ASN1_TIME *s);
|
| 697 |
+
int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm,
|
| 698 |
+
const ASN1_TIME *start, const ASN1_TIME *end);
|
| 699 |
+
ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
|
| 700 |
+
ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,
|
| 701 |
+
int offset_day, long offset_sec, time_t *t);
|
| 702 |
+
ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);
|
| 703 |
+
|
| 704 |
+
const char *X509_get_default_cert_area(void);
|
| 705 |
+
const char *X509_get_default_cert_dir(void);
|
| 706 |
+
const char *X509_get_default_cert_file(void);
|
| 707 |
+
const char *X509_get_default_cert_dir_env(void);
|
| 708 |
+
const char *X509_get_default_cert_file_env(void);
|
| 709 |
+
const char *X509_get_default_private_dir(void);
|
| 710 |
+
|
| 711 |
+
X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 712 |
+
X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey);
|
| 713 |
+
|
| 714 |
+
DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
|
| 715 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
|
| 716 |
+
DECLARE_ASN1_FUNCTIONS(X509_VAL)
|
| 717 |
+
|
| 718 |
+
DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
|
| 719 |
+
|
| 720 |
+
X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 721 |
+
int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
|
| 722 |
+
EVP_PKEY *X509_PUBKEY_get0(const X509_PUBKEY *key);
|
| 723 |
+
EVP_PKEY *X509_PUBKEY_get(const X509_PUBKEY *key);
|
| 724 |
+
int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain);
|
| 725 |
+
long X509_get_pathlen(X509 *x);
|
| 726 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only(EVP_PKEY, PUBKEY)
|
| 727 |
+
EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length,
|
| 728 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 729 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 730 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,RSA, RSA_PUBKEY)
|
| 731 |
+
# endif
|
| 732 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 733 |
+
# ifndef OPENSSL_NO_DSA
|
| 734 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,DSA, DSA_PUBKEY)
|
| 735 |
+
# endif
|
| 736 |
+
# endif
|
| 737 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 738 |
+
# ifndef OPENSSL_NO_EC
|
| 739 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, EC_KEY, EC_PUBKEY)
|
| 740 |
+
# endif
|
| 741 |
+
# endif
|
| 742 |
+
|
| 743 |
+
DECLARE_ASN1_FUNCTIONS(X509_SIG)
|
| 744 |
+
void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg,
|
| 745 |
+
const ASN1_OCTET_STRING **pdigest);
|
| 746 |
+
void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg,
|
| 747 |
+
ASN1_OCTET_STRING **pdigest);
|
| 748 |
+
|
| 749 |
+
DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)
|
| 750 |
+
DECLARE_ASN1_FUNCTIONS(X509_REQ)
|
| 751 |
+
X509_REQ *X509_REQ_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 752 |
+
|
| 753 |
+
DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
|
| 754 |
+
X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
|
| 755 |
+
|
| 756 |
+
DECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
|
| 757 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS)
|
| 758 |
+
|
| 759 |
+
DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
|
| 760 |
+
|
| 761 |
+
DECLARE_ASN1_FUNCTIONS(X509_NAME)
|
| 762 |
+
|
| 763 |
+
int X509_NAME_set(X509_NAME **xn, const X509_NAME *name);
|
| 764 |
+
|
| 765 |
+
DECLARE_ASN1_FUNCTIONS(X509_CINF)
|
| 766 |
+
DECLARE_ASN1_FUNCTIONS(X509)
|
| 767 |
+
X509 *X509_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 768 |
+
DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
|
| 769 |
+
|
| 770 |
+
#define X509_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 771 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef)
|
| 772 |
+
int X509_set_ex_data(X509 *r, int idx, void *arg);
|
| 773 |
+
void *X509_get_ex_data(const X509 *r, int idx);
|
| 774 |
+
DECLARE_ASN1_ENCODE_FUNCTIONS_only(X509,X509_AUX)
|
| 775 |
+
|
| 776 |
+
int i2d_re_X509_tbs(X509 *x, unsigned char **pp);
|
| 777 |
+
|
| 778 |
+
int X509_SIG_INFO_get(const X509_SIG_INFO *siginf, int *mdnid, int *pknid,
|
| 779 |
+
int *secbits, uint32_t *flags);
|
| 780 |
+
void X509_SIG_INFO_set(X509_SIG_INFO *siginf, int mdnid, int pknid,
|
| 781 |
+
int secbits, uint32_t flags);
|
| 782 |
+
|
| 783 |
+
int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits,
|
| 784 |
+
uint32_t *flags);
|
| 785 |
+
|
| 786 |
+
void X509_get0_signature(const ASN1_BIT_STRING **psig,
|
| 787 |
+
const X509_ALGOR **palg, const X509 *x);
|
| 788 |
+
int X509_get_signature_nid(const X509 *x);
|
| 789 |
+
|
| 790 |
+
void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *d_id);
|
| 791 |
+
ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x);
|
| 792 |
+
void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *d_id);
|
| 793 |
+
ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x);
|
| 794 |
+
|
| 795 |
+
int X509_alias_set1(X509 *x, const unsigned char *name, int len);
|
| 796 |
+
int X509_keyid_set1(X509 *x, const unsigned char *id, int len);
|
| 797 |
+
unsigned char *X509_alias_get0(X509 *x, int *len);
|
| 798 |
+
unsigned char *X509_keyid_get0(X509 *x, int *len);
|
| 799 |
+
|
| 800 |
+
DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
|
| 801 |
+
DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
|
| 802 |
+
DECLARE_ASN1_FUNCTIONS(X509_CRL)
|
| 803 |
+
X509_CRL *X509_CRL_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 804 |
+
|
| 805 |
+
int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
|
| 806 |
+
int X509_CRL_get0_by_serial(X509_CRL *crl,
|
| 807 |
+
X509_REVOKED **ret, const ASN1_INTEGER *serial);
|
| 808 |
+
int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
|
| 809 |
+
|
| 810 |
+
X509_PKEY *X509_PKEY_new(void);
|
| 811 |
+
void X509_PKEY_free(X509_PKEY *a);
|
| 812 |
+
|
| 813 |
+
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
|
| 814 |
+
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
|
| 815 |
+
DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
|
| 816 |
+
|
| 817 |
+
X509_INFO *X509_INFO_new(void);
|
| 818 |
+
void X509_INFO_free(X509_INFO *a);
|
| 819 |
+
char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size);
|
| 820 |
+
|
| 821 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 822 |
+
OSSL_DEPRECATEDIN_3_0
|
| 823 |
+
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
|
| 824 |
+
ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey);
|
| 825 |
+
OSSL_DEPRECATEDIN_3_0
|
| 826 |
+
int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
|
| 827 |
+
unsigned char *md, unsigned int *len);
|
| 828 |
+
OSSL_DEPRECATEDIN_3_0
|
| 829 |
+
int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
| 830 |
+
ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey,
|
| 831 |
+
const EVP_MD *type);
|
| 832 |
+
#endif
|
| 833 |
+
int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data,
|
| 834 |
+
unsigned char *md, unsigned int *len);
|
| 835 |
+
int ASN1_item_verify(const ASN1_ITEM *it, const X509_ALGOR *alg,
|
| 836 |
+
const ASN1_BIT_STRING *signature, const void *data,
|
| 837 |
+
EVP_PKEY *pkey);
|
| 838 |
+
int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
|
| 839 |
+
const ASN1_BIT_STRING *signature, const void *data,
|
| 840 |
+
EVP_MD_CTX *ctx);
|
| 841 |
+
int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
| 842 |
+
ASN1_BIT_STRING *signature, const void *data,
|
| 843 |
+
EVP_PKEY *pkey, const EVP_MD *md);
|
| 844 |
+
int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
|
| 845 |
+
X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
|
| 846 |
+
const void *data, EVP_MD_CTX *ctx);
|
| 847 |
+
|
| 848 |
+
#define X509_VERSION_1 0
|
| 849 |
+
#define X509_VERSION_2 1
|
| 850 |
+
#define X509_VERSION_3 2
|
| 851 |
+
|
| 852 |
+
long X509_get_version(const X509 *x);
|
| 853 |
+
int X509_set_version(X509 *x, long version);
|
| 854 |
+
int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
|
| 855 |
+
ASN1_INTEGER *X509_get_serialNumber(X509 *x);
|
| 856 |
+
const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x);
|
| 857 |
+
int X509_set_issuer_name(X509 *x, const X509_NAME *name);
|
| 858 |
+
X509_NAME *X509_get_issuer_name(const X509 *a);
|
| 859 |
+
int X509_set_subject_name(X509 *x, const X509_NAME *name);
|
| 860 |
+
X509_NAME *X509_get_subject_name(const X509 *a);
|
| 861 |
+
const ASN1_TIME * X509_get0_notBefore(const X509 *x);
|
| 862 |
+
ASN1_TIME *X509_getm_notBefore(const X509 *x);
|
| 863 |
+
int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm);
|
| 864 |
+
const ASN1_TIME *X509_get0_notAfter(const X509 *x);
|
| 865 |
+
ASN1_TIME *X509_getm_notAfter(const X509 *x);
|
| 866 |
+
int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm);
|
| 867 |
+
int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
|
| 868 |
+
int X509_up_ref(X509 *x);
|
| 869 |
+
int X509_get_signature_type(const X509 *x);
|
| 870 |
+
|
| 871 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 872 |
+
# define X509_get_notBefore X509_getm_notBefore
|
| 873 |
+
# define X509_get_notAfter X509_getm_notAfter
|
| 874 |
+
# define X509_set_notBefore X509_set1_notBefore
|
| 875 |
+
# define X509_set_notAfter X509_set1_notAfter
|
| 876 |
+
#endif
|
| 877 |
+
|
| 878 |
+
|
| 879 |
+
/*
|
| 880 |
+
* This one is only used so that a binary form can output, as in
|
| 881 |
+
* i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf)
|
| 882 |
+
*/
|
| 883 |
+
X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x);
|
| 884 |
+
const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);
|
| 885 |
+
void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid,
|
| 886 |
+
const ASN1_BIT_STRING **psuid);
|
| 887 |
+
const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x);
|
| 888 |
+
|
| 889 |
+
EVP_PKEY *X509_get0_pubkey(const X509 *x);
|
| 890 |
+
EVP_PKEY *X509_get_pubkey(X509 *x);
|
| 891 |
+
ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
|
| 892 |
+
|
| 893 |
+
#define X509_REQ_VERSION_1 0
|
| 894 |
+
|
| 895 |
+
long X509_REQ_get_version(const X509_REQ *req);
|
| 896 |
+
int X509_REQ_set_version(X509_REQ *x, long version);
|
| 897 |
+
X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req);
|
| 898 |
+
int X509_REQ_set_subject_name(X509_REQ *req, const X509_NAME *name);
|
| 899 |
+
void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
|
| 900 |
+
const X509_ALGOR **palg);
|
| 901 |
+
void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig);
|
| 902 |
+
int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg);
|
| 903 |
+
int X509_REQ_get_signature_nid(const X509_REQ *req);
|
| 904 |
+
int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp);
|
| 905 |
+
int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
|
| 906 |
+
EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);
|
| 907 |
+
EVP_PKEY *X509_REQ_get0_pubkey(const X509_REQ *req);
|
| 908 |
+
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req);
|
| 909 |
+
int X509_REQ_extension_nid(int nid);
|
| 910 |
+
int *X509_REQ_get_extension_nids(void);
|
| 911 |
+
void X509_REQ_set_extension_nids(int *nids);
|
| 912 |
+
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(OSSL_FUTURE_CONST X509_REQ *req);
|
| 913 |
+
int X509_REQ_add_extensions_nid(X509_REQ *req,
|
| 914 |
+
const STACK_OF(X509_EXTENSION) *exts, int nid);
|
| 915 |
+
int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *ext);
|
| 916 |
+
int X509_REQ_get_attr_count(const X509_REQ *req);
|
| 917 |
+
int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos);
|
| 918 |
+
int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj,
|
| 919 |
+
int lastpos);
|
| 920 |
+
X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
|
| 921 |
+
X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
|
| 922 |
+
int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
|
| 923 |
+
int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
|
| 924 |
+
const ASN1_OBJECT *obj, int type,
|
| 925 |
+
const unsigned char *bytes, int len);
|
| 926 |
+
int X509_REQ_add1_attr_by_NID(X509_REQ *req,
|
| 927 |
+
int nid, int type,
|
| 928 |
+
const unsigned char *bytes, int len);
|
| 929 |
+
int X509_REQ_add1_attr_by_txt(X509_REQ *req,
|
| 930 |
+
const char *attrname, int type,
|
| 931 |
+
const unsigned char *bytes, int len);
|
| 932 |
+
|
| 933 |
+
#define X509_CRL_VERSION_1 0
|
| 934 |
+
#define X509_CRL_VERSION_2 1
|
| 935 |
+
|
| 936 |
+
int X509_CRL_set_version(X509_CRL *x, long version);
|
| 937 |
+
int X509_CRL_set_issuer_name(X509_CRL *x, const X509_NAME *name);
|
| 938 |
+
int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
|
| 939 |
+
int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
|
| 940 |
+
int X509_CRL_sort(X509_CRL *crl);
|
| 941 |
+
int X509_CRL_up_ref(X509_CRL *crl);
|
| 942 |
+
|
| 943 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 944 |
+
# define X509_CRL_set_lastUpdate X509_CRL_set1_lastUpdate
|
| 945 |
+
# define X509_CRL_set_nextUpdate X509_CRL_set1_nextUpdate
|
| 946 |
+
#endif
|
| 947 |
+
|
| 948 |
+
long X509_CRL_get_version(const X509_CRL *crl);
|
| 949 |
+
const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl);
|
| 950 |
+
const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
|
| 951 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 952 |
+
OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl);
|
| 953 |
+
OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl);
|
| 954 |
+
#endif
|
| 955 |
+
X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl);
|
| 956 |
+
const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl);
|
| 957 |
+
STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl);
|
| 958 |
+
void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
|
| 959 |
+
const X509_ALGOR **palg);
|
| 960 |
+
int X509_CRL_get_signature_nid(const X509_CRL *crl);
|
| 961 |
+
int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp);
|
| 962 |
+
|
| 963 |
+
const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x);
|
| 964 |
+
int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
|
| 965 |
+
const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x);
|
| 966 |
+
int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
|
| 967 |
+
const STACK_OF(X509_EXTENSION) *
|
| 968 |
+
X509_REVOKED_get0_extensions(const X509_REVOKED *r);
|
| 969 |
+
|
| 970 |
+
X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer,
|
| 971 |
+
EVP_PKEY *skey, const EVP_MD *md, unsigned int flags);
|
| 972 |
+
|
| 973 |
+
int X509_REQ_check_private_key(const X509_REQ *req, EVP_PKEY *pkey);
|
| 974 |
+
|
| 975 |
+
int X509_check_private_key(const X509 *cert, const EVP_PKEY *pkey);
|
| 976 |
+
int X509_chain_check_suiteb(int *perror_depth,
|
| 977 |
+
X509 *x, STACK_OF(X509) *chain,
|
| 978 |
+
unsigned long flags);
|
| 979 |
+
int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags);
|
| 980 |
+
void OSSL_STACK_OF_X509_free(STACK_OF(X509) *certs);
|
| 981 |
+
STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain);
|
| 982 |
+
|
| 983 |
+
int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
|
| 984 |
+
unsigned long X509_issuer_and_serial_hash(X509 *a);
|
| 985 |
+
|
| 986 |
+
int X509_issuer_name_cmp(const X509 *a, const X509 *b);
|
| 987 |
+
unsigned long X509_issuer_name_hash(X509 *a);
|
| 988 |
+
|
| 989 |
+
int X509_subject_name_cmp(const X509 *a, const X509 *b);
|
| 990 |
+
unsigned long X509_subject_name_hash(X509 *x);
|
| 991 |
+
|
| 992 |
+
# ifndef OPENSSL_NO_MD5
|
| 993 |
+
unsigned long X509_issuer_name_hash_old(X509 *a);
|
| 994 |
+
unsigned long X509_subject_name_hash_old(X509 *x);
|
| 995 |
+
# endif
|
| 996 |
+
|
| 997 |
+
# define X509_ADD_FLAG_DEFAULT 0
|
| 998 |
+
# define X509_ADD_FLAG_UP_REF 0x1
|
| 999 |
+
# define X509_ADD_FLAG_PREPEND 0x2
|
| 1000 |
+
# define X509_ADD_FLAG_NO_DUP 0x4
|
| 1001 |
+
# define X509_ADD_FLAG_NO_SS 0x8
|
| 1002 |
+
int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags);
|
| 1003 |
+
int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags);
|
| 1004 |
+
|
| 1005 |
+
int X509_cmp(const X509 *a, const X509 *b);
|
| 1006 |
+
int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
|
| 1007 |
+
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 1008 |
+
# define X509_NAME_hash(x) X509_NAME_hash_ex(x, NULL, NULL, NULL)
|
| 1009 |
+
OSSL_DEPRECATEDIN_3_0 int X509_certificate_type(const X509 *x,
|
| 1010 |
+
const EVP_PKEY *pubkey);
|
| 1011 |
+
#endif
|
| 1012 |
+
unsigned long X509_NAME_hash_ex(const X509_NAME *x, OSSL_LIB_CTX *libctx,
|
| 1013 |
+
const char *propq, int *ok);
|
| 1014 |
+
unsigned long X509_NAME_hash_old(const X509_NAME *x);
|
| 1015 |
+
|
| 1016 |
+
int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
|
| 1017 |
+
int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
|
| 1018 |
+
int X509_aux_print(BIO *out, X509 *x, int indent);
|
| 1019 |
+
# ifndef OPENSSL_NO_STDIO
|
| 1020 |
+
int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag,
|
| 1021 |
+
unsigned long cflag);
|
| 1022 |
+
int X509_print_fp(FILE *bp, X509 *x);
|
| 1023 |
+
int X509_CRL_print_fp(FILE *bp, X509_CRL *x);
|
| 1024 |
+
int X509_REQ_print_fp(FILE *bp, X509_REQ *req);
|
| 1025 |
+
int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
|
| 1026 |
+
unsigned long flags);
|
| 1027 |
+
# endif
|
| 1028 |
+
|
| 1029 |
+
int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase);
|
| 1030 |
+
int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
|
| 1031 |
+
unsigned long flags);
|
| 1032 |
+
int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag,
|
| 1033 |
+
unsigned long cflag);
|
| 1034 |
+
int X509_print(BIO *bp, X509 *x);
|
| 1035 |
+
int X509_ocspid_print(BIO *bp, X509 *x);
|
| 1036 |
+
int X509_CRL_print_ex(BIO *out, X509_CRL *x, unsigned long nmflag);
|
| 1037 |
+
int X509_CRL_print(BIO *bp, X509_CRL *x);
|
| 1038 |
+
int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag,
|
| 1039 |
+
unsigned long cflag);
|
| 1040 |
+
int X509_REQ_print(BIO *bp, X509_REQ *req);
|
| 1041 |
+
|
| 1042 |
+
int X509_NAME_entry_count(const X509_NAME *name);
|
| 1043 |
+
int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid,
|
| 1044 |
+
char *buf, int len);
|
| 1045 |
+
int X509_NAME_get_text_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
|
| 1046 |
+
char *buf, int len);
|
| 1047 |
+
|
| 1048 |
+
/*
|
| 1049 |
+
* NOTE: you should be passing -1, not 0 as lastpos. The functions that use
|
| 1050 |
+
* lastpos, search after that position on.
|
| 1051 |
+
*/
|
| 1052 |
+
int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos);
|
| 1053 |
+
int X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
|
| 1054 |
+
int lastpos);
|
| 1055 |
+
X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc);
|
| 1056 |
+
X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
|
| 1057 |
+
int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne,
|
| 1058 |
+
int loc, int set);
|
| 1059 |
+
int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type,
|
| 1060 |
+
const unsigned char *bytes, int len, int loc,
|
| 1061 |
+
int set);
|
| 1062 |
+
int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
|
| 1063 |
+
const unsigned char *bytes, int len, int loc,
|
| 1064 |
+
int set);
|
| 1065 |
+
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
|
| 1066 |
+
const char *field, int type,
|
| 1067 |
+
const unsigned char *bytes,
|
| 1068 |
+
int len);
|
| 1069 |
+
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
|
| 1070 |
+
int type,
|
| 1071 |
+
const unsigned char *bytes,
|
| 1072 |
+
int len);
|
| 1073 |
+
int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
|
| 1074 |
+
const unsigned char *bytes, int len, int loc,
|
| 1075 |
+
int set);
|
| 1076 |
+
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
|
| 1077 |
+
const ASN1_OBJECT *obj, int type,
|
| 1078 |
+
const unsigned char *bytes,
|
| 1079 |
+
int len);
|
| 1080 |
+
int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj);
|
| 1081 |
+
int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
|
| 1082 |
+
const unsigned char *bytes, int len);
|
| 1083 |
+
ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne);
|
| 1084 |
+
ASN1_STRING * X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne);
|
| 1085 |
+
int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne);
|
| 1086 |
+
|
| 1087 |
+
int X509_NAME_get0_der(const X509_NAME *nm, const unsigned char **pder,
|
| 1088 |
+
size_t *pderlen);
|
| 1089 |
+
|
| 1090 |
+
int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
|
| 1091 |
+
int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
|
| 1092 |
+
int nid, int lastpos);
|
| 1093 |
+
int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
|
| 1094 |
+
const ASN1_OBJECT *obj, int lastpos);
|
| 1095 |
+
int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
|
| 1096 |
+
int crit, int lastpos);
|
| 1097 |
+
X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
|
| 1098 |
+
X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
|
| 1099 |
+
STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
|
| 1100 |
+
X509_EXTENSION *ex, int loc);
|
| 1101 |
+
STACK_OF(X509_EXTENSION) *X509v3_add_extensions(STACK_OF(X509_EXTENSION) **target,
|
| 1102 |
+
const STACK_OF(X509_EXTENSION) *exts);
|
| 1103 |
+
|
| 1104 |
+
int X509_get_ext_count(const X509 *x);
|
| 1105 |
+
int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos);
|
| 1106 |
+
int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos);
|
| 1107 |
+
int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos);
|
| 1108 |
+
X509_EXTENSION *X509_get_ext(const X509 *x, int loc);
|
| 1109 |
+
X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
|
| 1110 |
+
int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
|
| 1111 |
+
void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx);
|
| 1112 |
+
int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
|
| 1113 |
+
unsigned long flags);
|
| 1114 |
+
|
| 1115 |
+
int X509_CRL_get_ext_count(const X509_CRL *x);
|
| 1116 |
+
int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos);
|
| 1117 |
+
int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj,
|
| 1118 |
+
int lastpos);
|
| 1119 |
+
int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos);
|
| 1120 |
+
X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc);
|
| 1121 |
+
X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
|
| 1122 |
+
int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
|
| 1123 |
+
void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx);
|
| 1124 |
+
int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
|
| 1125 |
+
unsigned long flags);
|
| 1126 |
+
|
| 1127 |
+
int X509_REVOKED_get_ext_count(const X509_REVOKED *x);
|
| 1128 |
+
int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos);
|
| 1129 |
+
int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj,
|
| 1130 |
+
int lastpos);
|
| 1131 |
+
int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit,
|
| 1132 |
+
int lastpos);
|
| 1133 |
+
X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc);
|
| 1134 |
+
X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
|
| 1135 |
+
int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
|
| 1136 |
+
void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit,
|
| 1137 |
+
int *idx);
|
| 1138 |
+
int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
|
| 1139 |
+
unsigned long flags);
|
| 1140 |
+
|
| 1141 |
+
X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
|
| 1142 |
+
int nid, int crit,
|
| 1143 |
+
ASN1_OCTET_STRING *data);
|
| 1144 |
+
X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
|
| 1145 |
+
const ASN1_OBJECT *obj, int crit,
|
| 1146 |
+
ASN1_OCTET_STRING *data);
|
| 1147 |
+
int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj);
|
| 1148 |
+
int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
|
| 1149 |
+
int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
|
| 1150 |
+
ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
|
| 1151 |
+
ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
|
| 1152 |
+
int X509_EXTENSION_get_critical(const X509_EXTENSION *ex);
|
| 1153 |
+
|
| 1154 |
+
int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
|
| 1155 |
+
int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
|
| 1156 |
+
int lastpos);
|
| 1157 |
+
int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
|
| 1158 |
+
const ASN1_OBJECT *obj, int lastpos);
|
| 1159 |
+
X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
|
| 1160 |
+
X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
|
| 1161 |
+
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
|
| 1162 |
+
X509_ATTRIBUTE *attr);
|
| 1163 |
+
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)
|
| 1164 |
+
**x, const ASN1_OBJECT *obj,
|
| 1165 |
+
int type,
|
| 1166 |
+
const unsigned char *bytes,
|
| 1167 |
+
int len);
|
| 1168 |
+
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)
|
| 1169 |
+
**x, int nid, int type,
|
| 1170 |
+
const unsigned char *bytes,
|
| 1171 |
+
int len);
|
| 1172 |
+
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
|
| 1173 |
+
**x, const char *attrname,
|
| 1174 |
+
int type,
|
| 1175 |
+
const unsigned char *bytes,
|
| 1176 |
+
int len);
|
| 1177 |
+
void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x,
|
| 1178 |
+
const ASN1_OBJECT *obj, int lastpos, int type);
|
| 1179 |
+
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
|
| 1180 |
+
int atrtype, const void *data,
|
| 1181 |
+
int len);
|
| 1182 |
+
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
|
| 1183 |
+
const ASN1_OBJECT *obj,
|
| 1184 |
+
int atrtype, const void *data,
|
| 1185 |
+
int len);
|
| 1186 |
+
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
|
| 1187 |
+
const char *atrname, int type,
|
| 1188 |
+
const unsigned char *bytes,
|
| 1189 |
+
int len);
|
| 1190 |
+
int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
|
| 1191 |
+
int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
|
| 1192 |
+
const void *data, int len);
|
| 1193 |
+
void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype,
|
| 1194 |
+
void *data);
|
| 1195 |
+
int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr);
|
| 1196 |
+
ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
|
| 1197 |
+
ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
|
| 1198 |
+
|
| 1199 |
+
int EVP_PKEY_get_attr_count(const EVP_PKEY *key);
|
| 1200 |
+
int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos);
|
| 1201 |
+
int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj,
|
| 1202 |
+
int lastpos);
|
| 1203 |
+
X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
|
| 1204 |
+
X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
|
| 1205 |
+
int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
|
| 1206 |
+
int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
|
| 1207 |
+
const ASN1_OBJECT *obj, int type,
|
| 1208 |
+
const unsigned char *bytes, int len);
|
| 1209 |
+
int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
|
| 1210 |
+
int nid, int type,
|
| 1211 |
+
const unsigned char *bytes, int len);
|
| 1212 |
+
int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
|
| 1213 |
+
const char *attrname, int type,
|
| 1214 |
+
const unsigned char *bytes, int len);
|
| 1215 |
+
|
| 1216 |
+
/* lookup a cert from a X509 STACK */
|
| 1217 |
+
X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, const X509_NAME *name,
|
| 1218 |
+
const ASN1_INTEGER *serial);
|
| 1219 |
+
X509 *X509_find_by_subject(STACK_OF(X509) *sk, const X509_NAME *name);
|
| 1220 |
+
|
| 1221 |
+
DECLARE_ASN1_FUNCTIONS(PBEPARAM)
|
| 1222 |
+
DECLARE_ASN1_FUNCTIONS(PBE2PARAM)
|
| 1223 |
+
DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)
|
| 1224 |
+
DECLARE_ASN1_FUNCTIONS(PBMAC1PARAM)
|
| 1225 |
+
# ifndef OPENSSL_NO_SCRYPT
|
| 1226 |
+
DECLARE_ASN1_FUNCTIONS(SCRYPT_PARAMS)
|
| 1227 |
+
# endif
|
| 1228 |
+
|
| 1229 |
+
int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
|
| 1230 |
+
const unsigned char *salt, int saltlen);
|
| 1231 |
+
int PKCS5_pbe_set0_algor_ex(X509_ALGOR *algor, int alg, int iter,
|
| 1232 |
+
const unsigned char *salt, int saltlen,
|
| 1233 |
+
OSSL_LIB_CTX *libctx);
|
| 1234 |
+
|
| 1235 |
+
X509_ALGOR *PKCS5_pbe_set(int alg, int iter,
|
| 1236 |
+
const unsigned char *salt, int saltlen);
|
| 1237 |
+
X509_ALGOR *PKCS5_pbe_set_ex(int alg, int iter,
|
| 1238 |
+
const unsigned char *salt, int saltlen,
|
| 1239 |
+
OSSL_LIB_CTX *libctx);
|
| 1240 |
+
|
| 1241 |
+
X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
|
| 1242 |
+
unsigned char *salt, int saltlen);
|
| 1243 |
+
X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
|
| 1244 |
+
unsigned char *salt, int saltlen,
|
| 1245 |
+
unsigned char *aiv, int prf_nid);
|
| 1246 |
+
X509_ALGOR *PKCS5_pbe2_set_iv_ex(const EVP_CIPHER *cipher, int iter,
|
| 1247 |
+
unsigned char *salt, int saltlen,
|
| 1248 |
+
unsigned char *aiv, int prf_nid,
|
| 1249 |
+
OSSL_LIB_CTX *libctx);
|
| 1250 |
+
|
| 1251 |
+
#ifndef OPENSSL_NO_SCRYPT
|
| 1252 |
+
X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher,
|
| 1253 |
+
const unsigned char *salt, int saltlen,
|
| 1254 |
+
unsigned char *aiv, uint64_t N, uint64_t r,
|
| 1255 |
+
uint64_t p);
|
| 1256 |
+
#endif
|
| 1257 |
+
|
| 1258 |
+
X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
|
| 1259 |
+
int prf_nid, int keylen);
|
| 1260 |
+
X509_ALGOR *PKCS5_pbkdf2_set_ex(int iter, unsigned char *salt, int saltlen,
|
| 1261 |
+
int prf_nid, int keylen,
|
| 1262 |
+
OSSL_LIB_CTX *libctx);
|
| 1263 |
+
|
| 1264 |
+
PBKDF2PARAM *PBMAC1_get1_pbkdf2_param(const X509_ALGOR *macalg);
|
| 1265 |
+
/* PKCS#8 utilities */
|
| 1266 |
+
|
| 1267 |
+
DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
|
| 1268 |
+
|
| 1269 |
+
EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8);
|
| 1270 |
+
EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
|
| 1271 |
+
const char *propq);
|
| 1272 |
+
PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey);
|
| 1273 |
+
|
| 1274 |
+
int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj,
|
| 1275 |
+
int version, int ptype, void *pval,
|
| 1276 |
+
unsigned char *penc, int penclen);
|
| 1277 |
+
int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg,
|
| 1278 |
+
const unsigned char **pk, int *ppklen,
|
| 1279 |
+
const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8);
|
| 1280 |
+
|
| 1281 |
+
const STACK_OF(X509_ATTRIBUTE) *
|
| 1282 |
+
PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8);
|
| 1283 |
+
int PKCS8_pkey_add1_attr(PKCS8_PRIV_KEY_INFO *p8, X509_ATTRIBUTE *attr);
|
| 1284 |
+
int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type,
|
| 1285 |
+
const unsigned char *bytes, int len);
|
| 1286 |
+
int PKCS8_pkey_add1_attr_by_OBJ(PKCS8_PRIV_KEY_INFO *p8, const ASN1_OBJECT *obj,
|
| 1287 |
+
int type, const unsigned char *bytes, int len);
|
| 1288 |
+
|
| 1289 |
+
|
| 1290 |
+
void X509_PUBKEY_set0_public_key(X509_PUBKEY *pub,
|
| 1291 |
+
unsigned char *penc, int penclen);
|
| 1292 |
+
int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
|
| 1293 |
+
int ptype, void *pval,
|
| 1294 |
+
unsigned char *penc, int penclen);
|
| 1295 |
+
int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
|
| 1296 |
+
const unsigned char **pk, int *ppklen,
|
| 1297 |
+
X509_ALGOR **pa, const X509_PUBKEY *pub);
|
| 1298 |
+
int X509_PUBKEY_eq(const X509_PUBKEY *a, const X509_PUBKEY *b);
|
| 1299 |
+
|
| 1300 |
+
# ifdef __cplusplus
|
| 1301 |
+
}
|
| 1302 |
+
# endif
|
| 1303 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/x509_acert.h
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/x509_acert.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_X509_ACERT_H
|
| 16 |
+
# define OPENSSL_X509_ACERT_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/x509v3.h>
|
| 20 |
+
# include <openssl/x509.h>
|
| 21 |
+
# include <openssl/pem.h>
|
| 22 |
+
|
| 23 |
+
typedef struct X509_acert_st X509_ACERT;
|
| 24 |
+
typedef struct X509_acert_info_st X509_ACERT_INFO;
|
| 25 |
+
typedef struct ossl_object_digest_info_st OSSL_OBJECT_DIGEST_INFO;
|
| 26 |
+
typedef struct ossl_issuer_serial_st OSSL_ISSUER_SERIAL;
|
| 27 |
+
typedef struct X509_acert_issuer_v2form_st X509_ACERT_ISSUER_V2FORM;
|
| 28 |
+
|
| 29 |
+
DECLARE_ASN1_FUNCTIONS(X509_ACERT)
|
| 30 |
+
DECLARE_ASN1_DUP_FUNCTION(X509_ACERT)
|
| 31 |
+
DECLARE_ASN1_ITEM(X509_ACERT_INFO)
|
| 32 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(X509_ACERT_INFO)
|
| 33 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(OSSL_OBJECT_DIGEST_INFO)
|
| 34 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(OSSL_ISSUER_SERIAL)
|
| 35 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(X509_ACERT_ISSUER_V2FORM)
|
| 36 |
+
|
| 37 |
+
# ifndef OPENSSL_NO_STDIO
|
| 38 |
+
X509_ACERT *d2i_X509_ACERT_fp(FILE *fp, X509_ACERT **acert);
|
| 39 |
+
int i2d_X509_ACERT_fp(FILE *fp, const X509_ACERT *acert);
|
| 40 |
+
# endif
|
| 41 |
+
|
| 42 |
+
DECLARE_PEM_rw(X509_ACERT, X509_ACERT)
|
| 43 |
+
|
| 44 |
+
X509_ACERT *d2i_X509_ACERT_bio(BIO *bp, X509_ACERT **acert);
|
| 45 |
+
int i2d_X509_ACERT_bio(BIO *bp, const X509_ACERT *acert);
|
| 46 |
+
|
| 47 |
+
int X509_ACERT_sign(X509_ACERT *x, EVP_PKEY *pkey, const EVP_MD *md);
|
| 48 |
+
int X509_ACERT_sign_ctx(X509_ACERT *x, EVP_MD_CTX *ctx);
|
| 49 |
+
int X509_ACERT_verify(X509_ACERT *a, EVP_PKEY *r);
|
| 50 |
+
|
| 51 |
+
# define X509_ACERT_VERSION_2 1
|
| 52 |
+
|
| 53 |
+
const GENERAL_NAMES *X509_ACERT_get0_holder_entityName(const X509_ACERT *x);
|
| 54 |
+
const OSSL_ISSUER_SERIAL *X509_ACERT_get0_holder_baseCertId(const X509_ACERT *x);
|
| 55 |
+
const OSSL_OBJECT_DIGEST_INFO * X509_ACERT_get0_holder_digest(const X509_ACERT *x);
|
| 56 |
+
const X509_NAME *X509_ACERT_get0_issuerName(const X509_ACERT *x);
|
| 57 |
+
long X509_ACERT_get_version(const X509_ACERT *x);
|
| 58 |
+
void X509_ACERT_get0_signature(const X509_ACERT *x,
|
| 59 |
+
const ASN1_BIT_STRING **psig,
|
| 60 |
+
const X509_ALGOR **palg);
|
| 61 |
+
int X509_ACERT_get_signature_nid(const X509_ACERT *x);
|
| 62 |
+
const X509_ALGOR *X509_ACERT_get0_info_sigalg(const X509_ACERT *x);
|
| 63 |
+
const ASN1_INTEGER *X509_ACERT_get0_serialNumber(const X509_ACERT *x);
|
| 64 |
+
const ASN1_TIME *X509_ACERT_get0_notBefore(const X509_ACERT *x);
|
| 65 |
+
const ASN1_TIME *X509_ACERT_get0_notAfter(const X509_ACERT *x);
|
| 66 |
+
const ASN1_BIT_STRING *X509_ACERT_get0_issuerUID(const X509_ACERT *x);
|
| 67 |
+
|
| 68 |
+
int X509_ACERT_print(BIO *bp, X509_ACERT *x);
|
| 69 |
+
int X509_ACERT_print_ex(BIO *bp, X509_ACERT *x, unsigned long nmflags,
|
| 70 |
+
unsigned long cflag);
|
| 71 |
+
|
| 72 |
+
int X509_ACERT_get_attr_count(const X509_ACERT *x);
|
| 73 |
+
int X509_ACERT_get_attr_by_NID(const X509_ACERT *x, int nid, int lastpos);
|
| 74 |
+
int X509_ACERT_get_attr_by_OBJ(const X509_ACERT *x, const ASN1_OBJECT *obj,
|
| 75 |
+
int lastpos);
|
| 76 |
+
X509_ATTRIBUTE *X509_ACERT_get_attr(const X509_ACERT *x, int loc);
|
| 77 |
+
X509_ATTRIBUTE *X509_ACERT_delete_attr(X509_ACERT *x, int loc);
|
| 78 |
+
|
| 79 |
+
void *X509_ACERT_get_ext_d2i(const X509_ACERT *x, int nid, int *crit, int *idx);
|
| 80 |
+
int X509_ACERT_add1_ext_i2d(X509_ACERT *x, int nid, void *value, int crit,
|
| 81 |
+
unsigned long flags);
|
| 82 |
+
const STACK_OF(X509_EXTENSION) *X509_ACERT_get0_extensions(const X509_ACERT *x);
|
| 83 |
+
|
| 84 |
+
# define OSSL_OBJECT_DIGEST_INFO_PUBLIC_KEY 0
|
| 85 |
+
# define OSSL_OBJECT_DIGEST_INFO_PUBLIC_KEY_CERT 1
|
| 86 |
+
# define OSSL_OBJECT_DIGEST_INFO_OTHER 2 /* must not be used in RFC 5755 profile */
|
| 87 |
+
int X509_ACERT_set_version(X509_ACERT *x, long version);
|
| 88 |
+
void X509_ACERT_set0_holder_entityName(X509_ACERT *x, GENERAL_NAMES *name);
|
| 89 |
+
void X509_ACERT_set0_holder_baseCertId(X509_ACERT *x, OSSL_ISSUER_SERIAL *isss);
|
| 90 |
+
void X509_ACERT_set0_holder_digest(X509_ACERT *x,
|
| 91 |
+
OSSL_OBJECT_DIGEST_INFO *dinfo);
|
| 92 |
+
|
| 93 |
+
int X509_ACERT_add1_attr(X509_ACERT *x, X509_ATTRIBUTE *attr);
|
| 94 |
+
int X509_ACERT_add1_attr_by_OBJ(X509_ACERT *x, const ASN1_OBJECT *obj,
|
| 95 |
+
int type, const void *bytes, int len);
|
| 96 |
+
int X509_ACERT_add1_attr_by_NID(X509_ACERT *x, int nid, int type,
|
| 97 |
+
const void *bytes, int len);
|
| 98 |
+
int X509_ACERT_add1_attr_by_txt(X509_ACERT *x, const char *attrname, int type,
|
| 99 |
+
const unsigned char *bytes, int len);
|
| 100 |
+
int X509_ACERT_add_attr_nconf(CONF *conf, const char *section,
|
| 101 |
+
X509_ACERT *acert);
|
| 102 |
+
|
| 103 |
+
int X509_ACERT_set1_issuerName(X509_ACERT *x, const X509_NAME *name);
|
| 104 |
+
int X509_ACERT_set1_serialNumber(X509_ACERT *x, const ASN1_INTEGER *serial);
|
| 105 |
+
int X509_ACERT_set1_notBefore(X509_ACERT *x, const ASN1_GENERALIZEDTIME *time);
|
| 106 |
+
int X509_ACERT_set1_notAfter(X509_ACERT *x, const ASN1_GENERALIZEDTIME *time);
|
| 107 |
+
|
| 108 |
+
void OSSL_OBJECT_DIGEST_INFO_get0_digest(const OSSL_OBJECT_DIGEST_INFO *o,
|
| 109 |
+
int *digestedObjectType,
|
| 110 |
+
const X509_ALGOR **digestAlgorithm,
|
| 111 |
+
const ASN1_BIT_STRING **digest);
|
| 112 |
+
|
| 113 |
+
int OSSL_OBJECT_DIGEST_INFO_set1_digest(OSSL_OBJECT_DIGEST_INFO *o,
|
| 114 |
+
int digestedObjectType,
|
| 115 |
+
X509_ALGOR *digestAlgorithm,
|
| 116 |
+
ASN1_BIT_STRING *digest);
|
| 117 |
+
|
| 118 |
+
const X509_NAME *OSSL_ISSUER_SERIAL_get0_issuer(const OSSL_ISSUER_SERIAL *isss);
|
| 119 |
+
const ASN1_INTEGER *OSSL_ISSUER_SERIAL_get0_serial(const OSSL_ISSUER_SERIAL *isss);
|
| 120 |
+
const ASN1_BIT_STRING *OSSL_ISSUER_SERIAL_get0_issuerUID(const OSSL_ISSUER_SERIAL *isss);
|
| 121 |
+
|
| 122 |
+
int OSSL_ISSUER_SERIAL_set1_issuer(OSSL_ISSUER_SERIAL *isss,
|
| 123 |
+
const X509_NAME *issuer);
|
| 124 |
+
int OSSL_ISSUER_SERIAL_set1_serial(OSSL_ISSUER_SERIAL *isss,
|
| 125 |
+
const ASN1_INTEGER *serial);
|
| 126 |
+
int OSSL_ISSUER_SERIAL_set1_issuerUID(OSSL_ISSUER_SERIAL *isss,
|
| 127 |
+
const ASN1_BIT_STRING *uid);
|
| 128 |
+
|
| 129 |
+
# define OSSL_IETFAS_OCTETS 0
|
| 130 |
+
# define OSSL_IETFAS_OID 1
|
| 131 |
+
# define OSSL_IETFAS_STRING 2
|
| 132 |
+
|
| 133 |
+
typedef struct OSSL_IETF_ATTR_SYNTAX_VALUE_st OSSL_IETF_ATTR_SYNTAX_VALUE;
|
| 134 |
+
typedef struct OSSL_IETF_ATTR_SYNTAX_st OSSL_IETF_ATTR_SYNTAX;
|
| 135 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_IETF_ATTR_SYNTAX_VALUE, OSSL_IETF_ATTR_SYNTAX_VALUE, OSSL_IETF_ATTR_SYNTAX_VALUE)
|
| 136 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk))
|
| 137 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_value(sk, idx) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_value(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), (idx)))
|
| 138 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_new(cmp) ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_new(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_compfunc_type(cmp)))
|
| 139 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_new_null() ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_new_null())
|
| 140 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_new_reserve(cmp, n) ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_compfunc_type(cmp), (n)))
|
| 141 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), (n))
|
| 142 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk))
|
| 143 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk))
|
| 144 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_delete(sk, i) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_delete(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), (i)))
|
| 145 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_delete_ptr(sk, ptr) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr)))
|
| 146 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr))
|
| 147 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr))
|
| 148 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_pop(sk) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_pop(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk)))
|
| 149 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_shift(sk) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_shift(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk)))
|
| 150 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk),ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_freefunc_type(freefunc))
|
| 151 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr), (idx))
|
| 152 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_set(sk, idx, ptr) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_set(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), (idx), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr)))
|
| 153 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr))
|
| 154 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr))
|
| 155 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr), pnum)
|
| 156 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk))
|
| 157 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk))
|
| 158 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_dup(sk) ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk)))
|
| 159 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_copyfunc_type(copyfunc), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_freefunc_type(freefunc)))
|
| 160 |
+
#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_set_cmp_func(sk, cmp) ((sk_OSSL_IETF_ATTR_SYNTAX_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_compfunc_type(cmp)))
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
DECLARE_ASN1_ITEM(OSSL_IETF_ATTR_SYNTAX_VALUE)
|
| 164 |
+
DECLARE_ASN1_ALLOC_FUNCTIONS(OSSL_IETF_ATTR_SYNTAX_VALUE)
|
| 165 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_IETF_ATTR_SYNTAX)
|
| 166 |
+
|
| 167 |
+
const GENERAL_NAMES *
|
| 168 |
+
OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority(const OSSL_IETF_ATTR_SYNTAX *a);
|
| 169 |
+
void OSSL_IETF_ATTR_SYNTAX_set0_policyAuthority(OSSL_IETF_ATTR_SYNTAX *a,
|
| 170 |
+
GENERAL_NAMES *names);
|
| 171 |
+
|
| 172 |
+
int OSSL_IETF_ATTR_SYNTAX_get_value_num(const OSSL_IETF_ATTR_SYNTAX *a);
|
| 173 |
+
void *OSSL_IETF_ATTR_SYNTAX_get0_value(const OSSL_IETF_ATTR_SYNTAX *a,
|
| 174 |
+
int ind, int *type);
|
| 175 |
+
int OSSL_IETF_ATTR_SYNTAX_add1_value(OSSL_IETF_ATTR_SYNTAX *a, int type,
|
| 176 |
+
void *data);
|
| 177 |
+
int OSSL_IETF_ATTR_SYNTAX_print(BIO *bp, OSSL_IETF_ATTR_SYNTAX *a, int indent);
|
| 178 |
+
|
| 179 |
+
struct TARGET_CERT_st {
|
| 180 |
+
OSSL_ISSUER_SERIAL *targetCertificate;
|
| 181 |
+
GENERAL_NAME *targetName;
|
| 182 |
+
OSSL_OBJECT_DIGEST_INFO *certDigestInfo;
|
| 183 |
+
};
|
| 184 |
+
|
| 185 |
+
typedef struct TARGET_CERT_st OSSL_TARGET_CERT;
|
| 186 |
+
|
| 187 |
+
# define OSSL_TGT_TARGET_NAME 0
|
| 188 |
+
# define OSSL_TGT_TARGET_GROUP 1
|
| 189 |
+
# define OSSL_TGT_TARGET_CERT 2
|
| 190 |
+
|
| 191 |
+
typedef struct TARGET_st {
|
| 192 |
+
int type;
|
| 193 |
+
union {
|
| 194 |
+
GENERAL_NAME *targetName;
|
| 195 |
+
GENERAL_NAME *targetGroup;
|
| 196 |
+
OSSL_TARGET_CERT *targetCert;
|
| 197 |
+
} choice;
|
| 198 |
+
} OSSL_TARGET;
|
| 199 |
+
|
| 200 |
+
typedef STACK_OF(OSSL_TARGET) OSSL_TARGETS;
|
| 201 |
+
typedef STACK_OF(OSSL_TARGETS) OSSL_TARGETING_INFORMATION;
|
| 202 |
+
|
| 203 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_TARGET, OSSL_TARGET, OSSL_TARGET)
|
| 204 |
+
#define sk_OSSL_TARGET_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TARGET_sk_type(sk))
|
| 205 |
+
#define sk_OSSL_TARGET_value(sk, idx) ((OSSL_TARGET *)OPENSSL_sk_value(ossl_check_const_OSSL_TARGET_sk_type(sk), (idx)))
|
| 206 |
+
#define sk_OSSL_TARGET_new(cmp) ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_new(ossl_check_OSSL_TARGET_compfunc_type(cmp)))
|
| 207 |
+
#define sk_OSSL_TARGET_new_null() ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_new_null())
|
| 208 |
+
#define sk_OSSL_TARGET_new_reserve(cmp, n) ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_TARGET_compfunc_type(cmp), (n)))
|
| 209 |
+
#define sk_OSSL_TARGET_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_TARGET_sk_type(sk), (n))
|
| 210 |
+
#define sk_OSSL_TARGET_free(sk) OPENSSL_sk_free(ossl_check_OSSL_TARGET_sk_type(sk))
|
| 211 |
+
#define sk_OSSL_TARGET_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_TARGET_sk_type(sk))
|
| 212 |
+
#define sk_OSSL_TARGET_delete(sk, i) ((OSSL_TARGET *)OPENSSL_sk_delete(ossl_check_OSSL_TARGET_sk_type(sk), (i)))
|
| 213 |
+
#define sk_OSSL_TARGET_delete_ptr(sk, ptr) ((OSSL_TARGET *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr)))
|
| 214 |
+
#define sk_OSSL_TARGET_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr))
|
| 215 |
+
#define sk_OSSL_TARGET_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr))
|
| 216 |
+
#define sk_OSSL_TARGET_pop(sk) ((OSSL_TARGET *)OPENSSL_sk_pop(ossl_check_OSSL_TARGET_sk_type(sk)))
|
| 217 |
+
#define sk_OSSL_TARGET_shift(sk) ((OSSL_TARGET *)OPENSSL_sk_shift(ossl_check_OSSL_TARGET_sk_type(sk)))
|
| 218 |
+
#define sk_OSSL_TARGET_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_TARGET_sk_type(sk),ossl_check_OSSL_TARGET_freefunc_type(freefunc))
|
| 219 |
+
#define sk_OSSL_TARGET_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr), (idx))
|
| 220 |
+
#define sk_OSSL_TARGET_set(sk, idx, ptr) ((OSSL_TARGET *)OPENSSL_sk_set(ossl_check_OSSL_TARGET_sk_type(sk), (idx), ossl_check_OSSL_TARGET_type(ptr)))
|
| 221 |
+
#define sk_OSSL_TARGET_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr))
|
| 222 |
+
#define sk_OSSL_TARGET_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr))
|
| 223 |
+
#define sk_OSSL_TARGET_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr), pnum)
|
| 224 |
+
#define sk_OSSL_TARGET_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_TARGET_sk_type(sk))
|
| 225 |
+
#define sk_OSSL_TARGET_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_TARGET_sk_type(sk))
|
| 226 |
+
#define sk_OSSL_TARGET_dup(sk) ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_dup(ossl_check_const_OSSL_TARGET_sk_type(sk)))
|
| 227 |
+
#define sk_OSSL_TARGET_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_copyfunc_type(copyfunc), ossl_check_OSSL_TARGET_freefunc_type(freefunc)))
|
| 228 |
+
#define sk_OSSL_TARGET_set_cmp_func(sk, cmp) ((sk_OSSL_TARGET_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_compfunc_type(cmp)))
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_TARGETS, OSSL_TARGETS, OSSL_TARGETS)
|
| 232 |
+
#define sk_OSSL_TARGETS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TARGETS_sk_type(sk))
|
| 233 |
+
#define sk_OSSL_TARGETS_value(sk, idx) ((OSSL_TARGETS *)OPENSSL_sk_value(ossl_check_const_OSSL_TARGETS_sk_type(sk), (idx)))
|
| 234 |
+
#define sk_OSSL_TARGETS_new(cmp) ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_new(ossl_check_OSSL_TARGETS_compfunc_type(cmp)))
|
| 235 |
+
#define sk_OSSL_TARGETS_new_null() ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_new_null())
|
| 236 |
+
#define sk_OSSL_TARGETS_new_reserve(cmp, n) ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_TARGETS_compfunc_type(cmp), (n)))
|
| 237 |
+
#define sk_OSSL_TARGETS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_TARGETS_sk_type(sk), (n))
|
| 238 |
+
#define sk_OSSL_TARGETS_free(sk) OPENSSL_sk_free(ossl_check_OSSL_TARGETS_sk_type(sk))
|
| 239 |
+
#define sk_OSSL_TARGETS_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_TARGETS_sk_type(sk))
|
| 240 |
+
#define sk_OSSL_TARGETS_delete(sk, i) ((OSSL_TARGETS *)OPENSSL_sk_delete(ossl_check_OSSL_TARGETS_sk_type(sk), (i)))
|
| 241 |
+
#define sk_OSSL_TARGETS_delete_ptr(sk, ptr) ((OSSL_TARGETS *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr)))
|
| 242 |
+
#define sk_OSSL_TARGETS_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr))
|
| 243 |
+
#define sk_OSSL_TARGETS_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr))
|
| 244 |
+
#define sk_OSSL_TARGETS_pop(sk) ((OSSL_TARGETS *)OPENSSL_sk_pop(ossl_check_OSSL_TARGETS_sk_type(sk)))
|
| 245 |
+
#define sk_OSSL_TARGETS_shift(sk) ((OSSL_TARGETS *)OPENSSL_sk_shift(ossl_check_OSSL_TARGETS_sk_type(sk)))
|
| 246 |
+
#define sk_OSSL_TARGETS_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_TARGETS_sk_type(sk),ossl_check_OSSL_TARGETS_freefunc_type(freefunc))
|
| 247 |
+
#define sk_OSSL_TARGETS_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr), (idx))
|
| 248 |
+
#define sk_OSSL_TARGETS_set(sk, idx, ptr) ((OSSL_TARGETS *)OPENSSL_sk_set(ossl_check_OSSL_TARGETS_sk_type(sk), (idx), ossl_check_OSSL_TARGETS_type(ptr)))
|
| 249 |
+
#define sk_OSSL_TARGETS_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr))
|
| 250 |
+
#define sk_OSSL_TARGETS_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr))
|
| 251 |
+
#define sk_OSSL_TARGETS_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr), pnum)
|
| 252 |
+
#define sk_OSSL_TARGETS_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_TARGETS_sk_type(sk))
|
| 253 |
+
#define sk_OSSL_TARGETS_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_TARGETS_sk_type(sk))
|
| 254 |
+
#define sk_OSSL_TARGETS_dup(sk) ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_dup(ossl_check_const_OSSL_TARGETS_sk_type(sk)))
|
| 255 |
+
#define sk_OSSL_TARGETS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_copyfunc_type(copyfunc), ossl_check_OSSL_TARGETS_freefunc_type(freefunc)))
|
| 256 |
+
#define sk_OSSL_TARGETS_set_cmp_func(sk, cmp) ((sk_OSSL_TARGETS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_compfunc_type(cmp)))
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_TARGET)
|
| 260 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_TARGETS)
|
| 261 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_TARGETING_INFORMATION)
|
| 262 |
+
|
| 263 |
+
typedef STACK_OF(OSSL_ISSUER_SERIAL) OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX;
|
| 264 |
+
DECLARE_ASN1_FUNCTIONS(OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX)
|
| 265 |
+
|
| 266 |
+
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_ISSUER_SERIAL, OSSL_ISSUER_SERIAL, OSSL_ISSUER_SERIAL)
|
| 267 |
+
#define sk_OSSL_ISSUER_SERIAL_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk))
|
| 268 |
+
#define sk_OSSL_ISSUER_SERIAL_value(sk, idx) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_value(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk), (idx)))
|
| 269 |
+
#define sk_OSSL_ISSUER_SERIAL_new(cmp) ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_new(ossl_check_OSSL_ISSUER_SERIAL_compfunc_type(cmp)))
|
| 270 |
+
#define sk_OSSL_ISSUER_SERIAL_new_null() ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_new_null())
|
| 271 |
+
#define sk_OSSL_ISSUER_SERIAL_new_reserve(cmp, n) ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_ISSUER_SERIAL_compfunc_type(cmp), (n)))
|
| 272 |
+
#define sk_OSSL_ISSUER_SERIAL_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), (n))
|
| 273 |
+
#define sk_OSSL_ISSUER_SERIAL_free(sk) OPENSSL_sk_free(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk))
|
| 274 |
+
#define sk_OSSL_ISSUER_SERIAL_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk))
|
| 275 |
+
#define sk_OSSL_ISSUER_SERIAL_delete(sk, i) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_delete(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), (i)))
|
| 276 |
+
#define sk_OSSL_ISSUER_SERIAL_delete_ptr(sk, ptr) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr)))
|
| 277 |
+
#define sk_OSSL_ISSUER_SERIAL_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr))
|
| 278 |
+
#define sk_OSSL_ISSUER_SERIAL_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr))
|
| 279 |
+
#define sk_OSSL_ISSUER_SERIAL_pop(sk) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_pop(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk)))
|
| 280 |
+
#define sk_OSSL_ISSUER_SERIAL_shift(sk) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_shift(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk)))
|
| 281 |
+
#define sk_OSSL_ISSUER_SERIAL_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk),ossl_check_OSSL_ISSUER_SERIAL_freefunc_type(freefunc))
|
| 282 |
+
#define sk_OSSL_ISSUER_SERIAL_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr), (idx))
|
| 283 |
+
#define sk_OSSL_ISSUER_SERIAL_set(sk, idx, ptr) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_set(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), (idx), ossl_check_OSSL_ISSUER_SERIAL_type(ptr)))
|
| 284 |
+
#define sk_OSSL_ISSUER_SERIAL_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr))
|
| 285 |
+
#define sk_OSSL_ISSUER_SERIAL_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr))
|
| 286 |
+
#define sk_OSSL_ISSUER_SERIAL_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr), pnum)
|
| 287 |
+
#define sk_OSSL_ISSUER_SERIAL_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk))
|
| 288 |
+
#define sk_OSSL_ISSUER_SERIAL_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk))
|
| 289 |
+
#define sk_OSSL_ISSUER_SERIAL_dup(sk) ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_dup(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk)))
|
| 290 |
+
#define sk_OSSL_ISSUER_SERIAL_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_copyfunc_type(copyfunc), ossl_check_OSSL_ISSUER_SERIAL_freefunc_type(freefunc)))
|
| 291 |
+
#define sk_OSSL_ISSUER_SERIAL_set_cmp_func(sk, cmp) ((sk_OSSL_ISSUER_SERIAL_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* WARNING: do not edit!
|
| 3 |
+
* Generated by Makefile from include/openssl/x509_vfy.h.in
|
| 4 |
+
*
|
| 5 |
+
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
| 6 |
+
*
|
| 7 |
+
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
| 8 |
+
* this file except in compliance with the License. You can obtain a copy
|
| 9 |
+
* in the file LICENSE in the source distribution or at
|
| 10 |
+
* https://www.openssl.org/source/license.html
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
#ifndef OPENSSL_X509_VFY_H
|
| 16 |
+
# define OPENSSL_X509_VFY_H
|
| 17 |
+
# pragma once
|
| 18 |
+
|
| 19 |
+
# include <openssl/macros.h>
|
| 20 |
+
# ifndef OPENSSL_NO_DEPRECATED_3_0
|
| 21 |
+
# define HEADER_X509_VFY_H
|
| 22 |
+
# endif
|
| 23 |
+
|
| 24 |
+
/*
|
| 25 |
+
* Protect against recursion, x509.h and x509_vfy.h each include the other.
|
| 26 |
+
*/
|
| 27 |
+
# ifndef OPENSSL_X509_H
|
| 28 |
+
# include <openssl/x509.h>
|
| 29 |
+
# endif
|
| 30 |
+
|
| 31 |
+
# include <openssl/opensslconf.h>
|
| 32 |
+
# include <openssl/lhash.h>
|
| 33 |
+
# include <openssl/bio.h>
|
| 34 |
+
# include <openssl/crypto.h>
|
| 35 |
+
# include <openssl/symhacks.h>
|
| 36 |
+
|
| 37 |
+
#ifdef __cplusplus
|
| 38 |
+
extern "C" {
|
| 39 |
+
#endif
|
| 40 |
+
|
| 41 |
+
/*-
|
| 42 |
+
SSL_CTX -> X509_STORE
|
| 43 |
+
-> X509_LOOKUP
|
| 44 |
+
->X509_LOOKUP_METHOD
|
| 45 |
+
-> X509_LOOKUP
|
| 46 |
+
->X509_LOOKUP_METHOD
|
| 47 |
+
|
| 48 |
+
SSL -> X509_STORE_CTX
|
| 49 |
+
->X509_STORE
|
| 50 |
+
|
| 51 |
+
The X509_STORE holds the tables etc for verification stuff.
|
| 52 |
+
A X509_STORE_CTX is used while validating a single certificate.
|
| 53 |
+
The X509_STORE has X509_LOOKUPs for looking up certs.
|
| 54 |
+
The X509_STORE then calls a function to actually verify the
|
| 55 |
+
certificate chain.
|
| 56 |
+
*/
|
| 57 |
+
|
| 58 |
+
typedef enum {
|
| 59 |
+
X509_LU_NONE = 0,
|
| 60 |
+
X509_LU_X509, X509_LU_CRL
|
| 61 |
+
} X509_LOOKUP_TYPE;
|
| 62 |
+
|
| 63 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 64 |
+
#define X509_LU_RETRY -1
|
| 65 |
+
#define X509_LU_FAIL 0
|
| 66 |
+
#endif
|
| 67 |
+
|
| 68 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_LOOKUP, X509_LOOKUP, X509_LOOKUP)
|
| 69 |
+
#define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
|
| 70 |
+
#define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
|
| 71 |
+
#define sk_X509_LOOKUP_new(cmp) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new(ossl_check_X509_LOOKUP_compfunc_type(cmp)))
|
| 72 |
+
#define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_null())
|
| 73 |
+
#define sk_X509_LOOKUP_new_reserve(cmp, n) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_reserve(ossl_check_X509_LOOKUP_compfunc_type(cmp), (n)))
|
| 74 |
+
#define sk_X509_LOOKUP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_LOOKUP_sk_type(sk), (n))
|
| 75 |
+
#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
|
| 76 |
+
#define sk_X509_LOOKUP_zero(sk) OPENSSL_sk_zero(ossl_check_X509_LOOKUP_sk_type(sk))
|
| 77 |
+
#define sk_X509_LOOKUP_delete(sk, i) ((X509_LOOKUP *)OPENSSL_sk_delete(ossl_check_X509_LOOKUP_sk_type(sk), (i)))
|
| 78 |
+
#define sk_X509_LOOKUP_delete_ptr(sk, ptr) ((X509_LOOKUP *)OPENSSL_sk_delete_ptr(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)))
|
| 79 |
+
#define sk_X509_LOOKUP_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
| 80 |
+
#define sk_X509_LOOKUP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
| 81 |
+
#define sk_X509_LOOKUP_pop(sk) ((X509_LOOKUP *)OPENSSL_sk_pop(ossl_check_X509_LOOKUP_sk_type(sk)))
|
| 82 |
+
#define sk_X509_LOOKUP_shift(sk) ((X509_LOOKUP *)OPENSSL_sk_shift(ossl_check_X509_LOOKUP_sk_type(sk)))
|
| 83 |
+
#define sk_X509_LOOKUP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_LOOKUP_sk_type(sk),ossl_check_X509_LOOKUP_freefunc_type(freefunc))
|
| 84 |
+
#define sk_X509_LOOKUP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), (idx))
|
| 85 |
+
#define sk_X509_LOOKUP_set(sk, idx, ptr) ((X509_LOOKUP *)OPENSSL_sk_set(ossl_check_X509_LOOKUP_sk_type(sk), (idx), ossl_check_X509_LOOKUP_type(ptr)))
|
| 86 |
+
#define sk_X509_LOOKUP_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
| 87 |
+
#define sk_X509_LOOKUP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
|
| 88 |
+
#define sk_X509_LOOKUP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), pnum)
|
| 89 |
+
#define sk_X509_LOOKUP_sort(sk) OPENSSL_sk_sort(ossl_check_X509_LOOKUP_sk_type(sk))
|
| 90 |
+
#define sk_X509_LOOKUP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_LOOKUP_sk_type(sk))
|
| 91 |
+
#define sk_X509_LOOKUP_dup(sk) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_dup(ossl_check_const_X509_LOOKUP_sk_type(sk)))
|
| 92 |
+
#define sk_X509_LOOKUP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_copyfunc_type(copyfunc), ossl_check_X509_LOOKUP_freefunc_type(freefunc)))
|
| 93 |
+
#define sk_X509_LOOKUP_set_cmp_func(sk, cmp) ((sk_X509_LOOKUP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_compfunc_type(cmp)))
|
| 94 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_OBJECT, X509_OBJECT, X509_OBJECT)
|
| 95 |
+
#define sk_X509_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_X509_OBJECT_sk_type(sk))
|
| 96 |
+
#define sk_X509_OBJECT_value(sk, idx) ((X509_OBJECT *)OPENSSL_sk_value(ossl_check_const_X509_OBJECT_sk_type(sk), (idx)))
|
| 97 |
+
#define sk_X509_OBJECT_new(cmp) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new(ossl_check_X509_OBJECT_compfunc_type(cmp)))
|
| 98 |
+
#define sk_X509_OBJECT_new_null() ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_null())
|
| 99 |
+
#define sk_X509_OBJECT_new_reserve(cmp, n) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_X509_OBJECT_compfunc_type(cmp), (n)))
|
| 100 |
+
#define sk_X509_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_OBJECT_sk_type(sk), (n))
|
| 101 |
+
#define sk_X509_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_X509_OBJECT_sk_type(sk))
|
| 102 |
+
#define sk_X509_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_X509_OBJECT_sk_type(sk))
|
| 103 |
+
#define sk_X509_OBJECT_delete(sk, i) ((X509_OBJECT *)OPENSSL_sk_delete(ossl_check_X509_OBJECT_sk_type(sk), (i)))
|
| 104 |
+
#define sk_X509_OBJECT_delete_ptr(sk, ptr) ((X509_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)))
|
| 105 |
+
#define sk_X509_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
| 106 |
+
#define sk_X509_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
| 107 |
+
#define sk_X509_OBJECT_pop(sk) ((X509_OBJECT *)OPENSSL_sk_pop(ossl_check_X509_OBJECT_sk_type(sk)))
|
| 108 |
+
#define sk_X509_OBJECT_shift(sk) ((X509_OBJECT *)OPENSSL_sk_shift(ossl_check_X509_OBJECT_sk_type(sk)))
|
| 109 |
+
#define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk),ossl_check_X509_OBJECT_freefunc_type(freefunc))
|
| 110 |
+
#define sk_X509_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), (idx))
|
| 111 |
+
#define sk_X509_OBJECT_set(sk, idx, ptr) ((X509_OBJECT *)OPENSSL_sk_set(ossl_check_X509_OBJECT_sk_type(sk), (idx), ossl_check_X509_OBJECT_type(ptr)))
|
| 112 |
+
#define sk_X509_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
| 113 |
+
#define sk_X509_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
|
| 114 |
+
#define sk_X509_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), pnum)
|
| 115 |
+
#define sk_X509_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_X509_OBJECT_sk_type(sk))
|
| 116 |
+
#define sk_X509_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_OBJECT_sk_type(sk))
|
| 117 |
+
#define sk_X509_OBJECT_dup(sk) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_X509_OBJECT_sk_type(sk)))
|
| 118 |
+
#define sk_X509_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_copyfunc_type(copyfunc), ossl_check_X509_OBJECT_freefunc_type(freefunc)))
|
| 119 |
+
#define sk_X509_OBJECT_set_cmp_func(sk, cmp) ((sk_X509_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_compfunc_type(cmp)))
|
| 120 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_VERIFY_PARAM, X509_VERIFY_PARAM, X509_VERIFY_PARAM)
|
| 121 |
+
#define sk_X509_VERIFY_PARAM_num(sk) OPENSSL_sk_num(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
|
| 122 |
+
#define sk_X509_VERIFY_PARAM_value(sk, idx) ((X509_VERIFY_PARAM *)OPENSSL_sk_value(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), (idx)))
|
| 123 |
+
#define sk_X509_VERIFY_PARAM_new(cmp) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
|
| 124 |
+
#define sk_X509_VERIFY_PARAM_new_null() ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_null())
|
| 125 |
+
#define sk_X509_VERIFY_PARAM_new_reserve(cmp, n) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_reserve(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp), (n)))
|
| 126 |
+
#define sk_X509_VERIFY_PARAM_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (n))
|
| 127 |
+
#define sk_X509_VERIFY_PARAM_free(sk) OPENSSL_sk_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
| 128 |
+
#define sk_X509_VERIFY_PARAM_zero(sk) OPENSSL_sk_zero(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
| 129 |
+
#define sk_X509_VERIFY_PARAM_delete(sk, i) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (i)))
|
| 130 |
+
#define sk_X509_VERIFY_PARAM_delete_ptr(sk, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete_ptr(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)))
|
| 131 |
+
#define sk_X509_VERIFY_PARAM_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
| 132 |
+
#define sk_X509_VERIFY_PARAM_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
| 133 |
+
#define sk_X509_VERIFY_PARAM_pop(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_pop(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
|
| 134 |
+
#define sk_X509_VERIFY_PARAM_shift(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_shift(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
|
| 135 |
+
#define sk_X509_VERIFY_PARAM_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk),ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc))
|
| 136 |
+
#define sk_X509_VERIFY_PARAM_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), (idx))
|
| 137 |
+
#define sk_X509_VERIFY_PARAM_set(sk, idx, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_set(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (idx), ossl_check_X509_VERIFY_PARAM_type(ptr)))
|
| 138 |
+
#define sk_X509_VERIFY_PARAM_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
| 139 |
+
#define sk_X509_VERIFY_PARAM_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
|
| 140 |
+
#define sk_X509_VERIFY_PARAM_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), pnum)
|
| 141 |
+
#define sk_X509_VERIFY_PARAM_sort(sk) OPENSSL_sk_sort(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
|
| 142 |
+
#define sk_X509_VERIFY_PARAM_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
|
| 143 |
+
#define sk_X509_VERIFY_PARAM_dup(sk) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_dup(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk)))
|
| 144 |
+
#define sk_X509_VERIFY_PARAM_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_copyfunc_type(copyfunc), ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc)))
|
| 145 |
+
#define sk_X509_VERIFY_PARAM_set_cmp_func(sk, cmp) ((sk_X509_VERIFY_PARAM_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
/* This is used for a table of trust checking functions */
|
| 149 |
+
typedef struct x509_trust_st {
|
| 150 |
+
int trust;
|
| 151 |
+
int flags;
|
| 152 |
+
int (*check_trust) (struct x509_trust_st *, X509 *, int);
|
| 153 |
+
char *name;
|
| 154 |
+
int arg1;
|
| 155 |
+
void *arg2;
|
| 156 |
+
} X509_TRUST;
|
| 157 |
+
SKM_DEFINE_STACK_OF_INTERNAL(X509_TRUST, X509_TRUST, X509_TRUST)
|
| 158 |
+
#define sk_X509_TRUST_num(sk) OPENSSL_sk_num(ossl_check_const_X509_TRUST_sk_type(sk))
|
| 159 |
+
#define sk_X509_TRUST_value(sk, idx) ((X509_TRUST *)OPENSSL_sk_value(ossl_check_const_X509_TRUST_sk_type(sk), (idx)))
|
| 160 |
+
#define sk_X509_TRUST_new(cmp) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new(ossl_check_X509_TRUST_compfunc_type(cmp)))
|
| 161 |
+
#define sk_X509_TRUST_new_null() ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_null())
|
| 162 |
+
#define sk_X509_TRUST_new_reserve(cmp, n) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_reserve(ossl_check_X509_TRUST_compfunc_type(cmp), (n)))
|
| 163 |
+
#define sk_X509_TRUST_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_TRUST_sk_type(sk), (n))
|
| 164 |
+
#define sk_X509_TRUST_free(sk) OPENSSL_sk_free(ossl_check_X509_TRUST_sk_type(sk))
|
| 165 |
+
#define sk_X509_TRUST_zero(sk) OPENSSL_sk_zero(ossl_check_X509_TRUST_sk_type(sk))
|
| 166 |
+
#define sk_X509_TRUST_delete(sk, i) ((X509_TRUST *)OPENSSL_sk_delete(ossl_check_X509_TRUST_sk_type(sk), (i)))
|
| 167 |
+
#define sk_X509_TRUST_delete_ptr(sk, ptr) ((X509_TRUST *)OPENSSL_sk_delete_ptr(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)))
|
| 168 |
+
#define sk_X509_TRUST_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
| 169 |
+
#define sk_X509_TRUST_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
| 170 |
+
#define sk_X509_TRUST_pop(sk) ((X509_TRUST *)OPENSSL_sk_pop(ossl_check_X509_TRUST_sk_type(sk)))
|
| 171 |
+
#define sk_X509_TRUST_shift(sk) ((X509_TRUST *)OPENSSL_sk_shift(ossl_check_X509_TRUST_sk_type(sk)))
|
| 172 |
+
#define sk_X509_TRUST_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_TRUST_sk_type(sk),ossl_check_X509_TRUST_freefunc_type(freefunc))
|
| 173 |
+
#define sk_X509_TRUST_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), (idx))
|
| 174 |
+
#define sk_X509_TRUST_set(sk, idx, ptr) ((X509_TRUST *)OPENSSL_sk_set(ossl_check_X509_TRUST_sk_type(sk), (idx), ossl_check_X509_TRUST_type(ptr)))
|
| 175 |
+
#define sk_X509_TRUST_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
| 176 |
+
#define sk_X509_TRUST_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
|
| 177 |
+
#define sk_X509_TRUST_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), pnum)
|
| 178 |
+
#define sk_X509_TRUST_sort(sk) OPENSSL_sk_sort(ossl_check_X509_TRUST_sk_type(sk))
|
| 179 |
+
#define sk_X509_TRUST_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_TRUST_sk_type(sk))
|
| 180 |
+
#define sk_X509_TRUST_dup(sk) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_dup(ossl_check_const_X509_TRUST_sk_type(sk)))
|
| 181 |
+
#define sk_X509_TRUST_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_copyfunc_type(copyfunc), ossl_check_X509_TRUST_freefunc_type(freefunc)))
|
| 182 |
+
#define sk_X509_TRUST_set_cmp_func(sk, cmp) ((sk_X509_TRUST_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_compfunc_type(cmp)))
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
/* standard trust ids */
|
| 186 |
+
# define X509_TRUST_DEFAULT 0 /* Only valid in purpose settings */
|
| 187 |
+
# define X509_TRUST_COMPAT 1
|
| 188 |
+
# define X509_TRUST_SSL_CLIENT 2
|
| 189 |
+
# define X509_TRUST_SSL_SERVER 3
|
| 190 |
+
# define X509_TRUST_EMAIL 4
|
| 191 |
+
# define X509_TRUST_OBJECT_SIGN 5
|
| 192 |
+
# define X509_TRUST_OCSP_SIGN 6
|
| 193 |
+
# define X509_TRUST_OCSP_REQUEST 7
|
| 194 |
+
# define X509_TRUST_TSA 8
|
| 195 |
+
/* Keep these up to date! */
|
| 196 |
+
# define X509_TRUST_MIN 1
|
| 197 |
+
# define X509_TRUST_MAX 8
|
| 198 |
+
|
| 199 |
+
/* trust_flags values */
|
| 200 |
+
# define X509_TRUST_DYNAMIC (1U << 0)
|
| 201 |
+
# define X509_TRUST_DYNAMIC_NAME (1U << 1)
|
| 202 |
+
/* No compat trust if self-signed, preempts "DO_SS" */
|
| 203 |
+
# define X509_TRUST_NO_SS_COMPAT (1U << 2)
|
| 204 |
+
/* Compat trust if no explicit accepted trust EKUs */
|
| 205 |
+
# define X509_TRUST_DO_SS_COMPAT (1U << 3)
|
| 206 |
+
/* Accept "anyEKU" as a wildcard rejection OID and as a wildcard trust OID */
|
| 207 |
+
# define X509_TRUST_OK_ANY_EKU (1U << 4)
|
| 208 |
+
|
| 209 |
+
/* check_trust return codes */
|
| 210 |
+
# define X509_TRUST_TRUSTED 1
|
| 211 |
+
# define X509_TRUST_REJECTED 2
|
| 212 |
+
# define X509_TRUST_UNTRUSTED 3
|
| 213 |
+
|
| 214 |
+
int X509_TRUST_set(int *t, int trust);
|
| 215 |
+
int X509_TRUST_get_count(void);
|
| 216 |
+
X509_TRUST *X509_TRUST_get0(int idx);
|
| 217 |
+
int X509_TRUST_get_by_id(int id);
|
| 218 |
+
int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int),
|
| 219 |
+
const char *name, int arg1, void *arg2);
|
| 220 |
+
void X509_TRUST_cleanup(void);
|
| 221 |
+
int X509_TRUST_get_flags(const X509_TRUST *xp);
|
| 222 |
+
char *X509_TRUST_get0_name(const X509_TRUST *xp);
|
| 223 |
+
int X509_TRUST_get_trust(const X509_TRUST *xp);
|
| 224 |
+
|
| 225 |
+
int X509_trusted(const X509 *x);
|
| 226 |
+
int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
|
| 227 |
+
int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj);
|
| 228 |
+
void X509_trust_clear(X509 *x);
|
| 229 |
+
void X509_reject_clear(X509 *x);
|
| 230 |
+
STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x);
|
| 231 |
+
STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x);
|
| 232 |
+
|
| 233 |
+
int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
|
| 234 |
+
int);
|
| 235 |
+
int X509_check_trust(X509 *x, int id, int flags);
|
| 236 |
+
|
| 237 |
+
int X509_verify_cert(X509_STORE_CTX *ctx);
|
| 238 |
+
int X509_STORE_CTX_verify(X509_STORE_CTX *ctx);
|
| 239 |
+
STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
|
| 240 |
+
X509_STORE *store, int with_self_signed,
|
| 241 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 242 |
+
|
| 243 |
+
int X509_STORE_set_depth(X509_STORE *store, int depth);
|
| 244 |
+
|
| 245 |
+
typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);
|
| 246 |
+
int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx);
|
| 247 |
+
typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *);
|
| 248 |
+
typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
|
| 249 |
+
X509_STORE_CTX *ctx, X509 *x);
|
| 250 |
+
typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
|
| 251 |
+
X509 *x, X509 *issuer);
|
| 252 |
+
typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
|
| 253 |
+
typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
|
| 254 |
+
X509_CRL **crl, X509 *x);
|
| 255 |
+
typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl);
|
| 256 |
+
typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
|
| 257 |
+
X509_CRL *crl, X509 *x);
|
| 258 |
+
typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
|
| 259 |
+
typedef STACK_OF(X509)
|
| 260 |
+
*(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
|
| 261 |
+
const X509_NAME *nm);
|
| 262 |
+
typedef STACK_OF(X509_CRL)
|
| 263 |
+
*(*X509_STORE_CTX_lookup_crls_fn)(const X509_STORE_CTX *ctx,
|
| 264 |
+
const X509_NAME *nm);
|
| 265 |
+
typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx);
|
| 266 |
+
|
| 267 |
+
void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
|
| 268 |
+
|
| 269 |
+
# define X509_STORE_CTX_set_app_data(ctx,data) \
|
| 270 |
+
X509_STORE_CTX_set_ex_data(ctx,0,data)
|
| 271 |
+
# define X509_STORE_CTX_get_app_data(ctx) \
|
| 272 |
+
X509_STORE_CTX_get_ex_data(ctx,0)
|
| 273 |
+
|
| 274 |
+
# define X509_L_FILE_LOAD 1
|
| 275 |
+
# define X509_L_ADD_DIR 2
|
| 276 |
+
# define X509_L_ADD_STORE 3
|
| 277 |
+
# define X509_L_LOAD_STORE 4
|
| 278 |
+
|
| 279 |
+
# define X509_LOOKUP_load_file(x,name,type) \
|
| 280 |
+
X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
|
| 281 |
+
|
| 282 |
+
# define X509_LOOKUP_add_dir(x,name,type) \
|
| 283 |
+
X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
|
| 284 |
+
|
| 285 |
+
# define X509_LOOKUP_add_store(x,name) \
|
| 286 |
+
X509_LOOKUP_ctrl((x),X509_L_ADD_STORE,(name),0,NULL)
|
| 287 |
+
|
| 288 |
+
# define X509_LOOKUP_load_store(x,name) \
|
| 289 |
+
X509_LOOKUP_ctrl((x),X509_L_LOAD_STORE,(name),0,NULL)
|
| 290 |
+
|
| 291 |
+
# define X509_LOOKUP_load_file_ex(x, name, type, libctx, propq) \
|
| 292 |
+
X509_LOOKUP_ctrl_ex((x), X509_L_FILE_LOAD, (name), (long)(type), NULL,\
|
| 293 |
+
(libctx), (propq))
|
| 294 |
+
|
| 295 |
+
# define X509_LOOKUP_load_store_ex(x, name, libctx, propq) \
|
| 296 |
+
X509_LOOKUP_ctrl_ex((x), X509_L_LOAD_STORE, (name), 0, NULL, \
|
| 297 |
+
(libctx), (propq))
|
| 298 |
+
|
| 299 |
+
# define X509_LOOKUP_add_store_ex(x, name, libctx, propq) \
|
| 300 |
+
X509_LOOKUP_ctrl_ex((x), X509_L_ADD_STORE, (name), 0, NULL, \
|
| 301 |
+
(libctx), (propq))
|
| 302 |
+
|
| 303 |
+
# define X509_V_OK 0
|
| 304 |
+
# define X509_V_ERR_UNSPECIFIED 1
|
| 305 |
+
# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2
|
| 306 |
+
# define X509_V_ERR_UNABLE_TO_GET_CRL 3
|
| 307 |
+
# define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4
|
| 308 |
+
# define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5
|
| 309 |
+
# define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6
|
| 310 |
+
# define X509_V_ERR_CERT_SIGNATURE_FAILURE 7
|
| 311 |
+
# define X509_V_ERR_CRL_SIGNATURE_FAILURE 8
|
| 312 |
+
# define X509_V_ERR_CERT_NOT_YET_VALID 9
|
| 313 |
+
# define X509_V_ERR_CERT_HAS_EXPIRED 10
|
| 314 |
+
# define X509_V_ERR_CRL_NOT_YET_VALID 11
|
| 315 |
+
# define X509_V_ERR_CRL_HAS_EXPIRED 12
|
| 316 |
+
# define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13
|
| 317 |
+
# define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14
|
| 318 |
+
# define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15
|
| 319 |
+
# define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16
|
| 320 |
+
# define X509_V_ERR_OUT_OF_MEM 17
|
| 321 |
+
# define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18
|
| 322 |
+
# define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19
|
| 323 |
+
# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20
|
| 324 |
+
# define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21
|
| 325 |
+
# define X509_V_ERR_CERT_CHAIN_TOO_LONG 22
|
| 326 |
+
# define X509_V_ERR_CERT_REVOKED 23
|
| 327 |
+
# define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 24
|
| 328 |
+
# define X509_V_ERR_PATH_LENGTH_EXCEEDED 25
|
| 329 |
+
# define X509_V_ERR_INVALID_PURPOSE 26
|
| 330 |
+
# define X509_V_ERR_CERT_UNTRUSTED 27
|
| 331 |
+
# define X509_V_ERR_CERT_REJECTED 28
|
| 332 |
+
|
| 333 |
+
/* These are 'informational' when looking for issuer cert */
|
| 334 |
+
# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29
|
| 335 |
+
# define X509_V_ERR_AKID_SKID_MISMATCH 30
|
| 336 |
+
# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
|
| 337 |
+
# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
|
| 338 |
+
# define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33
|
| 339 |
+
# define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34
|
| 340 |
+
# define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35
|
| 341 |
+
# define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36
|
| 342 |
+
# define X509_V_ERR_INVALID_NON_CA 37
|
| 343 |
+
# define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38
|
| 344 |
+
# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39
|
| 345 |
+
# define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40
|
| 346 |
+
# define X509_V_ERR_INVALID_EXTENSION 41
|
| 347 |
+
# define X509_V_ERR_INVALID_POLICY_EXTENSION 42
|
| 348 |
+
# define X509_V_ERR_NO_EXPLICIT_POLICY 43
|
| 349 |
+
# define X509_V_ERR_DIFFERENT_CRL_SCOPE 44
|
| 350 |
+
# define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45
|
| 351 |
+
# define X509_V_ERR_UNNESTED_RESOURCE 46
|
| 352 |
+
# define X509_V_ERR_PERMITTED_VIOLATION 47
|
| 353 |
+
# define X509_V_ERR_EXCLUDED_VIOLATION 48
|
| 354 |
+
# define X509_V_ERR_SUBTREE_MINMAX 49
|
| 355 |
+
/* The application is not happy */
|
| 356 |
+
# define X509_V_ERR_APPLICATION_VERIFICATION 50
|
| 357 |
+
# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51
|
| 358 |
+
# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52
|
| 359 |
+
# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53
|
| 360 |
+
# define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54
|
| 361 |
+
/* Another issuer check debug option */
|
| 362 |
+
# define X509_V_ERR_PATH_LOOP 55
|
| 363 |
+
/* Suite B mode algorithm violation */
|
| 364 |
+
# define X509_V_ERR_SUITE_B_INVALID_VERSION 56
|
| 365 |
+
# define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57
|
| 366 |
+
# define X509_V_ERR_SUITE_B_INVALID_CURVE 58
|
| 367 |
+
# define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59
|
| 368 |
+
# define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60
|
| 369 |
+
# define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61
|
| 370 |
+
/* Host, email and IP check errors */
|
| 371 |
+
# define X509_V_ERR_HOSTNAME_MISMATCH 62
|
| 372 |
+
# define X509_V_ERR_EMAIL_MISMATCH 63
|
| 373 |
+
# define X509_V_ERR_IP_ADDRESS_MISMATCH 64
|
| 374 |
+
/* DANE TLSA errors */
|
| 375 |
+
# define X509_V_ERR_DANE_NO_MATCH 65
|
| 376 |
+
/* security level errors */
|
| 377 |
+
# define X509_V_ERR_EE_KEY_TOO_SMALL 66
|
| 378 |
+
# define X509_V_ERR_CA_KEY_TOO_SMALL 67
|
| 379 |
+
# define X509_V_ERR_CA_MD_TOO_WEAK 68
|
| 380 |
+
/* Caller error */
|
| 381 |
+
# define X509_V_ERR_INVALID_CALL 69
|
| 382 |
+
/* Issuer lookup error */
|
| 383 |
+
# define X509_V_ERR_STORE_LOOKUP 70
|
| 384 |
+
/* Certificate transparency */
|
| 385 |
+
# define X509_V_ERR_NO_VALID_SCTS 71
|
| 386 |
+
|
| 387 |
+
# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 72
|
| 388 |
+
/* OCSP status errors */
|
| 389 |
+
# define X509_V_ERR_OCSP_VERIFY_NEEDED 73 /* Need OCSP verification */
|
| 390 |
+
# define X509_V_ERR_OCSP_VERIFY_FAILED 74 /* Couldn't verify cert through OCSP */
|
| 391 |
+
# define X509_V_ERR_OCSP_CERT_UNKNOWN 75 /* Certificate wasn't recognized by the OCSP responder */
|
| 392 |
+
|
| 393 |
+
# define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 76
|
| 394 |
+
# define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 77
|
| 395 |
+
|
| 396 |
+
/* Errors in case a check in X509_V_FLAG_X509_STRICT mode fails */
|
| 397 |
+
# define X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY 78
|
| 398 |
+
# define X509_V_ERR_INVALID_CA 79
|
| 399 |
+
# define X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA 80
|
| 400 |
+
# define X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN 81
|
| 401 |
+
# define X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA 82
|
| 402 |
+
# define X509_V_ERR_ISSUER_NAME_EMPTY 83
|
| 403 |
+
# define X509_V_ERR_SUBJECT_NAME_EMPTY 84
|
| 404 |
+
# define X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER 85
|
| 405 |
+
# define X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER 86
|
| 406 |
+
# define X509_V_ERR_EMPTY_SUBJECT_ALT_NAME 87
|
| 407 |
+
# define X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL 88
|
| 408 |
+
# define X509_V_ERR_CA_BCONS_NOT_CRITICAL 89
|
| 409 |
+
# define X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL 90
|
| 410 |
+
# define X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL 91
|
| 411 |
+
# define X509_V_ERR_CA_CERT_MISSING_KEY_USAGE 92
|
| 412 |
+
# define X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3 93
|
| 413 |
+
# define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 94
|
| 414 |
+
# define X509_V_ERR_RPK_UNTRUSTED 95
|
| 415 |
+
|
| 416 |
+
/* Certificate verify flags */
|
| 417 |
+
# ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 418 |
+
# define X509_V_FLAG_CB_ISSUER_CHECK 0x0 /* Deprecated */
|
| 419 |
+
# endif
|
| 420 |
+
/* Use check time instead of current time */
|
| 421 |
+
# define X509_V_FLAG_USE_CHECK_TIME 0x2
|
| 422 |
+
/* Lookup CRLs */
|
| 423 |
+
# define X509_V_FLAG_CRL_CHECK 0x4
|
| 424 |
+
/* Lookup CRLs for whole chain */
|
| 425 |
+
# define X509_V_FLAG_CRL_CHECK_ALL 0x8
|
| 426 |
+
/* Ignore unhandled critical extensions */
|
| 427 |
+
# define X509_V_FLAG_IGNORE_CRITICAL 0x10
|
| 428 |
+
/* Disable workarounds for broken certificates */
|
| 429 |
+
# define X509_V_FLAG_X509_STRICT 0x20
|
| 430 |
+
/* Enable proxy certificate validation */
|
| 431 |
+
# define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40
|
| 432 |
+
/* Enable policy checking */
|
| 433 |
+
# define X509_V_FLAG_POLICY_CHECK 0x80
|
| 434 |
+
/* Policy variable require-explicit-policy */
|
| 435 |
+
# define X509_V_FLAG_EXPLICIT_POLICY 0x100
|
| 436 |
+
/* Policy variable inhibit-any-policy */
|
| 437 |
+
# define X509_V_FLAG_INHIBIT_ANY 0x200
|
| 438 |
+
/* Policy variable inhibit-policy-mapping */
|
| 439 |
+
# define X509_V_FLAG_INHIBIT_MAP 0x400
|
| 440 |
+
/* Notify callback that policy is OK */
|
| 441 |
+
# define X509_V_FLAG_NOTIFY_POLICY 0x800
|
| 442 |
+
/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */
|
| 443 |
+
# define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000
|
| 444 |
+
/* Delta CRL support */
|
| 445 |
+
# define X509_V_FLAG_USE_DELTAS 0x2000
|
| 446 |
+
/* Check self-signed CA signature */
|
| 447 |
+
# define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000
|
| 448 |
+
/* Use trusted store first */
|
| 449 |
+
# define X509_V_FLAG_TRUSTED_FIRST 0x8000
|
| 450 |
+
/* Suite B 128 bit only mode: not normally used */
|
| 451 |
+
# define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000
|
| 452 |
+
/* Suite B 192 bit only mode */
|
| 453 |
+
# define X509_V_FLAG_SUITEB_192_LOS 0x20000
|
| 454 |
+
/* Suite B 128 bit mode allowing 192 bit algorithms */
|
| 455 |
+
# define X509_V_FLAG_SUITEB_128_LOS 0x30000
|
| 456 |
+
/* Allow partial chains if at least one certificate is in trusted store */
|
| 457 |
+
# define X509_V_FLAG_PARTIAL_CHAIN 0x80000
|
| 458 |
+
/*
|
| 459 |
+
* If the initial chain is not trusted, do not attempt to build an alternative
|
| 460 |
+
* chain. Alternate chain checking was introduced in 1.1.0. Setting this flag
|
| 461 |
+
* will force the behaviour to match that of previous versions.
|
| 462 |
+
*/
|
| 463 |
+
# define X509_V_FLAG_NO_ALT_CHAINS 0x100000
|
| 464 |
+
/* Do not check certificate/CRL validity against current time */
|
| 465 |
+
# define X509_V_FLAG_NO_CHECK_TIME 0x200000
|
| 466 |
+
|
| 467 |
+
# define X509_VP_FLAG_DEFAULT 0x1
|
| 468 |
+
# define X509_VP_FLAG_OVERWRITE 0x2
|
| 469 |
+
# define X509_VP_FLAG_RESET_FLAGS 0x4
|
| 470 |
+
# define X509_VP_FLAG_LOCKED 0x8
|
| 471 |
+
# define X509_VP_FLAG_ONCE 0x10
|
| 472 |
+
|
| 473 |
+
/* Internal use: mask of policy related options */
|
| 474 |
+
# define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
|
| 475 |
+
| X509_V_FLAG_EXPLICIT_POLICY \
|
| 476 |
+
| X509_V_FLAG_INHIBIT_ANY \
|
| 477 |
+
| X509_V_FLAG_INHIBIT_MAP)
|
| 478 |
+
|
| 479 |
+
int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type,
|
| 480 |
+
const X509_NAME *name);
|
| 481 |
+
X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
|
| 482 |
+
X509_LOOKUP_TYPE type,
|
| 483 |
+
const X509_NAME *name);
|
| 484 |
+
X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
|
| 485 |
+
X509_OBJECT *x);
|
| 486 |
+
int X509_OBJECT_up_ref_count(X509_OBJECT *a);
|
| 487 |
+
X509_OBJECT *X509_OBJECT_new(void);
|
| 488 |
+
void X509_OBJECT_free(X509_OBJECT *a);
|
| 489 |
+
X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a);
|
| 490 |
+
X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a);
|
| 491 |
+
int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj);
|
| 492 |
+
X509_CRL *X509_OBJECT_get0_X509_CRL(const X509_OBJECT *a);
|
| 493 |
+
int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj);
|
| 494 |
+
X509_STORE *X509_STORE_new(void);
|
| 495 |
+
void X509_STORE_free(X509_STORE *xs);
|
| 496 |
+
int X509_STORE_lock(X509_STORE *xs);
|
| 497 |
+
int X509_STORE_unlock(X509_STORE *xs);
|
| 498 |
+
int X509_STORE_up_ref(X509_STORE *xs);
|
| 499 |
+
STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs);
|
| 500 |
+
STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *xs);
|
| 501 |
+
STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *xs);
|
| 502 |
+
STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *xs,
|
| 503 |
+
const X509_NAME *nm);
|
| 504 |
+
STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *st,
|
| 505 |
+
const X509_NAME *nm);
|
| 506 |
+
int X509_STORE_set_flags(X509_STORE *xs, unsigned long flags);
|
| 507 |
+
int X509_STORE_set_purpose(X509_STORE *xs, int purpose);
|
| 508 |
+
int X509_STORE_set_trust(X509_STORE *xs, int trust);
|
| 509 |
+
int X509_STORE_set1_param(X509_STORE *xs, const X509_VERIFY_PARAM *pm);
|
| 510 |
+
X509_VERIFY_PARAM *X509_STORE_get0_param(const X509_STORE *xs);
|
| 511 |
+
|
| 512 |
+
void X509_STORE_set_verify(X509_STORE *xs, X509_STORE_CTX_verify_fn verify);
|
| 513 |
+
#define X509_STORE_set_verify_func(ctx, func) \
|
| 514 |
+
X509_STORE_set_verify((ctx),(func))
|
| 515 |
+
void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx,
|
| 516 |
+
X509_STORE_CTX_verify_fn verify);
|
| 517 |
+
X509_STORE_CTX_verify_fn X509_STORE_get_verify(const X509_STORE *xs);
|
| 518 |
+
void X509_STORE_set_verify_cb(X509_STORE *xs,
|
| 519 |
+
X509_STORE_CTX_verify_cb verify_cb);
|
| 520 |
+
# define X509_STORE_set_verify_cb_func(ctx,func) \
|
| 521 |
+
X509_STORE_set_verify_cb((ctx),(func))
|
| 522 |
+
X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE *xs);
|
| 523 |
+
void X509_STORE_set_get_issuer(X509_STORE *xs,
|
| 524 |
+
X509_STORE_CTX_get_issuer_fn get_issuer);
|
| 525 |
+
X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(const X509_STORE *xs);
|
| 526 |
+
void X509_STORE_set_check_issued(X509_STORE *xs,
|
| 527 |
+
X509_STORE_CTX_check_issued_fn check_issued);
|
| 528 |
+
X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(const X509_STORE *s);
|
| 529 |
+
void X509_STORE_set_check_revocation(X509_STORE *xs,
|
| 530 |
+
X509_STORE_CTX_check_revocation_fn check_revocation);
|
| 531 |
+
X509_STORE_CTX_check_revocation_fn
|
| 532 |
+
X509_STORE_get_check_revocation(const X509_STORE *xs);
|
| 533 |
+
void X509_STORE_set_get_crl(X509_STORE *xs,
|
| 534 |
+
X509_STORE_CTX_get_crl_fn get_crl);
|
| 535 |
+
X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(const X509_STORE *xs);
|
| 536 |
+
void X509_STORE_set_check_crl(X509_STORE *xs,
|
| 537 |
+
X509_STORE_CTX_check_crl_fn check_crl);
|
| 538 |
+
X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(const X509_STORE *xs);
|
| 539 |
+
void X509_STORE_set_cert_crl(X509_STORE *xs,
|
| 540 |
+
X509_STORE_CTX_cert_crl_fn cert_crl);
|
| 541 |
+
X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(const X509_STORE *xs);
|
| 542 |
+
void X509_STORE_set_check_policy(X509_STORE *xs,
|
| 543 |
+
X509_STORE_CTX_check_policy_fn check_policy);
|
| 544 |
+
X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(const X509_STORE *s);
|
| 545 |
+
void X509_STORE_set_lookup_certs(X509_STORE *xs,
|
| 546 |
+
X509_STORE_CTX_lookup_certs_fn lookup_certs);
|
| 547 |
+
X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(const X509_STORE *s);
|
| 548 |
+
void X509_STORE_set_lookup_crls(X509_STORE *xs,
|
| 549 |
+
X509_STORE_CTX_lookup_crls_fn lookup_crls);
|
| 550 |
+
#define X509_STORE_set_lookup_crls_cb(ctx, func) \
|
| 551 |
+
X509_STORE_set_lookup_crls((ctx), (func))
|
| 552 |
+
X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(const X509_STORE *xs);
|
| 553 |
+
void X509_STORE_set_cleanup(X509_STORE *xs,
|
| 554 |
+
X509_STORE_CTX_cleanup_fn cleanup);
|
| 555 |
+
X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(const X509_STORE *xs);
|
| 556 |
+
|
| 557 |
+
#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 558 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef)
|
| 559 |
+
int X509_STORE_set_ex_data(X509_STORE *xs, int idx, void *data);
|
| 560 |
+
void *X509_STORE_get_ex_data(const X509_STORE *xs, int idx);
|
| 561 |
+
|
| 562 |
+
X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
| 563 |
+
X509_STORE_CTX *X509_STORE_CTX_new(void);
|
| 564 |
+
|
| 565 |
+
int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
|
| 566 |
+
|
| 567 |
+
void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
|
| 568 |
+
int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store,
|
| 569 |
+
X509 *target, STACK_OF(X509) *untrusted);
|
| 570 |
+
int X509_STORE_CTX_init_rpk(X509_STORE_CTX *ctx, X509_STORE *trust_store,
|
| 571 |
+
EVP_PKEY* rpk);
|
| 572 |
+
void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
|
| 573 |
+
void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
|
| 574 |
+
|
| 575 |
+
X509_STORE *X509_STORE_CTX_get0_store(const X509_STORE_CTX *ctx);
|
| 576 |
+
X509 *X509_STORE_CTX_get0_cert(const X509_STORE_CTX *ctx);
|
| 577 |
+
EVP_PKEY *X509_STORE_CTX_get0_rpk(const X509_STORE_CTX *ctx);
|
| 578 |
+
STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(const X509_STORE_CTX *ctx);
|
| 579 |
+
void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
|
| 580 |
+
void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
|
| 581 |
+
X509_STORE_CTX_verify_cb verify);
|
| 582 |
+
X509_STORE_CTX_verify_cb X509_STORE_CTX_get_verify_cb(const X509_STORE_CTX *ctx);
|
| 583 |
+
X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(const X509_STORE_CTX *ctx);
|
| 584 |
+
X509_STORE_CTX_get_issuer_fn X509_STORE_CTX_get_get_issuer(const X509_STORE_CTX *ctx);
|
| 585 |
+
X509_STORE_CTX_check_issued_fn X509_STORE_CTX_get_check_issued(const X509_STORE_CTX *ctx);
|
| 586 |
+
X509_STORE_CTX_check_revocation_fn X509_STORE_CTX_get_check_revocation(const X509_STORE_CTX *ctx);
|
| 587 |
+
void X509_STORE_CTX_set_get_crl(X509_STORE_CTX *ctx,
|
| 588 |
+
X509_STORE_CTX_get_crl_fn get_crl);
|
| 589 |
+
X509_STORE_CTX_get_crl_fn X509_STORE_CTX_get_get_crl(const X509_STORE_CTX *ctx);
|
| 590 |
+
X509_STORE_CTX_check_crl_fn X509_STORE_CTX_get_check_crl(const X509_STORE_CTX *ctx);
|
| 591 |
+
X509_STORE_CTX_cert_crl_fn X509_STORE_CTX_get_cert_crl(const X509_STORE_CTX *ctx);
|
| 592 |
+
X509_STORE_CTX_check_policy_fn X509_STORE_CTX_get_check_policy(const X509_STORE_CTX *ctx);
|
| 593 |
+
X509_STORE_CTX_lookup_certs_fn X509_STORE_CTX_get_lookup_certs(const X509_STORE_CTX *ctx);
|
| 594 |
+
X509_STORE_CTX_lookup_crls_fn X509_STORE_CTX_get_lookup_crls(const X509_STORE_CTX *ctx);
|
| 595 |
+
X509_STORE_CTX_cleanup_fn X509_STORE_CTX_get_cleanup(const X509_STORE_CTX *ctx);
|
| 596 |
+
|
| 597 |
+
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
| 598 |
+
# define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain
|
| 599 |
+
# define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
|
| 600 |
+
# define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
|
| 601 |
+
# define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject
|
| 602 |
+
# define X509_STORE_get1_certs X509_STORE_CTX_get1_certs
|
| 603 |
+
# define X509_STORE_get1_crls X509_STORE_CTX_get1_crls
|
| 604 |
+
/* the following macro is misspelled; use X509_STORE_get1_certs instead */
|
| 605 |
+
# define X509_STORE_get1_cert X509_STORE_CTX_get1_certs
|
| 606 |
+
/* the following macro is misspelled; use X509_STORE_get1_crls instead */
|
| 607 |
+
# define X509_STORE_get1_crl X509_STORE_CTX_get1_crls
|
| 608 |
+
#endif
|
| 609 |
+
|
| 610 |
+
X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *xs, X509_LOOKUP_METHOD *m);
|
| 611 |
+
X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
|
| 612 |
+
X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
|
| 613 |
+
X509_LOOKUP_METHOD *X509_LOOKUP_store(void);
|
| 614 |
+
|
| 615 |
+
typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc,
|
| 616 |
+
long argl, char **ret);
|
| 617 |
+
typedef int (*X509_LOOKUP_ctrl_ex_fn)(
|
| 618 |
+
X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret,
|
| 619 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 620 |
+
|
| 621 |
+
typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx,
|
| 622 |
+
X509_LOOKUP_TYPE type,
|
| 623 |
+
const X509_NAME *name,
|
| 624 |
+
X509_OBJECT *ret);
|
| 625 |
+
typedef int (*X509_LOOKUP_get_by_subject_ex_fn)(X509_LOOKUP *ctx,
|
| 626 |
+
X509_LOOKUP_TYPE type,
|
| 627 |
+
const X509_NAME *name,
|
| 628 |
+
X509_OBJECT *ret,
|
| 629 |
+
OSSL_LIB_CTX *libctx,
|
| 630 |
+
const char *propq);
|
| 631 |
+
typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx,
|
| 632 |
+
X509_LOOKUP_TYPE type,
|
| 633 |
+
const X509_NAME *name,
|
| 634 |
+
const ASN1_INTEGER *serial,
|
| 635 |
+
X509_OBJECT *ret);
|
| 636 |
+
typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx,
|
| 637 |
+
X509_LOOKUP_TYPE type,
|
| 638 |
+
const unsigned char* bytes,
|
| 639 |
+
int len,
|
| 640 |
+
X509_OBJECT *ret);
|
| 641 |
+
typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx,
|
| 642 |
+
X509_LOOKUP_TYPE type,
|
| 643 |
+
const char *str,
|
| 644 |
+
int len,
|
| 645 |
+
X509_OBJECT *ret);
|
| 646 |
+
|
| 647 |
+
X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name);
|
| 648 |
+
void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method);
|
| 649 |
+
|
| 650 |
+
int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method,
|
| 651 |
+
int (*new_item) (X509_LOOKUP *ctx));
|
| 652 |
+
int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method))
|
| 653 |
+
(X509_LOOKUP *ctx);
|
| 654 |
+
|
| 655 |
+
int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method,
|
| 656 |
+
void (*free_fn) (X509_LOOKUP *ctx));
|
| 657 |
+
void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method))
|
| 658 |
+
(X509_LOOKUP *ctx);
|
| 659 |
+
|
| 660 |
+
int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method,
|
| 661 |
+
int (*init) (X509_LOOKUP *ctx));
|
| 662 |
+
int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method))
|
| 663 |
+
(X509_LOOKUP *ctx);
|
| 664 |
+
|
| 665 |
+
int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method,
|
| 666 |
+
int (*shutdown) (X509_LOOKUP *ctx));
|
| 667 |
+
int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method))
|
| 668 |
+
(X509_LOOKUP *ctx);
|
| 669 |
+
|
| 670 |
+
int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method,
|
| 671 |
+
X509_LOOKUP_ctrl_fn ctrl_fn);
|
| 672 |
+
X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method);
|
| 673 |
+
|
| 674 |
+
int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method,
|
| 675 |
+
X509_LOOKUP_get_by_subject_fn fn);
|
| 676 |
+
X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject(
|
| 677 |
+
const X509_LOOKUP_METHOD *method);
|
| 678 |
+
|
| 679 |
+
int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method,
|
| 680 |
+
X509_LOOKUP_get_by_issuer_serial_fn fn);
|
| 681 |
+
X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial(
|
| 682 |
+
const X509_LOOKUP_METHOD *method);
|
| 683 |
+
|
| 684 |
+
int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method,
|
| 685 |
+
X509_LOOKUP_get_by_fingerprint_fn fn);
|
| 686 |
+
X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint(
|
| 687 |
+
const X509_LOOKUP_METHOD *method);
|
| 688 |
+
|
| 689 |
+
int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method,
|
| 690 |
+
X509_LOOKUP_get_by_alias_fn fn);
|
| 691 |
+
X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias(
|
| 692 |
+
const X509_LOOKUP_METHOD *method);
|
| 693 |
+
|
| 694 |
+
|
| 695 |
+
int X509_STORE_add_cert(X509_STORE *xs, X509 *x);
|
| 696 |
+
int X509_STORE_add_crl(X509_STORE *xs, X509_CRL *x);
|
| 697 |
+
|
| 698 |
+
int X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *vs,
|
| 699 |
+
X509_LOOKUP_TYPE type,
|
| 700 |
+
const X509_NAME *name, X509_OBJECT *ret);
|
| 701 |
+
X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs,
|
| 702 |
+
X509_LOOKUP_TYPE type,
|
| 703 |
+
const X509_NAME *name);
|
| 704 |
+
|
| 705 |
+
int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
|
| 706 |
+
long argl, char **ret);
|
| 707 |
+
int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
|
| 708 |
+
char **ret, OSSL_LIB_CTX *libctx, const char *propq);
|
| 709 |
+
|
| 710 |
+
int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
|
| 711 |
+
int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
|
| 712 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 713 |
+
int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
|
| 714 |
+
int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
|
| 715 |
+
int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
|
| 716 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 717 |
+
|
| 718 |
+
X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
|
| 719 |
+
void X509_LOOKUP_free(X509_LOOKUP *ctx);
|
| 720 |
+
int X509_LOOKUP_init(X509_LOOKUP *ctx);
|
| 721 |
+
int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 722 |
+
const X509_NAME *name, X509_OBJECT *ret);
|
| 723 |
+
int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 724 |
+
const X509_NAME *name, X509_OBJECT *ret,
|
| 725 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 726 |
+
int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 727 |
+
const X509_NAME *name,
|
| 728 |
+
const ASN1_INTEGER *serial,
|
| 729 |
+
X509_OBJECT *ret);
|
| 730 |
+
int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 731 |
+
const unsigned char *bytes, int len,
|
| 732 |
+
X509_OBJECT *ret);
|
| 733 |
+
int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
|
| 734 |
+
const char *str, int len, X509_OBJECT *ret);
|
| 735 |
+
int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data);
|
| 736 |
+
void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
|
| 737 |
+
X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx);
|
| 738 |
+
int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
|
| 739 |
+
|
| 740 |
+
int X509_STORE_load_file(X509_STORE *xs, const char *file);
|
| 741 |
+
int X509_STORE_load_path(X509_STORE *xs, const char *path);
|
| 742 |
+
int X509_STORE_load_store(X509_STORE *xs, const char *store);
|
| 743 |
+
int X509_STORE_load_locations(X509_STORE *s, const char *file, const char *dir);
|
| 744 |
+
int X509_STORE_set_default_paths(X509_STORE *xs);
|
| 745 |
+
|
| 746 |
+
int X509_STORE_load_file_ex(X509_STORE *xs, const char *file,
|
| 747 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 748 |
+
int X509_STORE_load_store_ex(X509_STORE *xs, const char *store,
|
| 749 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 750 |
+
int X509_STORE_load_locations_ex(X509_STORE *xs,
|
| 751 |
+
const char *file, const char *dir,
|
| 752 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 753 |
+
int X509_STORE_set_default_paths_ex(X509_STORE *xs,
|
| 754 |
+
OSSL_LIB_CTX *libctx, const char *propq);
|
| 755 |
+
|
| 756 |
+
#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \
|
| 757 |
+
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef)
|
| 758 |
+
int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data);
|
| 759 |
+
void *X509_STORE_CTX_get_ex_data(const X509_STORE_CTX *ctx, int idx);
|
| 760 |
+
int X509_STORE_CTX_get_error(const X509_STORE_CTX *ctx);
|
| 761 |
+
void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);
|
| 762 |
+
int X509_STORE_CTX_get_error_depth(const X509_STORE_CTX *ctx);
|
| 763 |
+
void X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth);
|
| 764 |
+
X509 *X509_STORE_CTX_get_current_cert(const X509_STORE_CTX *ctx);
|
| 765 |
+
void X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x);
|
| 766 |
+
X509 *X509_STORE_CTX_get0_current_issuer(const X509_STORE_CTX *ctx);
|
| 767 |
+
X509_CRL *X509_STORE_CTX_get0_current_crl(const X509_STORE_CTX *ctx);
|
| 768 |
+
X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(const X509_STORE_CTX *ctx);
|
| 769 |
+
STACK_OF(X509) *X509_STORE_CTX_get0_chain(const X509_STORE_CTX *ctx);
|
| 770 |
+
STACK_OF(X509) *X509_STORE_CTX_get1_chain(const X509_STORE_CTX *ctx);
|
| 771 |
+
void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *target);
|
| 772 |
+
void X509_STORE_CTX_set0_rpk(X509_STORE_CTX *ctx, EVP_PKEY *target);
|
| 773 |
+
void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);
|
| 774 |
+
void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk);
|
| 775 |
+
int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
|
| 776 |
+
int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
|
| 777 |
+
int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
|
| 778 |
+
int purpose, int trust);
|
| 779 |
+
void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);
|
| 780 |
+
void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
|
| 781 |
+
time_t t);
|
| 782 |
+
void X509_STORE_CTX_set_current_reasons(X509_STORE_CTX *ctx,
|
| 783 |
+
unsigned int current_reasons);
|
| 784 |
+
|
| 785 |
+
X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(const X509_STORE_CTX *ctx);
|
| 786 |
+
int X509_STORE_CTX_get_explicit_policy(const X509_STORE_CTX *ctx);
|
| 787 |
+
int X509_STORE_CTX_get_num_untrusted(const X509_STORE_CTX *ctx);
|
| 788 |
+
|
| 789 |
+
X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(const X509_STORE_CTX *ctx);
|
| 790 |
+
void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
|
| 791 |
+
int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
|
| 792 |
+
|
| 793 |
+
/*
|
| 794 |
+
* Bridge opacity barrier between libcrypt and libssl, also needed to support
|
| 795 |
+
* offline testing in test/danetest.c
|
| 796 |
+
*/
|
| 797 |
+
void X509_STORE_CTX_set0_dane(X509_STORE_CTX *ctx, SSL_DANE *dane);
|
| 798 |
+
#define DANE_FLAG_NO_DANE_EE_NAMECHECKS (1L << 0)
|
| 799 |
+
|
| 800 |
+
/* X509_VERIFY_PARAM functions */
|
| 801 |
+
|
| 802 |
+
X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);
|
| 803 |
+
void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);
|
| 804 |
+
int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,
|
| 805 |
+
const X509_VERIFY_PARAM *from);
|
| 806 |
+
int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
|
| 807 |
+
const X509_VERIFY_PARAM *from);
|
| 808 |
+
int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);
|
| 809 |
+
int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
|
| 810 |
+
unsigned long flags);
|
| 811 |
+
int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
|
| 812 |
+
unsigned long flags);
|
| 813 |
+
unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param);
|
| 814 |
+
int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
|
| 815 |
+
int X509_VERIFY_PARAM_get_purpose(const X509_VERIFY_PARAM *param);
|
| 816 |
+
int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
|
| 817 |
+
void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
|
| 818 |
+
void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level);
|
| 819 |
+
time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param);
|
| 820 |
+
void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
|
| 821 |
+
int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
|
| 822 |
+
ASN1_OBJECT *policy);
|
| 823 |
+
int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
|
| 824 |
+
STACK_OF(ASN1_OBJECT) *policies);
|
| 825 |
+
|
| 826 |
+
int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param,
|
| 827 |
+
uint32_t flags);
|
| 828 |
+
uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param);
|
| 829 |
+
|
| 830 |
+
char *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx);
|
| 831 |
+
int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
|
| 832 |
+
const char *name, size_t namelen);
|
| 833 |
+
int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
|
| 834 |
+
const char *name, size_t namelen);
|
| 835 |
+
void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
|
| 836 |
+
unsigned int flags);
|
| 837 |
+
unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
|
| 838 |
+
char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param);
|
| 839 |
+
void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *);
|
| 840 |
+
char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param);
|
| 841 |
+
int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
|
| 842 |
+
const char *email, size_t emaillen);
|
| 843 |
+
char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param);
|
| 844 |
+
int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
|
| 845 |
+
const unsigned char *ip, size_t iplen);
|
| 846 |
+
int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
|
| 847 |
+
const char *ipasc);
|
| 848 |
+
|
| 849 |
+
int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
|
| 850 |
+
int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param);
|
| 851 |
+
const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param);
|
| 852 |
+
|
| 853 |
+
int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);
|
| 854 |
+
int X509_VERIFY_PARAM_get_count(void);
|
| 855 |
+
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id);
|
| 856 |
+
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);
|
| 857 |
+
void X509_VERIFY_PARAM_table_cleanup(void);
|
| 858 |
+
|
| 859 |
+
/* Non positive return values are errors */
|
| 860 |
+
#define X509_PCY_TREE_FAILURE -2 /* Failure to satisfy explicit policy */
|
| 861 |
+
#define X509_PCY_TREE_INVALID -1 /* Inconsistent or invalid extensions */
|
| 862 |
+
#define X509_PCY_TREE_INTERNAL 0 /* Internal error, most likely malloc */
|
| 863 |
+
|
| 864 |
+
/*
|
| 865 |
+
* Positive return values form a bit mask, all but the first are internal to
|
| 866 |
+
* the library and don't appear in results from X509_policy_check().
|
| 867 |
+
*/
|
| 868 |
+
#define X509_PCY_TREE_VALID 1 /* The policy tree is valid */
|
| 869 |
+
#define X509_PCY_TREE_EMPTY 2 /* The policy tree is empty */
|
| 870 |
+
#define X509_PCY_TREE_EXPLICIT 4 /* Explicit policy required */
|
| 871 |
+
|
| 872 |
+
int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,
|
| 873 |
+
STACK_OF(X509) *certs,
|
| 874 |
+
STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags);
|
| 875 |
+
|
| 876 |
+
void X509_policy_tree_free(X509_POLICY_TREE *tree);
|
| 877 |
+
|
| 878 |
+
int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
|
| 879 |
+
X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
|
| 880 |
+
int i);
|
| 881 |
+
|
| 882 |
+
STACK_OF(X509_POLICY_NODE)
|
| 883 |
+
*X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree);
|
| 884 |
+
|
| 885 |
+
STACK_OF(X509_POLICY_NODE)
|
| 886 |
+
*X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree);
|
| 887 |
+
|
| 888 |
+
int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
|
| 889 |
+
|
| 890 |
+
X509_POLICY_NODE *X509_policy_level_get0_node(const X509_POLICY_LEVEL *level,
|
| 891 |
+
int i);
|
| 892 |
+
|
| 893 |
+
const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
|
| 894 |
+
|
| 895 |
+
STACK_OF(POLICYQUALINFO)
|
| 896 |
+
*X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node);
|
| 897 |
+
const X509_POLICY_NODE
|
| 898 |
+
*X509_policy_node_get0_parent(const X509_POLICY_NODE *node);
|
| 899 |
+
|
| 900 |
+
#ifdef __cplusplus
|
| 901 |
+
}
|
| 902 |
+
#endif
|
| 903 |
+
#endif
|
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/x509v3.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data_prepare/node-v24.12.0-linux-x64/include/node/uv.h
ADDED
|
@@ -0,0 +1,1990 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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ved.
|
| 2 |
+
*
|
| 3 |
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 4 |
+
* of this software and associated documentation files (the "Software"), to
|
| 5 |
+
* deal in the Software without restriction, including without limitation the
|
| 6 |
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 7 |
+
* sell copies of the Software, and to permit persons to whom the Software is
|
| 8 |
+
* furnished to do so, subject to the following conditions:
|
| 9 |
+
*
|
| 10 |
+
* The above copyright notice and this permission notice shall be included in
|
| 11 |
+
* all copies or substantial portions of the Software.
|
| 12 |
+
*
|
| 13 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 15 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 16 |
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 17 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
| 18 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
| 19 |
+
* IN THE SOFTWARE.
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/* See https://github.com/libuv/libuv#documentation for documentation. */
|
| 23 |
+
|
| 24 |
+
#ifndef UV_H
|
| 25 |
+
#define UV_H
|
| 26 |
+
#ifdef __cplusplus
|
| 27 |
+
extern "C" {
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
#if defined(BUILDING_UV_SHARED) && defined(USING_UV_SHARED)
|
| 31 |
+
#error "Define either BUILDING_UV_SHARED or USING_UV_SHARED, not both."
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
#ifndef UV_EXTERN
|
| 35 |
+
#ifdef _WIN32
|
| 36 |
+
/* Windows - set up dll import/export decorators. */
|
| 37 |
+
# if defined(BUILDING_UV_SHARED)
|
| 38 |
+
/* Building shared library. */
|
| 39 |
+
# define UV_EXTERN __declspec(dllexport)
|
| 40 |
+
# elif defined(USING_UV_SHARED)
|
| 41 |
+
/* Using shared library. */
|
| 42 |
+
# define UV_EXTERN __declspec(dllimport)
|
| 43 |
+
# else
|
| 44 |
+
/* Building static library. */
|
| 45 |
+
# define UV_EXTERN /* nothing */
|
| 46 |
+
# endif
|
| 47 |
+
#elif __GNUC__ >= 4
|
| 48 |
+
# define UV_EXTERN __attribute__((visibility("default")))
|
| 49 |
+
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) /* Sun Studio >= 8 */
|
| 50 |
+
# define UV_EXTERN __global
|
| 51 |
+
#else
|
| 52 |
+
# define UV_EXTERN /* nothing */
|
| 53 |
+
#endif
|
| 54 |
+
#endif /* UV_EXTERN */
|
| 55 |
+
|
| 56 |
+
#include "uv/errno.h"
|
| 57 |
+
#include "uv/version.h"
|
| 58 |
+
#include <stddef.h>
|
| 59 |
+
#include <stdio.h>
|
| 60 |
+
#include <stdint.h>
|
| 61 |
+
#include <math.h>
|
| 62 |
+
|
| 63 |
+
/* Internal type, do not use. */
|
| 64 |
+
struct uv__queue {
|
| 65 |
+
struct uv__queue* next;
|
| 66 |
+
struct uv__queue* prev;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
#if defined(_WIN32)
|
| 70 |
+
# include "uv/win.h"
|
| 71 |
+
#else
|
| 72 |
+
# include "uv/unix.h"
|
| 73 |
+
#endif
|
| 74 |
+
|
| 75 |
+
/* Expand this list if necessary. */
|
| 76 |
+
#define UV_ERRNO_MAP(XX) \
|
| 77 |
+
XX(E2BIG, "argument list too long") \
|
| 78 |
+
XX(EACCES, "permission denied") \
|
| 79 |
+
XX(EADDRINUSE, "address already in use") \
|
| 80 |
+
XX(EADDRNOTAVAIL, "address not available") \
|
| 81 |
+
XX(EAFNOSUPPORT, "address family not supported") \
|
| 82 |
+
XX(EAGAIN, "resource temporarily unavailable") \
|
| 83 |
+
XX(EAI_ADDRFAMILY, "address family not supported") \
|
| 84 |
+
XX(EAI_AGAIN, "temporary failure") \
|
| 85 |
+
XX(EAI_BADFLAGS, "bad ai_flags value") \
|
| 86 |
+
XX(EAI_BADHINTS, "invalid value for hints") \
|
| 87 |
+
XX(EAI_CANCELED, "request canceled") \
|
| 88 |
+
XX(EAI_FAIL, "permanent failure") \
|
| 89 |
+
XX(EAI_FAMILY, "ai_family not supported") \
|
| 90 |
+
XX(EAI_MEMORY, "out of memory") \
|
| 91 |
+
XX(EAI_NODATA, "no address") \
|
| 92 |
+
XX(EAI_NONAME, "unknown node or service") \
|
| 93 |
+
XX(EAI_OVERFLOW, "argument buffer overflow") \
|
| 94 |
+
XX(EAI_PROTOCOL, "resolved protocol is unknown") \
|
| 95 |
+
XX(EAI_SERVICE, "service not available for socket type") \
|
| 96 |
+
XX(EAI_SOCKTYPE, "socket type not supported") \
|
| 97 |
+
XX(EALREADY, "connection already in progress") \
|
| 98 |
+
XX(EBADF, "bad file descriptor") \
|
| 99 |
+
XX(EBUSY, "resource busy or locked") \
|
| 100 |
+
XX(ECANCELED, "operation canceled") \
|
| 101 |
+
XX(ECHARSET, "invalid Unicode character") \
|
| 102 |
+
XX(ECONNABORTED, "software caused connection abort") \
|
| 103 |
+
XX(ECONNREFUSED, "connection refused") \
|
| 104 |
+
XX(ECONNRESET, "connection reset by peer") \
|
| 105 |
+
XX(EDESTADDRREQ, "destination address required") \
|
| 106 |
+
XX(EEXIST, "file already exists") \
|
| 107 |
+
XX(EFAULT, "bad address in system call argument") \
|
| 108 |
+
XX(EFBIG, "file too large") \
|
| 109 |
+
XX(EHOSTUNREACH, "host is unreachable") \
|
| 110 |
+
XX(EINTR, "interrupted system call") \
|
| 111 |
+
XX(EINVAL, "invalid argument") \
|
| 112 |
+
XX(EIO, "i/o error") \
|
| 113 |
+
XX(EISCONN, "socket is already connected") \
|
| 114 |
+
XX(EISDIR, "illegal operation on a directory") \
|
| 115 |
+
XX(ELOOP, "too many symbolic links encountered") \
|
| 116 |
+
XX(EMFILE, "too many open files") \
|
| 117 |
+
XX(EMSGSIZE, "message too long") \
|
| 118 |
+
XX(ENAMETOOLONG, "name too long") \
|
| 119 |
+
XX(ENETDOWN, "network is down") \
|
| 120 |
+
XX(ENETUNREACH, "network is unreachable") \
|
| 121 |
+
XX(ENFILE, "file table overflow") \
|
| 122 |
+
XX(ENOBUFS, "no buffer space available") \
|
| 123 |
+
XX(ENODEV, "no such device") \
|
| 124 |
+
XX(ENOENT, "no such file or directory") \
|
| 125 |
+
XX(ENOMEM, "not enough memory") \
|
| 126 |
+
XX(ENONET, "machine is not on the network") \
|
| 127 |
+
XX(ENOPROTOOPT, "protocol not available") \
|
| 128 |
+
XX(ENOSPC, "no space left on device") \
|
| 129 |
+
XX(ENOSYS, "function not implemented") \
|
| 130 |
+
XX(ENOTCONN, "socket is not connected") \
|
| 131 |
+
XX(ENOTDIR, "not a directory") \
|
| 132 |
+
XX(ENOTEMPTY, "directory not empty") \
|
| 133 |
+
XX(ENOTSOCK, "socket operation on non-socket") \
|
| 134 |
+
XX(ENOTSUP, "operation not supported on socket") \
|
| 135 |
+
XX(EOVERFLOW, "value too large for defined data type") \
|
| 136 |
+
XX(EPERM, "operation not permitted") \
|
| 137 |
+
XX(EPIPE, "broken pipe") \
|
| 138 |
+
XX(EPROTO, "protocol error") \
|
| 139 |
+
XX(EPROTONOSUPPORT, "protocol not supported") \
|
| 140 |
+
XX(EPROTOTYPE, "protocol wrong type for socket") \
|
| 141 |
+
XX(ERANGE, "result too large") \
|
| 142 |
+
XX(EROFS, "read-only file system") \
|
| 143 |
+
XX(ESHUTDOWN, "cannot send after transport endpoint shutdown") \
|
| 144 |
+
XX(ESPIPE, "invalid seek") \
|
| 145 |
+
XX(ESRCH, "no such process") \
|
| 146 |
+
XX(ETIMEDOUT, "connection timed out") \
|
| 147 |
+
XX(ETXTBSY, "text file is busy") \
|
| 148 |
+
XX(EXDEV, "cross-device link not permitted") \
|
| 149 |
+
XX(UNKNOWN, "unknown error") \
|
| 150 |
+
XX(EOF, "end of file") \
|
| 151 |
+
XX(ENXIO, "no such device or address") \
|
| 152 |
+
XX(EMLINK, "too many links") \
|
| 153 |
+
XX(EHOSTDOWN, "host is down") \
|
| 154 |
+
XX(EREMOTEIO, "remote I/O error") \
|
| 155 |
+
XX(ENOTTY, "inappropriate ioctl for device") \
|
| 156 |
+
XX(EFTYPE, "inappropriate file type or format") \
|
| 157 |
+
XX(EILSEQ, "illegal byte sequence") \
|
| 158 |
+
XX(ESOCKTNOSUPPORT, "socket type not supported") \
|
| 159 |
+
XX(ENODATA, "no data available") \
|
| 160 |
+
XX(EUNATCH, "protocol driver not attached") \
|
| 161 |
+
XX(ENOEXEC, "exec format error") \
|
| 162 |
+
|
| 163 |
+
#define UV_HANDLE_TYPE_MAP(XX) \
|
| 164 |
+
XX(ASYNC, async) \
|
| 165 |
+
XX(CHECK, check) \
|
| 166 |
+
XX(FS_EVENT, fs_event) \
|
| 167 |
+
XX(FS_POLL, fs_poll) \
|
| 168 |
+
XX(HANDLE, handle) \
|
| 169 |
+
XX(IDLE, idle) \
|
| 170 |
+
XX(NAMED_PIPE, pipe) \
|
| 171 |
+
XX(POLL, poll) \
|
| 172 |
+
XX(PREPARE, prepare) \
|
| 173 |
+
XX(PROCESS, process) \
|
| 174 |
+
XX(STREAM, stream) \
|
| 175 |
+
XX(TCP, tcp) \
|
| 176 |
+
XX(TIMER, timer) \
|
| 177 |
+
XX(TTY, tty) \
|
| 178 |
+
XX(UDP, udp) \
|
| 179 |
+
XX(SIGNAL, signal) \
|
| 180 |
+
|
| 181 |
+
#define UV_REQ_TYPE_MAP(XX) \
|
| 182 |
+
XX(REQ, req) \
|
| 183 |
+
XX(CONNECT, connect) \
|
| 184 |
+
XX(WRITE, write) \
|
| 185 |
+
XX(SHUTDOWN, shutdown) \
|
| 186 |
+
XX(UDP_SEND, udp_send) \
|
| 187 |
+
XX(FS, fs) \
|
| 188 |
+
XX(WORK, work) \
|
| 189 |
+
XX(GETADDRINFO, getaddrinfo) \
|
| 190 |
+
XX(GETNAMEINFO, getnameinfo) \
|
| 191 |
+
XX(RANDOM, random) \
|
| 192 |
+
|
| 193 |
+
typedef enum {
|
| 194 |
+
#define XX(code, _) UV_ ## code = UV__ ## code,
|
| 195 |
+
UV_ERRNO_MAP(XX)
|
| 196 |
+
#undef XX
|
| 197 |
+
UV_ERRNO_MAX = UV__EOF - 1
|
| 198 |
+
} uv_errno_t;
|
| 199 |
+
|
| 200 |
+
typedef enum {
|
| 201 |
+
UV_UNKNOWN_HANDLE = 0,
|
| 202 |
+
#define XX(uc, lc) UV_##uc,
|
| 203 |
+
UV_HANDLE_TYPE_MAP(XX)
|
| 204 |
+
#undef XX
|
| 205 |
+
UV_FILE,
|
| 206 |
+
UV_HANDLE_TYPE_MAX
|
| 207 |
+
} uv_handle_type;
|
| 208 |
+
|
| 209 |
+
typedef enum {
|
| 210 |
+
UV_UNKNOWN_REQ = 0,
|
| 211 |
+
#define XX(uc, lc) UV_##uc,
|
| 212 |
+
UV_REQ_TYPE_MAP(XX)
|
| 213 |
+
#undef XX
|
| 214 |
+
UV_REQ_TYPE_PRIVATE
|
| 215 |
+
UV_REQ_TYPE_MAX
|
| 216 |
+
} uv_req_type;
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
/* Handle types. */
|
| 220 |
+
typedef struct uv_loop_s uv_loop_t;
|
| 221 |
+
typedef struct uv_handle_s uv_handle_t;
|
| 222 |
+
typedef struct uv_dir_s uv_dir_t;
|
| 223 |
+
typedef struct uv_stream_s uv_stream_t;
|
| 224 |
+
typedef struct uv_tcp_s uv_tcp_t;
|
| 225 |
+
typedef struct uv_udp_s uv_udp_t;
|
| 226 |
+
typedef struct uv_pipe_s uv_pipe_t;
|
| 227 |
+
typedef struct uv_tty_s uv_tty_t;
|
| 228 |
+
typedef struct uv_poll_s uv_poll_t;
|
| 229 |
+
typedef struct uv_timer_s uv_timer_t;
|
| 230 |
+
typedef struct uv_prepare_s uv_prepare_t;
|
| 231 |
+
typedef struct uv_check_s uv_check_t;
|
| 232 |
+
typedef struct uv_idle_s uv_idle_t;
|
| 233 |
+
typedef struct uv_async_s uv_async_t;
|
| 234 |
+
typedef struct uv_process_s uv_process_t;
|
| 235 |
+
typedef struct uv_fs_event_s uv_fs_event_t;
|
| 236 |
+
typedef struct uv_fs_poll_s uv_fs_poll_t;
|
| 237 |
+
typedef struct uv_signal_s uv_signal_t;
|
| 238 |
+
|
| 239 |
+
/* Request types. */
|
| 240 |
+
typedef struct uv_req_s uv_req_t;
|
| 241 |
+
typedef struct uv_getaddrinfo_s uv_getaddrinfo_t;
|
| 242 |
+
typedef struct uv_getnameinfo_s uv_getnameinfo_t;
|
| 243 |
+
typedef struct uv_shutdown_s uv_shutdown_t;
|
| 244 |
+
typedef struct uv_write_s uv_write_t;
|
| 245 |
+
typedef struct uv_connect_s uv_connect_t;
|
| 246 |
+
typedef struct uv_udp_send_s uv_udp_send_t;
|
| 247 |
+
typedef struct uv_fs_s uv_fs_t;
|
| 248 |
+
typedef struct uv_work_s uv_work_t;
|
| 249 |
+
typedef struct uv_random_s uv_random_t;
|
| 250 |
+
|
| 251 |
+
/* None of the above. */
|
| 252 |
+
typedef struct uv_env_item_s uv_env_item_t;
|
| 253 |
+
typedef struct uv_cpu_info_s uv_cpu_info_t;
|
| 254 |
+
typedef struct uv_interface_address_s uv_interface_address_t;
|
| 255 |
+
typedef struct uv_dirent_s uv_dirent_t;
|
| 256 |
+
typedef struct uv_passwd_s uv_passwd_t;
|
| 257 |
+
typedef struct uv_group_s uv_group_t;
|
| 258 |
+
typedef struct uv_utsname_s uv_utsname_t;
|
| 259 |
+
typedef struct uv_statfs_s uv_statfs_t;
|
| 260 |
+
|
| 261 |
+
typedef struct uv_metrics_s uv_metrics_t;
|
| 262 |
+
|
| 263 |
+
typedef enum {
|
| 264 |
+
UV_LOOP_BLOCK_SIGNAL = 0,
|
| 265 |
+
UV_METRICS_IDLE_TIME,
|
| 266 |
+
UV_LOOP_USE_IO_URING_SQPOLL
|
| 267 |
+
#define UV_LOOP_USE_IO_URING_SQPOLL UV_LOOP_USE_IO_URING_SQPOLL
|
| 268 |
+
} uv_loop_option;
|
| 269 |
+
|
| 270 |
+
typedef enum {
|
| 271 |
+
UV_RUN_DEFAULT = 0,
|
| 272 |
+
UV_RUN_ONCE,
|
| 273 |
+
UV_RUN_NOWAIT
|
| 274 |
+
} uv_run_mode;
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
UV_EXTERN unsigned int uv_version(void);
|
| 278 |
+
UV_EXTERN const char* uv_version_string(void);
|
| 279 |
+
|
| 280 |
+
typedef void* (*uv_malloc_func)(size_t size);
|
| 281 |
+
typedef void* (*uv_realloc_func)(void* ptr, size_t size);
|
| 282 |
+
typedef void* (*uv_calloc_func)(size_t count, size_t size);
|
| 283 |
+
typedef void (*uv_free_func)(void* ptr);
|
| 284 |
+
|
| 285 |
+
UV_EXTERN void uv_library_shutdown(void);
|
| 286 |
+
|
| 287 |
+
UV_EXTERN int uv_replace_allocator(uv_malloc_func malloc_func,
|
| 288 |
+
uv_realloc_func realloc_func,
|
| 289 |
+
uv_calloc_func calloc_func,
|
| 290 |
+
uv_free_func free_func);
|
| 291 |
+
|
| 292 |
+
UV_EXTERN uv_loop_t* uv_default_loop(void);
|
| 293 |
+
UV_EXTERN int uv_loop_init(uv_loop_t* loop);
|
| 294 |
+
UV_EXTERN int uv_loop_close(uv_loop_t* loop);
|
| 295 |
+
/*
|
| 296 |
+
* NOTE:
|
| 297 |
+
* This function is DEPRECATED, users should
|
| 298 |
+
* allocate the loop manually and use uv_loop_init instead.
|
| 299 |
+
*/
|
| 300 |
+
UV_EXTERN uv_loop_t* uv_loop_new(void);
|
| 301 |
+
/*
|
| 302 |
+
* NOTE:
|
| 303 |
+
* This function is DEPRECATED. Users should use
|
| 304 |
+
* uv_loop_close and free the memory manually instead.
|
| 305 |
+
*/
|
| 306 |
+
UV_EXTERN void uv_loop_delete(uv_loop_t*);
|
| 307 |
+
UV_EXTERN size_t uv_loop_size(void);
|
| 308 |
+
UV_EXTERN int uv_loop_alive(const uv_loop_t* loop);
|
| 309 |
+
UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...);
|
| 310 |
+
UV_EXTERN int uv_loop_fork(uv_loop_t* loop);
|
| 311 |
+
|
| 312 |
+
UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode);
|
| 313 |
+
UV_EXTERN void uv_stop(uv_loop_t*);
|
| 314 |
+
|
| 315 |
+
UV_EXTERN void uv_ref(uv_handle_t*);
|
| 316 |
+
UV_EXTERN void uv_unref(uv_handle_t*);
|
| 317 |
+
UV_EXTERN int uv_has_ref(const uv_handle_t*);
|
| 318 |
+
|
| 319 |
+
UV_EXTERN void uv_update_time(uv_loop_t*);
|
| 320 |
+
UV_EXTERN uint64_t uv_now(const uv_loop_t*);
|
| 321 |
+
|
| 322 |
+
UV_EXTERN int uv_backend_fd(const uv_loop_t*);
|
| 323 |
+
UV_EXTERN int uv_backend_timeout(const uv_loop_t*);
|
| 324 |
+
|
| 325 |
+
typedef void (*uv_alloc_cb)(uv_handle_t* handle,
|
| 326 |
+
size_t suggested_size,
|
| 327 |
+
uv_buf_t* buf);
|
| 328 |
+
typedef void (*uv_read_cb)(uv_stream_t* stream,
|
| 329 |
+
ssize_t nread,
|
| 330 |
+
const uv_buf_t* buf);
|
| 331 |
+
typedef void (*uv_write_cb)(uv_write_t* req, int status);
|
| 332 |
+
typedef void (*uv_connect_cb)(uv_connect_t* req, int status);
|
| 333 |
+
typedef void (*uv_shutdown_cb)(uv_shutdown_t* req, int status);
|
| 334 |
+
typedef void (*uv_connection_cb)(uv_stream_t* server, int status);
|
| 335 |
+
typedef void (*uv_close_cb)(uv_handle_t* handle);
|
| 336 |
+
typedef void (*uv_poll_cb)(uv_poll_t* handle, int status, int events);
|
| 337 |
+
typedef void (*uv_timer_cb)(uv_timer_t* handle);
|
| 338 |
+
typedef void (*uv_async_cb)(uv_async_t* handle);
|
| 339 |
+
typedef void (*uv_prepare_cb)(uv_prepare_t* handle);
|
| 340 |
+
typedef void (*uv_check_cb)(uv_check_t* handle);
|
| 341 |
+
typedef void (*uv_idle_cb)(uv_idle_t* handle);
|
| 342 |
+
typedef void (*uv_exit_cb)(uv_process_t*, int64_t exit_status, int term_signal);
|
| 343 |
+
typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg);
|
| 344 |
+
typedef void (*uv_fs_cb)(uv_fs_t* req);
|
| 345 |
+
typedef void (*uv_work_cb)(uv_work_t* req);
|
| 346 |
+
typedef void (*uv_after_work_cb)(uv_work_t* req, int status);
|
| 347 |
+
typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* req,
|
| 348 |
+
int status,
|
| 349 |
+
struct addrinfo* res);
|
| 350 |
+
typedef void (*uv_getnameinfo_cb)(uv_getnameinfo_t* req,
|
| 351 |
+
int status,
|
| 352 |
+
const char* hostname,
|
| 353 |
+
const char* service);
|
| 354 |
+
typedef void (*uv_random_cb)(uv_random_t* req,
|
| 355 |
+
int status,
|
| 356 |
+
void* buf,
|
| 357 |
+
size_t buflen);
|
| 358 |
+
|
| 359 |
+
typedef enum {
|
| 360 |
+
UV_CLOCK_MONOTONIC,
|
| 361 |
+
UV_CLOCK_REALTIME
|
| 362 |
+
} uv_clock_id;
|
| 363 |
+
|
| 364 |
+
/* XXX(bnoordhuis) not 2038-proof, https://github.com/libuv/libuv/issues/3864 */
|
| 365 |
+
typedef struct {
|
| 366 |
+
long tv_sec;
|
| 367 |
+
long tv_nsec;
|
| 368 |
+
} uv_timespec_t;
|
| 369 |
+
|
| 370 |
+
typedef struct {
|
| 371 |
+
int64_t tv_sec;
|
| 372 |
+
int32_t tv_nsec;
|
| 373 |
+
} uv_timespec64_t;
|
| 374 |
+
|
| 375 |
+
/* XXX(bnoordhuis) not 2038-proof, https://github.com/libuv/libuv/issues/3864 */
|
| 376 |
+
typedef struct {
|
| 377 |
+
long tv_sec;
|
| 378 |
+
long tv_usec;
|
| 379 |
+
} uv_timeval_t;
|
| 380 |
+
|
| 381 |
+
typedef struct {
|
| 382 |
+
int64_t tv_sec;
|
| 383 |
+
int32_t tv_usec;
|
| 384 |
+
} uv_timeval64_t;
|
| 385 |
+
|
| 386 |
+
typedef struct {
|
| 387 |
+
uint64_t st_dev;
|
| 388 |
+
uint64_t st_mode;
|
| 389 |
+
uint64_t st_nlink;
|
| 390 |
+
uint64_t st_uid;
|
| 391 |
+
uint64_t st_gid;
|
| 392 |
+
uint64_t st_rdev;
|
| 393 |
+
uint64_t st_ino;
|
| 394 |
+
uint64_t st_size;
|
| 395 |
+
uint64_t st_blksize;
|
| 396 |
+
uint64_t st_blocks;
|
| 397 |
+
uint64_t st_flags;
|
| 398 |
+
uint64_t st_gen;
|
| 399 |
+
uv_timespec_t st_atim;
|
| 400 |
+
uv_timespec_t st_mtim;
|
| 401 |
+
uv_timespec_t st_ctim;
|
| 402 |
+
uv_timespec_t st_birthtim;
|
| 403 |
+
} uv_stat_t;
|
| 404 |
+
|
| 405 |
+
|
| 406 |
+
typedef void (*uv_fs_event_cb)(uv_fs_event_t* handle,
|
| 407 |
+
const char* filename,
|
| 408 |
+
int events,
|
| 409 |
+
int status);
|
| 410 |
+
|
| 411 |
+
typedef void (*uv_fs_poll_cb)(uv_fs_poll_t* handle,
|
| 412 |
+
int status,
|
| 413 |
+
const uv_stat_t* prev,
|
| 414 |
+
const uv_stat_t* curr);
|
| 415 |
+
|
| 416 |
+
typedef void (*uv_signal_cb)(uv_signal_t* handle, int signum);
|
| 417 |
+
|
| 418 |
+
|
| 419 |
+
typedef enum {
|
| 420 |
+
UV_LEAVE_GROUP = 0,
|
| 421 |
+
UV_JOIN_GROUP
|
| 422 |
+
} uv_membership;
|
| 423 |
+
|
| 424 |
+
|
| 425 |
+
UV_EXTERN int uv_translate_sys_error(int sys_errno);
|
| 426 |
+
|
| 427 |
+
UV_EXTERN const char* uv_strerror(int err);
|
| 428 |
+
UV_EXTERN char* uv_strerror_r(int err, char* buf, size_t buflen);
|
| 429 |
+
|
| 430 |
+
UV_EXTERN const char* uv_err_name(int err);
|
| 431 |
+
UV_EXTERN char* uv_err_name_r(int err, char* buf, size_t buflen);
|
| 432 |
+
|
| 433 |
+
|
| 434 |
+
#define UV_REQ_FIELDS \
|
| 435 |
+
/* public */ \
|
| 436 |
+
void* data; \
|
| 437 |
+
/* read-only */ \
|
| 438 |
+
uv_req_type type; \
|
| 439 |
+
/* private */ \
|
| 440 |
+
void* reserved[6]; \
|
| 441 |
+
UV_REQ_PRIVATE_FIELDS \
|
| 442 |
+
|
| 443 |
+
/* Abstract base class of all requests. */
|
| 444 |
+
struct uv_req_s {
|
| 445 |
+
UV_REQ_FIELDS
|
| 446 |
+
};
|
| 447 |
+
|
| 448 |
+
|
| 449 |
+
/* Platform-specific request types. */
|
| 450 |
+
UV_PRIVATE_REQ_TYPES
|
| 451 |
+
|
| 452 |
+
|
| 453 |
+
UV_EXTERN int uv_shutdown(uv_shutdown_t* req,
|
| 454 |
+
uv_stream_t* handle,
|
| 455 |
+
uv_shutdown_cb cb);
|
| 456 |
+
|
| 457 |
+
struct uv_shutdown_s {
|
| 458 |
+
UV_REQ_FIELDS
|
| 459 |
+
uv_stream_t* handle;
|
| 460 |
+
uv_shutdown_cb cb;
|
| 461 |
+
UV_SHUTDOWN_PRIVATE_FIELDS
|
| 462 |
+
};
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
#define UV_HANDLE_FIELDS \
|
| 466 |
+
/* public */ \
|
| 467 |
+
void* data; \
|
| 468 |
+
/* read-only */ \
|
| 469 |
+
uv_loop_t* loop; \
|
| 470 |
+
uv_handle_type type; \
|
| 471 |
+
/* private */ \
|
| 472 |
+
uv_close_cb close_cb; \
|
| 473 |
+
struct uv__queue handle_queue; \
|
| 474 |
+
union { \
|
| 475 |
+
int fd; \
|
| 476 |
+
void* reserved[4]; \
|
| 477 |
+
} u; \
|
| 478 |
+
UV_HANDLE_PRIVATE_FIELDS \
|
| 479 |
+
|
| 480 |
+
/* The abstract base class of all handles. */
|
| 481 |
+
struct uv_handle_s {
|
| 482 |
+
UV_HANDLE_FIELDS
|
| 483 |
+
};
|
| 484 |
+
|
| 485 |
+
UV_EXTERN size_t uv_handle_size(uv_handle_type type);
|
| 486 |
+
UV_EXTERN uv_handle_type uv_handle_get_type(const uv_handle_t* handle);
|
| 487 |
+
UV_EXTERN const char* uv_handle_type_name(uv_handle_type type);
|
| 488 |
+
UV_EXTERN void* uv_handle_get_data(const uv_handle_t* handle);
|
| 489 |
+
UV_EXTERN uv_loop_t* uv_handle_get_loop(const uv_handle_t* handle);
|
| 490 |
+
UV_EXTERN void uv_handle_set_data(uv_handle_t* handle, void* data);
|
| 491 |
+
|
| 492 |
+
UV_EXTERN size_t uv_req_size(uv_req_type type);
|
| 493 |
+
UV_EXTERN void* uv_req_get_data(const uv_req_t* req);
|
| 494 |
+
UV_EXTERN void uv_req_set_data(uv_req_t* req, void* data);
|
| 495 |
+
UV_EXTERN uv_req_type uv_req_get_type(const uv_req_t* req);
|
| 496 |
+
UV_EXTERN const char* uv_req_type_name(uv_req_type type);
|
| 497 |
+
|
| 498 |
+
UV_EXTERN int uv_is_active(const uv_handle_t* handle);
|
| 499 |
+
|
| 500 |
+
UV_EXTERN void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg);
|
| 501 |
+
|
| 502 |
+
/* Helpers for ad hoc debugging, no API/ABI stability guaranteed. */
|
| 503 |
+
UV_EXTERN void uv_print_all_handles(uv_loop_t* loop, FILE* stream);
|
| 504 |
+
UV_EXTERN void uv_print_active_handles(uv_loop_t* loop, FILE* stream);
|
| 505 |
+
|
| 506 |
+
UV_EXTERN void uv_close(uv_handle_t* handle, uv_close_cb close_cb);
|
| 507 |
+
|
| 508 |
+
UV_EXTERN int uv_send_buffer_size(uv_handle_t* handle, int* value);
|
| 509 |
+
UV_EXTERN int uv_recv_buffer_size(uv_handle_t* handle, int* value);
|
| 510 |
+
|
| 511 |
+
UV_EXTERN int uv_fileno(const uv_handle_t* handle, uv_os_fd_t* fd);
|
| 512 |
+
|
| 513 |
+
UV_EXTERN uv_buf_t uv_buf_init(char* base, unsigned int len);
|
| 514 |
+
|
| 515 |
+
UV_EXTERN int uv_pipe(uv_file fds[2], int read_flags, int write_flags);
|
| 516 |
+
UV_EXTERN int uv_socketpair(int type,
|
| 517 |
+
int protocol,
|
| 518 |
+
uv_os_sock_t socket_vector[2],
|
| 519 |
+
int flags0,
|
| 520 |
+
int flags1);
|
| 521 |
+
|
| 522 |
+
#define UV_STREAM_FIELDS \
|
| 523 |
+
/* number of bytes queued for writing */ \
|
| 524 |
+
size_t write_queue_size; \
|
| 525 |
+
uv_alloc_cb alloc_cb; \
|
| 526 |
+
uv_read_cb read_cb; \
|
| 527 |
+
/* private */ \
|
| 528 |
+
UV_STREAM_PRIVATE_FIELDS
|
| 529 |
+
|
| 530 |
+
/*
|
| 531 |
+
* uv_stream_t is a subclass of uv_handle_t.
|
| 532 |
+
*
|
| 533 |
+
* uv_stream is an abstract class.
|
| 534 |
+
*
|
| 535 |
+
* uv_stream_t is the parent class of uv_tcp_t, uv_pipe_t and uv_tty_t.
|
| 536 |
+
*/
|
| 537 |
+
struct uv_stream_s {
|
| 538 |
+
UV_HANDLE_FIELDS
|
| 539 |
+
UV_STREAM_FIELDS
|
| 540 |
+
};
|
| 541 |
+
|
| 542 |
+
UV_EXTERN size_t uv_stream_get_write_queue_size(const uv_stream_t* stream);
|
| 543 |
+
|
| 544 |
+
UV_EXTERN int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb);
|
| 545 |
+
UV_EXTERN int uv_accept(uv_stream_t* server, uv_stream_t* client);
|
| 546 |
+
|
| 547 |
+
UV_EXTERN int uv_read_start(uv_stream_t*,
|
| 548 |
+
uv_alloc_cb alloc_cb,
|
| 549 |
+
uv_read_cb read_cb);
|
| 550 |
+
UV_EXTERN int uv_read_stop(uv_stream_t*);
|
| 551 |
+
|
| 552 |
+
UV_EXTERN int uv_write(uv_write_t* req,
|
| 553 |
+
uv_stream_t* handle,
|
| 554 |
+
const uv_buf_t bufs[],
|
| 555 |
+
unsigned int nbufs,
|
| 556 |
+
uv_write_cb cb);
|
| 557 |
+
UV_EXTERN int uv_write2(uv_write_t* req,
|
| 558 |
+
uv_stream_t* handle,
|
| 559 |
+
const uv_buf_t bufs[],
|
| 560 |
+
unsigned int nbufs,
|
| 561 |
+
uv_stream_t* send_handle,
|
| 562 |
+
uv_write_cb cb);
|
| 563 |
+
UV_EXTERN int uv_try_write(uv_stream_t* handle,
|
| 564 |
+
const uv_buf_t bufs[],
|
| 565 |
+
unsigned int nbufs);
|
| 566 |
+
UV_EXTERN int uv_try_write2(uv_stream_t* handle,
|
| 567 |
+
const uv_buf_t bufs[],
|
| 568 |
+
unsigned int nbufs,
|
| 569 |
+
uv_stream_t* send_handle);
|
| 570 |
+
|
| 571 |
+
/* uv_write_t is a subclass of uv_req_t. */
|
| 572 |
+
struct uv_write_s {
|
| 573 |
+
UV_REQ_FIELDS
|
| 574 |
+
uv_write_cb cb;
|
| 575 |
+
uv_stream_t* send_handle; /* TODO: make private and unix-only in v2.x. */
|
| 576 |
+
uv_stream_t* handle;
|
| 577 |
+
UV_WRITE_PRIVATE_FIELDS
|
| 578 |
+
};
|
| 579 |
+
|
| 580 |
+
|
| 581 |
+
UV_EXTERN int uv_is_readable(const uv_stream_t* handle);
|
| 582 |
+
UV_EXTERN int uv_is_writable(const uv_stream_t* handle);
|
| 583 |
+
|
| 584 |
+
UV_EXTERN int uv_stream_set_blocking(uv_stream_t* handle, int blocking);
|
| 585 |
+
|
| 586 |
+
UV_EXTERN int uv_is_closing(const uv_handle_t* handle);
|
| 587 |
+
|
| 588 |
+
|
| 589 |
+
/*
|
| 590 |
+
* uv_tcp_t is a subclass of uv_stream_t.
|
| 591 |
+
*
|
| 592 |
+
* Represents a TCP stream or TCP server.
|
| 593 |
+
*/
|
| 594 |
+
struct uv_tcp_s {
|
| 595 |
+
UV_HANDLE_FIELDS
|
| 596 |
+
UV_STREAM_FIELDS
|
| 597 |
+
UV_TCP_PRIVATE_FIELDS
|
| 598 |
+
};
|
| 599 |
+
|
| 600 |
+
UV_EXTERN int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle);
|
| 601 |
+
UV_EXTERN int uv_tcp_init_ex(uv_loop_t*, uv_tcp_t* handle, unsigned int flags);
|
| 602 |
+
UV_EXTERN int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock);
|
| 603 |
+
UV_EXTERN int uv_tcp_nodelay(uv_tcp_t* handle, int enable);
|
| 604 |
+
UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle,
|
| 605 |
+
int enable,
|
| 606 |
+
unsigned int delay);
|
| 607 |
+
UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable);
|
| 608 |
+
|
| 609 |
+
enum uv_tcp_flags {
|
| 610 |
+
/* Used with uv_tcp_bind, when an IPv6 address is used. */
|
| 611 |
+
UV_TCP_IPV6ONLY = 1,
|
| 612 |
+
|
| 613 |
+
/* Enable SO_REUSEPORT socket option when binding the handle.
|
| 614 |
+
* This allows completely duplicate bindings by multiple processes
|
| 615 |
+
* or threads if they all set SO_REUSEPORT before binding the port.
|
| 616 |
+
* Incoming connections are distributed across the participating
|
| 617 |
+
* listener sockets.
|
| 618 |
+
*
|
| 619 |
+
* This flag is available only on Linux 3.9+, DragonFlyBSD 3.6+,
|
| 620 |
+
* FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+ for now.
|
| 621 |
+
*/
|
| 622 |
+
UV_TCP_REUSEPORT = 2,
|
| 623 |
+
};
|
| 624 |
+
|
| 625 |
+
UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle,
|
| 626 |
+
const struct sockaddr* addr,
|
| 627 |
+
unsigned int flags);
|
| 628 |
+
UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle,
|
| 629 |
+
struct sockaddr* name,
|
| 630 |
+
int* namelen);
|
| 631 |
+
UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle,
|
| 632 |
+
struct sockaddr* name,
|
| 633 |
+
int* namelen);
|
| 634 |
+
UV_EXTERN int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb);
|
| 635 |
+
UV_EXTERN int uv_tcp_connect(uv_connect_t* req,
|
| 636 |
+
uv_tcp_t* handle,
|
| 637 |
+
const struct sockaddr* addr,
|
| 638 |
+
uv_connect_cb cb);
|
| 639 |
+
|
| 640 |
+
/* uv_connect_t is a subclass of uv_req_t. */
|
| 641 |
+
struct uv_connect_s {
|
| 642 |
+
UV_REQ_FIELDS
|
| 643 |
+
uv_connect_cb cb;
|
| 644 |
+
uv_stream_t* handle;
|
| 645 |
+
UV_CONNECT_PRIVATE_FIELDS
|
| 646 |
+
};
|
| 647 |
+
|
| 648 |
+
|
| 649 |
+
/*
|
| 650 |
+
* UDP support.
|
| 651 |
+
*/
|
| 652 |
+
|
| 653 |
+
enum uv_udp_flags {
|
| 654 |
+
/* Disables dual stack mode. */
|
| 655 |
+
UV_UDP_IPV6ONLY = 1,
|
| 656 |
+
/*
|
| 657 |
+
* Indicates message was truncated because read buffer was too small. The
|
| 658 |
+
* remainder was discarded by the OS. Used in uv_udp_recv_cb.
|
| 659 |
+
*/
|
| 660 |
+
UV_UDP_PARTIAL = 2,
|
| 661 |
+
/*
|
| 662 |
+
* Indicates if SO_REUSEADDR will be set when binding the handle.
|
| 663 |
+
* This sets the SO_REUSEPORT socket flag on the BSDs (except for
|
| 664 |
+
* DragonFlyBSD), OS X, and other platforms where SO_REUSEPORTs don't
|
| 665 |
+
* have the capability of load balancing, as the opposite of what
|
| 666 |
+
* UV_UDP_REUSEPORT would do. On other Unix platforms, it sets the
|
| 667 |
+
* SO_REUSEADDR flag. What that means is that multiple threads or
|
| 668 |
+
* processes can bind to the same address without error (provided
|
| 669 |
+
* they all set the flag) but only the last one to bind will receive
|
| 670 |
+
* any traffic, in effect "stealing" the port from the previous listener.
|
| 671 |
+
*/
|
| 672 |
+
UV_UDP_REUSEADDR = 4,
|
| 673 |
+
/*
|
| 674 |
+
* Indicates that the message was received by recvmmsg, so the buffer provided
|
| 675 |
+
* must not be freed by the recv_cb callback.
|
| 676 |
+
*/
|
| 677 |
+
UV_UDP_MMSG_CHUNK = 8,
|
| 678 |
+
/*
|
| 679 |
+
* Indicates that the buffer provided has been fully utilized by recvmmsg and
|
| 680 |
+
* that it should now be freed by the recv_cb callback. When this flag is set
|
| 681 |
+
* in uv_udp_recv_cb, nread will always be 0 and addr will always be NULL.
|
| 682 |
+
*/
|
| 683 |
+
UV_UDP_MMSG_FREE = 16,
|
| 684 |
+
/*
|
| 685 |
+
* Indicates if IP_RECVERR/IPV6_RECVERR will be set when binding the handle.
|
| 686 |
+
* This sets IP_RECVERR for IPv4 and IPV6_RECVERR for IPv6 UDP sockets on
|
| 687 |
+
* Linux. This stops the Linux kernel from suppressing some ICMP error
|
| 688 |
+
* messages and enables full ICMP error reporting for faster failover.
|
| 689 |
+
* This flag is no-op on platforms other than Linux.
|
| 690 |
+
*/
|
| 691 |
+
UV_UDP_LINUX_RECVERR = 32,
|
| 692 |
+
/*
|
| 693 |
+
* Indicates if SO_REUSEPORT will be set when binding the handle.
|
| 694 |
+
* This sets the SO_REUSEPORT socket option on supported platforms.
|
| 695 |
+
* Unlike UV_UDP_REUSEADDR, this flag will make multiple threads or
|
| 696 |
+
* processes that are binding to the same address and port "share"
|
| 697 |
+
* the port, which means incoming datagrams are distributed across
|
| 698 |
+
* the receiving sockets among threads or processes.
|
| 699 |
+
*
|
| 700 |
+
* This flag is available only on Linux 3.9+, DragonFlyBSD 3.6+,
|
| 701 |
+
* FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+ for now.
|
| 702 |
+
*/
|
| 703 |
+
UV_UDP_REUSEPORT = 64,
|
| 704 |
+
/*
|
| 705 |
+
* Indicates that recvmmsg should be used, if available.
|
| 706 |
+
*/
|
| 707 |
+
UV_UDP_RECVMMSG = 256
|
| 708 |
+
};
|
| 709 |
+
|
| 710 |
+
typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status);
|
| 711 |
+
typedef void (*uv_udp_recv_cb)(uv_udp_t* handle,
|
| 712 |
+
ssize_t nread,
|
| 713 |
+
const uv_buf_t* buf,
|
| 714 |
+
const struct sockaddr* addr,
|
| 715 |
+
unsigned flags);
|
| 716 |
+
|
| 717 |
+
/* uv_udp_t is a subclass of uv_handle_t. */
|
| 718 |
+
struct uv_udp_s {
|
| 719 |
+
UV_HANDLE_FIELDS
|
| 720 |
+
/* read-only */
|
| 721 |
+
/*
|
| 722 |
+
* Number of bytes queued for sending. This field strictly shows how much
|
| 723 |
+
* information is currently queued.
|
| 724 |
+
*/
|
| 725 |
+
size_t send_queue_size;
|
| 726 |
+
/*
|
| 727 |
+
* Number of send requests currently in the queue awaiting to be processed.
|
| 728 |
+
*/
|
| 729 |
+
size_t send_queue_count;
|
| 730 |
+
UV_UDP_PRIVATE_FIELDS
|
| 731 |
+
};
|
| 732 |
+
|
| 733 |
+
/* uv_udp_send_t is a subclass of uv_req_t. */
|
| 734 |
+
struct uv_udp_send_s {
|
| 735 |
+
UV_REQ_FIELDS
|
| 736 |
+
uv_udp_t* handle;
|
| 737 |
+
uv_udp_send_cb cb;
|
| 738 |
+
UV_UDP_SEND_PRIVATE_FIELDS
|
| 739 |
+
};
|
| 740 |
+
|
| 741 |
+
UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle);
|
| 742 |
+
UV_EXTERN int uv_udp_init_ex(uv_loop_t*, uv_udp_t* handle, unsigned int flags);
|
| 743 |
+
UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock);
|
| 744 |
+
UV_EXTERN int uv_udp_bind(uv_udp_t* handle,
|
| 745 |
+
const struct sockaddr* addr,
|
| 746 |
+
unsigned int flags);
|
| 747 |
+
UV_EXTERN int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr);
|
| 748 |
+
|
| 749 |
+
UV_EXTERN int uv_udp_getpeername(const uv_udp_t* handle,
|
| 750 |
+
struct sockaddr* name,
|
| 751 |
+
int* namelen);
|
| 752 |
+
UV_EXTERN int uv_udp_getsockname(const uv_udp_t* handle,
|
| 753 |
+
struct sockaddr* name,
|
| 754 |
+
int* namelen);
|
| 755 |
+
UV_EXTERN int uv_udp_set_membership(uv_udp_t* handle,
|
| 756 |
+
const char* multicast_addr,
|
| 757 |
+
const char* interface_addr,
|
| 758 |
+
uv_membership membership);
|
| 759 |
+
UV_EXTERN int uv_udp_set_source_membership(uv_udp_t* handle,
|
| 760 |
+
const char* multicast_addr,
|
| 761 |
+
const char* interface_addr,
|
| 762 |
+
const char* source_addr,
|
| 763 |
+
uv_membership membership);
|
| 764 |
+
UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t* handle, int on);
|
| 765 |
+
UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl);
|
| 766 |
+
UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t* handle,
|
| 767 |
+
const char* interface_addr);
|
| 768 |
+
UV_EXTERN int uv_udp_set_broadcast(uv_udp_t* handle, int on);
|
| 769 |
+
UV_EXTERN int uv_udp_set_ttl(uv_udp_t* handle, int ttl);
|
| 770 |
+
UV_EXTERN int uv_udp_send(uv_udp_send_t* req,
|
| 771 |
+
uv_udp_t* handle,
|
| 772 |
+
const uv_buf_t bufs[],
|
| 773 |
+
unsigned int nbufs,
|
| 774 |
+
const struct sockaddr* addr,
|
| 775 |
+
uv_udp_send_cb send_cb);
|
| 776 |
+
UV_EXTERN int uv_udp_try_send(uv_udp_t* handle,
|
| 777 |
+
const uv_buf_t bufs[],
|
| 778 |
+
unsigned int nbufs,
|
| 779 |
+
const struct sockaddr* addr);
|
| 780 |
+
UV_EXTERN int uv_udp_try_send2(uv_udp_t* handle,
|
| 781 |
+
unsigned int count,
|
| 782 |
+
uv_buf_t* bufs[/*count*/],
|
| 783 |
+
unsigned int nbufs[/*count*/],
|
| 784 |
+
struct sockaddr* addrs[/*count*/],
|
| 785 |
+
unsigned int flags);
|
| 786 |
+
UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle,
|
| 787 |
+
uv_alloc_cb alloc_cb,
|
| 788 |
+
uv_udp_recv_cb recv_cb);
|
| 789 |
+
UV_EXTERN int uv_udp_using_recvmmsg(const uv_udp_t* handle);
|
| 790 |
+
UV_EXTERN int uv_udp_recv_stop(uv_udp_t* handle);
|
| 791 |
+
UV_EXTERN size_t uv_udp_get_send_queue_size(const uv_udp_t* handle);
|
| 792 |
+
UV_EXTERN size_t uv_udp_get_send_queue_count(const uv_udp_t* handle);
|
| 793 |
+
|
| 794 |
+
|
| 795 |
+
/*
|
| 796 |
+
* uv_tty_t is a subclass of uv_stream_t.
|
| 797 |
+
*
|
| 798 |
+
* Representing a stream for the console.
|
| 799 |
+
*/
|
| 800 |
+
struct uv_tty_s {
|
| 801 |
+
UV_HANDLE_FIELDS
|
| 802 |
+
UV_STREAM_FIELDS
|
| 803 |
+
UV_TTY_PRIVATE_FIELDS
|
| 804 |
+
};
|
| 805 |
+
|
| 806 |
+
typedef enum {
|
| 807 |
+
/* Initial/normal terminal mode */
|
| 808 |
+
UV_TTY_MODE_NORMAL,
|
| 809 |
+
/*
|
| 810 |
+
* Raw input mode (On Windows, ENABLE_WINDOW_INPUT is also enabled).
|
| 811 |
+
* May become equivalent to UV_TTY_MODE_RAW_VT in future libuv versions.
|
| 812 |
+
*/
|
| 813 |
+
UV_TTY_MODE_RAW,
|
| 814 |
+
/* Binary-safe I/O mode for IPC (Unix-only) */
|
| 815 |
+
UV_TTY_MODE_IO,
|
| 816 |
+
/* Raw input mode. On Windows ENABLE_VIRTUAL_TERMINAL_INPUT is also set. */
|
| 817 |
+
UV_TTY_MODE_RAW_VT
|
| 818 |
+
} uv_tty_mode_t;
|
| 819 |
+
|
| 820 |
+
typedef enum {
|
| 821 |
+
/*
|
| 822 |
+
* The console supports handling of virtual terminal sequences
|
| 823 |
+
* (Windows10 new console, ConEmu)
|
| 824 |
+
*/
|
| 825 |
+
UV_TTY_SUPPORTED,
|
| 826 |
+
/* The console cannot process the virtual terminal sequence. (Legacy
|
| 827 |
+
* console)
|
| 828 |
+
*/
|
| 829 |
+
UV_TTY_UNSUPPORTED
|
| 830 |
+
} uv_tty_vtermstate_t;
|
| 831 |
+
|
| 832 |
+
|
| 833 |
+
UV_EXTERN int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd, int readable);
|
| 834 |
+
UV_EXTERN int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode);
|
| 835 |
+
UV_EXTERN int uv_tty_reset_mode(void);
|
| 836 |
+
UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height);
|
| 837 |
+
UV_EXTERN void uv_tty_set_vterm_state(uv_tty_vtermstate_t state);
|
| 838 |
+
UV_EXTERN int uv_tty_get_vterm_state(uv_tty_vtermstate_t* state);
|
| 839 |
+
|
| 840 |
+
#ifdef __cplusplus
|
| 841 |
+
extern "C++" {
|
| 842 |
+
|
| 843 |
+
inline int uv_tty_set_mode(uv_tty_t* handle, int mode) {
|
| 844 |
+
return uv_tty_set_mode(handle, static_cast<uv_tty_mode_t>(mode));
|
| 845 |
+
}
|
| 846 |
+
|
| 847 |
+
}
|
| 848 |
+
#endif
|
| 849 |
+
|
| 850 |
+
UV_EXTERN uv_handle_type uv_guess_handle(uv_file file);
|
| 851 |
+
|
| 852 |
+
enum {
|
| 853 |
+
UV_PIPE_NO_TRUNCATE = 1u << 0
|
| 854 |
+
};
|
| 855 |
+
|
| 856 |
+
/*
|
| 857 |
+
* uv_pipe_t is a subclass of uv_stream_t.
|
| 858 |
+
*
|
| 859 |
+
* Representing a pipe stream or pipe server. On Windows this is a Named
|
| 860 |
+
* Pipe. On Unix this is a Unix domain socket.
|
| 861 |
+
*/
|
| 862 |
+
struct uv_pipe_s {
|
| 863 |
+
UV_HANDLE_FIELDS
|
| 864 |
+
UV_STREAM_FIELDS
|
| 865 |
+
int ipc; /* non-zero if this pipe is used for passing handles */
|
| 866 |
+
UV_PIPE_PRIVATE_FIELDS
|
| 867 |
+
};
|
| 868 |
+
|
| 869 |
+
UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc);
|
| 870 |
+
UV_EXTERN int uv_pipe_open(uv_pipe_t*, uv_file file);
|
| 871 |
+
UV_EXTERN int uv_pipe_bind(uv_pipe_t* handle, const char* name);
|
| 872 |
+
UV_EXTERN int uv_pipe_bind2(uv_pipe_t* handle,
|
| 873 |
+
const char* name,
|
| 874 |
+
size_t namelen,
|
| 875 |
+
unsigned int flags);
|
| 876 |
+
UV_EXTERN void uv_pipe_connect(uv_connect_t* req,
|
| 877 |
+
uv_pipe_t* handle,
|
| 878 |
+
const char* name,
|
| 879 |
+
uv_connect_cb cb);
|
| 880 |
+
UV_EXTERN int uv_pipe_connect2(uv_connect_t* req,
|
| 881 |
+
uv_pipe_t* handle,
|
| 882 |
+
const char* name,
|
| 883 |
+
size_t namelen,
|
| 884 |
+
unsigned int flags,
|
| 885 |
+
uv_connect_cb cb);
|
| 886 |
+
UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle,
|
| 887 |
+
char* buffer,
|
| 888 |
+
size_t* size);
|
| 889 |
+
UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle,
|
| 890 |
+
char* buffer,
|
| 891 |
+
size_t* size);
|
| 892 |
+
UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count);
|
| 893 |
+
UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle);
|
| 894 |
+
UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle);
|
| 895 |
+
UV_EXTERN int uv_pipe_chmod(uv_pipe_t* handle, int flags);
|
| 896 |
+
|
| 897 |
+
|
| 898 |
+
struct uv_poll_s {
|
| 899 |
+
UV_HANDLE_FIELDS
|
| 900 |
+
uv_poll_cb poll_cb;
|
| 901 |
+
UV_POLL_PRIVATE_FIELDS
|
| 902 |
+
};
|
| 903 |
+
|
| 904 |
+
enum uv_poll_event {
|
| 905 |
+
UV_READABLE = 1,
|
| 906 |
+
UV_WRITABLE = 2,
|
| 907 |
+
UV_DISCONNECT = 4,
|
| 908 |
+
UV_PRIORITIZED = 8
|
| 909 |
+
};
|
| 910 |
+
|
| 911 |
+
UV_EXTERN int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd);
|
| 912 |
+
UV_EXTERN int uv_poll_init_socket(uv_loop_t* loop,
|
| 913 |
+
uv_poll_t* handle,
|
| 914 |
+
uv_os_sock_t socket);
|
| 915 |
+
UV_EXTERN int uv_poll_start(uv_poll_t* handle, int events, uv_poll_cb cb);
|
| 916 |
+
UV_EXTERN int uv_poll_stop(uv_poll_t* handle);
|
| 917 |
+
|
| 918 |
+
|
| 919 |
+
struct uv_prepare_s {
|
| 920 |
+
UV_HANDLE_FIELDS
|
| 921 |
+
UV_PREPARE_PRIVATE_FIELDS
|
| 922 |
+
};
|
| 923 |
+
|
| 924 |
+
UV_EXTERN int uv_prepare_init(uv_loop_t*, uv_prepare_t* prepare);
|
| 925 |
+
UV_EXTERN int uv_prepare_start(uv_prepare_t* prepare, uv_prepare_cb cb);
|
| 926 |
+
UV_EXTERN int uv_prepare_stop(uv_prepare_t* prepare);
|
| 927 |
+
|
| 928 |
+
|
| 929 |
+
struct uv_check_s {
|
| 930 |
+
UV_HANDLE_FIELDS
|
| 931 |
+
UV_CHECK_PRIVATE_FIELDS
|
| 932 |
+
};
|
| 933 |
+
|
| 934 |
+
UV_EXTERN int uv_check_init(uv_loop_t*, uv_check_t* check);
|
| 935 |
+
UV_EXTERN int uv_check_start(uv_check_t* check, uv_check_cb cb);
|
| 936 |
+
UV_EXTERN int uv_check_stop(uv_check_t* check);
|
| 937 |
+
|
| 938 |
+
|
| 939 |
+
struct uv_idle_s {
|
| 940 |
+
UV_HANDLE_FIELDS
|
| 941 |
+
UV_IDLE_PRIVATE_FIELDS
|
| 942 |
+
};
|
| 943 |
+
|
| 944 |
+
UV_EXTERN int uv_idle_init(uv_loop_t*, uv_idle_t* idle);
|
| 945 |
+
UV_EXTERN int uv_idle_start(uv_idle_t* idle, uv_idle_cb cb);
|
| 946 |
+
UV_EXTERN int uv_idle_stop(uv_idle_t* idle);
|
| 947 |
+
|
| 948 |
+
|
| 949 |
+
struct uv_async_s {
|
| 950 |
+
UV_HANDLE_FIELDS
|
| 951 |
+
UV_ASYNC_PRIVATE_FIELDS
|
| 952 |
+
};
|
| 953 |
+
|
| 954 |
+
UV_EXTERN int uv_async_init(uv_loop_t*,
|
| 955 |
+
uv_async_t* async,
|
| 956 |
+
uv_async_cb async_cb);
|
| 957 |
+
UV_EXTERN int uv_async_send(uv_async_t* async);
|
| 958 |
+
|
| 959 |
+
|
| 960 |
+
/*
|
| 961 |
+
* uv_timer_t is a subclass of uv_handle_t.
|
| 962 |
+
*
|
| 963 |
+
* Used to get woken up at a specified time in the future.
|
| 964 |
+
*/
|
| 965 |
+
struct uv_timer_s {
|
| 966 |
+
UV_HANDLE_FIELDS
|
| 967 |
+
UV_TIMER_PRIVATE_FIELDS
|
| 968 |
+
};
|
| 969 |
+
|
| 970 |
+
UV_EXTERN int uv_timer_init(uv_loop_t*, uv_timer_t* handle);
|
| 971 |
+
UV_EXTERN int uv_timer_start(uv_timer_t* handle,
|
| 972 |
+
uv_timer_cb cb,
|
| 973 |
+
uint64_t timeout,
|
| 974 |
+
uint64_t repeat);
|
| 975 |
+
UV_EXTERN int uv_timer_stop(uv_timer_t* handle);
|
| 976 |
+
UV_EXTERN int uv_timer_again(uv_timer_t* handle);
|
| 977 |
+
UV_EXTERN void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat);
|
| 978 |
+
UV_EXTERN uint64_t uv_timer_get_repeat(const uv_timer_t* handle);
|
| 979 |
+
UV_EXTERN uint64_t uv_timer_get_due_in(const uv_timer_t* handle);
|
| 980 |
+
|
| 981 |
+
|
| 982 |
+
/*
|
| 983 |
+
* uv_getaddrinfo_t is a subclass of uv_req_t.
|
| 984 |
+
*
|
| 985 |
+
* Request object for uv_getaddrinfo.
|
| 986 |
+
*/
|
| 987 |
+
struct uv_getaddrinfo_s {
|
| 988 |
+
UV_REQ_FIELDS
|
| 989 |
+
/* read-only */
|
| 990 |
+
uv_loop_t* loop;
|
| 991 |
+
/* struct addrinfo* addrinfo is marked as private, but it really isn't. */
|
| 992 |
+
UV_GETADDRINFO_PRIVATE_FIELDS
|
| 993 |
+
};
|
| 994 |
+
|
| 995 |
+
|
| 996 |
+
UV_EXTERN int uv_getaddrinfo(uv_loop_t* loop,
|
| 997 |
+
uv_getaddrinfo_t* req,
|
| 998 |
+
uv_getaddrinfo_cb getaddrinfo_cb,
|
| 999 |
+
const char* node,
|
| 1000 |
+
const char* service,
|
| 1001 |
+
const struct addrinfo* hints);
|
| 1002 |
+
UV_EXTERN void uv_freeaddrinfo(struct addrinfo* ai);
|
| 1003 |
+
|
| 1004 |
+
|
| 1005 |
+
/*
|
| 1006 |
+
* uv_getnameinfo_t is a subclass of uv_req_t.
|
| 1007 |
+
*
|
| 1008 |
+
* Request object for uv_getnameinfo.
|
| 1009 |
+
*/
|
| 1010 |
+
struct uv_getnameinfo_s {
|
| 1011 |
+
UV_REQ_FIELDS
|
| 1012 |
+
/* read-only */
|
| 1013 |
+
uv_loop_t* loop;
|
| 1014 |
+
/* host and service are marked as private, but they really aren't. */
|
| 1015 |
+
UV_GETNAMEINFO_PRIVATE_FIELDS
|
| 1016 |
+
};
|
| 1017 |
+
|
| 1018 |
+
UV_EXTERN int uv_getnameinfo(uv_loop_t* loop,
|
| 1019 |
+
uv_getnameinfo_t* req,
|
| 1020 |
+
uv_getnameinfo_cb getnameinfo_cb,
|
| 1021 |
+
const struct sockaddr* addr,
|
| 1022 |
+
int flags);
|
| 1023 |
+
|
| 1024 |
+
|
| 1025 |
+
/* uv_spawn() options. */
|
| 1026 |
+
typedef enum {
|
| 1027 |
+
UV_IGNORE = 0x00,
|
| 1028 |
+
UV_CREATE_PIPE = 0x01,
|
| 1029 |
+
UV_INHERIT_FD = 0x02,
|
| 1030 |
+
UV_INHERIT_STREAM = 0x04,
|
| 1031 |
+
|
| 1032 |
+
/*
|
| 1033 |
+
* When UV_CREATE_PIPE is specified, UV_READABLE_PIPE and UV_WRITABLE_PIPE
|
| 1034 |
+
* determine the direction of flow, from the child process' perspective. Both
|
| 1035 |
+
* flags may be specified to create a duplex data stream.
|
| 1036 |
+
*/
|
| 1037 |
+
UV_READABLE_PIPE = 0x10,
|
| 1038 |
+
UV_WRITABLE_PIPE = 0x20,
|
| 1039 |
+
|
| 1040 |
+
/*
|
| 1041 |
+
* When UV_CREATE_PIPE is specified, specifying UV_NONBLOCK_PIPE opens the
|
| 1042 |
+
* handle in non-blocking mode in the child. This may cause loss of data,
|
| 1043 |
+
* if the child is not designed to handle to encounter this mode,
|
| 1044 |
+
* but can also be significantly more efficient.
|
| 1045 |
+
*/
|
| 1046 |
+
UV_NONBLOCK_PIPE = 0x40,
|
| 1047 |
+
UV_OVERLAPPED_PIPE = 0x40 /* old name, for compatibility */
|
| 1048 |
+
} uv_stdio_flags;
|
| 1049 |
+
|
| 1050 |
+
typedef struct uv_stdio_container_s {
|
| 1051 |
+
uv_stdio_flags flags;
|
| 1052 |
+
|
| 1053 |
+
union {
|
| 1054 |
+
uv_stream_t* stream;
|
| 1055 |
+
int fd;
|
| 1056 |
+
} data;
|
| 1057 |
+
} uv_stdio_container_t;
|
| 1058 |
+
|
| 1059 |
+
typedef struct uv_process_options_s {
|
| 1060 |
+
uv_exit_cb exit_cb; /* Called after the process exits. */
|
| 1061 |
+
const char* file; /* Path to program to execute. */
|
| 1062 |
+
/*
|
| 1063 |
+
* Command line arguments. args[0] should be the path to the program. On
|
| 1064 |
+
* Windows this uses CreateProcess which concatenates the arguments into a
|
| 1065 |
+
* string this can cause some strange errors. See the note at
|
| 1066 |
+
* windows_verbatim_arguments.
|
| 1067 |
+
*/
|
| 1068 |
+
char** args;
|
| 1069 |
+
/*
|
| 1070 |
+
* This will be set as the environ variable in the subprocess. If this is
|
| 1071 |
+
* NULL then the parents environ will be used.
|
| 1072 |
+
*/
|
| 1073 |
+
char** env;
|
| 1074 |
+
/*
|
| 1075 |
+
* If non-null this represents a directory the subprocess should execute
|
| 1076 |
+
* in. Stands for current working directory.
|
| 1077 |
+
*/
|
| 1078 |
+
const char* cwd;
|
| 1079 |
+
/*
|
| 1080 |
+
* Various flags that control how uv_spawn() behaves. See the definition of
|
| 1081 |
+
* `enum uv_process_flags` below.
|
| 1082 |
+
*/
|
| 1083 |
+
unsigned int flags;
|
| 1084 |
+
/*
|
| 1085 |
+
* The `stdio` field points to an array of uv_stdio_container_t structs that
|
| 1086 |
+
* describe the file descriptors that will be made available to the child
|
| 1087 |
+
* process. The convention is that stdio[0] points to stdin, fd 1 is used for
|
| 1088 |
+
* stdout, and fd 2 is stderr.
|
| 1089 |
+
*
|
| 1090 |
+
* Note that on windows file descriptors greater than 2 are available to the
|
| 1091 |
+
* child process only if the child processes uses the MSVCRT runtime.
|
| 1092 |
+
*/
|
| 1093 |
+
int stdio_count;
|
| 1094 |
+
uv_stdio_container_t* stdio;
|
| 1095 |
+
/*
|
| 1096 |
+
* Libuv can change the child process' user/group id. This happens only when
|
| 1097 |
+
* the appropriate bits are set in the flags fields. This is not supported on
|
| 1098 |
+
* windows; uv_spawn() will fail and set the error to UV_ENOTSUP.
|
| 1099 |
+
*/
|
| 1100 |
+
uv_uid_t uid;
|
| 1101 |
+
uv_gid_t gid;
|
| 1102 |
+
} uv_process_options_t;
|
| 1103 |
+
|
| 1104 |
+
/*
|
| 1105 |
+
* These are the flags that can be used for the uv_process_options.flags field.
|
| 1106 |
+
*/
|
| 1107 |
+
enum uv_process_flags {
|
| 1108 |
+
/*
|
| 1109 |
+
* Set the child process' user id. The user id is supplied in the `uid` field
|
| 1110 |
+
* of the options struct. This does not work on windows; setting this flag
|
| 1111 |
+
* will cause uv_spawn() to fail.
|
| 1112 |
+
*/
|
| 1113 |
+
UV_PROCESS_SETUID = (1 << 0),
|
| 1114 |
+
/*
|
| 1115 |
+
* Set the child process' group id. The user id is supplied in the `gid`
|
| 1116 |
+
* field of the options struct. This does not work on windows; setting this
|
| 1117 |
+
* flag will cause uv_spawn() to fail.
|
| 1118 |
+
*/
|
| 1119 |
+
UV_PROCESS_SETGID = (1 << 1),
|
| 1120 |
+
/*
|
| 1121 |
+
* Do not wrap any arguments in quotes, or perform any other escaping, when
|
| 1122 |
+
* converting the argument list into a command line string. This option is
|
| 1123 |
+
* only meaningful on Windows systems. On Unix it is silently ignored.
|
| 1124 |
+
*/
|
| 1125 |
+
UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = (1 << 2),
|
| 1126 |
+
/*
|
| 1127 |
+
* Spawn the child process in a detached state - this will make it a process
|
| 1128 |
+
* group leader, and will effectively enable the child to keep running after
|
| 1129 |
+
* the parent exits. Note that the child process will still keep the
|
| 1130 |
+
* parent's event loop alive unless the parent process calls uv_unref() on
|
| 1131 |
+
* the child's process handle.
|
| 1132 |
+
*/
|
| 1133 |
+
UV_PROCESS_DETACHED = (1 << 3),
|
| 1134 |
+
/*
|
| 1135 |
+
* Hide the subprocess window that would normally be created. This option is
|
| 1136 |
+
* only meaningful on Windows systems. On Unix it is silently ignored.
|
| 1137 |
+
*/
|
| 1138 |
+
UV_PROCESS_WINDOWS_HIDE = (1 << 4),
|
| 1139 |
+
/*
|
| 1140 |
+
* Hide the subprocess console window that would normally be created. This
|
| 1141 |
+
* option is only meaningful on Windows systems. On Unix it is silently
|
| 1142 |
+
* ignored.
|
| 1143 |
+
*/
|
| 1144 |
+
UV_PROCESS_WINDOWS_HIDE_CONSOLE = (1 << 5),
|
| 1145 |
+
/*
|
| 1146 |
+
* Hide the subprocess GUI window that would normally be created. This
|
| 1147 |
+
* option is only meaningful on Windows systems. On Unix it is silently
|
| 1148 |
+
* ignored.
|
| 1149 |
+
*/
|
| 1150 |
+
UV_PROCESS_WINDOWS_HIDE_GUI = (1 << 6),
|
| 1151 |
+
/*
|
| 1152 |
+
* On Windows, if the path to the program to execute, specified in
|
| 1153 |
+
* uv_process_options_t's file field, has a directory component,
|
| 1154 |
+
* search for the exact file name before trying variants with
|
| 1155 |
+
* extensions like '.exe' or '.cmd'.
|
| 1156 |
+
*/
|
| 1157 |
+
UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME = (1 << 7)
|
| 1158 |
+
};
|
| 1159 |
+
|
| 1160 |
+
/*
|
| 1161 |
+
* uv_process_t is a subclass of uv_handle_t.
|
| 1162 |
+
*/
|
| 1163 |
+
struct uv_process_s {
|
| 1164 |
+
UV_HANDLE_FIELDS
|
| 1165 |
+
uv_exit_cb exit_cb;
|
| 1166 |
+
int pid;
|
| 1167 |
+
UV_PROCESS_PRIVATE_FIELDS
|
| 1168 |
+
};
|
| 1169 |
+
|
| 1170 |
+
UV_EXTERN int uv_spawn(uv_loop_t* loop,
|
| 1171 |
+
uv_process_t* handle,
|
| 1172 |
+
const uv_process_options_t* options);
|
| 1173 |
+
UV_EXTERN int uv_process_kill(uv_process_t*, int signum);
|
| 1174 |
+
UV_EXTERN int uv_kill(int pid, int signum);
|
| 1175 |
+
UV_EXTERN uv_pid_t uv_process_get_pid(const uv_process_t*);
|
| 1176 |
+
|
| 1177 |
+
|
| 1178 |
+
/*
|
| 1179 |
+
* uv_work_t is a subclass of uv_req_t.
|
| 1180 |
+
*/
|
| 1181 |
+
struct uv_work_s {
|
| 1182 |
+
UV_REQ_FIELDS
|
| 1183 |
+
uv_loop_t* loop;
|
| 1184 |
+
uv_work_cb work_cb;
|
| 1185 |
+
uv_after_work_cb after_work_cb;
|
| 1186 |
+
UV_WORK_PRIVATE_FIELDS
|
| 1187 |
+
};
|
| 1188 |
+
|
| 1189 |
+
UV_EXTERN int uv_queue_work(uv_loop_t* loop,
|
| 1190 |
+
uv_work_t* req,
|
| 1191 |
+
uv_work_cb work_cb,
|
| 1192 |
+
uv_after_work_cb after_work_cb);
|
| 1193 |
+
|
| 1194 |
+
UV_EXTERN int uv_cancel(uv_req_t* req);
|
| 1195 |
+
|
| 1196 |
+
|
| 1197 |
+
struct uv_cpu_times_s {
|
| 1198 |
+
uint64_t user; /* milliseconds */
|
| 1199 |
+
uint64_t nice; /* milliseconds */
|
| 1200 |
+
uint64_t sys; /* milliseconds */
|
| 1201 |
+
uint64_t idle; /* milliseconds */
|
| 1202 |
+
uint64_t irq; /* milliseconds */
|
| 1203 |
+
};
|
| 1204 |
+
|
| 1205 |
+
struct uv_cpu_info_s {
|
| 1206 |
+
char* model;
|
| 1207 |
+
int speed;
|
| 1208 |
+
struct uv_cpu_times_s cpu_times;
|
| 1209 |
+
};
|
| 1210 |
+
|
| 1211 |
+
struct uv_interface_address_s {
|
| 1212 |
+
char* name;
|
| 1213 |
+
char phys_addr[6];
|
| 1214 |
+
int is_internal;
|
| 1215 |
+
union {
|
| 1216 |
+
struct sockaddr_in address4;
|
| 1217 |
+
struct sockaddr_in6 address6;
|
| 1218 |
+
} address;
|
| 1219 |
+
union {
|
| 1220 |
+
struct sockaddr_in netmask4;
|
| 1221 |
+
struct sockaddr_in6 netmask6;
|
| 1222 |
+
} netmask;
|
| 1223 |
+
};
|
| 1224 |
+
|
| 1225 |
+
struct uv_passwd_s {
|
| 1226 |
+
char* username;
|
| 1227 |
+
unsigned long uid;
|
| 1228 |
+
unsigned long gid;
|
| 1229 |
+
char* shell;
|
| 1230 |
+
char* homedir;
|
| 1231 |
+
};
|
| 1232 |
+
|
| 1233 |
+
struct uv_group_s {
|
| 1234 |
+
char* groupname;
|
| 1235 |
+
unsigned long gid;
|
| 1236 |
+
char** members;
|
| 1237 |
+
};
|
| 1238 |
+
|
| 1239 |
+
struct uv_utsname_s {
|
| 1240 |
+
char sysname[256];
|
| 1241 |
+
char release[256];
|
| 1242 |
+
char version[256];
|
| 1243 |
+
char machine[256];
|
| 1244 |
+
/* This struct does not contain the nodename and domainname fields present in
|
| 1245 |
+
the utsname type. domainname is a GNU extension. Both fields are referred
|
| 1246 |
+
to as meaningless in the docs. */
|
| 1247 |
+
};
|
| 1248 |
+
|
| 1249 |
+
struct uv_statfs_s {
|
| 1250 |
+
uint64_t f_type;
|
| 1251 |
+
uint64_t f_bsize;
|
| 1252 |
+
uint64_t f_blocks;
|
| 1253 |
+
uint64_t f_bfree;
|
| 1254 |
+
uint64_t f_bavail;
|
| 1255 |
+
uint64_t f_files;
|
| 1256 |
+
uint64_t f_ffree;
|
| 1257 |
+
uint64_t f_spare[4];
|
| 1258 |
+
};
|
| 1259 |
+
|
| 1260 |
+
typedef enum {
|
| 1261 |
+
UV_DIRENT_UNKNOWN,
|
| 1262 |
+
UV_DIRENT_FILE,
|
| 1263 |
+
UV_DIRENT_DIR,
|
| 1264 |
+
UV_DIRENT_LINK,
|
| 1265 |
+
UV_DIRENT_FIFO,
|
| 1266 |
+
UV_DIRENT_SOCKET,
|
| 1267 |
+
UV_DIRENT_CHAR,
|
| 1268 |
+
UV_DIRENT_BLOCK
|
| 1269 |
+
} uv_dirent_type_t;
|
| 1270 |
+
|
| 1271 |
+
struct uv_dirent_s {
|
| 1272 |
+
const char* name;
|
| 1273 |
+
uv_dirent_type_t type;
|
| 1274 |
+
};
|
| 1275 |
+
|
| 1276 |
+
UV_EXTERN char** uv_setup_args(int argc, char** argv);
|
| 1277 |
+
UV_EXTERN int uv_get_process_title(char* buffer, size_t size);
|
| 1278 |
+
UV_EXTERN int uv_set_process_title(const char* title);
|
| 1279 |
+
UV_EXTERN int uv_resident_set_memory(size_t* rss);
|
| 1280 |
+
UV_EXTERN int uv_uptime(double* uptime);
|
| 1281 |
+
UV_EXTERN uv_os_fd_t uv_get_osfhandle(int fd);
|
| 1282 |
+
UV_EXTERN int uv_open_osfhandle(uv_os_fd_t os_fd);
|
| 1283 |
+
|
| 1284 |
+
typedef struct {
|
| 1285 |
+
uv_timeval_t ru_utime; /* user CPU time used */
|
| 1286 |
+
uv_timeval_t ru_stime; /* system CPU time used */
|
| 1287 |
+
uint64_t ru_maxrss; /* maximum resident set size */
|
| 1288 |
+
uint64_t ru_ixrss; /* integral shared memory size */
|
| 1289 |
+
uint64_t ru_idrss; /* integral unshared data size */
|
| 1290 |
+
uint64_t ru_isrss; /* integral unshared stack size */
|
| 1291 |
+
uint64_t ru_minflt; /* page reclaims (soft page faults) */
|
| 1292 |
+
uint64_t ru_majflt; /* page faults (hard page faults) */
|
| 1293 |
+
uint64_t ru_nswap; /* swaps */
|
| 1294 |
+
uint64_t ru_inblock; /* block input operations */
|
| 1295 |
+
uint64_t ru_oublock; /* block output operations */
|
| 1296 |
+
uint64_t ru_msgsnd; /* IPC messages sent */
|
| 1297 |
+
uint64_t ru_msgrcv; /* IPC messages received */
|
| 1298 |
+
uint64_t ru_nsignals; /* signals received */
|
| 1299 |
+
uint64_t ru_nvcsw; /* voluntary context switches */
|
| 1300 |
+
uint64_t ru_nivcsw; /* involuntary context switches */
|
| 1301 |
+
} uv_rusage_t;
|
| 1302 |
+
|
| 1303 |
+
UV_EXTERN int uv_getrusage(uv_rusage_t* rusage);
|
| 1304 |
+
UV_EXTERN int uv_getrusage_thread(uv_rusage_t* rusage);
|
| 1305 |
+
|
| 1306 |
+
UV_EXTERN int uv_os_homedir(char* buffer, size_t* size);
|
| 1307 |
+
UV_EXTERN int uv_os_tmpdir(char* buffer, size_t* size);
|
| 1308 |
+
UV_EXTERN int uv_os_get_passwd(uv_passwd_t* pwd);
|
| 1309 |
+
UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd);
|
| 1310 |
+
UV_EXTERN int uv_os_get_passwd2(uv_passwd_t* pwd, uv_uid_t uid);
|
| 1311 |
+
UV_EXTERN int uv_os_get_group(uv_group_t* grp, uv_uid_t gid);
|
| 1312 |
+
UV_EXTERN void uv_os_free_group(uv_group_t* grp);
|
| 1313 |
+
UV_EXTERN uv_pid_t uv_os_getpid(void);
|
| 1314 |
+
UV_EXTERN uv_pid_t uv_os_getppid(void);
|
| 1315 |
+
|
| 1316 |
+
#if defined(__PASE__)
|
| 1317 |
+
/* On IBM i PASE, the highest process priority is -10 */
|
| 1318 |
+
# define UV_PRIORITY_LOW 39 /* RUNPTY(99) */
|
| 1319 |
+
# define UV_PRIORITY_BELOW_NORMAL 15 /* RUNPTY(50) */
|
| 1320 |
+
# define UV_PRIORITY_NORMAL 0 /* RUNPTY(20) */
|
| 1321 |
+
# define UV_PRIORITY_ABOVE_NORMAL -4 /* RUNTY(12) */
|
| 1322 |
+
# define UV_PRIORITY_HIGH -7 /* RUNPTY(6) */
|
| 1323 |
+
# define UV_PRIORITY_HIGHEST -10 /* RUNPTY(1) */
|
| 1324 |
+
#else
|
| 1325 |
+
# define UV_PRIORITY_LOW 19
|
| 1326 |
+
# define UV_PRIORITY_BELOW_NORMAL 10
|
| 1327 |
+
# define UV_PRIORITY_NORMAL 0
|
| 1328 |
+
# define UV_PRIORITY_ABOVE_NORMAL -7
|
| 1329 |
+
# define UV_PRIORITY_HIGH -14
|
| 1330 |
+
# define UV_PRIORITY_HIGHEST -20
|
| 1331 |
+
#endif
|
| 1332 |
+
|
| 1333 |
+
UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int* priority);
|
| 1334 |
+
UV_EXTERN int uv_os_setpriority(uv_pid_t pid, int priority);
|
| 1335 |
+
|
| 1336 |
+
enum {
|
| 1337 |
+
UV_THREAD_PRIORITY_HIGHEST = 2,
|
| 1338 |
+
UV_THREAD_PRIORITY_ABOVE_NORMAL = 1,
|
| 1339 |
+
UV_THREAD_PRIORITY_NORMAL = 0,
|
| 1340 |
+
UV_THREAD_PRIORITY_BELOW_NORMAL = -1,
|
| 1341 |
+
UV_THREAD_PRIORITY_LOWEST = -2,
|
| 1342 |
+
};
|
| 1343 |
+
|
| 1344 |
+
UV_EXTERN int uv_thread_getpriority(uv_thread_t tid, int* priority);
|
| 1345 |
+
UV_EXTERN int uv_thread_setpriority(uv_thread_t tid, int priority);
|
| 1346 |
+
|
| 1347 |
+
UV_EXTERN unsigned int uv_available_parallelism(void);
|
| 1348 |
+
UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count);
|
| 1349 |
+
UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count);
|
| 1350 |
+
UV_EXTERN int uv_cpumask_size(void);
|
| 1351 |
+
|
| 1352 |
+
UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses,
|
| 1353 |
+
int* count);
|
| 1354 |
+
UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses,
|
| 1355 |
+
int count);
|
| 1356 |
+
|
| 1357 |
+
struct uv_env_item_s {
|
| 1358 |
+
char* name;
|
| 1359 |
+
char* value;
|
| 1360 |
+
};
|
| 1361 |
+
|
| 1362 |
+
UV_EXTERN int uv_os_environ(uv_env_item_t** envitems, int* count);
|
| 1363 |
+
UV_EXTERN void uv_os_free_environ(uv_env_item_t* envitems, int count);
|
| 1364 |
+
UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size);
|
| 1365 |
+
UV_EXTERN int uv_os_setenv(const char* name, const char* value);
|
| 1366 |
+
UV_EXTERN int uv_os_unsetenv(const char* name);
|
| 1367 |
+
|
| 1368 |
+
#ifdef MAXHOSTNAMELEN
|
| 1369 |
+
# define UV_MAXHOSTNAMESIZE (MAXHOSTNAMELEN + 1)
|
| 1370 |
+
#else
|
| 1371 |
+
/*
|
| 1372 |
+
Fallback for the maximum hostname size, including the null terminator. The
|
| 1373 |
+
Windows gethostname() documentation states that 256 bytes will always be
|
| 1374 |
+
large enough to hold the null-terminated hostname.
|
| 1375 |
+
*/
|
| 1376 |
+
# define UV_MAXHOSTNAMESIZE 256
|
| 1377 |
+
#endif
|
| 1378 |
+
|
| 1379 |
+
UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size);
|
| 1380 |
+
|
| 1381 |
+
UV_EXTERN int uv_os_uname(uv_utsname_t* buffer);
|
| 1382 |
+
|
| 1383 |
+
struct uv_metrics_s {
|
| 1384 |
+
uint64_t loop_count;
|
| 1385 |
+
uint64_t events;
|
| 1386 |
+
uint64_t events_waiting;
|
| 1387 |
+
/* private */
|
| 1388 |
+
uint64_t* reserved[13];
|
| 1389 |
+
};
|
| 1390 |
+
|
| 1391 |
+
UV_EXTERN int uv_metrics_info(uv_loop_t* loop, uv_metrics_t* metrics);
|
| 1392 |
+
UV_EXTERN uint64_t uv_metrics_idle_time(uv_loop_t* loop);
|
| 1393 |
+
|
| 1394 |
+
typedef enum {
|
| 1395 |
+
UV_FS_UNKNOWN = -1,
|
| 1396 |
+
UV_FS_CUSTOM,
|
| 1397 |
+
UV_FS_OPEN,
|
| 1398 |
+
UV_FS_CLOSE,
|
| 1399 |
+
UV_FS_READ,
|
| 1400 |
+
UV_FS_WRITE,
|
| 1401 |
+
UV_FS_SENDFILE,
|
| 1402 |
+
UV_FS_STAT,
|
| 1403 |
+
UV_FS_LSTAT,
|
| 1404 |
+
UV_FS_FSTAT,
|
| 1405 |
+
UV_FS_FTRUNCATE,
|
| 1406 |
+
UV_FS_UTIME,
|
| 1407 |
+
UV_FS_FUTIME,
|
| 1408 |
+
UV_FS_ACCESS,
|
| 1409 |
+
UV_FS_CHMOD,
|
| 1410 |
+
UV_FS_FCHMOD,
|
| 1411 |
+
UV_FS_FSYNC,
|
| 1412 |
+
UV_FS_FDATASYNC,
|
| 1413 |
+
UV_FS_UNLINK,
|
| 1414 |
+
UV_FS_RMDIR,
|
| 1415 |
+
UV_FS_MKDIR,
|
| 1416 |
+
UV_FS_MKDTEMP,
|
| 1417 |
+
UV_FS_RENAME,
|
| 1418 |
+
UV_FS_SCANDIR,
|
| 1419 |
+
UV_FS_LINK,
|
| 1420 |
+
UV_FS_SYMLINK,
|
| 1421 |
+
UV_FS_READLINK,
|
| 1422 |
+
UV_FS_CHOWN,
|
| 1423 |
+
UV_FS_FCHOWN,
|
| 1424 |
+
UV_FS_REALPATH,
|
| 1425 |
+
UV_FS_COPYFILE,
|
| 1426 |
+
UV_FS_LCHOWN,
|
| 1427 |
+
UV_FS_OPENDIR,
|
| 1428 |
+
UV_FS_READDIR,
|
| 1429 |
+
UV_FS_CLOSEDIR,
|
| 1430 |
+
UV_FS_STATFS,
|
| 1431 |
+
UV_FS_MKSTEMP,
|
| 1432 |
+
UV_FS_LUTIME
|
| 1433 |
+
} uv_fs_type;
|
| 1434 |
+
|
| 1435 |
+
struct uv_dir_s {
|
| 1436 |
+
uv_dirent_t* dirents;
|
| 1437 |
+
size_t nentries;
|
| 1438 |
+
void* reserved[4];
|
| 1439 |
+
UV_DIR_PRIVATE_FIELDS
|
| 1440 |
+
};
|
| 1441 |
+
|
| 1442 |
+
/* uv_fs_t is a subclass of uv_req_t. */
|
| 1443 |
+
struct uv_fs_s {
|
| 1444 |
+
UV_REQ_FIELDS
|
| 1445 |
+
uv_fs_type fs_type;
|
| 1446 |
+
uv_loop_t* loop;
|
| 1447 |
+
uv_fs_cb cb;
|
| 1448 |
+
ssize_t result;
|
| 1449 |
+
void* ptr;
|
| 1450 |
+
const char* path;
|
| 1451 |
+
uv_stat_t statbuf; /* Stores the result of uv_fs_stat() and uv_fs_fstat(). */
|
| 1452 |
+
UV_FS_PRIVATE_FIELDS
|
| 1453 |
+
};
|
| 1454 |
+
|
| 1455 |
+
UV_EXTERN uv_fs_type uv_fs_get_type(const uv_fs_t*);
|
| 1456 |
+
UV_EXTERN ssize_t uv_fs_get_result(const uv_fs_t*);
|
| 1457 |
+
UV_EXTERN int uv_fs_get_system_error(const uv_fs_t*);
|
| 1458 |
+
UV_EXTERN void* uv_fs_get_ptr(const uv_fs_t*);
|
| 1459 |
+
UV_EXTERN const char* uv_fs_get_path(const uv_fs_t*);
|
| 1460 |
+
UV_EXTERN uv_stat_t* uv_fs_get_statbuf(uv_fs_t*);
|
| 1461 |
+
|
| 1462 |
+
UV_EXTERN void uv_fs_req_cleanup(uv_fs_t* req);
|
| 1463 |
+
UV_EXTERN int uv_fs_close(uv_loop_t* loop,
|
| 1464 |
+
uv_fs_t* req,
|
| 1465 |
+
uv_file file,
|
| 1466 |
+
uv_fs_cb cb);
|
| 1467 |
+
UV_EXTERN int uv_fs_open(uv_loop_t* loop,
|
| 1468 |
+
uv_fs_t* req,
|
| 1469 |
+
const char* path,
|
| 1470 |
+
int flags,
|
| 1471 |
+
int mode,
|
| 1472 |
+
uv_fs_cb cb);
|
| 1473 |
+
UV_EXTERN int uv_fs_read(uv_loop_t* loop,
|
| 1474 |
+
uv_fs_t* req,
|
| 1475 |
+
uv_file file,
|
| 1476 |
+
const uv_buf_t bufs[],
|
| 1477 |
+
unsigned int nbufs,
|
| 1478 |
+
int64_t offset,
|
| 1479 |
+
uv_fs_cb cb);
|
| 1480 |
+
UV_EXTERN int uv_fs_unlink(uv_loop_t* loop,
|
| 1481 |
+
uv_fs_t* req,
|
| 1482 |
+
const char* path,
|
| 1483 |
+
uv_fs_cb cb);
|
| 1484 |
+
UV_EXTERN int uv_fs_write(uv_loop_t* loop,
|
| 1485 |
+
uv_fs_t* req,
|
| 1486 |
+
uv_file file,
|
| 1487 |
+
const uv_buf_t bufs[],
|
| 1488 |
+
unsigned int nbufs,
|
| 1489 |
+
int64_t offset,
|
| 1490 |
+
uv_fs_cb cb);
|
| 1491 |
+
/*
|
| 1492 |
+
* This flag can be used with uv_fs_copyfile() to return an error if the
|
| 1493 |
+
* destination already exists.
|
| 1494 |
+
*/
|
| 1495 |
+
#define UV_FS_COPYFILE_EXCL 0x0001
|
| 1496 |
+
|
| 1497 |
+
/*
|
| 1498 |
+
* This flag can be used with uv_fs_copyfile() to attempt to create a reflink.
|
| 1499 |
+
* If copy-on-write is not supported, a fallback copy mechanism is used.
|
| 1500 |
+
*/
|
| 1501 |
+
#define UV_FS_COPYFILE_FICLONE 0x0002
|
| 1502 |
+
|
| 1503 |
+
/*
|
| 1504 |
+
* This flag can be used with uv_fs_copyfile() to attempt to create a reflink.
|
| 1505 |
+
* If copy-on-write is not supported, an error is returned.
|
| 1506 |
+
*/
|
| 1507 |
+
#define UV_FS_COPYFILE_FICLONE_FORCE 0x0004
|
| 1508 |
+
|
| 1509 |
+
UV_EXTERN int uv_fs_copyfile(uv_loop_t* loop,
|
| 1510 |
+
uv_fs_t* req,
|
| 1511 |
+
const char* path,
|
| 1512 |
+
const char* new_path,
|
| 1513 |
+
int flags,
|
| 1514 |
+
uv_fs_cb cb);
|
| 1515 |
+
UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop,
|
| 1516 |
+
uv_fs_t* req,
|
| 1517 |
+
const char* path,
|
| 1518 |
+
int mode,
|
| 1519 |
+
uv_fs_cb cb);
|
| 1520 |
+
UV_EXTERN int uv_fs_mkdtemp(uv_loop_t* loop,
|
| 1521 |
+
uv_fs_t* req,
|
| 1522 |
+
const char* tpl,
|
| 1523 |
+
uv_fs_cb cb);
|
| 1524 |
+
UV_EXTERN int uv_fs_mkstemp(uv_loop_t* loop,
|
| 1525 |
+
uv_fs_t* req,
|
| 1526 |
+
const char* tpl,
|
| 1527 |
+
uv_fs_cb cb);
|
| 1528 |
+
UV_EXTERN int uv_fs_rmdir(uv_loop_t* loop,
|
| 1529 |
+
uv_fs_t* req,
|
| 1530 |
+
const char* path,
|
| 1531 |
+
uv_fs_cb cb);
|
| 1532 |
+
UV_EXTERN int uv_fs_scandir(uv_loop_t* loop,
|
| 1533 |
+
uv_fs_t* req,
|
| 1534 |
+
const char* path,
|
| 1535 |
+
int flags,
|
| 1536 |
+
uv_fs_cb cb);
|
| 1537 |
+
UV_EXTERN int uv_fs_scandir_next(uv_fs_t* req,
|
| 1538 |
+
uv_dirent_t* ent);
|
| 1539 |
+
UV_EXTERN int uv_fs_opendir(uv_loop_t* loop,
|
| 1540 |
+
uv_fs_t* req,
|
| 1541 |
+
const char* path,
|
| 1542 |
+
uv_fs_cb cb);
|
| 1543 |
+
UV_EXTERN int uv_fs_readdir(uv_loop_t* loop,
|
| 1544 |
+
uv_fs_t* req,
|
| 1545 |
+
uv_dir_t* dir,
|
| 1546 |
+
uv_fs_cb cb);
|
| 1547 |
+
UV_EXTERN int uv_fs_closedir(uv_loop_t* loop,
|
| 1548 |
+
uv_fs_t* req,
|
| 1549 |
+
uv_dir_t* dir,
|
| 1550 |
+
uv_fs_cb cb);
|
| 1551 |
+
UV_EXTERN int uv_fs_stat(uv_loop_t* loop,
|
| 1552 |
+
uv_fs_t* req,
|
| 1553 |
+
const char* path,
|
| 1554 |
+
uv_fs_cb cb);
|
| 1555 |
+
UV_EXTERN int uv_fs_fstat(uv_loop_t* loop,
|
| 1556 |
+
uv_fs_t* req,
|
| 1557 |
+
uv_file file,
|
| 1558 |
+
uv_fs_cb cb);
|
| 1559 |
+
UV_EXTERN int uv_fs_rename(uv_loop_t* loop,
|
| 1560 |
+
uv_fs_t* req,
|
| 1561 |
+
const char* path,
|
| 1562 |
+
const char* new_path,
|
| 1563 |
+
uv_fs_cb cb);
|
| 1564 |
+
UV_EXTERN int uv_fs_fsync(uv_loop_t* loop,
|
| 1565 |
+
uv_fs_t* req,
|
| 1566 |
+
uv_file file,
|
| 1567 |
+
uv_fs_cb cb);
|
| 1568 |
+
UV_EXTERN int uv_fs_fdatasync(uv_loop_t* loop,
|
| 1569 |
+
uv_fs_t* req,
|
| 1570 |
+
uv_file file,
|
| 1571 |
+
uv_fs_cb cb);
|
| 1572 |
+
UV_EXTERN int uv_fs_ftruncate(uv_loop_t* loop,
|
| 1573 |
+
uv_fs_t* req,
|
| 1574 |
+
uv_file file,
|
| 1575 |
+
int64_t offset,
|
| 1576 |
+
uv_fs_cb cb);
|
| 1577 |
+
UV_EXTERN int uv_fs_sendfile(uv_loop_t* loop,
|
| 1578 |
+
uv_fs_t* req,
|
| 1579 |
+
uv_file out_fd,
|
| 1580 |
+
uv_file in_fd,
|
| 1581 |
+
int64_t in_offset,
|
| 1582 |
+
size_t length,
|
| 1583 |
+
uv_fs_cb cb);
|
| 1584 |
+
UV_EXTERN int uv_fs_access(uv_loop_t* loop,
|
| 1585 |
+
uv_fs_t* req,
|
| 1586 |
+
const char* path,
|
| 1587 |
+
int mode,
|
| 1588 |
+
uv_fs_cb cb);
|
| 1589 |
+
UV_EXTERN int uv_fs_chmod(uv_loop_t* loop,
|
| 1590 |
+
uv_fs_t* req,
|
| 1591 |
+
const char* path,
|
| 1592 |
+
int mode,
|
| 1593 |
+
uv_fs_cb cb);
|
| 1594 |
+
#define UV_FS_UTIME_NOW (INFINITY)
|
| 1595 |
+
#define UV_FS_UTIME_OMIT (NAN)
|
| 1596 |
+
UV_EXTERN int uv_fs_utime(uv_loop_t* loop,
|
| 1597 |
+
uv_fs_t* req,
|
| 1598 |
+
const char* path,
|
| 1599 |
+
double atime,
|
| 1600 |
+
double mtime,
|
| 1601 |
+
uv_fs_cb cb);
|
| 1602 |
+
UV_EXTERN int uv_fs_futime(uv_loop_t* loop,
|
| 1603 |
+
uv_fs_t* req,
|
| 1604 |
+
uv_file file,
|
| 1605 |
+
double atime,
|
| 1606 |
+
double mtime,
|
| 1607 |
+
uv_fs_cb cb);
|
| 1608 |
+
UV_EXTERN int uv_fs_lutime(uv_loop_t* loop,
|
| 1609 |
+
uv_fs_t* req,
|
| 1610 |
+
const char* path,
|
| 1611 |
+
double atime,
|
| 1612 |
+
double mtime,
|
| 1613 |
+
uv_fs_cb cb);
|
| 1614 |
+
UV_EXTERN int uv_fs_lstat(uv_loop_t* loop,
|
| 1615 |
+
uv_fs_t* req,
|
| 1616 |
+
const char* path,
|
| 1617 |
+
uv_fs_cb cb);
|
| 1618 |
+
UV_EXTERN int uv_fs_link(uv_loop_t* loop,
|
| 1619 |
+
uv_fs_t* req,
|
| 1620 |
+
const char* path,
|
| 1621 |
+
const char* new_path,
|
| 1622 |
+
uv_fs_cb cb);
|
| 1623 |
+
|
| 1624 |
+
/*
|
| 1625 |
+
* This flag can be used with uv_fs_symlink() on Windows to specify whether
|
| 1626 |
+
* path argument points to a directory.
|
| 1627 |
+
*/
|
| 1628 |
+
#define UV_FS_SYMLINK_DIR 0x0001
|
| 1629 |
+
|
| 1630 |
+
/*
|
| 1631 |
+
* This flag can be used with uv_fs_symlink() on Windows to specify whether
|
| 1632 |
+
* the symlink is to be created using junction points.
|
| 1633 |
+
*/
|
| 1634 |
+
#define UV_FS_SYMLINK_JUNCTION 0x0002
|
| 1635 |
+
|
| 1636 |
+
UV_EXTERN int uv_fs_symlink(uv_loop_t* loop,
|
| 1637 |
+
uv_fs_t* req,
|
| 1638 |
+
const char* path,
|
| 1639 |
+
const char* new_path,
|
| 1640 |
+
int flags,
|
| 1641 |
+
uv_fs_cb cb);
|
| 1642 |
+
UV_EXTERN int uv_fs_readlink(uv_loop_t* loop,
|
| 1643 |
+
uv_fs_t* req,
|
| 1644 |
+
const char* path,
|
| 1645 |
+
uv_fs_cb cb);
|
| 1646 |
+
UV_EXTERN int uv_fs_realpath(uv_loop_t* loop,
|
| 1647 |
+
uv_fs_t* req,
|
| 1648 |
+
const char* path,
|
| 1649 |
+
uv_fs_cb cb);
|
| 1650 |
+
UV_EXTERN int uv_fs_fchmod(uv_loop_t* loop,
|
| 1651 |
+
uv_fs_t* req,
|
| 1652 |
+
uv_file file,
|
| 1653 |
+
int mode,
|
| 1654 |
+
uv_fs_cb cb);
|
| 1655 |
+
UV_EXTERN int uv_fs_chown(uv_loop_t* loop,
|
| 1656 |
+
uv_fs_t* req,
|
| 1657 |
+
const char* path,
|
| 1658 |
+
uv_uid_t uid,
|
| 1659 |
+
uv_gid_t gid,
|
| 1660 |
+
uv_fs_cb cb);
|
| 1661 |
+
UV_EXTERN int uv_fs_fchown(uv_loop_t* loop,
|
| 1662 |
+
uv_fs_t* req,
|
| 1663 |
+
uv_file file,
|
| 1664 |
+
uv_uid_t uid,
|
| 1665 |
+
uv_gid_t gid,
|
| 1666 |
+
uv_fs_cb cb);
|
| 1667 |
+
UV_EXTERN int uv_fs_lchown(uv_loop_t* loop,
|
| 1668 |
+
uv_fs_t* req,
|
| 1669 |
+
const char* path,
|
| 1670 |
+
uv_uid_t uid,
|
| 1671 |
+
uv_gid_t gid,
|
| 1672 |
+
uv_fs_cb cb);
|
| 1673 |
+
UV_EXTERN int uv_fs_statfs(uv_loop_t* loop,
|
| 1674 |
+
uv_fs_t* req,
|
| 1675 |
+
const char* path,
|
| 1676 |
+
uv_fs_cb cb);
|
| 1677 |
+
|
| 1678 |
+
|
| 1679 |
+
enum uv_fs_event {
|
| 1680 |
+
UV_RENAME = 1,
|
| 1681 |
+
UV_CHANGE = 2
|
| 1682 |
+
};
|
| 1683 |
+
|
| 1684 |
+
|
| 1685 |
+
struct uv_fs_event_s {
|
| 1686 |
+
UV_HANDLE_FIELDS
|
| 1687 |
+
/* private */
|
| 1688 |
+
char* path;
|
| 1689 |
+
UV_FS_EVENT_PRIVATE_FIELDS
|
| 1690 |
+
};
|
| 1691 |
+
|
| 1692 |
+
|
| 1693 |
+
/*
|
| 1694 |
+
* uv_fs_stat() based polling file watcher.
|
| 1695 |
+
*/
|
| 1696 |
+
struct uv_fs_poll_s {
|
| 1697 |
+
UV_HANDLE_FIELDS
|
| 1698 |
+
/* Private, don't touch. */
|
| 1699 |
+
void* poll_ctx;
|
| 1700 |
+
};
|
| 1701 |
+
|
| 1702 |
+
UV_EXTERN int uv_fs_poll_init(uv_loop_t* loop, uv_fs_poll_t* handle);
|
| 1703 |
+
UV_EXTERN int uv_fs_poll_start(uv_fs_poll_t* handle,
|
| 1704 |
+
uv_fs_poll_cb poll_cb,
|
| 1705 |
+
const char* path,
|
| 1706 |
+
unsigned int interval);
|
| 1707 |
+
UV_EXTERN int uv_fs_poll_stop(uv_fs_poll_t* handle);
|
| 1708 |
+
UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle,
|
| 1709 |
+
char* buffer,
|
| 1710 |
+
size_t* size);
|
| 1711 |
+
|
| 1712 |
+
|
| 1713 |
+
struct uv_signal_s {
|
| 1714 |
+
UV_HANDLE_FIELDS
|
| 1715 |
+
uv_signal_cb signal_cb;
|
| 1716 |
+
int signum;
|
| 1717 |
+
UV_SIGNAL_PRIVATE_FIELDS
|
| 1718 |
+
};
|
| 1719 |
+
|
| 1720 |
+
UV_EXTERN int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle);
|
| 1721 |
+
UV_EXTERN int uv_signal_start(uv_signal_t* handle,
|
| 1722 |
+
uv_signal_cb signal_cb,
|
| 1723 |
+
int signum);
|
| 1724 |
+
UV_EXTERN int uv_signal_start_oneshot(uv_signal_t* handle,
|
| 1725 |
+
uv_signal_cb signal_cb,
|
| 1726 |
+
int signum);
|
| 1727 |
+
UV_EXTERN int uv_signal_stop(uv_signal_t* handle);
|
| 1728 |
+
|
| 1729 |
+
UV_EXTERN void uv_loadavg(double avg[3]);
|
| 1730 |
+
|
| 1731 |
+
|
| 1732 |
+
/*
|
| 1733 |
+
* Flags to be passed to uv_fs_event_start().
|
| 1734 |
+
*/
|
| 1735 |
+
enum uv_fs_event_flags {
|
| 1736 |
+
/*
|
| 1737 |
+
* By default, if the fs event watcher is given a directory name, we will
|
| 1738 |
+
* watch for all events in that directory. This flags overrides this behavior
|
| 1739 |
+
* and makes fs_event report only changes to the directory entry itself. This
|
| 1740 |
+
* flag does not affect individual files watched.
|
| 1741 |
+
* This flag is currently not implemented yet on any backend.
|
| 1742 |
+
*/
|
| 1743 |
+
UV_FS_EVENT_WATCH_ENTRY = 1,
|
| 1744 |
+
|
| 1745 |
+
/*
|
| 1746 |
+
* By default uv_fs_event will try to use a kernel interface such as inotify
|
| 1747 |
+
* or kqueue to detect events. This may not work on remote filesystems such
|
| 1748 |
+
* as NFS mounts. This flag makes fs_event fall back to calling stat() on a
|
| 1749 |
+
* regular interval.
|
| 1750 |
+
* This flag is currently not implemented yet on any backend.
|
| 1751 |
+
*/
|
| 1752 |
+
UV_FS_EVENT_STAT = 2,
|
| 1753 |
+
|
| 1754 |
+
/*
|
| 1755 |
+
* By default, event watcher, when watching directory, is not registering
|
| 1756 |
+
* (is ignoring) changes in it's subdirectories.
|
| 1757 |
+
* This flag will override this behaviour on platforms that support it.
|
| 1758 |
+
*/
|
| 1759 |
+
UV_FS_EVENT_RECURSIVE = 4
|
| 1760 |
+
};
|
| 1761 |
+
|
| 1762 |
+
|
| 1763 |
+
UV_EXTERN int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle);
|
| 1764 |
+
UV_EXTERN int uv_fs_event_start(uv_fs_event_t* handle,
|
| 1765 |
+
uv_fs_event_cb cb,
|
| 1766 |
+
const char* path,
|
| 1767 |
+
unsigned int flags);
|
| 1768 |
+
UV_EXTERN int uv_fs_event_stop(uv_fs_event_t* handle);
|
| 1769 |
+
UV_EXTERN int uv_fs_event_getpath(uv_fs_event_t* handle,
|
| 1770 |
+
char* buffer,
|
| 1771 |
+
size_t* size);
|
| 1772 |
+
|
| 1773 |
+
UV_EXTERN int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr);
|
| 1774 |
+
UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr);
|
| 1775 |
+
|
| 1776 |
+
UV_EXTERN int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size);
|
| 1777 |
+
UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size);
|
| 1778 |
+
UV_EXTERN int uv_ip_name(const struct sockaddr* src, char* dst, size_t size);
|
| 1779 |
+
|
| 1780 |
+
UV_EXTERN int uv_inet_ntop(int af, const void* src, char* dst, size_t size);
|
| 1781 |
+
UV_EXTERN int uv_inet_pton(int af, const char* src, void* dst);
|
| 1782 |
+
|
| 1783 |
+
|
| 1784 |
+
struct uv_random_s {
|
| 1785 |
+
UV_REQ_FIELDS
|
| 1786 |
+
/* read-only */
|
| 1787 |
+
uv_loop_t* loop;
|
| 1788 |
+
/* private */
|
| 1789 |
+
int status;
|
| 1790 |
+
void* buf;
|
| 1791 |
+
size_t buflen;
|
| 1792 |
+
uv_random_cb cb;
|
| 1793 |
+
struct uv__work work_req;
|
| 1794 |
+
};
|
| 1795 |
+
|
| 1796 |
+
UV_EXTERN int uv_random(uv_loop_t* loop,
|
| 1797 |
+
uv_random_t* req,
|
| 1798 |
+
void *buf,
|
| 1799 |
+
size_t buflen,
|
| 1800 |
+
unsigned flags, /* For future extension; must be 0. */
|
| 1801 |
+
uv_random_cb cb);
|
| 1802 |
+
|
| 1803 |
+
#if defined(IF_NAMESIZE)
|
| 1804 |
+
# define UV_IF_NAMESIZE (IF_NAMESIZE + 1)
|
| 1805 |
+
#elif defined(IFNAMSIZ)
|
| 1806 |
+
# define UV_IF_NAMESIZE (IFNAMSIZ + 1)
|
| 1807 |
+
#else
|
| 1808 |
+
# define UV_IF_NAMESIZE (16 + 1)
|
| 1809 |
+
#endif
|
| 1810 |
+
|
| 1811 |
+
UV_EXTERN int uv_if_indextoname(unsigned int ifindex,
|
| 1812 |
+
char* buffer,
|
| 1813 |
+
size_t* size);
|
| 1814 |
+
UV_EXTERN int uv_if_indextoiid(unsigned int ifindex,
|
| 1815 |
+
char* buffer,
|
| 1816 |
+
size_t* size);
|
| 1817 |
+
|
| 1818 |
+
UV_EXTERN int uv_exepath(char* buffer, size_t* size);
|
| 1819 |
+
|
| 1820 |
+
UV_EXTERN int uv_cwd(char* buffer, size_t* size);
|
| 1821 |
+
|
| 1822 |
+
UV_EXTERN int uv_chdir(const char* dir);
|
| 1823 |
+
|
| 1824 |
+
UV_EXTERN uint64_t uv_get_free_memory(void);
|
| 1825 |
+
UV_EXTERN uint64_t uv_get_total_memory(void);
|
| 1826 |
+
UV_EXTERN uint64_t uv_get_constrained_memory(void);
|
| 1827 |
+
UV_EXTERN uint64_t uv_get_available_memory(void);
|
| 1828 |
+
|
| 1829 |
+
UV_EXTERN int uv_clock_gettime(uv_clock_id clock_id, uv_timespec64_t* ts);
|
| 1830 |
+
UV_EXTERN uint64_t uv_hrtime(void);
|
| 1831 |
+
UV_EXTERN void uv_sleep(unsigned int msec);
|
| 1832 |
+
|
| 1833 |
+
UV_EXTERN void uv_disable_stdio_inheritance(void);
|
| 1834 |
+
|
| 1835 |
+
UV_EXTERN int uv_dlopen(const char* filename, uv_lib_t* lib);
|
| 1836 |
+
UV_EXTERN void uv_dlclose(uv_lib_t* lib);
|
| 1837 |
+
UV_EXTERN int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr);
|
| 1838 |
+
UV_EXTERN const char* uv_dlerror(const uv_lib_t* lib);
|
| 1839 |
+
|
| 1840 |
+
UV_EXTERN int uv_mutex_init(uv_mutex_t* handle);
|
| 1841 |
+
UV_EXTERN int uv_mutex_init_recursive(uv_mutex_t* handle);
|
| 1842 |
+
UV_EXTERN void uv_mutex_destroy(uv_mutex_t* handle);
|
| 1843 |
+
UV_EXTERN void uv_mutex_lock(uv_mutex_t* handle);
|
| 1844 |
+
UV_EXTERN int uv_mutex_trylock(uv_mutex_t* handle);
|
| 1845 |
+
UV_EXTERN void uv_mutex_unlock(uv_mutex_t* handle);
|
| 1846 |
+
|
| 1847 |
+
UV_EXTERN int uv_rwlock_init(uv_rwlock_t* rwlock);
|
| 1848 |
+
UV_EXTERN void uv_rwlock_destroy(uv_rwlock_t* rwlock);
|
| 1849 |
+
UV_EXTERN void uv_rwlock_rdlock(uv_rwlock_t* rwlock);
|
| 1850 |
+
UV_EXTERN int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock);
|
| 1851 |
+
UV_EXTERN void uv_rwlock_rdunlock(uv_rwlock_t* rwlock);
|
| 1852 |
+
UV_EXTERN void uv_rwlock_wrlock(uv_rwlock_t* rwlock);
|
| 1853 |
+
UV_EXTERN int uv_rwlock_trywrlock(uv_rwlock_t* rwlock);
|
| 1854 |
+
UV_EXTERN void uv_rwlock_wrunlock(uv_rwlock_t* rwlock);
|
| 1855 |
+
|
| 1856 |
+
UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
|
| 1857 |
+
UV_EXTERN void uv_sem_destroy(uv_sem_t* sem);
|
| 1858 |
+
UV_EXTERN void uv_sem_post(uv_sem_t* sem);
|
| 1859 |
+
UV_EXTERN void uv_sem_wait(uv_sem_t* sem);
|
| 1860 |
+
UV_EXTERN int uv_sem_trywait(uv_sem_t* sem);
|
| 1861 |
+
|
| 1862 |
+
UV_EXTERN int uv_cond_init(uv_cond_t* cond);
|
| 1863 |
+
UV_EXTERN void uv_cond_destroy(uv_cond_t* cond);
|
| 1864 |
+
UV_EXTERN void uv_cond_signal(uv_cond_t* cond);
|
| 1865 |
+
UV_EXTERN void uv_cond_broadcast(uv_cond_t* cond);
|
| 1866 |
+
|
| 1867 |
+
UV_EXTERN int uv_barrier_init(uv_barrier_t* barrier, unsigned int count);
|
| 1868 |
+
UV_EXTERN void uv_barrier_destroy(uv_barrier_t* barrier);
|
| 1869 |
+
UV_EXTERN int uv_barrier_wait(uv_barrier_t* barrier);
|
| 1870 |
+
|
| 1871 |
+
UV_EXTERN void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex);
|
| 1872 |
+
UV_EXTERN int uv_cond_timedwait(uv_cond_t* cond,
|
| 1873 |
+
uv_mutex_t* mutex,
|
| 1874 |
+
uint64_t timeout);
|
| 1875 |
+
|
| 1876 |
+
UV_EXTERN void uv_once(uv_once_t* guard, void (*callback)(void));
|
| 1877 |
+
|
| 1878 |
+
UV_EXTERN int uv_key_create(uv_key_t* key);
|
| 1879 |
+
UV_EXTERN void uv_key_delete(uv_key_t* key);
|
| 1880 |
+
UV_EXTERN void* uv_key_get(uv_key_t* key);
|
| 1881 |
+
UV_EXTERN void uv_key_set(uv_key_t* key, void* value);
|
| 1882 |
+
|
| 1883 |
+
UV_EXTERN int uv_gettimeofday(uv_timeval64_t* tv);
|
| 1884 |
+
|
| 1885 |
+
typedef void (*uv_thread_cb)(void* arg);
|
| 1886 |
+
|
| 1887 |
+
UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg);
|
| 1888 |
+
UV_EXTERN int uv_thread_detach(uv_thread_t* tid);
|
| 1889 |
+
|
| 1890 |
+
typedef enum {
|
| 1891 |
+
UV_THREAD_NO_FLAGS = 0x00,
|
| 1892 |
+
UV_THREAD_HAS_STACK_SIZE = 0x01
|
| 1893 |
+
} uv_thread_create_flags;
|
| 1894 |
+
|
| 1895 |
+
struct uv_thread_options_s {
|
| 1896 |
+
unsigned int flags;
|
| 1897 |
+
size_t stack_size;
|
| 1898 |
+
/* More fields may be added at any time. */
|
| 1899 |
+
};
|
| 1900 |
+
|
| 1901 |
+
typedef struct uv_thread_options_s uv_thread_options_t;
|
| 1902 |
+
|
| 1903 |
+
UV_EXTERN int uv_thread_create_ex(uv_thread_t* tid,
|
| 1904 |
+
const uv_thread_options_t* params,
|
| 1905 |
+
uv_thread_cb entry,
|
| 1906 |
+
void* arg);
|
| 1907 |
+
UV_EXTERN int uv_thread_setaffinity(uv_thread_t* tid,
|
| 1908 |
+
char* cpumask,
|
| 1909 |
+
char* oldmask,
|
| 1910 |
+
size_t mask_size);
|
| 1911 |
+
UV_EXTERN int uv_thread_getaffinity(uv_thread_t* tid,
|
| 1912 |
+
char* cpumask,
|
| 1913 |
+
size_t mask_size);
|
| 1914 |
+
UV_EXTERN int uv_thread_getcpu(void);
|
| 1915 |
+
UV_EXTERN uv_thread_t uv_thread_self(void);
|
| 1916 |
+
UV_EXTERN int uv_thread_join(uv_thread_t *tid);
|
| 1917 |
+
UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2);
|
| 1918 |
+
UV_EXTERN int uv_thread_setname(const char* name);
|
| 1919 |
+
UV_EXTERN int uv_thread_getname(uv_thread_t* tid, char* name, size_t size);
|
| 1920 |
+
|
| 1921 |
+
|
| 1922 |
+
/* The presence of these unions force similar struct layout. */
|
| 1923 |
+
#define XX(_, name) uv_ ## name ## _t name;
|
| 1924 |
+
union uv_any_handle {
|
| 1925 |
+
UV_HANDLE_TYPE_MAP(XX)
|
| 1926 |
+
};
|
| 1927 |
+
|
| 1928 |
+
union uv_any_req {
|
| 1929 |
+
UV_REQ_TYPE_MAP(XX)
|
| 1930 |
+
};
|
| 1931 |
+
#undef XX
|
| 1932 |
+
|
| 1933 |
+
|
| 1934 |
+
struct uv_loop_s {
|
| 1935 |
+
/* User data - use this for whatever. */
|
| 1936 |
+
void* data;
|
| 1937 |
+
/* Loop reference counting. */
|
| 1938 |
+
unsigned int active_handles;
|
| 1939 |
+
struct uv__queue handle_queue;
|
| 1940 |
+
union {
|
| 1941 |
+
void* unused;
|
| 1942 |
+
unsigned int count;
|
| 1943 |
+
} active_reqs;
|
| 1944 |
+
/* Internal storage for future extensions. */
|
| 1945 |
+
void* internal_fields;
|
| 1946 |
+
/* Internal flag to signal loop stop. */
|
| 1947 |
+
unsigned int stop_flag;
|
| 1948 |
+
UV_LOOP_PRIVATE_FIELDS
|
| 1949 |
+
};
|
| 1950 |
+
|
| 1951 |
+
UV_EXTERN void* uv_loop_get_data(const uv_loop_t*);
|
| 1952 |
+
UV_EXTERN void uv_loop_set_data(uv_loop_t*, void* data);
|
| 1953 |
+
|
| 1954 |
+
/* Unicode utilities needed for dealing with Windows. */
|
| 1955 |
+
UV_EXTERN size_t uv_utf16_length_as_wtf8(const uint16_t* utf16,
|
| 1956 |
+
ssize_t utf16_len);
|
| 1957 |
+
UV_EXTERN int uv_utf16_to_wtf8(const uint16_t* utf16,
|
| 1958 |
+
ssize_t utf16_len,
|
| 1959 |
+
char** wtf8_ptr,
|
| 1960 |
+
size_t* wtf8_len_ptr);
|
| 1961 |
+
UV_EXTERN ssize_t uv_wtf8_length_as_utf16(const char* wtf8);
|
| 1962 |
+
UV_EXTERN void uv_wtf8_to_utf16(const char* wtf8,
|
| 1963 |
+
uint16_t* utf16,
|
| 1964 |
+
size_t utf16_len);
|
| 1965 |
+
|
| 1966 |
+
/* Don't export the private CPP symbols. */
|
| 1967 |
+
#undef UV_HANDLE_TYPE_PRIVATE
|
| 1968 |
+
#undef UV_REQ_TYPE_PRIVATE
|
| 1969 |
+
#undef UV_REQ_PRIVATE_FIELDS
|
| 1970 |
+
#undef UV_STREAM_PRIVATE_FIELDS
|
| 1971 |
+
#undef UV_TCP_PRIVATE_FIELDS
|
| 1972 |
+
#undef UV_PREPARE_PRIVATE_FIELDS
|
| 1973 |
+
#undef UV_CHECK_PRIVATE_FIELDS
|
| 1974 |
+
#undef UV_IDLE_PRIVATE_FIELDS
|
| 1975 |
+
#undef UV_ASYNC_PRIVATE_FIELDS
|
| 1976 |
+
#undef UV_TIMER_PRIVATE_FIELDS
|
| 1977 |
+
#undef UV_GETADDRINFO_PRIVATE_FIELDS
|
| 1978 |
+
#undef UV_GETNAMEINFO_PRIVATE_FIELDS
|
| 1979 |
+
#undef UV_FS_REQ_PRIVATE_FIELDS
|
| 1980 |
+
#undef UV_WORK_PRIVATE_FIELDS
|
| 1981 |
+
#undef UV_FS_EVENT_PRIVATE_FIELDS
|
| 1982 |
+
#undef UV_SIGNAL_PRIVATE_FIELDS
|
| 1983 |
+
#undef UV_LOOP_PRIVATE_FIELDS
|
| 1984 |
+
#undef UV_LOOP_PRIVATE_PLATFORM_FIELDS
|
| 1985 |
+
#undef UV__ERR
|
| 1986 |
+
|
| 1987 |
+
#ifdef __cplusplus
|
| 1988 |
+
}
|
| 1989 |
+
#endif
|
| 1990 |
+
#endif /* UV_H */
|