CSDDSFSFSAFSAF commited on
Commit
8778eb9
·
verified ·
1 Parent(s): 2b9827a

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/cross-thread-persistent.h +466 -0
  2. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/explicit-management.h +100 -0
  3. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/garbage-collected.h +114 -0
  4. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap-handle.h +48 -0
  5. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/liveness-broker.h +78 -0
  6. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/object-size-trait.h +58 -0
  7. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/prefinalizer.h +75 -0
  8. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/process-heap-statistics.h +36 -0
  9. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/sentinel-pointer.h +39 -0
  10. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/source-location.h +16 -0
  11. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/trace-trait.h +128 -0
  12. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/type-traits.h +272 -0
  13. data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/visitor.h +528 -0
  14. data_prepare/node-v24.12.0-linux-x64/include/node/libplatform/libplatform-export.h +29 -0
  15. data_prepare/node-v24.12.0-linux-x64/include/node/libplatform/libplatform.h +112 -0
  16. data_prepare/node-v24.12.0-linux-x64/include/node/libplatform/v8-tracing.h +332 -0
  17. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/aes.h +111 -0
  18. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1_asm.h +53 -0
  19. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1t_asm.h +53 -0
  20. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/bio.h +5 -0
  21. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/bio_asm.h +53 -0
  22. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmp_util.h +56 -0
  23. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmserr.h +126 -0
  24. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/comp_asm.h +53 -0
  25. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/core_dispatch.h +1145 -0
  26. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/core_object.h +41 -0
  27. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dsaerr.h +44 -0
  28. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dtls1.h +57 -0
  29. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ecdh.h +10 -0
  30. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/encodererr.h +28 -0
  31. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ess_no-asm.h +57 -0
  32. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/evperr.h +148 -0
  33. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/macros.h +349 -0
  34. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/md5.h +62 -0
  35. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ocsp_no-asm.h +57 -0
  36. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/opensslconf_asm.h +138 -0
  37. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/opensslv_asm.h +53 -0
  38. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/param_names_asm.h +53 -0
  39. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/param_names_no-asm.h +57 -0
  40. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/params.h +163 -0
  41. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/pem.h +548 -0
  42. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/rsa.h +615 -0
  43. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ssl.h +5 -0
  44. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ssl2.h +30 -0
  45. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ssl_no-asm.h +57 -0
  46. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/sslerr.h +382 -0
  47. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ui_no-asm.h +57 -0
  48. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/x509_asm.h +53 -0
  49. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/x509v3_asm.h +53 -0
  50. requirements.txt +37 -0
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/cross-thread-persistent.h ADDED
@@ -0,0 +1,466 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_CROSS_THREAD_PERSISTENT_H_
6
+ #define INCLUDE_CPPGC_CROSS_THREAD_PERSISTENT_H_
7
+
8
+ #include <atomic>
9
+
10
+ #include "cppgc/internal/persistent-node.h"
11
+ #include "cppgc/internal/pointer-policies.h"
12
+ #include "cppgc/persistent.h"
13
+ #include "cppgc/visitor.h"
14
+
15
+ namespace cppgc {
16
+ namespace internal {
17
+
18
+ // Wrapper around PersistentBase that allows accessing poisoned memory when
19
+ // using ASAN. This is needed as the GC of the heap that owns the value
20
+ // of a CTP, may clear it (heap termination, weakness) while the object
21
+ // holding the CTP may be poisoned as itself may be deemed dead.
22
+ class CrossThreadPersistentBase : public PersistentBase {
23
+ public:
24
+ CrossThreadPersistentBase() = default;
25
+ explicit CrossThreadPersistentBase(const void* raw) : PersistentBase(raw) {}
26
+
27
+ V8_CLANG_NO_SANITIZE("address") const void* GetValueFromGC() const {
28
+ return raw_;
29
+ }
30
+
31
+ V8_CLANG_NO_SANITIZE("address")
32
+ PersistentNode* GetNodeFromGC() const { return node_; }
33
+
34
+ V8_CLANG_NO_SANITIZE("address")
35
+ void ClearFromGC() const {
36
+ raw_ = nullptr;
37
+ SetNodeSafe(nullptr);
38
+ }
39
+
40
+ // GetNodeSafe() can be used for a thread-safe IsValid() check in a
41
+ // double-checked locking pattern. See ~BasicCrossThreadPersistent.
42
+ PersistentNode* GetNodeSafe() const {
43
+ return reinterpret_cast<std::atomic<PersistentNode*>*>(&node_)->load(
44
+ std::memory_order_acquire);
45
+ }
46
+
47
+ // The GC writes using SetNodeSafe() while holding the lock.
48
+ V8_CLANG_NO_SANITIZE("address")
49
+ void SetNodeSafe(PersistentNode* value) const {
50
+ #if defined(__has_feature)
51
+ #if __has_feature(address_sanitizer)
52
+ #define V8_IS_ASAN 1
53
+ #endif
54
+ #endif
55
+
56
+ #ifdef V8_IS_ASAN
57
+ __atomic_store(&node_, &value, __ATOMIC_RELEASE);
58
+ #else // !V8_IS_ASAN
59
+ // Non-ASAN builds can use atomics. This also covers MSVC which does not
60
+ // have the __atomic_store intrinsic.
61
+ reinterpret_cast<std::atomic<PersistentNode*>*>(&node_)->store(
62
+ value, std::memory_order_release);
63
+ #endif // !V8_IS_ASAN
64
+
65
+ #undef V8_IS_ASAN
66
+ }
67
+ };
68
+
69
+ template <typename T, typename WeaknessPolicy, typename LocationPolicy,
70
+ typename CheckingPolicy>
71
+ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
72
+ public LocationPolicy,
73
+ private WeaknessPolicy,
74
+ private CheckingPolicy {
75
+ public:
76
+ using typename WeaknessPolicy::IsStrongPersistent;
77
+ using PointeeType = T;
78
+
79
+ ~BasicCrossThreadPersistent() {
80
+ // This implements fast path for destroying empty/sentinel.
81
+ //
82
+ // Simplified version of `AssignUnsafe()` to allow calling without a
83
+ // complete type `T`. Uses double-checked locking with a simple thread-safe
84
+ // check for a valid handle based on a node.
85
+ if (GetNodeSafe()) {
86
+ PersistentRegionLock guard;
87
+ const void* old_value = GetValue();
88
+ // The fast path check (GetNodeSafe()) does not acquire the lock. Recheck
89
+ // validity while holding the lock to ensure the reference has not been
90
+ // cleared.
91
+ if (IsValid(old_value)) {
92
+ CrossThreadPersistentRegion& region =
93
+ this->GetPersistentRegion(old_value);
94
+ region.FreeNode(GetNode());
95
+ SetNode(nullptr);
96
+ } else {
97
+ CPPGC_DCHECK(!GetNode());
98
+ }
99
+ }
100
+ // No need to call SetValue() as the handle is not used anymore. This can
101
+ // leave behind stale sentinel values but will always destroy the underlying
102
+ // node.
103
+ }
104
+
105
+ BasicCrossThreadPersistent(
106
+ const SourceLocation& loc = SourceLocation::Current())
107
+ : LocationPolicy(loc) {}
108
+
109
+ BasicCrossThreadPersistent(
110
+ std::nullptr_t, const SourceLocation& loc = SourceLocation::Current())
111
+ : LocationPolicy(loc) {}
112
+
113
+ BasicCrossThreadPersistent(
114
+ SentinelPointer s, const SourceLocation& loc = SourceLocation::Current())
115
+ : CrossThreadPersistentBase(s), LocationPolicy(loc) {}
116
+
117
+ BasicCrossThreadPersistent(
118
+ T* raw, const SourceLocation& loc = SourceLocation::Current())
119
+ : CrossThreadPersistentBase(raw), LocationPolicy(loc) {
120
+ if (!IsValid(raw)) return;
121
+ PersistentRegionLock guard;
122
+ CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw);
123
+ SetNode(region.AllocateNode(this, &TraceAsRoot));
124
+ this->CheckPointer(raw);
125
+ }
126
+
127
+ class UnsafeCtorTag {
128
+ private:
129
+ UnsafeCtorTag() = default;
130
+ template <typename U, typename OtherWeaknessPolicy,
131
+ typename OtherLocationPolicy, typename OtherCheckingPolicy>
132
+ friend class BasicCrossThreadPersistent;
133
+ };
134
+
135
+ BasicCrossThreadPersistent(
136
+ UnsafeCtorTag, T* raw,
137
+ const SourceLocation& loc = SourceLocation::Current())
138
+ : CrossThreadPersistentBase(raw), LocationPolicy(loc) {
139
+ if (!IsValid(raw)) return;
140
+ CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw);
141
+ SetNode(region.AllocateNode(this, &TraceAsRoot));
142
+ this->CheckPointer(raw);
143
+ }
144
+
145
+ BasicCrossThreadPersistent(
146
+ T& raw, const SourceLocation& loc = SourceLocation::Current())
147
+ : BasicCrossThreadPersistent(&raw, loc) {}
148
+
149
+ template <typename U, typename MemberBarrierPolicy,
150
+ typename MemberWeaknessTag, typename MemberCheckingPolicy,
151
+ typename MemberStorageType,
152
+ typename = std::enable_if_t<std::is_base_of<T, U>::value>>
153
+ BasicCrossThreadPersistent(
154
+ internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
155
+ MemberCheckingPolicy, MemberStorageType>
156
+ member,
157
+ const SourceLocation& loc = SourceLocation::Current())
158
+ : BasicCrossThreadPersistent(member.Get(), loc) {}
159
+
160
+ BasicCrossThreadPersistent(
161
+ const BasicCrossThreadPersistent& other,
162
+ const SourceLocation& loc = SourceLocation::Current())
163
+ : BasicCrossThreadPersistent(loc) {
164
+ // Invoke operator=.
165
+ *this = other;
166
+ }
167
+
168
+ // Heterogeneous ctor.
169
+ template <typename U, typename OtherWeaknessPolicy,
170
+ typename OtherLocationPolicy, typename OtherCheckingPolicy,
171
+ typename = std::enable_if_t<std::is_base_of<T, U>::value>>
172
+ BasicCrossThreadPersistent(
173
+ const BasicCrossThreadPersistent<U, OtherWeaknessPolicy,
174
+ OtherLocationPolicy,
175
+ OtherCheckingPolicy>& other,
176
+ const SourceLocation& loc = SourceLocation::Current())
177
+ : BasicCrossThreadPersistent(loc) {
178
+ *this = other;
179
+ }
180
+
181
+ BasicCrossThreadPersistent(
182
+ BasicCrossThreadPersistent&& other,
183
+ const SourceLocation& loc = SourceLocation::Current()) noexcept {
184
+ // Invoke operator=.
185
+ *this = std::move(other);
186
+ }
187
+
188
+ BasicCrossThreadPersistent& operator=(
189
+ const BasicCrossThreadPersistent& other) {
190
+ PersistentRegionLock guard;
191
+ AssignSafe(guard, other.Get());
192
+ return *this;
193
+ }
194
+
195
+ template <typename U, typename OtherWeaknessPolicy,
196
+ typename OtherLocationPolicy, typename OtherCheckingPolicy,
197
+ typename = std::enable_if_t<std::is_base_of<T, U>::value>>
198
+ BasicCrossThreadPersistent& operator=(
199
+ const BasicCrossThreadPersistent<U, OtherWeaknessPolicy,
200
+ OtherLocationPolicy,
201
+ OtherCheckingPolicy>& other) {
202
+ PersistentRegionLock guard;
203
+ AssignSafe(guard, other.Get());
204
+ return *this;
205
+ }
206
+
207
+ BasicCrossThreadPersistent& operator=(BasicCrossThreadPersistent&& other) {
208
+ if (this == &other) return *this;
209
+ Clear();
210
+ PersistentRegionLock guard;
211
+ PersistentBase::operator=(std::move(other));
212
+ LocationPolicy::operator=(std::move(other));
213
+ if (!IsValid(GetValue())) return *this;
214
+ GetNode()->UpdateOwner(this);
215
+ other.SetValue(nullptr);
216
+ other.SetNode(nullptr);
217
+ this->CheckPointer(Get());
218
+ return *this;
219
+ }
220
+
221
+ /**
222
+ * Assigns a raw pointer.
223
+ *
224
+ * Note: **Not thread-safe.**
225
+ */
226
+ BasicCrossThreadPersistent& operator=(T* other) {
227
+ AssignUnsafe(other);
228
+ return *this;
229
+ }
230
+
231
+ // Assignment from member.
232
+ template <typename U, typename MemberBarrierPolicy,
233
+ typename MemberWeaknessTag, typename MemberCheckingPolicy,
234
+ typename MemberStorageType,
235
+ typename = std::enable_if_t<std::is_base_of<T, U>::value>>
236
+ BasicCrossThreadPersistent& operator=(
237
+ internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
238
+ MemberCheckingPolicy, MemberStorageType>
239
+ member) {
240
+ return operator=(member.Get());
241
+ }
242
+
243
+ /**
244
+ * Assigns a nullptr.
245
+ *
246
+ * \returns the handle.
247
+ */
248
+ BasicCrossThreadPersistent& operator=(std::nullptr_t) {
249
+ Clear();
250
+ return *this;
251
+ }
252
+
253
+ /**
254
+ * Assigns the sentinel pointer.
255
+ *
256
+ * \returns the handle.
257
+ */
258
+ BasicCrossThreadPersistent& operator=(SentinelPointer s) {
259
+ PersistentRegionLock guard;
260
+ AssignSafe(guard, s);
261
+ return *this;
262
+ }
263
+
264
+ /**
265
+ * Returns a pointer to the stored object.
266
+ *
267
+ * Note: **Not thread-safe.**
268
+ *
269
+ * \returns a pointer to the stored object.
270
+ */
271
+ // CFI cast exemption to allow passing SentinelPointer through T* and support
272
+ // heterogeneous assignments between different Member and Persistent handles
273
+ // based on their actual types.
274
+ V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const {
275
+ return static_cast<T*>(const_cast<void*>(GetValue()));
276
+ }
277
+
278
+ /**
279
+ * Clears the stored object.
280
+ */
281
+ void Clear() {
282
+ PersistentRegionLock guard;
283
+ AssignSafe(guard, nullptr);
284
+ }
285
+
286
+ /**
287
+ * Returns a pointer to the stored object and releases it.
288
+ *
289
+ * Note: **Not thread-safe.**
290
+ *
291
+ * \returns a pointer to the stored object.
292
+ */
293
+ T* Release() {
294
+ T* result = Get();
295
+ Clear();
296
+ return result;
297
+ }
298
+
299
+ /**
300
+ * Conversio to boolean.
301
+ *
302
+ * Note: **Not thread-safe.**
303
+ *
304
+ * \returns true if an actual object has been stored and false otherwise.
305
+ */
306
+ explicit operator bool() const { return Get(); }
307
+
308
+ /**
309
+ * Conversion to object of type T.
310
+ *
311
+ * Note: **Not thread-safe.**
312
+ *
313
+ * \returns the object.
314
+ */
315
+ operator T*() const { return Get(); }
316
+
317
+ /**
318
+ * Dereferences the stored object.
319
+ *
320
+ * Note: **Not thread-safe.**
321
+ */
322
+ T* operator->() const { return Get(); }
323
+ T& operator*() const { return *Get(); }
324
+
325
+ template <typename U, typename OtherWeaknessPolicy = WeaknessPolicy,
326
+ typename OtherLocationPolicy = LocationPolicy,
327
+ typename OtherCheckingPolicy = CheckingPolicy>
328
+ BasicCrossThreadPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
329
+ OtherCheckingPolicy>
330
+ To() const {
331
+ using OtherBasicCrossThreadPersistent =
332
+ BasicCrossThreadPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
333
+ OtherCheckingPolicy>;
334
+ PersistentRegionLock guard;
335
+ return OtherBasicCrossThreadPersistent(
336
+ typename OtherBasicCrossThreadPersistent::UnsafeCtorTag(),
337
+ static_cast<U*>(Get()));
338
+ }
339
+
340
+ template <typename U = T,
341
+ typename = typename std::enable_if<!BasicCrossThreadPersistent<
342
+ U, WeaknessPolicy>::IsStrongPersistent::value>::type>
343
+ BasicCrossThreadPersistent<U, internal::StrongCrossThreadPersistentPolicy>
344
+ Lock() const {
345
+ return BasicCrossThreadPersistent<
346
+ U, internal::StrongCrossThreadPersistentPolicy>(*this);
347
+ }
348
+
349
+ private:
350
+ static bool IsValid(const void* ptr) {
351
+ return ptr && ptr != kSentinelPointer;
352
+ }
353
+
354
+ static void TraceAsRoot(RootVisitor& root_visitor, const void* ptr) {
355
+ root_visitor.Trace(*static_cast<const BasicCrossThreadPersistent*>(ptr));
356
+ }
357
+
358
+ void AssignUnsafe(T* ptr) {
359
+ const void* old_value = GetValue();
360
+ if (IsValid(old_value)) {
361
+ PersistentRegionLock guard;
362
+ old_value = GetValue();
363
+ // The fast path check (IsValid()) does not acquire the lock. Reload
364
+ // the value to ensure the reference has not been cleared.
365
+ if (IsValid(old_value)) {
366
+ CrossThreadPersistentRegion& region =
367
+ this->GetPersistentRegion(old_value);
368
+ if (IsValid(ptr) && (&region == &this->GetPersistentRegion(ptr))) {
369
+ SetValue(ptr);
370
+ this->CheckPointer(ptr);
371
+ return;
372
+ }
373
+ region.FreeNode(GetNode());
374
+ SetNode(nullptr);
375
+ } else {
376
+ CPPGC_DCHECK(!GetNode());
377
+ }
378
+ }
379
+ SetValue(ptr);
380
+ if (!IsValid(ptr)) return;
381
+ PersistentRegionLock guard;
382
+ SetNode(this->GetPersistentRegion(ptr).AllocateNode(this, &TraceAsRoot));
383
+ this->CheckPointer(ptr);
384
+ }
385
+
386
+ void AssignSafe(PersistentRegionLock&, T* ptr) {
387
+ PersistentRegionLock::AssertLocked();
388
+ const void* old_value = GetValue();
389
+ if (IsValid(old_value)) {
390
+ CrossThreadPersistentRegion& region =
391
+ this->GetPersistentRegion(old_value);
392
+ if (IsValid(ptr) && (&region == &this->GetPersistentRegion(ptr))) {
393
+ SetValue(ptr);
394
+ this->CheckPointer(ptr);
395
+ return;
396
+ }
397
+ region.FreeNode(GetNode());
398
+ SetNode(nullptr);
399
+ }
400
+ SetValue(ptr);
401
+ if (!IsValid(ptr)) return;
402
+ SetNode(this->GetPersistentRegion(ptr).AllocateNode(this, &TraceAsRoot));
403
+ this->CheckPointer(ptr);
404
+ }
405
+
406
+ void ClearFromGC() const {
407
+ if (IsValid(GetValueFromGC())) {
408
+ WeaknessPolicy::GetPersistentRegion(GetValueFromGC())
409
+ .FreeNode(GetNodeFromGC());
410
+ CrossThreadPersistentBase::ClearFromGC();
411
+ }
412
+ }
413
+
414
+ // See Get() for details.
415
+ V8_CLANG_NO_SANITIZE("cfi-unrelated-cast")
416
+ T* GetFromGC() const {
417
+ return static_cast<T*>(const_cast<void*>(GetValueFromGC()));
418
+ }
419
+
420
+ friend class internal::RootVisitor;
421
+ };
422
+
423
+ template <typename T, typename LocationPolicy, typename CheckingPolicy>
424
+ struct IsWeak<
425
+ BasicCrossThreadPersistent<T, internal::WeakCrossThreadPersistentPolicy,
426
+ LocationPolicy, CheckingPolicy>>
427
+ : std::true_type {};
428
+
429
+ } // namespace internal
430
+
431
+ namespace subtle {
432
+
433
+ /**
434
+ * **DO NOT USE: Has known caveats, see below.**
435
+ *
436
+ * CrossThreadPersistent allows retaining objects from threads other than the
437
+ * thread the owning heap is operating on.
438
+ *
439
+ * Known caveats:
440
+ * - Does not protect the heap owning an object from terminating.
441
+ * - Reaching transitively through the graph is unsupported as objects may be
442
+ * moved concurrently on the thread owning the object.
443
+ */
444
+ template <typename T>
445
+ using CrossThreadPersistent = internal::BasicCrossThreadPersistent<
446
+ T, internal::StrongCrossThreadPersistentPolicy>;
447
+
448
+ /**
449
+ * **DO NOT USE: Has known caveats, see below.**
450
+ *
451
+ * CrossThreadPersistent allows weakly retaining objects from threads other than
452
+ * the thread the owning heap is operating on.
453
+ *
454
+ * Known caveats:
455
+ * - Does not protect the heap owning an object from terminating.
456
+ * - Reaching transitively through the graph is unsupported as objects may be
457
+ * moved concurrently on the thread owning the object.
458
+ */
459
+ template <typename T>
460
+ using WeakCrossThreadPersistent = internal::BasicCrossThreadPersistent<
461
+ T, internal::WeakCrossThreadPersistentPolicy>;
462
+
463
+ } // namespace subtle
464
+ } // namespace cppgc
465
+
466
+ #endif // INCLUDE_CPPGC_CROSS_THREAD_PERSISTENT_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/explicit-management.h ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_EXPLICIT_MANAGEMENT_H_
6
+ #define INCLUDE_CPPGC_EXPLICIT_MANAGEMENT_H_
7
+
8
+ #include <cstddef>
9
+
10
+ #include "cppgc/allocation.h"
11
+ #include "cppgc/internal/logging.h"
12
+ #include "cppgc/type-traits.h"
13
+
14
+ namespace cppgc {
15
+
16
+ class HeapHandle;
17
+
18
+ namespace subtle {
19
+
20
+ template <typename T>
21
+ void FreeUnreferencedObject(HeapHandle& heap_handle, T& object);
22
+ template <typename T>
23
+ bool Resize(T& object, AdditionalBytes additional_bytes);
24
+
25
+ } // namespace subtle
26
+
27
+ namespace internal {
28
+
29
+ class ExplicitManagementImpl final {
30
+ private:
31
+ V8_EXPORT static void FreeUnreferencedObject(HeapHandle&, void*);
32
+ V8_EXPORT static bool Resize(void*, size_t);
33
+
34
+ template <typename T>
35
+ friend void subtle::FreeUnreferencedObject(HeapHandle&, T&);
36
+ template <typename T>
37
+ friend bool subtle::Resize(T&, AdditionalBytes);
38
+ };
39
+ } // namespace internal
40
+
41
+ namespace subtle {
42
+
43
+ /**
44
+ * Informs the garbage collector that `object` can be immediately reclaimed. The
45
+ * destructor may not be invoked immediately but only on next garbage
46
+ * collection.
47
+ *
48
+ * It is up to the embedder to guarantee that no other object holds a reference
49
+ * to `object` after calling `FreeUnreferencedObject()`. In case such a
50
+ * reference exists, it's use results in a use-after-free.
51
+ *
52
+ * To aid in using the API, `FreeUnreferencedObject()` may be called from
53
+ * destructors on objects that would be reclaimed in the same garbage collection
54
+ * cycle.
55
+ *
56
+ * \param heap_handle The corresponding heap.
57
+ * \param object Reference to an object that is of type `GarbageCollected` and
58
+ * should be immediately reclaimed.
59
+ */
60
+ template <typename T>
61
+ void FreeUnreferencedObject(HeapHandle& heap_handle, T& object) {
62
+ static_assert(IsGarbageCollectedTypeV<T>,
63
+ "Object must be of type GarbageCollected.");
64
+ internal::ExplicitManagementImpl::FreeUnreferencedObject(heap_handle,
65
+ &object);
66
+ }
67
+
68
+ /**
69
+ * Tries to resize `object` of type `T` with additional bytes on top of
70
+ * sizeof(T). Resizing is only useful with trailing inlined storage, see e.g.
71
+ * `MakeGarbageCollected(AllocationHandle&, AdditionalBytes)`.
72
+ *
73
+ * `Resize()` performs growing or shrinking as needed and may skip the operation
74
+ * for internal reasons, see return value.
75
+ *
76
+ * It is up to the embedder to guarantee that in case of shrinking a larger
77
+ * object down, the reclaimed area is not used anymore. Any subsequent use
78
+ * results in a use-after-free.
79
+ *
80
+ * The `object` must be live when calling `Resize()`.
81
+ *
82
+ * \param object Reference to an object that is of type `GarbageCollected` and
83
+ * should be resized.
84
+ * \param additional_bytes Bytes in addition to sizeof(T) that the object should
85
+ * provide.
86
+ * \returns true when the operation was successful and the result can be relied
87
+ * on, and false otherwise.
88
+ */
89
+ template <typename T>
90
+ bool Resize(T& object, AdditionalBytes additional_bytes) {
91
+ static_assert(IsGarbageCollectedTypeV<T>,
92
+ "Object must be of type GarbageCollected.");
93
+ return internal::ExplicitManagementImpl::Resize(
94
+ &object, sizeof(T) + additional_bytes.value);
95
+ }
96
+
97
+ } // namespace subtle
98
+ } // namespace cppgc
99
+
100
+ #endif // INCLUDE_CPPGC_EXPLICIT_MANAGEMENT_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/garbage-collected.h ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_GARBAGE_COLLECTED_H_
6
+ #define INCLUDE_CPPGC_GARBAGE_COLLECTED_H_
7
+
8
+ #include "cppgc/internal/api-constants.h"
9
+ #include "cppgc/platform.h"
10
+ #include "cppgc/trace-trait.h"
11
+ #include "cppgc/type-traits.h"
12
+
13
+ namespace cppgc {
14
+
15
+ class Visitor;
16
+
17
+ /**
18
+ * Base class for managed objects. Only descendent types of `GarbageCollected`
19
+ * can be constructed using `MakeGarbageCollected()`. Must be inherited from as
20
+ * left-most base class.
21
+ *
22
+ * Types inheriting from GarbageCollected must provide a method of
23
+ * signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed
24
+ * pointers to the visitor and delegates to garbage-collected base classes.
25
+ * The method must be virtual if the type is not directly a child of
26
+ * GarbageCollected and marked as final.
27
+ *
28
+ * \code
29
+ * // Example using final class.
30
+ * class FinalType final : public GarbageCollected<FinalType> {
31
+ * public:
32
+ * void Trace(cppgc::Visitor* visitor) const {
33
+ * // Dispatch using visitor->Trace(...);
34
+ * }
35
+ * };
36
+ *
37
+ * // Example using non-final base class.
38
+ * class NonFinalBase : public GarbageCollected<NonFinalBase> {
39
+ * public:
40
+ * virtual void Trace(cppgc::Visitor*) const {}
41
+ * };
42
+ *
43
+ * class FinalChild final : public NonFinalBase {
44
+ * public:
45
+ * void Trace(cppgc::Visitor* visitor) const final {
46
+ * // Dispatch using visitor->Trace(...);
47
+ * NonFinalBase::Trace(visitor);
48
+ * }
49
+ * };
50
+ * \endcode
51
+ */
52
+ template <typename T>
53
+ class GarbageCollected {
54
+ public:
55
+ using IsGarbageCollectedTypeMarker = void;
56
+ using ParentMostGarbageCollectedType = T;
57
+
58
+ // Must use MakeGarbageCollected.
59
+ void* operator new(size_t) = delete;
60
+ void* operator new[](size_t) = delete;
61
+ // The garbage collector is taking care of reclaiming the object. Also,
62
+ // virtual destructor requires an unambiguous, accessible 'operator delete'.
63
+ void operator delete(void*) {
64
+ #ifdef V8_ENABLE_CHECKS
65
+ internal::Fatal(
66
+ "Manually deleting a garbage collected object is not allowed");
67
+ #endif // V8_ENABLE_CHECKS
68
+ }
69
+ void operator delete[](void*) = delete;
70
+
71
+ protected:
72
+ GarbageCollected() = default;
73
+ };
74
+
75
+ /**
76
+ * Base class for managed mixin objects. Such objects cannot be constructed
77
+ * directly but must be mixed into the inheritance hierarchy of a
78
+ * GarbageCollected object.
79
+ *
80
+ * Types inheriting from GarbageCollectedMixin must override a virtual method
81
+ * of signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed
82
+ * pointers to the visitor and delegates to base classes.
83
+ *
84
+ * \code
85
+ * class Mixin : public GarbageCollectedMixin {
86
+ * public:
87
+ * void Trace(cppgc::Visitor* visitor) const override {
88
+ * // Dispatch using visitor->Trace(...);
89
+ * }
90
+ * };
91
+ * \endcode
92
+ */
93
+ class GarbageCollectedMixin {
94
+ public:
95
+ using IsGarbageCollectedMixinTypeMarker = void;
96
+
97
+ // Must use MakeGarbageCollected.
98
+ void* operator new(size_t) = delete;
99
+ void* operator new[](size_t) = delete;
100
+ // The garbage collector is taking care of reclaiming the object.
101
+ // Not override the non-array varaint of `delete` to not conflict with the
102
+ // operator in GarbageCollected above.
103
+ void operator delete[](void*) = delete;
104
+
105
+ /**
106
+ * This Trace method must be overriden by objects inheriting from
107
+ * GarbageCollectedMixin.
108
+ */
109
+ virtual void Trace(cppgc::Visitor*) const {}
110
+ };
111
+
112
+ } // namespace cppgc
113
+
114
+ #endif // INCLUDE_CPPGC_GARBAGE_COLLECTED_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/heap-handle.h ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2022 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_HANDLE_H_
6
+ #define INCLUDE_CPPGC_HEAP_HANDLE_H_
7
+
8
+ #include "v8config.h" // NOLINT(build/include_directory)
9
+
10
+ namespace cppgc {
11
+
12
+ namespace internal {
13
+ class HeapBase;
14
+ class WriteBarrierTypeForCagedHeapPolicy;
15
+ class WriteBarrierTypeForNonCagedHeapPolicy;
16
+ } // namespace internal
17
+
18
+ /**
19
+ * Opaque handle used for additional heap APIs.
20
+ */
21
+ class HeapHandle {
22
+ public:
23
+ // Deleted copy ctor to avoid treating the type by value.
24
+ HeapHandle(const HeapHandle&) = delete;
25
+ HeapHandle& operator=(const HeapHandle&) = delete;
26
+
27
+ private:
28
+ HeapHandle() = default;
29
+
30
+ V8_INLINE bool is_incremental_marking_in_progress() const {
31
+ return is_incremental_marking_in_progress_;
32
+ }
33
+
34
+ V8_INLINE bool is_young_generation_enabled() const {
35
+ return is_young_generation_enabled_;
36
+ }
37
+
38
+ bool is_incremental_marking_in_progress_ = false;
39
+ bool is_young_generation_enabled_ = false;
40
+
41
+ friend class internal::HeapBase;
42
+ friend class internal::WriteBarrierTypeForCagedHeapPolicy;
43
+ friend class internal::WriteBarrierTypeForNonCagedHeapPolicy;
44
+ };
45
+
46
+ } // namespace cppgc
47
+
48
+ #endif // INCLUDE_CPPGC_HEAP_HANDLE_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/liveness-broker.h ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_LIVENESS_BROKER_H_
6
+ #define INCLUDE_CPPGC_LIVENESS_BROKER_H_
7
+
8
+ #include "cppgc/heap.h"
9
+ #include "cppgc/member.h"
10
+ #include "cppgc/sentinel-pointer.h"
11
+ #include "cppgc/trace-trait.h"
12
+ #include "v8config.h" // NOLINT(build/include_directory)
13
+
14
+ namespace cppgc {
15
+
16
+ namespace internal {
17
+ class LivenessBrokerFactory;
18
+ } // namespace internal
19
+
20
+ /**
21
+ * The broker is passed to weak callbacks to allow (temporarily) querying
22
+ * the liveness state of an object. References to non-live objects must be
23
+ * cleared when `IsHeapObjectAlive()` returns false.
24
+ *
25
+ * \code
26
+ * class GCedWithCustomWeakCallback final
27
+ * : public GarbageCollected<GCedWithCustomWeakCallback> {
28
+ * public:
29
+ * UntracedMember<Bar> bar;
30
+ *
31
+ * void CustomWeakCallbackMethod(const LivenessBroker& broker) {
32
+ * if (!broker.IsHeapObjectAlive(bar))
33
+ * bar = nullptr;
34
+ * }
35
+ *
36
+ * void Trace(cppgc::Visitor* visitor) const {
37
+ * visitor->RegisterWeakCallbackMethod<
38
+ * GCedWithCustomWeakCallback,
39
+ * &GCedWithCustomWeakCallback::CustomWeakCallbackMethod>(this);
40
+ * }
41
+ * };
42
+ * \endcode
43
+ */
44
+ class V8_EXPORT LivenessBroker final {
45
+ public:
46
+ template <typename T>
47
+ bool IsHeapObjectAlive(const T* object) const {
48
+ // - nullptr objects are considered alive to allow weakness to be used from
49
+ // stack while running into a conservative GC. Treating nullptr as dead
50
+ // would mean that e.g. custom collections could not be strongified on
51
+ // stack.
52
+ // - Sentinel pointers are also preserved in weakness and not cleared.
53
+ return !object || object == kSentinelPointer ||
54
+ IsHeapObjectAliveImpl(
55
+ TraceTrait<T>::GetTraceDescriptor(object).base_object_payload);
56
+ }
57
+
58
+ template <typename T>
59
+ bool IsHeapObjectAlive(const WeakMember<T>& weak_member) const {
60
+ return IsHeapObjectAlive<T>(weak_member.Get());
61
+ }
62
+
63
+ template <typename T>
64
+ bool IsHeapObjectAlive(const UntracedMember<T>& untraced_member) const {
65
+ return IsHeapObjectAlive<T>(untraced_member.Get());
66
+ }
67
+
68
+ private:
69
+ LivenessBroker() = default;
70
+
71
+ bool IsHeapObjectAliveImpl(const void*) const;
72
+
73
+ friend class internal::LivenessBrokerFactory;
74
+ };
75
+
76
+ } // namespace cppgc
77
+
78
+ #endif // INCLUDE_CPPGC_LIVENESS_BROKER_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/object-size-trait.h ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_OBJECT_SIZE_TRAIT_H_
6
+ #define INCLUDE_CPPGC_OBJECT_SIZE_TRAIT_H_
7
+
8
+ #include <cstddef>
9
+
10
+ #include "cppgc/type-traits.h"
11
+ #include "v8config.h" // NOLINT(build/include_directory)
12
+
13
+ namespace cppgc {
14
+
15
+ namespace internal {
16
+
17
+ struct V8_EXPORT BaseObjectSizeTrait {
18
+ protected:
19
+ static size_t GetObjectSizeForGarbageCollected(const void*);
20
+ static size_t GetObjectSizeForGarbageCollectedMixin(const void*);
21
+ };
22
+
23
+ } // namespace internal
24
+
25
+ namespace subtle {
26
+
27
+ /**
28
+ * Trait specifying how to get the size of an object that was allocated using
29
+ * `MakeGarbageCollected()`. Also supports querying the size with an inner
30
+ * pointer to a mixin.
31
+ */
32
+ template <typename T, bool = IsGarbageCollectedMixinTypeV<T>>
33
+ struct ObjectSizeTrait;
34
+
35
+ template <typename T>
36
+ struct ObjectSizeTrait<T, false> : cppgc::internal::BaseObjectSizeTrait {
37
+ static_assert(sizeof(T), "T must be fully defined");
38
+ static_assert(IsGarbageCollectedTypeV<T>,
39
+ "T must be of type GarbageCollected or GarbageCollectedMixin");
40
+
41
+ static size_t GetSize(const T& object) {
42
+ return GetObjectSizeForGarbageCollected(&object);
43
+ }
44
+ };
45
+
46
+ template <typename T>
47
+ struct ObjectSizeTrait<T, true> : cppgc::internal::BaseObjectSizeTrait {
48
+ static_assert(sizeof(T), "T must be fully defined");
49
+
50
+ static size_t GetSize(const T& object) {
51
+ return GetObjectSizeForGarbageCollectedMixin(&object);
52
+ }
53
+ };
54
+
55
+ } // namespace subtle
56
+ } // namespace cppgc
57
+
58
+ #endif // INCLUDE_CPPGC_OBJECT_SIZE_TRAIT_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/prefinalizer.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_PREFINALIZER_H_
6
+ #define INCLUDE_CPPGC_PREFINALIZER_H_
7
+
8
+ #include "cppgc/internal/compiler-specific.h"
9
+ #include "cppgc/liveness-broker.h"
10
+
11
+ namespace cppgc {
12
+
13
+ namespace internal {
14
+
15
+ class V8_EXPORT PrefinalizerRegistration final {
16
+ public:
17
+ using Callback = bool (*)(const cppgc::LivenessBroker&, void*);
18
+
19
+ PrefinalizerRegistration(void*, Callback);
20
+
21
+ void* operator new(size_t, void* location) = delete;
22
+ void* operator new(size_t) = delete;
23
+ };
24
+
25
+ } // namespace internal
26
+
27
+ /**
28
+ * Macro must be used in the private section of `Class` and registers a
29
+ * prefinalization callback `void Class::PreFinalizer()`. The callback is
30
+ * invoked on garbage collection after the collector has found an object to be
31
+ * dead.
32
+ *
33
+ * Callback properties:
34
+ * - The callback is invoked before a possible destructor for the corresponding
35
+ * object.
36
+ * - The callback may access the whole object graph, irrespective of whether
37
+ * objects are considered dead or alive.
38
+ * - The callback is invoked on the same thread as the object was created on.
39
+ *
40
+ * Example:
41
+ * \code
42
+ * class WithPrefinalizer : public GarbageCollected<WithPrefinalizer> {
43
+ * CPPGC_USING_PRE_FINALIZER(WithPrefinalizer, Dispose);
44
+ *
45
+ * public:
46
+ * void Trace(Visitor*) const {}
47
+ * void Dispose() { prefinalizer_called = true; }
48
+ * ~WithPrefinalizer() {
49
+ * // prefinalizer_called == true
50
+ * }
51
+ * private:
52
+ * bool prefinalizer_called = false;
53
+ * };
54
+ * \endcode
55
+ */
56
+ #define CPPGC_USING_PRE_FINALIZER(Class, PreFinalizer) \
57
+ public: \
58
+ static bool InvokePreFinalizer(const cppgc::LivenessBroker& liveness_broker, \
59
+ void* object) { \
60
+ static_assert(cppgc::IsGarbageCollectedOrMixinTypeV<Class>, \
61
+ "Only garbage collected objects can have prefinalizers"); \
62
+ Class* self = static_cast<Class*>(object); \
63
+ if (liveness_broker.IsHeapObjectAlive(self)) return false; \
64
+ self->PreFinalizer(); \
65
+ return true; \
66
+ } \
67
+ \
68
+ private: \
69
+ CPPGC_NO_UNIQUE_ADDRESS cppgc::internal::PrefinalizerRegistration \
70
+ prefinalizer_dummy_{this, Class::InvokePreFinalizer}; \
71
+ static_assert(true, "Force semicolon.")
72
+
73
+ } // namespace cppgc
74
+
75
+ #endif // INCLUDE_CPPGC_PREFINALIZER_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/process-heap-statistics.h ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_PROCESS_HEAP_STATISTICS_H_
6
+ #define INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_
7
+
8
+ #include <atomic>
9
+ #include <cstddef>
10
+
11
+ #include "v8config.h" // NOLINT(build/include_directory)
12
+
13
+ namespace cppgc {
14
+ namespace internal {
15
+ class ProcessHeapStatisticsUpdater;
16
+ } // namespace internal
17
+
18
+ class V8_EXPORT ProcessHeapStatistics final {
19
+ public:
20
+ static size_t TotalAllocatedObjectSize() {
21
+ return total_allocated_object_size_.load(std::memory_order_relaxed);
22
+ }
23
+ static size_t TotalAllocatedSpace() {
24
+ return total_allocated_space_.load(std::memory_order_relaxed);
25
+ }
26
+
27
+ private:
28
+ static std::atomic_size_t total_allocated_space_;
29
+ static std::atomic_size_t total_allocated_object_size_;
30
+
31
+ friend class internal::ProcessHeapStatisticsUpdater;
32
+ };
33
+
34
+ } // namespace cppgc
35
+
36
+ #endif // INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/sentinel-pointer.h ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_SENTINEL_POINTER_H_
6
+ #define INCLUDE_CPPGC_SENTINEL_POINTER_H_
7
+
8
+ #include <cstdint>
9
+
10
+ #include "cppgc/internal/api-constants.h"
11
+
12
+ namespace cppgc {
13
+ namespace internal {
14
+
15
+ // Special tag type used to denote some sentinel member. The semantics of the
16
+ // sentinel is defined by the embedder.
17
+ struct SentinelPointer {
18
+ #if defined(CPPGC_POINTER_COMPRESSION)
19
+ static constexpr intptr_t kSentinelValue =
20
+ 1 << api_constants::kPointerCompressionShift;
21
+ #else // !defined(CPPGC_POINTER_COMPRESSION)
22
+ static constexpr intptr_t kSentinelValue = 0b10;
23
+ #endif // !defined(CPPGC_POINTER_COMPRESSION)
24
+ template <typename T>
25
+ operator T*() const {
26
+ return reinterpret_cast<T*>(kSentinelValue);
27
+ }
28
+ // Hidden friends.
29
+ friend bool operator==(SentinelPointer, SentinelPointer) { return true; }
30
+ friend bool operator!=(SentinelPointer, SentinelPointer) { return false; }
31
+ };
32
+
33
+ } // namespace internal
34
+
35
+ constexpr internal::SentinelPointer kSentinelPointer;
36
+
37
+ } // namespace cppgc
38
+
39
+ #endif // INCLUDE_CPPGC_SENTINEL_POINTER_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/source-location.h ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_SOURCE_LOCATION_H_
6
+ #define INCLUDE_CPPGC_SOURCE_LOCATION_H_
7
+
8
+ #include "v8-source-location.h"
9
+
10
+ namespace cppgc {
11
+
12
+ using SourceLocation = v8::SourceLocation;
13
+
14
+ } // namespace cppgc
15
+
16
+ #endif // INCLUDE_CPPGC_SOURCE_LOCATION_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/trace-trait.h ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_TRACE_TRAIT_H_
6
+ #define INCLUDE_CPPGC_TRACE_TRAIT_H_
7
+
8
+ #include <type_traits>
9
+
10
+ #include "cppgc/type-traits.h"
11
+ #include "v8config.h" // NOLINT(build/include_directory)
12
+
13
+ namespace cppgc {
14
+
15
+ class Visitor;
16
+
17
+ namespace internal {
18
+
19
+ class RootVisitor;
20
+
21
+ using TraceRootCallback = void (*)(RootVisitor&, const void* object);
22
+
23
+ // Implementation of the default TraceTrait handling GarbageCollected and
24
+ // GarbageCollectedMixin.
25
+ template <typename T,
26
+ bool =
27
+ IsGarbageCollectedMixinTypeV<typename std::remove_const<T>::type>>
28
+ struct TraceTraitImpl;
29
+
30
+ } // namespace internal
31
+
32
+ /**
33
+ * Callback for invoking tracing on a given object.
34
+ *
35
+ * \param visitor The visitor to dispatch to.
36
+ * \param object The object to invoke tracing on.
37
+ */
38
+ using TraceCallback = void (*)(Visitor* visitor, const void* object);
39
+
40
+ /**
41
+ * Describes how to trace an object, i.e., how to visit all Oilpan-relevant
42
+ * fields of an object.
43
+ */
44
+ struct TraceDescriptor {
45
+ /**
46
+ * Adjusted base pointer, i.e., the pointer to the class inheriting directly
47
+ * from GarbageCollected, of the object that is being traced.
48
+ */
49
+ const void* base_object_payload;
50
+ /**
51
+ * Callback for tracing the object.
52
+ */
53
+ TraceCallback callback;
54
+ };
55
+
56
+ /**
57
+ * Callback for getting a TraceDescriptor for a given address.
58
+ *
59
+ * \param address Possibly inner address of an object.
60
+ * \returns a TraceDescriptor for the provided address.
61
+ */
62
+ using TraceDescriptorCallback = TraceDescriptor (*)(const void* address);
63
+
64
+ namespace internal {
65
+
66
+ struct V8_EXPORT TraceTraitFromInnerAddressImpl {
67
+ static TraceDescriptor GetTraceDescriptor(const void* address);
68
+ };
69
+
70
+ /**
71
+ * Trait specifying how the garbage collector processes an object of type T.
72
+ *
73
+ * Advanced users may override handling by creating a specialization for their
74
+ * type.
75
+ */
76
+ template <typename T>
77
+ struct TraceTraitBase {
78
+ static_assert(internal::IsTraceableV<T>, "T must have a Trace() method");
79
+
80
+ /**
81
+ * Accessor for retrieving a TraceDescriptor to process an object of type T.
82
+ *
83
+ * \param self The object to be processed.
84
+ * \returns a TraceDescriptor to process the object.
85
+ */
86
+ static TraceDescriptor GetTraceDescriptor(const void* self) {
87
+ return internal::TraceTraitImpl<T>::GetTraceDescriptor(
88
+ static_cast<const T*>(self));
89
+ }
90
+
91
+ /**
92
+ * Function invoking the tracing for an object of type T.
93
+ *
94
+ * \param visitor The visitor to dispatch to.
95
+ * \param self The object to invoke tracing on.
96
+ */
97
+ static void Trace(Visitor* visitor, const void* self) {
98
+ static_cast<const T*>(self)->Trace(visitor);
99
+ }
100
+ };
101
+
102
+ } // namespace internal
103
+
104
+ template <typename T>
105
+ struct TraceTrait : public internal::TraceTraitBase<T> {};
106
+
107
+ namespace internal {
108
+
109
+ template <typename T>
110
+ struct TraceTraitImpl<T, false> {
111
+ static_assert(IsGarbageCollectedTypeV<T>,
112
+ "T must be of type GarbageCollected or GarbageCollectedMixin");
113
+ static TraceDescriptor GetTraceDescriptor(const void* self) {
114
+ return {self, TraceTrait<T>::Trace};
115
+ }
116
+ };
117
+
118
+ template <typename T>
119
+ struct TraceTraitImpl<T, true> {
120
+ static TraceDescriptor GetTraceDescriptor(const void* self) {
121
+ return internal::TraceTraitFromInnerAddressImpl::GetTraceDescriptor(self);
122
+ }
123
+ };
124
+
125
+ } // namespace internal
126
+ } // namespace cppgc
127
+
128
+ #endif // INCLUDE_CPPGC_TRACE_TRAIT_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/type-traits.h ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_TYPE_TRAITS_H_
6
+ #define INCLUDE_CPPGC_TYPE_TRAITS_H_
7
+
8
+ // This file should stay with minimal dependencies to allow embedder to check
9
+ // against Oilpan types without including any other parts.
10
+ #include <cstddef>
11
+ #include <type_traits>
12
+ #include <utility>
13
+
14
+ namespace cppgc {
15
+
16
+ class Visitor;
17
+
18
+ namespace internal {
19
+ template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
20
+ typename CheckingPolicy, typename StorageType>
21
+ class BasicMember;
22
+ struct DijkstraWriteBarrierPolicy;
23
+ struct NoWriteBarrierPolicy;
24
+ class StrongMemberTag;
25
+ class UntracedMemberTag;
26
+ class WeakMemberTag;
27
+
28
+ // Not supposed to be specialized by the user.
29
+ template <typename T>
30
+ struct IsWeak : std::false_type {};
31
+
32
+ // IsTraceMethodConst is used to verify that all Trace methods are marked as
33
+ // const. It is equivalent to IsTraceable but for a non-const object.
34
+ template <typename T, typename = void>
35
+ struct IsTraceMethodConst : std::false_type {};
36
+
37
+ template <typename T>
38
+ struct IsTraceMethodConst<T, std::void_t<decltype(std::declval<const T>().Trace(
39
+ std::declval<Visitor*>()))>> : std::true_type {
40
+ };
41
+
42
+ template <typename T, typename = void>
43
+ struct IsTraceable : std::false_type {
44
+ static_assert(sizeof(T), "T must be fully defined");
45
+ };
46
+
47
+ template <typename T>
48
+ struct IsTraceable<
49
+ T, std::void_t<decltype(std::declval<T>().Trace(std::declval<Visitor*>()))>>
50
+ : std::true_type {
51
+ // All Trace methods should be marked as const. If an object of type
52
+ // 'T' is traceable then any object of type 'const T' should also
53
+ // be traceable.
54
+ static_assert(IsTraceMethodConst<T>(),
55
+ "Trace methods should be marked as const.");
56
+ };
57
+
58
+ template <typename T>
59
+ constexpr bool IsTraceableV = IsTraceable<T>::value;
60
+
61
+ template <typename T, typename = void>
62
+ struct HasGarbageCollectedMixinTypeMarker : std::false_type {
63
+ static_assert(sizeof(T), "T must be fully defined");
64
+ };
65
+
66
+ template <typename T>
67
+ struct HasGarbageCollectedMixinTypeMarker<
68
+ T, std::void_t<
69
+ typename std::remove_const_t<T>::IsGarbageCollectedMixinTypeMarker>>
70
+ : std::true_type {
71
+ static_assert(sizeof(T), "T must be fully defined");
72
+ };
73
+
74
+ template <typename T, typename = void>
75
+ struct HasGarbageCollectedTypeMarker : std::false_type {
76
+ static_assert(sizeof(T), "T must be fully defined");
77
+ };
78
+
79
+ template <typename T>
80
+ struct HasGarbageCollectedTypeMarker<
81
+ T,
82
+ std::void_t<typename std::remove_const_t<T>::IsGarbageCollectedTypeMarker>>
83
+ : std::true_type {
84
+ static_assert(sizeof(T), "T must be fully defined");
85
+ };
86
+
87
+ template <typename T, bool = HasGarbageCollectedTypeMarker<T>::value,
88
+ bool = HasGarbageCollectedMixinTypeMarker<T>::value>
89
+ struct IsGarbageCollectedMixinType : std::false_type {
90
+ static_assert(sizeof(T), "T must be fully defined");
91
+ };
92
+
93
+ template <typename T>
94
+ struct IsGarbageCollectedMixinType<T, false, true> : std::true_type {
95
+ static_assert(sizeof(T), "T must be fully defined");
96
+ };
97
+
98
+ template <typename T, bool = HasGarbageCollectedTypeMarker<T>::value>
99
+ struct IsGarbageCollectedType : std::false_type {
100
+ static_assert(sizeof(T), "T must be fully defined");
101
+ };
102
+
103
+ template <typename T>
104
+ struct IsGarbageCollectedType<T, true> : std::true_type {
105
+ static_assert(sizeof(T), "T must be fully defined");
106
+ };
107
+
108
+ template <typename T>
109
+ struct IsGarbageCollectedOrMixinType
110
+ : std::integral_constant<bool, IsGarbageCollectedType<T>::value ||
111
+ IsGarbageCollectedMixinType<T>::value> {
112
+ static_assert(sizeof(T), "T must be fully defined");
113
+ };
114
+
115
+ template <typename T, bool = (HasGarbageCollectedTypeMarker<T>::value &&
116
+ HasGarbageCollectedMixinTypeMarker<T>::value)>
117
+ struct IsGarbageCollectedWithMixinType : std::false_type {
118
+ static_assert(sizeof(T), "T must be fully defined");
119
+ };
120
+
121
+ template <typename T>
122
+ struct IsGarbageCollectedWithMixinType<T, true> : std::true_type {
123
+ static_assert(sizeof(T), "T must be fully defined");
124
+ };
125
+
126
+ template <typename BasicMemberCandidate, typename WeaknessTag,
127
+ typename WriteBarrierPolicy>
128
+ struct IsSubclassOfBasicMemberTemplate {
129
+ private:
130
+ template <typename T, typename CheckingPolicy, typename StorageType>
131
+ static std::true_type SubclassCheck(
132
+ const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
133
+ StorageType>*);
134
+ static std::false_type SubclassCheck(...);
135
+
136
+ public:
137
+ static constexpr bool value = decltype(SubclassCheck(
138
+ std::declval<std::decay_t<BasicMemberCandidate>*>()))::value;
139
+ };
140
+
141
+ template <typename T,
142
+ bool = IsSubclassOfBasicMemberTemplate<
143
+ T, StrongMemberTag, DijkstraWriteBarrierPolicy>::value>
144
+ struct IsMemberType : std::false_type {};
145
+
146
+ template <typename T>
147
+ struct IsMemberType<T, true> : std::true_type {};
148
+
149
+ template <typename T, bool = IsSubclassOfBasicMemberTemplate<
150
+ T, WeakMemberTag, DijkstraWriteBarrierPolicy>::value>
151
+ struct IsWeakMemberType : std::false_type {};
152
+
153
+ template <typename T>
154
+ struct IsWeakMemberType<T, true> : std::true_type {};
155
+
156
+ template <typename T, bool = IsSubclassOfBasicMemberTemplate<
157
+ T, UntracedMemberTag, NoWriteBarrierPolicy>::value>
158
+ struct IsUntracedMemberType : std::false_type {};
159
+
160
+ template <typename T>
161
+ struct IsUntracedMemberType<T, true> : std::true_type {};
162
+
163
+ template <typename T>
164
+ struct IsComplete {
165
+ private:
166
+ template <typename U, size_t = sizeof(U)>
167
+ static std::true_type IsSizeOfKnown(U*);
168
+ static std::false_type IsSizeOfKnown(...);
169
+
170
+ public:
171
+ static constexpr bool value =
172
+ decltype(IsSizeOfKnown(std::declval<T*>()))::value;
173
+ };
174
+
175
+ template <typename T, typename U>
176
+ constexpr bool IsDecayedSameV =
177
+ std::is_same_v<std::decay_t<T>, std::decay_t<U>>;
178
+
179
+ template <typename B, typename D>
180
+ constexpr bool IsStrictlyBaseOfV =
181
+ std::is_base_of_v<std::decay_t<B>, std::decay_t<D>> &&
182
+ !IsDecayedSameV<B, D>;
183
+
184
+ template <typename T>
185
+ constexpr bool IsAnyMemberTypeV = false;
186
+
187
+ template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
188
+ typename CheckingPolicy, typename StorageType>
189
+ constexpr bool IsAnyMemberTypeV<internal::BasicMember<
190
+ T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy, StorageType>> = true;
191
+
192
+ } // namespace internal
193
+
194
+ /**
195
+ * Value is true for types that inherit from `GarbageCollectedMixin` but not
196
+ * `GarbageCollected<T>` (i.e., they are free mixins), and false otherwise.
197
+ */
198
+ template <typename T>
199
+ constexpr bool IsGarbageCollectedMixinTypeV =
200
+ internal::IsGarbageCollectedMixinType<T>::value;
201
+
202
+ /**
203
+ * Value is true for types that inherit from `GarbageCollected<T>`, and false
204
+ * otherwise.
205
+ */
206
+ template <typename T>
207
+ constexpr bool IsGarbageCollectedTypeV =
208
+ internal::IsGarbageCollectedType<T>::value;
209
+
210
+ /**
211
+ * Value is true for types that inherit from either `GarbageCollected<T>` or
212
+ * `GarbageCollectedMixin`, and false otherwise.
213
+ */
214
+ template <typename T>
215
+ constexpr bool IsGarbageCollectedOrMixinTypeV =
216
+ internal::IsGarbageCollectedOrMixinType<T>::value;
217
+
218
+ /**
219
+ * Value is true for types that inherit from `GarbageCollected<T>` and
220
+ * `GarbageCollectedMixin`, and false otherwise.
221
+ */
222
+ template <typename T>
223
+ constexpr bool IsGarbageCollectedWithMixinTypeV =
224
+ internal::IsGarbageCollectedWithMixinType<T>::value;
225
+
226
+ /**
227
+ * Value is true for types of type `Member<T>`, and false otherwise.
228
+ */
229
+ template <typename T>
230
+ constexpr bool IsMemberTypeV = internal::IsMemberType<T>::value;
231
+
232
+ /**
233
+ * Value is true for types of type `UntracedMember<T>`, and false otherwise.
234
+ */
235
+ template <typename T>
236
+ constexpr bool IsUntracedMemberTypeV = internal::IsUntracedMemberType<T>::value;
237
+
238
+ /**
239
+ * Value is true for types of type `WeakMember<T>`, and false otherwise.
240
+ */
241
+ template <typename T>
242
+ constexpr bool IsWeakMemberTypeV = internal::IsWeakMemberType<T>::value;
243
+
244
+ /**
245
+ * Value is true for types that are considered weak references, and false
246
+ * otherwise.
247
+ */
248
+ template <typename T>
249
+ constexpr bool IsWeakV = internal::IsWeak<T>::value;
250
+
251
+ /**
252
+ * Value is true for types that are complete, and false otherwise.
253
+ */
254
+ template <typename T>
255
+ constexpr bool IsCompleteV = internal::IsComplete<T>::value;
256
+
257
+ /**
258
+ * Value is true for member types `Member<T>` and `WeakMember<T>`.
259
+ */
260
+ template <typename T>
261
+ constexpr bool IsMemberOrWeakMemberTypeV =
262
+ IsMemberTypeV<T> || IsWeakMemberTypeV<T>;
263
+
264
+ /**
265
+ * Value is true for any member type.
266
+ */
267
+ template <typename T>
268
+ constexpr bool IsAnyMemberTypeV = internal::IsAnyMemberTypeV<std::decay_t<T>>;
269
+
270
+ } // namespace cppgc
271
+
272
+ #endif // INCLUDE_CPPGC_TYPE_TRAITS_H_
data_prepare/node-v24.12.0-linux-x64/include/node/cppgc/visitor.h ADDED
@@ -0,0 +1,528 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_VISITOR_H_
6
+ #define INCLUDE_CPPGC_VISITOR_H_
7
+
8
+ #include <type_traits>
9
+
10
+ #include "cppgc/custom-space.h"
11
+ #include "cppgc/garbage-collected.h"
12
+ #include "cppgc/internal/logging.h"
13
+ #include "cppgc/internal/member-storage.h"
14
+ #include "cppgc/internal/pointer-policies.h"
15
+ #include "cppgc/liveness-broker.h"
16
+ #include "cppgc/macros.h"
17
+ #include "cppgc/member.h"
18
+ #include "cppgc/sentinel-pointer.h"
19
+ #include "cppgc/source-location.h"
20
+ #include "cppgc/trace-trait.h"
21
+ #include "cppgc/type-traits.h"
22
+
23
+ namespace cppgc {
24
+
25
+ namespace internal {
26
+ template <typename T, typename WeaknessPolicy, typename LocationPolicy,
27
+ typename CheckingPolicy>
28
+ class BasicCrossThreadPersistent;
29
+ template <typename T, typename WeaknessPolicy, typename LocationPolicy,
30
+ typename CheckingPolicy>
31
+ class BasicPersistent;
32
+ class ConservativeTracingVisitor;
33
+ class VisitorBase;
34
+ class VisitorFactory;
35
+ } // namespace internal
36
+
37
+ using WeakCallback = void (*)(const LivenessBroker&, const void*);
38
+
39
+ /**
40
+ * An ephemeron pair is used to conditionally retain an object.
41
+ * The `value` will be kept alive only if the `key` is alive.
42
+ */
43
+ template <typename K, typename V>
44
+ struct EphemeronPair {
45
+ CPPGC_DISALLOW_NEW();
46
+
47
+ EphemeronPair(K* k, V* v) : key(k), value(v) {}
48
+ WeakMember<K> key;
49
+ Member<V> value;
50
+
51
+ void ClearValueIfKeyIsDead(const LivenessBroker& broker) {
52
+ if (!broker.IsHeapObjectAlive(key)) value = nullptr;
53
+ }
54
+
55
+ void Trace(Visitor* visitor) const;
56
+ };
57
+
58
+ /**
59
+ * Visitor passed to trace methods. All managed pointers must have called the
60
+ * Visitor's trace method on them.
61
+ *
62
+ * \code
63
+ * class Foo final : public GarbageCollected<Foo> {
64
+ * public:
65
+ * void Trace(Visitor* visitor) const {
66
+ * visitor->Trace(foo_);
67
+ * visitor->Trace(weak_foo_);
68
+ * }
69
+ * private:
70
+ * Member<Foo> foo_;
71
+ * WeakMember<Foo> weak_foo_;
72
+ * };
73
+ * \endcode
74
+ */
75
+ class V8_EXPORT Visitor {
76
+ public:
77
+ class Key {
78
+ private:
79
+ Key() = default;
80
+ friend class internal::VisitorFactory;
81
+ };
82
+
83
+ explicit Visitor(Key) {}
84
+
85
+ virtual ~Visitor() = default;
86
+
87
+ /**
88
+ * Trace method for Member.
89
+ *
90
+ * \param member Member reference retaining an object.
91
+ */
92
+ template <typename T>
93
+ void Trace(const Member<T>& member) {
94
+ const T* value = member.GetRawAtomic();
95
+ CPPGC_DCHECK(value != kSentinelPointer);
96
+ TraceImpl(value);
97
+ }
98
+
99
+ /**
100
+ * Trace method for WeakMember.
101
+ *
102
+ * \param weak_member WeakMember reference weakly retaining an object.
103
+ */
104
+ template <typename T>
105
+ void Trace(const WeakMember<T>& weak_member) {
106
+ static_assert(sizeof(T), "Pointee type must be fully defined.");
107
+ static_assert(internal::IsGarbageCollectedOrMixinType<T>::value,
108
+ "T must be GarbageCollected or GarbageCollectedMixin type");
109
+ static_assert(!internal::IsAllocatedOnCompactableSpace<T>::value,
110
+ "Weak references to compactable objects are not allowed");
111
+
112
+ const T* value = weak_member.GetRawAtomic();
113
+
114
+ // Bailout assumes that WeakMember emits write barrier.
115
+ if (!value) {
116
+ return;
117
+ }
118
+
119
+ CPPGC_DCHECK(value != kSentinelPointer);
120
+ VisitWeak(value, TraceTrait<T>::GetTraceDescriptor(value),
121
+ &HandleWeak<WeakMember<T>>, &weak_member);
122
+ }
123
+
124
+ #if defined(CPPGC_POINTER_COMPRESSION)
125
+ /**
126
+ * Trace method for UncompressedMember.
127
+ *
128
+ * \param member UncompressedMember reference retaining an object.
129
+ */
130
+ template <typename T>
131
+ void Trace(const subtle::UncompressedMember<T>& member) {
132
+ const T* value = member.GetRawAtomic();
133
+ CPPGC_DCHECK(value != kSentinelPointer);
134
+ TraceImpl(value);
135
+ }
136
+ #endif // defined(CPPGC_POINTER_COMPRESSION)
137
+
138
+ template <typename T>
139
+ void TraceMultiple(const subtle::UncompressedMember<T>* start, size_t len) {
140
+ static_assert(sizeof(T), "Pointee type must be fully defined.");
141
+ static_assert(internal::IsGarbageCollectedOrMixinType<T>::value,
142
+ "T must be GarbageCollected or GarbageCollectedMixin type");
143
+ VisitMultipleUncompressedMember(start, len,
144
+ &TraceTrait<T>::GetTraceDescriptor);
145
+ }
146
+
147
+ template <typename T,
148
+ std::enable_if_t<!std::is_same_v<
149
+ Member<T>, subtle::UncompressedMember<T>>>* = nullptr>
150
+ void TraceMultiple(const Member<T>* start, size_t len) {
151
+ static_assert(sizeof(T), "Pointee type must be fully defined.");
152
+ static_assert(internal::IsGarbageCollectedOrMixinType<T>::value,
153
+ "T must be GarbageCollected or GarbageCollectedMixin type");
154
+ #if defined(CPPGC_POINTER_COMPRESSION)
155
+ static_assert(std::is_same_v<Member<T>, subtle::CompressedMember<T>>,
156
+ "Member and CompressedMember must be the same.");
157
+ VisitMultipleCompressedMember(start, len,
158
+ &TraceTrait<T>::GetTraceDescriptor);
159
+ #endif // defined(CPPGC_POINTER_COMPRESSION)
160
+ }
161
+
162
+ /**
163
+ * Trace method for inlined objects that are not allocated themselves but
164
+ * otherwise follow managed heap layout and have a Trace() method.
165
+ *
166
+ * \param object reference of the inlined object.
167
+ */
168
+ template <typename T>
169
+ void Trace(const T& object) {
170
+ #if V8_ENABLE_CHECKS
171
+ // This object is embedded in potentially multiple nested objects. The
172
+ // outermost object must not be in construction as such objects are (a) not
173
+ // processed immediately, and (b) only processed conservatively if not
174
+ // otherwise possible.
175
+ CheckObjectNotInConstruction(&object);
176
+ #endif // V8_ENABLE_CHECKS
177
+ TraceTrait<T>::Trace(this, &object);
178
+ }
179
+
180
+ template <typename T>
181
+ void TraceMultiple(const T* start, size_t len) {
182
+ #if V8_ENABLE_CHECKS
183
+ // This object is embedded in potentially multiple nested objects. The
184
+ // outermost object must not be in construction as such objects are (a) not
185
+ // processed immediately, and (b) only processed conservatively if not
186
+ // otherwise possible.
187
+ CheckObjectNotInConstruction(start);
188
+ #endif // V8_ENABLE_CHECKS
189
+ for (size_t i = 0; i < len; ++i) {
190
+ const T* object = &start[i];
191
+ if constexpr (std::is_polymorphic_v<T>) {
192
+ // The object's vtable may be uninitialized in which case the object is
193
+ // not traced.
194
+ if (*reinterpret_cast<const uintptr_t*>(object) == 0) continue;
195
+ }
196
+ TraceTrait<T>::Trace(this, object);
197
+ }
198
+ }
199
+
200
+ /**
201
+ * Registers a weak callback method on the object of type T. See
202
+ * LivenessBroker for an usage example.
203
+ *
204
+ * \param object of type T specifying a weak callback method.
205
+ */
206
+ template <typename T, void (T::*method)(const LivenessBroker&)>
207
+ void RegisterWeakCallbackMethod(const T* object) {
208
+ RegisterWeakCallback(&WeakCallbackMethodDelegate<T, method>, object);
209
+ }
210
+
211
+ /**
212
+ * Trace method for EphemeronPair.
213
+ *
214
+ * \param ephemeron_pair EphemeronPair reference weakly retaining a key object
215
+ * and strongly retaining a value object in case the key object is alive.
216
+ */
217
+ template <typename K, typename V>
218
+ void Trace(const EphemeronPair<K, V>& ephemeron_pair) {
219
+ TraceEphemeron(ephemeron_pair.key, &ephemeron_pair.value);
220
+ RegisterWeakCallbackMethod<EphemeronPair<K, V>,
221
+ &EphemeronPair<K, V>::ClearValueIfKeyIsDead>(
222
+ &ephemeron_pair);
223
+ }
224
+
225
+ /**
226
+ * Trace method for a single ephemeron. Used for tracing a raw ephemeron in
227
+ * which the `key` and `value` are kept separately.
228
+ *
229
+ * \param weak_member_key WeakMember reference weakly retaining a key object.
230
+ * \param member_value Member reference with ephemeron semantics.
231
+ */
232
+ template <typename KeyType, typename ValueType>
233
+ void TraceEphemeron(const WeakMember<KeyType>& weak_member_key,
234
+ const Member<ValueType>* member_value) {
235
+ const KeyType* key = weak_member_key.GetRawAtomic();
236
+ if (!key) return;
237
+
238
+ // `value` must always be non-null.
239
+ CPPGC_DCHECK(member_value);
240
+ const ValueType* value = member_value->GetRawAtomic();
241
+ if (!value) return;
242
+
243
+ // KeyType and ValueType may refer to GarbageCollectedMixin.
244
+ TraceDescriptor value_desc =
245
+ TraceTrait<ValueType>::GetTraceDescriptor(value);
246
+ CPPGC_DCHECK(value_desc.base_object_payload);
247
+ const void* key_base_object_payload =
248
+ TraceTrait<KeyType>::GetTraceDescriptor(key).base_object_payload;
249
+ CPPGC_DCHECK(key_base_object_payload);
250
+
251
+ VisitEphemeron(key_base_object_payload, value, value_desc);
252
+ }
253
+
254
+ /**
255
+ * Trace method for a single ephemeron. Used for tracing a raw ephemeron in
256
+ * which the `key` and `value` are kept separately. Note that this overload
257
+ * is for non-GarbageCollected `value`s that can be traced though.
258
+ *
259
+ * \param key `WeakMember` reference weakly retaining a key object.
260
+ * \param value Reference weakly retaining a value object. Note that
261
+ * `ValueType` here should not be `Member`. It is expected that
262
+ * `TraceTrait<ValueType>::GetTraceDescriptor(value)` returns a
263
+ * `TraceDescriptor` with a null base pointer but a valid trace method.
264
+ */
265
+ template <typename KeyType, typename ValueType>
266
+ void TraceEphemeron(const WeakMember<KeyType>& weak_member_key,
267
+ const ValueType* value) {
268
+ static_assert(!IsGarbageCollectedOrMixinTypeV<ValueType>,
269
+ "garbage-collected types must use WeakMember and Member");
270
+ const KeyType* key = weak_member_key.GetRawAtomic();
271
+ if (!key) return;
272
+
273
+ // `value` must always be non-null.
274
+ CPPGC_DCHECK(value);
275
+ TraceDescriptor value_desc =
276
+ TraceTrait<ValueType>::GetTraceDescriptor(value);
277
+ // `value_desc.base_object_payload` must be null as this override is only
278
+ // taken for non-garbage-collected values.
279
+ CPPGC_DCHECK(!value_desc.base_object_payload);
280
+
281
+ // KeyType might be a GarbageCollectedMixin.
282
+ const void* key_base_object_payload =
283
+ TraceTrait<KeyType>::GetTraceDescriptor(key).base_object_payload;
284
+ CPPGC_DCHECK(key_base_object_payload);
285
+
286
+ VisitEphemeron(key_base_object_payload, value, value_desc);
287
+ }
288
+
289
+ /**
290
+ * Trace method that strongifies a WeakMember.
291
+ *
292
+ * \param weak_member WeakMember reference retaining an object.
293
+ */
294
+ template <typename T>
295
+ void TraceStrongly(const WeakMember<T>& weak_member) {
296
+ const T* value = weak_member.GetRawAtomic();
297
+ CPPGC_DCHECK(value != kSentinelPointer);
298
+ TraceImpl(value);
299
+ }
300
+
301
+ /**
302
+ * Trace method for retaining containers strongly.
303
+ *
304
+ * \param object reference to the container.
305
+ */
306
+ template <typename T>
307
+ void TraceStrongContainer(const T* object) {
308
+ TraceImpl(object);
309
+ }
310
+
311
+ /**
312
+ * Trace method for retaining containers weakly. Note that weak containers
313
+ * should emit write barriers.
314
+ *
315
+ * \param object reference to the container.
316
+ * \param callback to be invoked.
317
+ * \param callback_data custom data that is passed to the callback.
318
+ */
319
+ template <typename T>
320
+ void TraceWeakContainer(const T* object, WeakCallback callback,
321
+ const void* callback_data) {
322
+ if (!object) return;
323
+ VisitWeakContainer(object, TraceTrait<T>::GetTraceDescriptor(object),
324
+ TraceTrait<T>::GetWeakTraceDescriptor(object), callback,
325
+ callback_data);
326
+ }
327
+
328
+ /**
329
+ * Registers a slot containing a reference to an object allocated on a
330
+ * compactable space. Such references maybe be arbitrarily moved by the GC.
331
+ *
332
+ * \param slot location of reference to object that might be moved by the GC.
333
+ * The slot must contain an uncompressed pointer.
334
+ */
335
+ template <typename T>
336
+ void RegisterMovableReference(const T** slot) {
337
+ static_assert(internal::IsAllocatedOnCompactableSpace<T>::value,
338
+ "Only references to objects allocated on compactable spaces "
339
+ "should be registered as movable slots.");
340
+ static_assert(!IsGarbageCollectedMixinTypeV<T>,
341
+ "Mixin types do not support compaction.");
342
+ HandleMovableReference(reinterpret_cast<const void**>(slot));
343
+ }
344
+
345
+ /**
346
+ * Registers a weak callback that is invoked during garbage collection.
347
+ *
348
+ * \param callback to be invoked.
349
+ * \param data custom data that is passed to the callback.
350
+ */
351
+ virtual void RegisterWeakCallback(WeakCallback callback, const void* data) {}
352
+
353
+ /**
354
+ * Defers tracing an object from a concurrent thread to the mutator thread.
355
+ * Should be called by Trace methods of types that are not safe to trace
356
+ * concurrently.
357
+ *
358
+ * \param parameter tells the trace callback which object was deferred.
359
+ * \param callback to be invoked for tracing on the mutator thread.
360
+ * \param deferred_size size of deferred object.
361
+ *
362
+ * \returns false if the object does not need to be deferred (i.e. currently
363
+ * traced on the mutator thread) and true otherwise (i.e. currently traced on
364
+ * a concurrent thread).
365
+ */
366
+ virtual V8_WARN_UNUSED_RESULT bool DeferTraceToMutatorThreadIfConcurrent(
367
+ const void* parameter, TraceCallback callback, size_t deferred_size) {
368
+ // By default tracing is not deferred.
369
+ return false;
370
+ }
371
+
372
+ protected:
373
+ virtual void Visit(const void* self, TraceDescriptor) {}
374
+ virtual void VisitWeak(const void* self, TraceDescriptor, WeakCallback,
375
+ const void* weak_member) {}
376
+ virtual void VisitEphemeron(const void* key, const void* value,
377
+ TraceDescriptor value_desc) {}
378
+ virtual void VisitWeakContainer(const void* self, TraceDescriptor strong_desc,
379
+ TraceDescriptor weak_desc,
380
+ WeakCallback callback, const void* data) {}
381
+ virtual void HandleMovableReference(const void**) {}
382
+
383
+ virtual void VisitMultipleUncompressedMember(
384
+ const void* start, size_t len,
385
+ TraceDescriptorCallback get_trace_descriptor) {
386
+ // Default implementation merely delegates to Visit().
387
+ const char* it = static_cast<const char*>(start);
388
+ const char* end = it + len * internal::kSizeOfUncompressedMember;
389
+ for (; it < end; it += internal::kSizeOfUncompressedMember) {
390
+ const auto* current = reinterpret_cast<const internal::RawPointer*>(it);
391
+ const void* object = current->LoadAtomic();
392
+ if (!object) continue;
393
+
394
+ Visit(object, get_trace_descriptor(object));
395
+ }
396
+ }
397
+
398
+ #if defined(CPPGC_POINTER_COMPRESSION)
399
+ virtual void VisitMultipleCompressedMember(
400
+ const void* start, size_t len,
401
+ TraceDescriptorCallback get_trace_descriptor) {
402
+ // Default implementation merely delegates to Visit().
403
+ const char* it = static_cast<const char*>(start);
404
+ const char* end = it + len * internal::kSizeofCompressedMember;
405
+ for (; it < end; it += internal::kSizeofCompressedMember) {
406
+ const auto* current =
407
+ reinterpret_cast<const internal::CompressedPointer*>(it);
408
+ const void* object = current->LoadAtomic();
409
+ if (!object) continue;
410
+
411
+ Visit(object, get_trace_descriptor(object));
412
+ }
413
+ }
414
+ #endif // defined(CPPGC_POINTER_COMPRESSION)
415
+
416
+ private:
417
+ template <typename T, void (T::*method)(const LivenessBroker&)>
418
+ static void WeakCallbackMethodDelegate(const LivenessBroker& info,
419
+ const void* self) {
420
+ // Callback is registered through a potential const Trace method but needs
421
+ // to be able to modify fields. See HandleWeak.
422
+ (const_cast<T*>(static_cast<const T*>(self))->*method)(info);
423
+ }
424
+
425
+ template <typename PointerType>
426
+ static void HandleWeak(const LivenessBroker& info, const void* object) {
427
+ const PointerType* weak = static_cast<const PointerType*>(object);
428
+ if (!info.IsHeapObjectAlive(weak->GetFromGC())) {
429
+ weak->ClearFromGC();
430
+ }
431
+ }
432
+
433
+ template <typename T>
434
+ void TraceImpl(const T* t) {
435
+ static_assert(sizeof(T), "Pointee type must be fully defined.");
436
+ static_assert(internal::IsGarbageCollectedOrMixinType<T>::value,
437
+ "T must be GarbageCollected or GarbageCollectedMixin type");
438
+ if (!t) {
439
+ return;
440
+ }
441
+ Visit(t, TraceTrait<T>::GetTraceDescriptor(t));
442
+ }
443
+
444
+ #if V8_ENABLE_CHECKS
445
+ void CheckObjectNotInConstruction(const void* address);
446
+ #endif // V8_ENABLE_CHECKS
447
+
448
+ template <typename T, typename WeaknessPolicy, typename LocationPolicy,
449
+ typename CheckingPolicy>
450
+ friend class internal::BasicCrossThreadPersistent;
451
+ template <typename T, typename WeaknessPolicy, typename LocationPolicy,
452
+ typename CheckingPolicy>
453
+ friend class internal::BasicPersistent;
454
+ friend class internal::ConservativeTracingVisitor;
455
+ friend class internal::VisitorBase;
456
+ };
457
+
458
+ template <typename K, typename V>
459
+ void EphemeronPair<K, V>::Trace(Visitor* visitor) const {
460
+ visitor->TraceEphemeron(key, value);
461
+ }
462
+
463
+ namespace internal {
464
+
465
+ class V8_EXPORT RootVisitor {
466
+ public:
467
+ explicit RootVisitor(Visitor::Key) {}
468
+
469
+ virtual ~RootVisitor() = default;
470
+
471
+ template <typename AnyStrongPersistentType,
472
+ std::enable_if_t<
473
+ AnyStrongPersistentType::IsStrongPersistent::value>* = nullptr>
474
+ void Trace(const AnyStrongPersistentType& p) {
475
+ using PointeeType = typename AnyStrongPersistentType::PointeeType;
476
+ const void* object = Extract(p);
477
+ if (!object) {
478
+ return;
479
+ }
480
+ VisitRoot(object, TraceTrait<PointeeType>::GetTraceDescriptor(object),
481
+ p.Location());
482
+ }
483
+
484
+ template <typename AnyWeakPersistentType,
485
+ std::enable_if_t<
486
+ !AnyWeakPersistentType::IsStrongPersistent::value>* = nullptr>
487
+ void Trace(const AnyWeakPersistentType& p) {
488
+ using PointeeType = typename AnyWeakPersistentType::PointeeType;
489
+ static_assert(!internal::IsAllocatedOnCompactableSpace<PointeeType>::value,
490
+ "Weak references to compactable objects are not allowed");
491
+ const void* object = Extract(p);
492
+ if (!object) {
493
+ return;
494
+ }
495
+ VisitWeakRoot(object, TraceTrait<PointeeType>::GetTraceDescriptor(object),
496
+ &HandleWeak<AnyWeakPersistentType>, &p, p.Location());
497
+ }
498
+
499
+ protected:
500
+ virtual void VisitRoot(const void*, TraceDescriptor, const SourceLocation&) {}
501
+ virtual void VisitWeakRoot(const void* self, TraceDescriptor, WeakCallback,
502
+ const void* weak_root, const SourceLocation&) {}
503
+
504
+ private:
505
+ template <typename AnyPersistentType>
506
+ static const void* Extract(AnyPersistentType& p) {
507
+ using PointeeType = typename AnyPersistentType::PointeeType;
508
+ static_assert(sizeof(PointeeType),
509
+ "Persistent's pointee type must be fully defined");
510
+ static_assert(internal::IsGarbageCollectedOrMixinType<PointeeType>::value,
511
+ "Persistent's pointee type must be GarbageCollected or "
512
+ "GarbageCollectedMixin");
513
+ return p.GetFromGC();
514
+ }
515
+
516
+ template <typename PointerType>
517
+ static void HandleWeak(const LivenessBroker& info, const void* object) {
518
+ const PointerType* weak = static_cast<const PointerType*>(object);
519
+ if (!info.IsHeapObjectAlive(weak->GetFromGC())) {
520
+ weak->ClearFromGC();
521
+ }
522
+ }
523
+ };
524
+
525
+ } // namespace internal
526
+ } // namespace cppgc
527
+
528
+ #endif // INCLUDE_CPPGC_VISITOR_H_
data_prepare/node-v24.12.0-linux-x64/include/node/libplatform/libplatform-export.h ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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 V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
6
+ #define V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
7
+
8
+ #if defined(_WIN32)
9
+
10
+ #ifdef BUILDING_V8_PLATFORM_SHARED
11
+ #define V8_PLATFORM_EXPORT __declspec(dllexport)
12
+ #elif USING_V8_PLATFORM_SHARED
13
+ #define V8_PLATFORM_EXPORT __declspec(dllimport)
14
+ #else
15
+ #define V8_PLATFORM_EXPORT
16
+ #endif // BUILDING_V8_PLATFORM_SHARED
17
+
18
+ #else // defined(_WIN32)
19
+
20
+ // Setup for Linux shared library export.
21
+ #if defined(BUILDING_V8_PLATFORM_SHARED) || USING_V8_PLATFORM_SHARED
22
+ #define V8_PLATFORM_EXPORT __attribute__((visibility("default")))
23
+ #else
24
+ #define V8_PLATFORM_EXPORT
25
+ #endif // defined(BUILDING_V8_PLATFORM_SHARED) || ...
26
+
27
+ #endif // defined(_WIN32)
28
+
29
+ #endif // V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
data_prepare/node-v24.12.0-linux-x64/include/node/libplatform/libplatform.h ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2014 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 V8_LIBPLATFORM_LIBPLATFORM_H_
6
+ #define V8_LIBPLATFORM_LIBPLATFORM_H_
7
+
8
+ #include <memory>
9
+
10
+ #include "libplatform/libplatform-export.h"
11
+ #include "libplatform/v8-tracing.h"
12
+ #include "v8-platform.h" // NOLINT(build/include_directory)
13
+ #include "v8config.h" // NOLINT(build/include_directory)
14
+
15
+ namespace v8 {
16
+ namespace platform {
17
+
18
+ enum class IdleTaskSupport { kDisabled, kEnabled };
19
+ enum class InProcessStackDumping { kDisabled, kEnabled };
20
+
21
+ enum class MessageLoopBehavior : bool {
22
+ kDoNotWait = false,
23
+ kWaitForWork = true
24
+ };
25
+
26
+ enum class PriorityMode : bool { kDontApply, kApply };
27
+
28
+ /**
29
+ * Returns a new instance of the default v8::Platform implementation.
30
+ *
31
+ * The caller will take ownership of the returned pointer. |thread_pool_size|
32
+ * is the number of worker threads to allocate for background jobs. If a value
33
+ * of zero is passed, a suitable default based on the current number of
34
+ * processors online will be chosen.
35
+ * If |idle_task_support| is enabled then the platform will accept idle
36
+ * tasks (IdleTasksEnabled will return true) and will rely on the embedder
37
+ * calling v8::platform::RunIdleTasks to process the idle tasks.
38
+ * If |tracing_controller| is nullptr, the default platform will create a
39
+ * v8::platform::TracingController instance and use it.
40
+ * If |priority_mode| is PriorityMode::kApply, the default platform will use
41
+ * multiple task queues executed by threads different system-level priorities
42
+ * (where available) to schedule tasks.
43
+ */
44
+ V8_PLATFORM_EXPORT std::unique_ptr<v8::Platform> NewDefaultPlatform(
45
+ int thread_pool_size = 0,
46
+ IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
47
+ InProcessStackDumping in_process_stack_dumping =
48
+ InProcessStackDumping::kDisabled,
49
+ std::unique_ptr<v8::TracingController> tracing_controller = {},
50
+ PriorityMode priority_mode = PriorityMode::kDontApply);
51
+
52
+ /**
53
+ * The same as NewDefaultPlatform but disables the worker thread pool.
54
+ * It must be used with the --single-threaded V8 flag.
55
+ */
56
+ V8_PLATFORM_EXPORT std::unique_ptr<v8::Platform>
57
+ NewSingleThreadedDefaultPlatform(
58
+ IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
59
+ InProcessStackDumping in_process_stack_dumping =
60
+ InProcessStackDumping::kDisabled,
61
+ std::unique_ptr<v8::TracingController> tracing_controller = {});
62
+
63
+ /**
64
+ * Returns a new instance of the default v8::JobHandle implementation.
65
+ *
66
+ * The job will be executed by spawning up to |num_worker_threads| many worker
67
+ * threads on the provided |platform| with the given |priority|.
68
+ */
69
+ V8_PLATFORM_EXPORT std::unique_ptr<v8::JobHandle> NewDefaultJobHandle(
70
+ v8::Platform* platform, v8::TaskPriority priority,
71
+ std::unique_ptr<v8::JobTask> job_task, size_t num_worker_threads);
72
+
73
+ /**
74
+ * Pumps the message loop for the given isolate.
75
+ *
76
+ * The caller has to make sure that this is called from the right thread.
77
+ * Returns true if a task was executed, and false otherwise. If the call to
78
+ * PumpMessageLoop is nested within another call to PumpMessageLoop, only
79
+ * nestable tasks may run. Otherwise, any task may run. Unless requested through
80
+ * the |behavior| parameter, this call does not block if no task is pending. The
81
+ * |platform| has to be created using |NewDefaultPlatform|.
82
+ */
83
+ V8_PLATFORM_EXPORT bool PumpMessageLoop(
84
+ v8::Platform* platform, v8::Isolate* isolate,
85
+ MessageLoopBehavior behavior = MessageLoopBehavior::kDoNotWait);
86
+
87
+ /**
88
+ * Runs pending idle tasks for at most |idle_time_in_seconds| seconds.
89
+ *
90
+ * The caller has to make sure that this is called from the right thread.
91
+ * This call does not block if no task is pending. The |platform| has to be
92
+ * created using |NewDefaultPlatform|.
93
+ */
94
+ V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform* platform,
95
+ v8::Isolate* isolate,
96
+ double idle_time_in_seconds);
97
+
98
+ /**
99
+ * Notifies the given platform about the Isolate getting deleted soon. Has to be
100
+ * called for all Isolates which are deleted - unless we're shutting down the
101
+ * platform.
102
+ *
103
+ * The |platform| has to be created using |NewDefaultPlatform|.
104
+ *
105
+ */
106
+ V8_PLATFORM_EXPORT void NotifyIsolateShutdown(v8::Platform* platform,
107
+ Isolate* isolate);
108
+
109
+ } // namespace platform
110
+ } // namespace v8
111
+
112
+ #endif // V8_LIBPLATFORM_LIBPLATFORM_H_
data_prepare/node-v24.12.0-linux-x64/include/node/libplatform/v8-tracing.h ADDED
@@ -0,0 +1,332 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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 V8_LIBPLATFORM_V8_TRACING_H_
6
+ #define V8_LIBPLATFORM_V8_TRACING_H_
7
+
8
+ #include <atomic>
9
+ #include <memory>
10
+ #include <unordered_set>
11
+ #include <vector>
12
+
13
+ #include "libplatform/libplatform-export.h"
14
+ #include "v8-platform.h" // NOLINT(build/include_directory)
15
+
16
+ namespace perfetto {
17
+ namespace trace_processor {
18
+ class TraceProcessorStorage;
19
+ }
20
+ class TracingSession;
21
+ }
22
+
23
+ namespace v8 {
24
+
25
+ namespace base {
26
+ class Mutex;
27
+ } // namespace base
28
+
29
+ namespace platform {
30
+ namespace tracing {
31
+
32
+ class TraceEventListener;
33
+
34
+ const int kTraceMaxNumArgs = 2;
35
+
36
+ class V8_PLATFORM_EXPORT TraceObject {
37
+ public:
38
+ union ArgValue {
39
+ uint64_t as_uint;
40
+ int64_t as_int;
41
+ double as_double;
42
+ const void* as_pointer;
43
+ const char* as_string;
44
+ };
45
+
46
+ TraceObject() = default;
47
+ ~TraceObject();
48
+ void Initialize(
49
+ char phase, const uint8_t* category_enabled_flag, const char* name,
50
+ const char* scope, uint64_t id, uint64_t bind_id, int num_args,
51
+ const char** arg_names, const uint8_t* arg_types,
52
+ const uint64_t* arg_values,
53
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
54
+ unsigned int flags, int64_t timestamp, int64_t cpu_timestamp);
55
+ void UpdateDuration(int64_t timestamp, int64_t cpu_timestamp);
56
+ void InitializeForTesting(
57
+ char phase, const uint8_t* category_enabled_flag, const char* name,
58
+ const char* scope, uint64_t id, uint64_t bind_id, int num_args,
59
+ const char** arg_names, const uint8_t* arg_types,
60
+ const uint64_t* arg_values,
61
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
62
+ unsigned int flags, int pid, int tid, int64_t ts, int64_t tts,
63
+ uint64_t duration, uint64_t cpu_duration);
64
+
65
+ int pid() const { return pid_; }
66
+ int tid() const { return tid_; }
67
+ char phase() const { return phase_; }
68
+ const uint8_t* category_enabled_flag() const {
69
+ return category_enabled_flag_;
70
+ }
71
+ const char* name() const { return name_; }
72
+ const char* scope() const { return scope_; }
73
+ uint64_t id() const { return id_; }
74
+ uint64_t bind_id() const { return bind_id_; }
75
+ int num_args() const { return num_args_; }
76
+ const char** arg_names() { return arg_names_; }
77
+ uint8_t* arg_types() { return arg_types_; }
78
+ ArgValue* arg_values() { return arg_values_; }
79
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables() {
80
+ return arg_convertables_;
81
+ }
82
+ unsigned int flags() const { return flags_; }
83
+ int64_t ts() { return ts_; }
84
+ int64_t tts() { return tts_; }
85
+ uint64_t duration() { return duration_; }
86
+ uint64_t cpu_duration() { return cpu_duration_; }
87
+
88
+ private:
89
+ int pid_;
90
+ int tid_;
91
+ char phase_;
92
+ const char* name_;
93
+ const char* scope_;
94
+ const uint8_t* category_enabled_flag_;
95
+ uint64_t id_;
96
+ uint64_t bind_id_;
97
+ int num_args_ = 0;
98
+ const char* arg_names_[kTraceMaxNumArgs];
99
+ uint8_t arg_types_[kTraceMaxNumArgs];
100
+ ArgValue arg_values_[kTraceMaxNumArgs];
101
+ std::unique_ptr<v8::ConvertableToTraceFormat>
102
+ arg_convertables_[kTraceMaxNumArgs];
103
+ char* parameter_copy_storage_ = nullptr;
104
+ unsigned int flags_;
105
+ int64_t ts_;
106
+ int64_t tts_;
107
+ uint64_t duration_;
108
+ uint64_t cpu_duration_;
109
+
110
+ // Disallow copy and assign
111
+ TraceObject(const TraceObject&) = delete;
112
+ void operator=(const TraceObject&) = delete;
113
+ };
114
+
115
+ class V8_PLATFORM_EXPORT TraceWriter {
116
+ public:
117
+ TraceWriter() = default;
118
+ virtual ~TraceWriter() = default;
119
+ virtual void AppendTraceEvent(TraceObject* trace_event) = 0;
120
+ virtual void Flush() = 0;
121
+
122
+ static TraceWriter* CreateJSONTraceWriter(std::ostream& stream);
123
+ static TraceWriter* CreateJSONTraceWriter(std::ostream& stream,
124
+ const std::string& tag);
125
+
126
+ static TraceWriter* CreateSystemInstrumentationTraceWriter();
127
+
128
+ private:
129
+ // Disallow copy and assign
130
+ TraceWriter(const TraceWriter&) = delete;
131
+ void operator=(const TraceWriter&) = delete;
132
+ };
133
+
134
+ class V8_PLATFORM_EXPORT TraceBufferChunk {
135
+ public:
136
+ explicit TraceBufferChunk(uint32_t seq);
137
+
138
+ void Reset(uint32_t new_seq);
139
+ bool IsFull() const { return next_free_ == kChunkSize; }
140
+ TraceObject* AddTraceEvent(size_t* event_index);
141
+ TraceObject* GetEventAt(size_t index) { return &chunk_[index]; }
142
+
143
+ uint32_t seq() const { return seq_; }
144
+ size_t size() const { return next_free_; }
145
+
146
+ static const size_t kChunkSize = 64;
147
+
148
+ private:
149
+ size_t next_free_ = 0;
150
+ TraceObject chunk_[kChunkSize];
151
+ uint32_t seq_;
152
+
153
+ // Disallow copy and assign
154
+ TraceBufferChunk(const TraceBufferChunk&) = delete;
155
+ void operator=(const TraceBufferChunk&) = delete;
156
+ };
157
+
158
+ class V8_PLATFORM_EXPORT TraceBuffer {
159
+ public:
160
+ TraceBuffer() = default;
161
+ virtual ~TraceBuffer() = default;
162
+
163
+ virtual TraceObject* AddTraceEvent(uint64_t* handle) = 0;
164
+ virtual TraceObject* GetEventByHandle(uint64_t handle) = 0;
165
+ virtual bool Flush() = 0;
166
+
167
+ static const size_t kRingBufferChunks = 1024;
168
+
169
+ static TraceBuffer* CreateTraceBufferRingBuffer(size_t max_chunks,
170
+ TraceWriter* trace_writer);
171
+
172
+ private:
173
+ // Disallow copy and assign
174
+ TraceBuffer(const TraceBuffer&) = delete;
175
+ void operator=(const TraceBuffer&) = delete;
176
+ };
177
+
178
+ // Options determines how the trace buffer stores data.
179
+ enum TraceRecordMode {
180
+ // Record until the trace buffer is full.
181
+ RECORD_UNTIL_FULL,
182
+
183
+ // Record until the user ends the trace. The trace buffer is a fixed size
184
+ // and we use it as a ring buffer during recording.
185
+ RECORD_CONTINUOUSLY,
186
+
187
+ // Record until the trace buffer is full, but with a huge buffer size.
188
+ RECORD_AS_MUCH_AS_POSSIBLE,
189
+
190
+ // Echo to console. Events are discarded.
191
+ ECHO_TO_CONSOLE,
192
+ };
193
+
194
+ class V8_PLATFORM_EXPORT TraceConfig {
195
+ public:
196
+ typedef std::vector<std::string> StringList;
197
+
198
+ static TraceConfig* CreateDefaultTraceConfig();
199
+
200
+ TraceConfig() : enable_systrace_(false), enable_argument_filter_(false) {}
201
+ TraceRecordMode GetTraceRecordMode() const { return record_mode_; }
202
+ const StringList& GetEnabledCategories() const {
203
+ return included_categories_;
204
+ }
205
+ bool IsSystraceEnabled() const { return enable_systrace_; }
206
+ bool IsArgumentFilterEnabled() const { return enable_argument_filter_; }
207
+
208
+ void SetTraceRecordMode(TraceRecordMode mode) { record_mode_ = mode; }
209
+ void EnableSystrace() { enable_systrace_ = true; }
210
+ void EnableArgumentFilter() { enable_argument_filter_ = true; }
211
+
212
+ void AddIncludedCategory(const char* included_category);
213
+
214
+ bool IsCategoryGroupEnabled(const char* category_group) const;
215
+
216
+ private:
217
+ TraceRecordMode record_mode_;
218
+ bool enable_systrace_ : 1;
219
+ bool enable_argument_filter_ : 1;
220
+ StringList included_categories_;
221
+
222
+ // Disallow copy and assign
223
+ TraceConfig(const TraceConfig&) = delete;
224
+ void operator=(const TraceConfig&) = delete;
225
+ };
226
+
227
+ #if defined(_MSC_VER)
228
+ #define V8_PLATFORM_NON_EXPORTED_BASE(code) \
229
+ __pragma(warning(suppress : 4275)) code
230
+ #else
231
+ #define V8_PLATFORM_NON_EXPORTED_BASE(code) code
232
+ #endif // defined(_MSC_VER)
233
+
234
+ class V8_PLATFORM_EXPORT TracingController
235
+ : public V8_PLATFORM_NON_EXPORTED_BASE(v8::TracingController) {
236
+ public:
237
+ TracingController();
238
+ ~TracingController() override;
239
+
240
+ #if defined(V8_USE_PERFETTO)
241
+ // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides
242
+ // the output stream for the JSON trace data.
243
+ void InitializeForPerfetto(std::ostream* output_stream);
244
+ // Provide an optional listener for testing that will receive trace events.
245
+ // Must be called before StartTracing().
246
+ void SetTraceEventListenerForTesting(TraceEventListener* listener);
247
+ #else // defined(V8_USE_PERFETTO)
248
+ // The pointer returned from GetCategoryGroupEnabled() points to a value with
249
+ // zero or more of the following bits. Used in this class only. The
250
+ // TRACE_EVENT macros should only use the value as a bool. These values must
251
+ // be in sync with macro values in TraceEvent.h in Blink.
252
+ enum CategoryGroupEnabledFlags {
253
+ // Category group enabled for the recording mode.
254
+ ENABLED_FOR_RECORDING = 1 << 0,
255
+ // Category group enabled by SetEventCallbackEnabled().
256
+ ENABLED_FOR_EVENT_CALLBACK = 1 << 2,
257
+ // Category group enabled to export events to ETW.
258
+ ENABLED_FOR_ETW_EXPORT = 1 << 3
259
+ };
260
+
261
+ // Takes ownership of |trace_buffer|.
262
+ void Initialize(TraceBuffer* trace_buffer);
263
+
264
+ // v8::TracingController implementation.
265
+ const uint8_t* GetCategoryGroupEnabled(const char* category_group) override;
266
+ uint64_t AddTraceEvent(
267
+ char phase, const uint8_t* category_enabled_flag, const char* name,
268
+ const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
269
+ const char** arg_names, const uint8_t* arg_types,
270
+ const uint64_t* arg_values,
271
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
272
+ unsigned int flags) override;
273
+ uint64_t AddTraceEventWithTimestamp(
274
+ char phase, const uint8_t* category_enabled_flag, const char* name,
275
+ const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
276
+ const char** arg_names, const uint8_t* arg_types,
277
+ const uint64_t* arg_values,
278
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
279
+ unsigned int flags, int64_t timestamp) override;
280
+ void UpdateTraceEventDuration(const uint8_t* category_enabled_flag,
281
+ const char* name, uint64_t handle) override;
282
+
283
+ static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag);
284
+
285
+ void AddTraceStateObserver(
286
+ v8::TracingController::TraceStateObserver* observer) override;
287
+ void RemoveTraceStateObserver(
288
+ v8::TracingController::TraceStateObserver* observer) override;
289
+ #endif // !defined(V8_USE_PERFETTO)
290
+
291
+ void StartTracing(TraceConfig* trace_config);
292
+ void StopTracing();
293
+
294
+ protected:
295
+ #if !defined(V8_USE_PERFETTO)
296
+ virtual int64_t CurrentTimestampMicroseconds();
297
+ virtual int64_t CurrentCpuTimestampMicroseconds();
298
+ #endif // !defined(V8_USE_PERFETTO)
299
+
300
+ private:
301
+ #if !defined(V8_USE_PERFETTO)
302
+ void UpdateCategoryGroupEnabledFlag(size_t category_index);
303
+ void UpdateCategoryGroupEnabledFlags();
304
+ #endif // !defined(V8_USE_PERFETTO)
305
+
306
+ std::unique_ptr<base::Mutex> mutex_;
307
+ std::unique_ptr<TraceConfig> trace_config_;
308
+ std::atomic_bool recording_{false};
309
+
310
+ #if defined(V8_USE_PERFETTO)
311
+ std::ostream* output_stream_ = nullptr;
312
+ std::unique_ptr<perfetto::trace_processor::TraceProcessorStorage>
313
+ trace_processor_;
314
+ TraceEventListener* listener_for_testing_ = nullptr;
315
+ std::unique_ptr<perfetto::TracingSession> tracing_session_;
316
+ #else // !defined(V8_USE_PERFETTO)
317
+ std::unordered_set<v8::TracingController::TraceStateObserver*> observers_;
318
+ std::unique_ptr<TraceBuffer> trace_buffer_;
319
+ #endif // !defined(V8_USE_PERFETTO)
320
+
321
+ // Disallow copy and assign
322
+ TracingController(const TracingController&) = delete;
323
+ void operator=(const TracingController&) = delete;
324
+ };
325
+
326
+ #undef V8_PLATFORM_NON_EXPORTED_BASE
327
+
328
+ } // namespace tracing
329
+ } // namespace platform
330
+ } // namespace v8
331
+
332
+ #endif // V8_LIBPLATFORM_V8_TRACING_H_
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/aes.h ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2002-2020 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
+ #ifndef OPENSSL_AES_H
11
+ # define OPENSSL_AES_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_AES_H
17
+ # endif
18
+
19
+ # include <openssl/opensslconf.h>
20
+
21
+ # include <stddef.h>
22
+ # ifdef __cplusplus
23
+ extern "C" {
24
+ # endif
25
+
26
+ # define AES_BLOCK_SIZE 16
27
+
28
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
29
+
30
+ # define AES_ENCRYPT 1
31
+ # define AES_DECRYPT 0
32
+
33
+ # define AES_MAXNR 14
34
+
35
+
36
+ /* This should be a hidden type, but EVP requires that the size be known */
37
+ struct aes_key_st {
38
+ # ifdef AES_LONG
39
+ unsigned long rd_key[4 * (AES_MAXNR + 1)];
40
+ # else
41
+ unsigned int rd_key[4 * (AES_MAXNR + 1)];
42
+ # endif
43
+ int rounds;
44
+ };
45
+ typedef struct aes_key_st AES_KEY;
46
+
47
+ # endif
48
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
49
+ OSSL_DEPRECATEDIN_3_0 const char *AES_options(void);
50
+ OSSL_DEPRECATEDIN_3_0
51
+ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
52
+ AES_KEY *key);
53
+ OSSL_DEPRECATEDIN_3_0
54
+ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
55
+ AES_KEY *key);
56
+ OSSL_DEPRECATEDIN_3_0
57
+ void AES_encrypt(const unsigned char *in, unsigned char *out,
58
+ const AES_KEY *key);
59
+ OSSL_DEPRECATEDIN_3_0
60
+ void AES_decrypt(const unsigned char *in, unsigned char *out,
61
+ const AES_KEY *key);
62
+ OSSL_DEPRECATEDIN_3_0
63
+ void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
64
+ const AES_KEY *key, const int enc);
65
+ OSSL_DEPRECATEDIN_3_0
66
+ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
67
+ size_t length, const AES_KEY *key,
68
+ unsigned char *ivec, const int enc);
69
+ OSSL_DEPRECATEDIN_3_0
70
+ void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
71
+ size_t length, const AES_KEY *key,
72
+ unsigned char *ivec, int *num, const int enc);
73
+ OSSL_DEPRECATEDIN_3_0
74
+ void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
75
+ size_t length, const AES_KEY *key,
76
+ unsigned char *ivec, int *num, const int enc);
77
+ OSSL_DEPRECATEDIN_3_0
78
+ void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
79
+ size_t length, const AES_KEY *key,
80
+ unsigned char *ivec, int *num, const int enc);
81
+ OSSL_DEPRECATEDIN_3_0
82
+ void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
83
+ size_t length, const AES_KEY *key,
84
+ unsigned char *ivec, int *num);
85
+
86
+ /* NB: the IV is _two_ blocks long */
87
+ OSSL_DEPRECATEDIN_3_0
88
+ void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
89
+ size_t length, const AES_KEY *key,
90
+ unsigned char *ivec, const int enc);
91
+ /* NB: the IV is _four_ blocks long */
92
+ OSSL_DEPRECATEDIN_3_0
93
+ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
94
+ size_t length, const AES_KEY *key, const AES_KEY *key2,
95
+ const unsigned char *ivec, const int enc);
96
+ OSSL_DEPRECATEDIN_3_0
97
+ int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
98
+ unsigned char *out, const unsigned char *in,
99
+ unsigned int inlen);
100
+ OSSL_DEPRECATEDIN_3_0
101
+ int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
102
+ unsigned char *out, const unsigned char *in,
103
+ unsigned int inlen);
104
+ # endif
105
+
106
+
107
+ # ifdef __cplusplus
108
+ }
109
+ # endif
110
+
111
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1_asm.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/asm/include/openssl/asn1.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/asn1.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/asn1.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/asn1.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/asn1.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/asn1.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/asn1.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/asn1.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/asn1.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/asn1.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/asn1.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/asn1.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/asn1.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/asn1.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/asn1.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/asn1.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/asn1.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/asn1.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/asn1.h"
44
+ #endif
45
+
46
+ /* GOST is not included in all platform */
47
+ #ifndef OPENSSL_NO_GOST
48
+ # define OPENSSL_NO_GOST
49
+ #endif
50
+ /* HW_PADLOCK is not included in all platform */
51
+ #ifndef OPENSSL_NO_HW_PADLOCK
52
+ # define OPENSSL_NO_HW_PADLOCK
53
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1t_asm.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/asm/include/openssl/asn1t.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/asn1t.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/asn1t.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/asn1t.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/asn1t.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/asn1t.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/asn1t.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/asn1t.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/asn1t.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/asn1t.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/asn1t.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/asn1t.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/asn1t.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/asn1t.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/asn1t.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/asn1t.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/asn1t.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/asn1t.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/asn1t.h"
44
+ #endif
45
+
46
+ /* GOST is not included in all platform */
47
+ #ifndef OPENSSL_NO_GOST
48
+ # define OPENSSL_NO_GOST
49
+ #endif
50
+ /* HW_PADLOCK is not included in all platform */
51
+ #ifndef OPENSSL_NO_HW_PADLOCK
52
+ # define OPENSSL_NO_HW_PADLOCK
53
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/bio.h ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #if defined(OPENSSL_NO_ASM)
2
+ # include "./bio_no-asm.h"
3
+ #else
4
+ # include "./bio_asm.h"
5
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/bio_asm.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/asm/include/openssl/bio.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/bio.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/bio.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/bio.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/bio.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/bio.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/bio.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/bio.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/bio.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/bio.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/bio.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/bio.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/bio.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/bio.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/bio.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/bio.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/bio.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/bio.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/bio.h"
44
+ #endif
45
+
46
+ /* GOST is not included in all platform */
47
+ #ifndef OPENSSL_NO_GOST
48
+ # define OPENSSL_NO_GOST
49
+ #endif
50
+ /* HW_PADLOCK is not included in all platform */
51
+ #ifndef OPENSSL_NO_HW_PADLOCK
52
+ # define OPENSSL_NO_HW_PADLOCK
53
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmp_util.h ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
3
+ * Copyright Nokia 2007-2019
4
+ * Copyright Siemens AG 2015-2019
5
+ *
6
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
7
+ * this file except in compliance with the License. You can obtain a copy
8
+ * in the file LICENSE in the source distribution or at
9
+ * https://www.openssl.org/source/license.html
10
+ */
11
+
12
+ #ifndef OPENSSL_CMP_UTIL_H
13
+ # define OPENSSL_CMP_UTIL_H
14
+ # pragma once
15
+
16
+ # include <openssl/opensslconf.h>
17
+ # ifndef OPENSSL_NO_CMP
18
+
19
+ # include <openssl/macros.h>
20
+ # include <openssl/trace.h>
21
+
22
+ # ifdef __cplusplus
23
+ extern "C" {
24
+ # endif
25
+
26
+ int OSSL_CMP_log_open(void);
27
+ void OSSL_CMP_log_close(void);
28
+ # define OSSL_CMP_LOG_PREFIX "CMP "
29
+
30
+ /*
31
+ * generalized logging/error callback mirroring the severity levels of syslog.h
32
+ */
33
+ typedef int OSSL_CMP_severity;
34
+ # define OSSL_CMP_LOG_EMERG 0
35
+ # define OSSL_CMP_LOG_ALERT 1
36
+ # define OSSL_CMP_LOG_CRIT 2
37
+ # define OSSL_CMP_LOG_ERR 3
38
+ # define OSSL_CMP_LOG_WARNING 4
39
+ # define OSSL_CMP_LOG_NOTICE 5
40
+ # define OSSL_CMP_LOG_INFO 6
41
+ # define OSSL_CMP_LOG_DEBUG 7
42
+ # define OSSL_CMP_LOG_TRACE 8
43
+ # define OSSL_CMP_LOG_MAX OSSL_CMP_LOG_TRACE
44
+ typedef int (*OSSL_CMP_log_cb_t)(const char *func, const char *file, int line,
45
+ OSSL_CMP_severity level, const char *msg);
46
+
47
+ int OSSL_CMP_print_to_bio(BIO *bio, const char *component, const char *file,
48
+ int line, OSSL_CMP_severity level, const char *msg);
49
+ /* use of the logging callback for outputting error queue */
50
+ void OSSL_CMP_print_errors_cb(OSSL_CMP_log_cb_t log_fn);
51
+
52
+ # ifdef __cplusplus
53
+ }
54
+ # endif
55
+ # endif /* !defined(OPENSSL_NO_CMP) */
56
+ #endif /* !defined(OPENSSL_CMP_UTIL_H) */
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmserr.h ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Generated by util/mkerr.pl DO NOT EDIT
3
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
6
+ * this file except in compliance with the License. You can obtain a copy
7
+ * in the file LICENSE in the source distribution or at
8
+ * https://www.openssl.org/source/license.html
9
+ */
10
+
11
+ #ifndef OPENSSL_CMSERR_H
12
+ # define OPENSSL_CMSERR_H
13
+ # pragma once
14
+
15
+ # include <openssl/opensslconf.h>
16
+ # include <openssl/symhacks.h>
17
+ # include <openssl/cryptoerr_legacy.h>
18
+
19
+
20
+ # ifndef OPENSSL_NO_CMS
21
+
22
+
23
+ /*
24
+ * CMS reason codes.
25
+ */
26
+ # define CMS_R_ADD_SIGNER_ERROR 99
27
+ # define CMS_R_ATTRIBUTE_ERROR 161
28
+ # define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
29
+ # define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
30
+ # define CMS_R_CERTIFICATE_VERIFY_ERROR 100
31
+ # define CMS_R_CIPHER_AEAD_SET_TAG_ERROR 184
32
+ # define CMS_R_CIPHER_GET_TAG 185
33
+ # define CMS_R_CIPHER_INITIALISATION_ERROR 101
34
+ # define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
35
+ # define CMS_R_CMS_DATAFINAL_ERROR 103
36
+ # define CMS_R_CMS_LIB 104
37
+ # define CMS_R_CONTENTIDENTIFIER_MISMATCH 170
38
+ # define CMS_R_CONTENT_NOT_FOUND 105
39
+ # define CMS_R_CONTENT_TYPE_MISMATCH 171
40
+ # define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106
41
+ # define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107
42
+ # define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108
43
+ # define CMS_R_CONTENT_VERIFY_ERROR 109
44
+ # define CMS_R_CTRL_ERROR 110
45
+ # define CMS_R_CTRL_FAILURE 111
46
+ # define CMS_R_DECODE_ERROR 187
47
+ # define CMS_R_DECRYPT_ERROR 112
48
+ # define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
49
+ # define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
50
+ # define CMS_R_ERROR_SETTING_KEY 115
51
+ # define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
52
+ # define CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT 196
53
+ # define CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR 183
54
+ # define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
55
+ # define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
56
+ # define CMS_R_INVALID_KEY_LENGTH 118
57
+ # define CMS_R_INVALID_LABEL 190
58
+ # define CMS_R_INVALID_OAEP_PARAMETERS 191
59
+ # define CMS_R_KDF_PARAMETER_ERROR 186
60
+ # define CMS_R_MD_BIO_INIT_ERROR 119
61
+ # define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
62
+ # define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
63
+ # define CMS_R_MSGSIGDIGEST_ERROR 172
64
+ # define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162
65
+ # define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163
66
+ # define CMS_R_NEED_ONE_SIGNER 164
67
+ # define CMS_R_NOT_A_SIGNED_RECEIPT 165
68
+ # define CMS_R_NOT_ENCRYPTED_DATA 122
69
+ # define CMS_R_NOT_KEK 123
70
+ # define CMS_R_NOT_KEY_AGREEMENT 181
71
+ # define CMS_R_NOT_KEY_TRANSPORT 124
72
+ # define CMS_R_NOT_PWRI 177
73
+ # define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
74
+ # define CMS_R_NO_CIPHER 126
75
+ # define CMS_R_NO_CONTENT 127
76
+ # define CMS_R_NO_CONTENT_TYPE 173
77
+ # define CMS_R_NO_DEFAULT_DIGEST 128
78
+ # define CMS_R_NO_DIGEST_SET 129
79
+ # define CMS_R_NO_KEY 130
80
+ # define CMS_R_NO_KEY_OR_CERT 174
81
+ # define CMS_R_NO_MATCHING_DIGEST 131
82
+ # define CMS_R_NO_MATCHING_RECIPIENT 132
83
+ # define CMS_R_NO_MATCHING_SIGNATURE 166
84
+ # define CMS_R_NO_MSGSIGDIGEST 167
85
+ # define CMS_R_NO_PASSWORD 178
86
+ # define CMS_R_NO_PRIVATE_KEY 133
87
+ # define CMS_R_NO_PUBLIC_KEY 134
88
+ # define CMS_R_NO_RECEIPT_REQUEST 168
89
+ # define CMS_R_NO_SIGNERS 135
90
+ # define CMS_R_OPERATION_UNSUPPORTED 182
91
+ # define CMS_R_PEER_KEY_ERROR 188
92
+ # define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
93
+ # define CMS_R_RECEIPT_DECODE_ERROR 169
94
+ # define CMS_R_RECIPIENT_ERROR 137
95
+ # define CMS_R_SHARED_INFO_ERROR 189
96
+ # define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
97
+ # define CMS_R_SIGNFINAL_ERROR 139
98
+ # define CMS_R_SMIME_TEXT_ERROR 140
99
+ # define CMS_R_STORE_INIT_ERROR 141
100
+ # define CMS_R_TYPE_NOT_COMPRESSED_DATA 142
101
+ # define CMS_R_TYPE_NOT_DATA 143
102
+ # define CMS_R_TYPE_NOT_DIGESTED_DATA 144
103
+ # define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145
104
+ # define CMS_R_TYPE_NOT_ENVELOPED_DATA 146
105
+ # define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147
106
+ # define CMS_R_UNKNOWN_CIPHER 148
107
+ # define CMS_R_UNKNOWN_DIGEST_ALGORITHM 149
108
+ # define CMS_R_UNKNOWN_ID 150
109
+ # define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
110
+ # define CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM 194
111
+ # define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
112
+ # define CMS_R_UNSUPPORTED_ENCRYPTION_TYPE 192
113
+ # define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
114
+ # define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
115
+ # define CMS_R_UNSUPPORTED_LABEL_SOURCE 193
116
+ # define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE 155
117
+ # define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
118
+ # define CMS_R_UNSUPPORTED_SIGNATURE_ALGORITHM 195
119
+ # define CMS_R_UNSUPPORTED_TYPE 156
120
+ # define CMS_R_UNWRAP_ERROR 157
121
+ # define CMS_R_UNWRAP_FAILURE 180
122
+ # define CMS_R_VERIFICATION_FAILURE 158
123
+ # define CMS_R_WRAP_ERROR 159
124
+
125
+ # endif
126
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/comp_asm.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/asm/include/openssl/comp.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/comp.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/comp.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/comp.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/comp.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/comp.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/comp.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/comp.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/comp.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/comp.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/comp.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/comp.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/comp.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/comp.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/comp.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/comp.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/comp.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/comp.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/comp.h"
44
+ #endif
45
+
46
+ /* GOST is not included in all platform */
47
+ #ifndef OPENSSL_NO_GOST
48
+ # define OPENSSL_NO_GOST
49
+ #endif
50
+ /* HW_PADLOCK is not included in all platform */
51
+ #ifndef OPENSSL_NO_HW_PADLOCK
52
+ # define OPENSSL_NO_HW_PADLOCK
53
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/core_dispatch.h ADDED
@@ -0,0 +1,1145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2019-2025 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
+ #ifndef OPENSSL_CORE_NUMBERS_H
11
+ # define OPENSSL_CORE_NUMBERS_H
12
+ # pragma once
13
+
14
+ # include <stdarg.h>
15
+ # include <openssl/core.h>
16
+ # include <openssl/indicator.h>
17
+
18
+ # ifdef __cplusplus
19
+ extern "C" {
20
+ # endif
21
+
22
+ /*
23
+ * Generic function pointer for provider method arrays, or other contexts where
24
+ * functions of various signatures must occupy a common slot in an array of
25
+ * structures.
26
+ */
27
+ typedef void (*OSSL_FUNC)(void);
28
+
29
+ /*-
30
+ * Identities
31
+ * ----------
32
+ *
33
+ * All series start with 1, to allow 0 to be an array terminator.
34
+ * For any FUNC identity, we also provide a function signature typedef
35
+ * and a static inline function to extract a function pointer from a
36
+ * OSSL_DISPATCH element in a type safe manner.
37
+ *
38
+ * Names:
39
+ * for any function base name 'foo' (uppercase form 'FOO'), we will have
40
+ * the following:
41
+ * - a macro for the identity with the name OSSL_FUNC_'FOO' or derivatives
42
+ * thereof (to be specified further down)
43
+ * - a function signature typedef with the name OSSL_FUNC_'foo'_fn
44
+ * - a function pointer extractor function with the name OSSL_FUNC_'foo'
45
+ */
46
+
47
+ /*
48
+ * Helper macro to create the function signature typedef and the extractor
49
+ * |type| is the return-type of the function, |name| is the name of the
50
+ * function to fetch, and |args| is a parenthesized list of parameters
51
+ * for the function (that is, it is |name|'s function signature).
52
+ * Note: This is considered a "reserved" internal macro. Applications should
53
+ * not use this or assume its existence.
54
+ */
55
+ #define OSSL_CORE_MAKE_FUNC(type,name,args) \
56
+ typedef type (OSSL_FUNC_##name##_fn)args; \
57
+ static ossl_unused ossl_inline \
58
+ OSSL_FUNC_##name##_fn *OSSL_FUNC_##name(const OSSL_DISPATCH *opf) \
59
+ { \
60
+ return (OSSL_FUNC_##name##_fn *)opf->function; \
61
+ }
62
+
63
+ /*
64
+ * Core function identities, for the two OSSL_DISPATCH tables being passed
65
+ * in the OSSL_provider_init call.
66
+ *
67
+ * 0 serves as a marker for the end of the OSSL_DISPATCH array, and must
68
+ * therefore NEVER be used as a function identity.
69
+ */
70
+ /* Functions provided by the Core to the provider, reserved numbers 1-1023 */
71
+ # define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
72
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
73
+ core_gettable_params,(const OSSL_CORE_HANDLE *prov))
74
+ # define OSSL_FUNC_CORE_GET_PARAMS 2
75
+ OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_CORE_HANDLE *prov,
76
+ OSSL_PARAM params[]))
77
+ # define OSSL_FUNC_CORE_THREAD_START 3
78
+ OSSL_CORE_MAKE_FUNC(int,core_thread_start,(const OSSL_CORE_HANDLE *prov,
79
+ OSSL_thread_stop_handler_fn handfn,
80
+ void *arg))
81
+ # define OSSL_FUNC_CORE_GET_LIBCTX 4
82
+ OSSL_CORE_MAKE_FUNC(OPENSSL_CORE_CTX *,core_get_libctx,
83
+ (const OSSL_CORE_HANDLE *prov))
84
+ # define OSSL_FUNC_CORE_NEW_ERROR 5
85
+ OSSL_CORE_MAKE_FUNC(void,core_new_error,(const OSSL_CORE_HANDLE *prov))
86
+ # define OSSL_FUNC_CORE_SET_ERROR_DEBUG 6
87
+ OSSL_CORE_MAKE_FUNC(void,core_set_error_debug,
88
+ (const OSSL_CORE_HANDLE *prov,
89
+ const char *file, int line, const char *func))
90
+ # define OSSL_FUNC_CORE_VSET_ERROR 7
91
+ OSSL_CORE_MAKE_FUNC(void,core_vset_error,
92
+ (const OSSL_CORE_HANDLE *prov,
93
+ uint32_t reason, const char *fmt, va_list args))
94
+ # define OSSL_FUNC_CORE_SET_ERROR_MARK 8
95
+ OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_CORE_HANDLE *prov))
96
+ # define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9
97
+ OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark,
98
+ (const OSSL_CORE_HANDLE *prov))
99
+ # define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10
100
+ OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_CORE_HANDLE *prov))
101
+
102
+
103
+ /* Functions to access the OBJ database */
104
+
105
+ #define OSSL_FUNC_CORE_OBJ_ADD_SIGID 11
106
+ #define OSSL_FUNC_CORE_OBJ_CREATE 12
107
+
108
+ OSSL_CORE_MAKE_FUNC(int, core_obj_add_sigid,
109
+ (const OSSL_CORE_HANDLE *prov, const char *sign_name,
110
+ const char *digest_name, const char *pkey_name))
111
+ OSSL_CORE_MAKE_FUNC(int, core_obj_create,
112
+ (const OSSL_CORE_HANDLE *prov, const char *oid,
113
+ const char *sn, const char *ln))
114
+
115
+ /* Memory allocation, freeing, clearing. */
116
+ #define OSSL_FUNC_CRYPTO_MALLOC 20
117
+ OSSL_CORE_MAKE_FUNC(void *,
118
+ CRYPTO_malloc, (size_t num, const char *file, int line))
119
+ #define OSSL_FUNC_CRYPTO_ZALLOC 21
120
+ OSSL_CORE_MAKE_FUNC(void *,
121
+ CRYPTO_zalloc, (size_t num, const char *file, int line))
122
+ #define OSSL_FUNC_CRYPTO_FREE 22
123
+ OSSL_CORE_MAKE_FUNC(void,
124
+ CRYPTO_free, (void *ptr, const char *file, int line))
125
+ #define OSSL_FUNC_CRYPTO_CLEAR_FREE 23
126
+ OSSL_CORE_MAKE_FUNC(void,
127
+ CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line))
128
+ #define OSSL_FUNC_CRYPTO_REALLOC 24
129
+ OSSL_CORE_MAKE_FUNC(void *,
130
+ CRYPTO_realloc, (void *addr, size_t num, const char *file, int line))
131
+ #define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 25
132
+ OSSL_CORE_MAKE_FUNC(void *,
133
+ CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num,
134
+ const char *file, int line))
135
+ #define OSSL_FUNC_CRYPTO_SECURE_MALLOC 26
136
+ OSSL_CORE_MAKE_FUNC(void *,
137
+ CRYPTO_secure_malloc, (size_t num, const char *file, int line))
138
+ #define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 27
139
+ OSSL_CORE_MAKE_FUNC(void *,
140
+ CRYPTO_secure_zalloc, (size_t num, const char *file, int line))
141
+ #define OSSL_FUNC_CRYPTO_SECURE_FREE 28
142
+ OSSL_CORE_MAKE_FUNC(void,
143
+ CRYPTO_secure_free, (void *ptr, const char *file, int line))
144
+ #define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 29
145
+ OSSL_CORE_MAKE_FUNC(void,
146
+ CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file,
147
+ int line))
148
+ #define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 30
149
+ OSSL_CORE_MAKE_FUNC(int,
150
+ CRYPTO_secure_allocated, (const void *ptr))
151
+ #define OSSL_FUNC_OPENSSL_CLEANSE 31
152
+ OSSL_CORE_MAKE_FUNC(void,
153
+ OPENSSL_cleanse, (void *ptr, size_t len))
154
+
155
+ /* Bio functions provided by the core */
156
+ #define OSSL_FUNC_BIO_NEW_FILE 40
157
+ #define OSSL_FUNC_BIO_NEW_MEMBUF 41
158
+ #define OSSL_FUNC_BIO_READ_EX 42
159
+ #define OSSL_FUNC_BIO_WRITE_EX 43
160
+ #define OSSL_FUNC_BIO_UP_REF 44
161
+ #define OSSL_FUNC_BIO_FREE 45
162
+ #define OSSL_FUNC_BIO_VPRINTF 46
163
+ #define OSSL_FUNC_BIO_VSNPRINTF 47
164
+ #define OSSL_FUNC_BIO_PUTS 48
165
+ #define OSSL_FUNC_BIO_GETS 49
166
+ #define OSSL_FUNC_BIO_CTRL 50
167
+
168
+
169
+ OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_file, (const char *filename,
170
+ const char *mode))
171
+ OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_membuf, (const void *buf, int len))
172
+ OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO *bio, void *data,
173
+ size_t data_len, size_t *bytes_read))
174
+ OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO *bio, const void *data,
175
+ size_t data_len, size_t *written))
176
+ OSSL_CORE_MAKE_FUNC(int, BIO_gets, (OSSL_CORE_BIO *bio, char *buf, int size))
177
+ OSSL_CORE_MAKE_FUNC(int, BIO_puts, (OSSL_CORE_BIO *bio, const char *str))
178
+ OSSL_CORE_MAKE_FUNC(int, BIO_up_ref, (OSSL_CORE_BIO *bio))
179
+ OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO *bio))
180
+ OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO *bio, const char *format,
181
+ va_list args))
182
+ OSSL_CORE_MAKE_FUNC(int, BIO_vsnprintf,
183
+ (char *buf, size_t n, const char *fmt, va_list args))
184
+ OSSL_CORE_MAKE_FUNC(int, BIO_ctrl, (OSSL_CORE_BIO *bio,
185
+ int cmd, long num, void *ptr))
186
+
187
+ /* New seeding functions prototypes with the 101-104 series */
188
+ #define OSSL_FUNC_CLEANUP_USER_ENTROPY 96
189
+ #define OSSL_FUNC_CLEANUP_USER_NONCE 97
190
+ #define OSSL_FUNC_GET_USER_ENTROPY 98
191
+ #define OSSL_FUNC_GET_USER_NONCE 99
192
+
193
+ #define OSSL_FUNC_INDICATOR_CB 95
194
+ OSSL_CORE_MAKE_FUNC(void, indicator_cb, (OPENSSL_CORE_CTX *ctx,
195
+ OSSL_INDICATOR_CALLBACK **cb))
196
+ #define OSSL_FUNC_SELF_TEST_CB 100
197
+ OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX *ctx, OSSL_CALLBACK **cb,
198
+ void **cbarg))
199
+
200
+ /* Functions to get seed material from the operating system */
201
+ #define OSSL_FUNC_GET_ENTROPY 101
202
+ #define OSSL_FUNC_CLEANUP_ENTROPY 102
203
+ #define OSSL_FUNC_GET_NONCE 103
204
+ #define OSSL_FUNC_CLEANUP_NONCE 104
205
+ OSSL_CORE_MAKE_FUNC(size_t, get_entropy, (const OSSL_CORE_HANDLE *handle,
206
+ unsigned char **pout, int entropy,
207
+ size_t min_len, size_t max_len))
208
+ OSSL_CORE_MAKE_FUNC(size_t, get_user_entropy, (const OSSL_CORE_HANDLE *handle,
209
+ unsigned char **pout, int entropy,
210
+ size_t min_len, size_t max_len))
211
+ OSSL_CORE_MAKE_FUNC(void, cleanup_entropy, (const OSSL_CORE_HANDLE *handle,
212
+ unsigned char *buf, size_t len))
213
+ OSSL_CORE_MAKE_FUNC(void, cleanup_user_entropy, (const OSSL_CORE_HANDLE *handle,
214
+ unsigned char *buf, size_t len))
215
+ OSSL_CORE_MAKE_FUNC(size_t, get_nonce, (const OSSL_CORE_HANDLE *handle,
216
+ unsigned char **pout, size_t min_len,
217
+ size_t max_len, const void *salt,
218
+ size_t salt_len))
219
+ OSSL_CORE_MAKE_FUNC(size_t, get_user_nonce, (const OSSL_CORE_HANDLE *handle,
220
+ unsigned char **pout, size_t min_len,
221
+ size_t max_len, const void *salt,
222
+ size_t salt_len))
223
+ OSSL_CORE_MAKE_FUNC(void, cleanup_nonce, (const OSSL_CORE_HANDLE *handle,
224
+ unsigned char *buf, size_t len))
225
+ OSSL_CORE_MAKE_FUNC(void, cleanup_user_nonce, (const OSSL_CORE_HANDLE *handle,
226
+ unsigned char *buf, size_t len))
227
+
228
+ /* Functions to access the core's providers */
229
+ #define OSSL_FUNC_PROVIDER_REGISTER_CHILD_CB 105
230
+ #define OSSL_FUNC_PROVIDER_DEREGISTER_CHILD_CB 106
231
+ #define OSSL_FUNC_PROVIDER_NAME 107
232
+ #define OSSL_FUNC_PROVIDER_GET0_PROVIDER_CTX 108
233
+ #define OSSL_FUNC_PROVIDER_GET0_DISPATCH 109
234
+ #define OSSL_FUNC_PROVIDER_UP_REF 110
235
+ #define OSSL_FUNC_PROVIDER_FREE 111
236
+
237
+ OSSL_CORE_MAKE_FUNC(int, provider_register_child_cb,
238
+ (const OSSL_CORE_HANDLE *handle,
239
+ int (*create_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata),
240
+ int (*remove_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata),
241
+ int (*global_props_cb)(const char *props, void *cbdata),
242
+ void *cbdata))
243
+ OSSL_CORE_MAKE_FUNC(void, provider_deregister_child_cb,
244
+ (const OSSL_CORE_HANDLE *handle))
245
+ OSSL_CORE_MAKE_FUNC(const char *, provider_name,
246
+ (const OSSL_CORE_HANDLE *prov))
247
+ OSSL_CORE_MAKE_FUNC(void *, provider_get0_provider_ctx,
248
+ (const OSSL_CORE_HANDLE *prov))
249
+ OSSL_CORE_MAKE_FUNC(const OSSL_DISPATCH *, provider_get0_dispatch,
250
+ (const OSSL_CORE_HANDLE *prov))
251
+ OSSL_CORE_MAKE_FUNC(int, provider_up_ref,
252
+ (const OSSL_CORE_HANDLE *prov, int activate))
253
+ OSSL_CORE_MAKE_FUNC(int, provider_free,
254
+ (const OSSL_CORE_HANDLE *prov, int deactivate))
255
+
256
+ /* Additional error functions provided by the core */
257
+ # define OSSL_FUNC_CORE_COUNT_TO_MARK 120
258
+ OSSL_CORE_MAKE_FUNC(int, core_count_to_mark, (const OSSL_CORE_HANDLE *prov))
259
+
260
+ /* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
261
+ # define OSSL_FUNC_PROVIDER_TEARDOWN 1024
262
+ OSSL_CORE_MAKE_FUNC(void, provider_teardown, (void *provctx))
263
+ # define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025
264
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
265
+ provider_gettable_params,(void *provctx))
266
+ # define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
267
+ OSSL_CORE_MAKE_FUNC(int, provider_get_params, (void *provctx,
268
+ OSSL_PARAM params[]))
269
+ # define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
270
+ OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM *,provider_query_operation,
271
+ (void *provctx, int operation_id, int *no_store))
272
+ # define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION 1028
273
+ OSSL_CORE_MAKE_FUNC(void, provider_unquery_operation,
274
+ (void *provctx, int operation_id, const OSSL_ALGORITHM *))
275
+ # define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029
276
+ OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings,
277
+ (void *provctx))
278
+ # define OSSL_FUNC_PROVIDER_GET_CAPABILITIES 1030
279
+ OSSL_CORE_MAKE_FUNC(int, provider_get_capabilities, (void *provctx,
280
+ const char *capability, OSSL_CALLBACK *cb, void *arg))
281
+ # define OSSL_FUNC_PROVIDER_SELF_TEST 1031
282
+ OSSL_CORE_MAKE_FUNC(int, provider_self_test, (void *provctx))
283
+ # define OSSL_FUNC_PROVIDER_RANDOM_BYTES 1032
284
+ OSSL_CORE_MAKE_FUNC(int, provider_random_bytes, (void *provctx, int which,
285
+ void *buf, size_t n,
286
+ unsigned int strength))
287
+
288
+ /* Libssl related functions */
289
+ #define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_SEND 2001
290
+ OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_send,
291
+ (SSL *s, const unsigned char *buf, size_t buf_len,
292
+ size_t *consumed, void *arg))
293
+ #define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_RECV_RCD 2002
294
+ OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_recv_rcd,
295
+ (SSL *s, const unsigned char **buf, size_t *bytes_read,
296
+ void *arg))
297
+ #define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_RELEASE_RCD 2003
298
+ OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_release_rcd,
299
+ (SSL *s, size_t bytes_read, void *arg))
300
+ #define OSSL_FUNC_SSL_QUIC_TLS_YIELD_SECRET 2004
301
+ OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_yield_secret,
302
+ (SSL *s, uint32_t prot_level, int direction,
303
+ const unsigned char *secret, size_t secret_len, void *arg))
304
+ #define OSSL_FUNC_SSL_QUIC_TLS_GOT_TRANSPORT_PARAMS 2005
305
+ OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_got_transport_params,
306
+ (SSL *s, const unsigned char *params, size_t params_len,
307
+ void *arg))
308
+ #define OSSL_FUNC_SSL_QUIC_TLS_ALERT 2006
309
+ OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_alert,
310
+ (SSL *s, unsigned char alert_code, void *arg))
311
+
312
+ /* Operations */
313
+
314
+ # define OSSL_OP_DIGEST 1
315
+ # define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
316
+ # define OSSL_OP_MAC 3
317
+ # define OSSL_OP_KDF 4
318
+ # define OSSL_OP_RAND 5
319
+ # define OSSL_OP_KEYMGMT 10
320
+ # define OSSL_OP_KEYEXCH 11
321
+ # define OSSL_OP_SIGNATURE 12
322
+ # define OSSL_OP_ASYM_CIPHER 13
323
+ # define OSSL_OP_KEM 14
324
+ # define OSSL_OP_SKEYMGMT 15
325
+ /* New section for non-EVP operations */
326
+ # define OSSL_OP_ENCODER 20
327
+ # define OSSL_OP_DECODER 21
328
+ # define OSSL_OP_STORE 22
329
+ /* Highest known operation number */
330
+ # define OSSL_OP__HIGHEST 22
331
+
332
+ /* Digests */
333
+
334
+ # define OSSL_FUNC_DIGEST_NEWCTX 1
335
+ # define OSSL_FUNC_DIGEST_INIT 2
336
+ # define OSSL_FUNC_DIGEST_UPDATE 3
337
+ # define OSSL_FUNC_DIGEST_FINAL 4
338
+ # define OSSL_FUNC_DIGEST_DIGEST 5
339
+ # define OSSL_FUNC_DIGEST_FREECTX 6
340
+ # define OSSL_FUNC_DIGEST_DUPCTX 7
341
+ # define OSSL_FUNC_DIGEST_GET_PARAMS 8
342
+ # define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9
343
+ # define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10
344
+ # define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
345
+ # define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
346
+ # define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
347
+ # define OSSL_FUNC_DIGEST_SQUEEZE 14
348
+ # define OSSL_FUNC_DIGEST_COPYCTX 15
349
+
350
+ OSSL_CORE_MAKE_FUNC(void *, digest_newctx, (void *provctx))
351
+ OSSL_CORE_MAKE_FUNC(int, digest_init, (void *dctx, const OSSL_PARAM params[]))
352
+ OSSL_CORE_MAKE_FUNC(int, digest_update,
353
+ (void *dctx, const unsigned char *in, size_t inl))
354
+ OSSL_CORE_MAKE_FUNC(int, digest_final,
355
+ (void *dctx,
356
+ unsigned char *out, size_t *outl, size_t outsz))
357
+ OSSL_CORE_MAKE_FUNC(int, digest_squeeze,
358
+ (void *dctx,
359
+ unsigned char *out, size_t *outl, size_t outsz))
360
+ OSSL_CORE_MAKE_FUNC(int, digest_digest,
361
+ (void *provctx, const unsigned char *in, size_t inl,
362
+ unsigned char *out, size_t *outl, size_t outsz))
363
+
364
+ OSSL_CORE_MAKE_FUNC(void, digest_freectx, (void *dctx))
365
+ OSSL_CORE_MAKE_FUNC(void *, digest_dupctx, (void *dctx))
366
+ OSSL_CORE_MAKE_FUNC(void, digest_copyctx, (void *outctx, void *inctx))
367
+
368
+ OSSL_CORE_MAKE_FUNC(int, digest_get_params, (OSSL_PARAM params[]))
369
+ OSSL_CORE_MAKE_FUNC(int, digest_set_ctx_params,
370
+ (void *vctx, const OSSL_PARAM params[]))
371
+ OSSL_CORE_MAKE_FUNC(int, digest_get_ctx_params,
372
+ (void *vctx, OSSL_PARAM params[]))
373
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_params,
374
+ (void *provctx))
375
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_settable_ctx_params,
376
+ (void *dctx, void *provctx))
377
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_ctx_params,
378
+ (void *dctx, void *provctx))
379
+
380
+ /* Symmetric Ciphers */
381
+
382
+ # define OSSL_FUNC_CIPHER_NEWCTX 1
383
+ # define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2
384
+ # define OSSL_FUNC_CIPHER_DECRYPT_INIT 3
385
+ # define OSSL_FUNC_CIPHER_UPDATE 4
386
+ # define OSSL_FUNC_CIPHER_FINAL 5
387
+ # define OSSL_FUNC_CIPHER_CIPHER 6
388
+ # define OSSL_FUNC_CIPHER_FREECTX 7
389
+ # define OSSL_FUNC_CIPHER_DUPCTX 8
390
+ # define OSSL_FUNC_CIPHER_GET_PARAMS 9
391
+ # define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10
392
+ # define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11
393
+ # define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
394
+ # define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
395
+ # define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
396
+ # define OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT 15
397
+ # define OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT 16
398
+ # define OSSL_FUNC_CIPHER_PIPELINE_UPDATE 17
399
+ # define OSSL_FUNC_CIPHER_PIPELINE_FINAL 18
400
+ # define OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT 19
401
+ # define OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT 20
402
+
403
+ OSSL_CORE_MAKE_FUNC(void *, cipher_newctx, (void *provctx))
404
+ OSSL_CORE_MAKE_FUNC(int, cipher_encrypt_init, (void *cctx,
405
+ const unsigned char *key,
406
+ size_t keylen,
407
+ const unsigned char *iv,
408
+ size_t ivlen,
409
+ const OSSL_PARAM params[]))
410
+ OSSL_CORE_MAKE_FUNC(int, cipher_decrypt_init, (void *cctx,
411
+ const unsigned char *key,
412
+ size_t keylen,
413
+ const unsigned char *iv,
414
+ size_t ivlen,
415
+ const OSSL_PARAM params[]))
416
+ OSSL_CORE_MAKE_FUNC(int, cipher_update,
417
+ (void *cctx,
418
+ unsigned char *out, size_t *outl, size_t outsize,
419
+ const unsigned char *in, size_t inl))
420
+ OSSL_CORE_MAKE_FUNC(int, cipher_final,
421
+ (void *cctx,
422
+ unsigned char *out, size_t *outl, size_t outsize))
423
+ OSSL_CORE_MAKE_FUNC(int, cipher_cipher,
424
+ (void *cctx,
425
+ unsigned char *out, size_t *outl, size_t outsize,
426
+ const unsigned char *in, size_t inl))
427
+ OSSL_CORE_MAKE_FUNC(int, cipher_pipeline_encrypt_init,
428
+ (void *cctx,
429
+ const unsigned char *key, size_t keylen,
430
+ size_t numpipes, const unsigned char **iv, size_t ivlen,
431
+ const OSSL_PARAM params[]))
432
+ OSSL_CORE_MAKE_FUNC(int, cipher_pipeline_decrypt_init,
433
+ (void *cctx,
434
+ const unsigned char *key, size_t keylen,
435
+ size_t numpipes, const unsigned char **iv, size_t ivlen,
436
+ const OSSL_PARAM params[]))
437
+ OSSL_CORE_MAKE_FUNC(int, cipher_pipeline_update,
438
+ (void *cctx, size_t numpipes,
439
+ unsigned char **out, size_t *outl, const size_t *outsize,
440
+ const unsigned char **in, const size_t *inl))
441
+ OSSL_CORE_MAKE_FUNC(int, cipher_pipeline_final,
442
+ (void *cctx, size_t numpipes,
443
+ unsigned char **out, size_t *outl, const size_t *outsize))
444
+ OSSL_CORE_MAKE_FUNC(void, cipher_freectx, (void *cctx))
445
+ OSSL_CORE_MAKE_FUNC(void *, cipher_dupctx, (void *cctx))
446
+ OSSL_CORE_MAKE_FUNC(int, cipher_get_params, (OSSL_PARAM params[]))
447
+ OSSL_CORE_MAKE_FUNC(int, cipher_get_ctx_params, (void *cctx,
448
+ OSSL_PARAM params[]))
449
+ OSSL_CORE_MAKE_FUNC(int, cipher_set_ctx_params, (void *cctx,
450
+ const OSSL_PARAM params[]))
451
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_params,
452
+ (void *provctx))
453
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_settable_ctx_params,
454
+ (void *cctx, void *provctx))
455
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_ctx_params,
456
+ (void *cctx, void *provctx))
457
+ OSSL_CORE_MAKE_FUNC(int, cipher_encrypt_skey_init, (void *cctx,
458
+ void *skeydata,
459
+ const unsigned char *iv,
460
+ size_t ivlen,
461
+ const OSSL_PARAM params[]))
462
+ OSSL_CORE_MAKE_FUNC(int, cipher_decrypt_skey_init, (void *cctx,
463
+ void *skeydata,
464
+ const unsigned char *iv,
465
+ size_t ivlen,
466
+ const OSSL_PARAM params[]))
467
+
468
+ /* MACs */
469
+
470
+ # define OSSL_FUNC_MAC_NEWCTX 1
471
+ # define OSSL_FUNC_MAC_DUPCTX 2
472
+ # define OSSL_FUNC_MAC_FREECTX 3
473
+ # define OSSL_FUNC_MAC_INIT 4
474
+ # define OSSL_FUNC_MAC_UPDATE 5
475
+ # define OSSL_FUNC_MAC_FINAL 6
476
+ # define OSSL_FUNC_MAC_GET_PARAMS 7
477
+ # define OSSL_FUNC_MAC_GET_CTX_PARAMS 8
478
+ # define OSSL_FUNC_MAC_SET_CTX_PARAMS 9
479
+ # define OSSL_FUNC_MAC_GETTABLE_PARAMS 10
480
+ # define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS 11
481
+ # define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS 12
482
+ # define OSSL_FUNC_MAC_INIT_SKEY 13
483
+
484
+ OSSL_CORE_MAKE_FUNC(void *, mac_newctx, (void *provctx))
485
+ OSSL_CORE_MAKE_FUNC(void *, mac_dupctx, (void *src))
486
+ OSSL_CORE_MAKE_FUNC(void, mac_freectx, (void *mctx))
487
+ OSSL_CORE_MAKE_FUNC(int, mac_init, (void *mctx, const unsigned char *key,
488
+ size_t keylen, const OSSL_PARAM params[]))
489
+ OSSL_CORE_MAKE_FUNC(int, mac_update,
490
+ (void *mctx, const unsigned char *in, size_t inl))
491
+ OSSL_CORE_MAKE_FUNC(int, mac_final,
492
+ (void *mctx,
493
+ unsigned char *out, size_t *outl, size_t outsize))
494
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_params, (void *provctx))
495
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_ctx_params,
496
+ (void *mctx, void *provctx))
497
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_settable_ctx_params,
498
+ (void *mctx, void *provctx))
499
+ OSSL_CORE_MAKE_FUNC(int, mac_get_params, (OSSL_PARAM params[]))
500
+ OSSL_CORE_MAKE_FUNC(int, mac_get_ctx_params,
501
+ (void *mctx, OSSL_PARAM params[]))
502
+ OSSL_CORE_MAKE_FUNC(int, mac_set_ctx_params,
503
+ (void *mctx, const OSSL_PARAM params[]))
504
+ OSSL_CORE_MAKE_FUNC(int, mac_init_skey, (void *mctx, void *key, const OSSL_PARAM params[]))
505
+
506
+ /* KDFs and PRFs */
507
+
508
+ # define OSSL_FUNC_KDF_NEWCTX 1
509
+ # define OSSL_FUNC_KDF_DUPCTX 2
510
+ # define OSSL_FUNC_KDF_FREECTX 3
511
+ # define OSSL_FUNC_KDF_RESET 4
512
+ # define OSSL_FUNC_KDF_DERIVE 5
513
+ # define OSSL_FUNC_KDF_GETTABLE_PARAMS 6
514
+ # define OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 7
515
+ # define OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 8
516
+ # define OSSL_FUNC_KDF_GET_PARAMS 9
517
+ # define OSSL_FUNC_KDF_GET_CTX_PARAMS 10
518
+ # define OSSL_FUNC_KDF_SET_CTX_PARAMS 11
519
+
520
+ OSSL_CORE_MAKE_FUNC(void *, kdf_newctx, (void *provctx))
521
+ OSSL_CORE_MAKE_FUNC(void *, kdf_dupctx, (void *src))
522
+ OSSL_CORE_MAKE_FUNC(void, kdf_freectx, (void *kctx))
523
+ OSSL_CORE_MAKE_FUNC(void, kdf_reset, (void *kctx))
524
+ OSSL_CORE_MAKE_FUNC(int, kdf_derive, (void *kctx, unsigned char *key,
525
+ size_t keylen, const OSSL_PARAM params[]))
526
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_params, (void *provctx))
527
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_ctx_params,
528
+ (void *kctx, void *provctx))
529
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_settable_ctx_params,
530
+ (void *kctx, void *provctx))
531
+ OSSL_CORE_MAKE_FUNC(int, kdf_get_params, (OSSL_PARAM params[]))
532
+ OSSL_CORE_MAKE_FUNC(int, kdf_get_ctx_params,
533
+ (void *kctx, OSSL_PARAM params[]))
534
+ OSSL_CORE_MAKE_FUNC(int, kdf_set_ctx_params,
535
+ (void *kctx, const OSSL_PARAM params[]))
536
+
537
+ /* RAND */
538
+
539
+ # define OSSL_FUNC_RAND_NEWCTX 1
540
+ # define OSSL_FUNC_RAND_FREECTX 2
541
+ # define OSSL_FUNC_RAND_INSTANTIATE 3
542
+ # define OSSL_FUNC_RAND_UNINSTANTIATE 4
543
+ # define OSSL_FUNC_RAND_GENERATE 5
544
+ # define OSSL_FUNC_RAND_RESEED 6
545
+ # define OSSL_FUNC_RAND_NONCE 7
546
+ # define OSSL_FUNC_RAND_ENABLE_LOCKING 8
547
+ # define OSSL_FUNC_RAND_LOCK 9
548
+ # define OSSL_FUNC_RAND_UNLOCK 10
549
+ # define OSSL_FUNC_RAND_GETTABLE_PARAMS 11
550
+ # define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS 12
551
+ # define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS 13
552
+ # define OSSL_FUNC_RAND_GET_PARAMS 14
553
+ # define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
554
+ # define OSSL_FUNC_RAND_SET_CTX_PARAMS 16
555
+ # define OSSL_FUNC_RAND_VERIFY_ZEROIZATION 17
556
+ # define OSSL_FUNC_RAND_GET_SEED 18
557
+ # define OSSL_FUNC_RAND_CLEAR_SEED 19
558
+
559
+ OSSL_CORE_MAKE_FUNC(void *,rand_newctx,
560
+ (void *provctx, void *parent,
561
+ const OSSL_DISPATCH *parent_calls))
562
+ OSSL_CORE_MAKE_FUNC(void,rand_freectx, (void *vctx))
563
+ OSSL_CORE_MAKE_FUNC(int,rand_instantiate,
564
+ (void *vdrbg, unsigned int strength,
565
+ int prediction_resistance,
566
+ const unsigned char *pstr, size_t pstr_len,
567
+ const OSSL_PARAM params[]))
568
+ OSSL_CORE_MAKE_FUNC(int,rand_uninstantiate, (void *vdrbg))
569
+ OSSL_CORE_MAKE_FUNC(int,rand_generate,
570
+ (void *vctx, unsigned char *out, size_t outlen,
571
+ unsigned int strength, int prediction_resistance,
572
+ const unsigned char *addin, size_t addin_len))
573
+ OSSL_CORE_MAKE_FUNC(int,rand_reseed,
574
+ (void *vctx, int prediction_resistance,
575
+ const unsigned char *ent, size_t ent_len,
576
+ const unsigned char *addin, size_t addin_len))
577
+ OSSL_CORE_MAKE_FUNC(size_t,rand_nonce,
578
+ (void *vctx, unsigned char *out, unsigned int strength,
579
+ size_t min_noncelen, size_t max_noncelen))
580
+ OSSL_CORE_MAKE_FUNC(int,rand_enable_locking, (void *vctx))
581
+ OSSL_CORE_MAKE_FUNC(int,rand_lock, (void *vctx))
582
+ OSSL_CORE_MAKE_FUNC(void,rand_unlock, (void *vctx))
583
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_gettable_params, (void *provctx))
584
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_gettable_ctx_params,
585
+ (void *vctx, void *provctx))
586
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_settable_ctx_params,
587
+ (void *vctx, void *provctx))
588
+ OSSL_CORE_MAKE_FUNC(int,rand_get_params, (OSSL_PARAM params[]))
589
+ OSSL_CORE_MAKE_FUNC(int,rand_get_ctx_params,
590
+ (void *vctx, OSSL_PARAM params[]))
591
+ OSSL_CORE_MAKE_FUNC(int,rand_set_ctx_params,
592
+ (void *vctx, const OSSL_PARAM params[]))
593
+ OSSL_CORE_MAKE_FUNC(void,rand_set_callbacks,
594
+ (void *vctx, OSSL_INOUT_CALLBACK *get_entropy,
595
+ OSSL_CALLBACK *cleanup_entropy,
596
+ OSSL_INOUT_CALLBACK *get_nonce,
597
+ OSSL_CALLBACK *cleanup_nonce, void *arg))
598
+ OSSL_CORE_MAKE_FUNC(int,rand_verify_zeroization,
599
+ (void *vctx))
600
+ OSSL_CORE_MAKE_FUNC(size_t,rand_get_seed,
601
+ (void *vctx, unsigned char **buffer,
602
+ int entropy, size_t min_len, size_t max_len,
603
+ int prediction_resistance,
604
+ const unsigned char *adin, size_t adin_len))
605
+ OSSL_CORE_MAKE_FUNC(void,rand_clear_seed,
606
+ (void *vctx, unsigned char *buffer, size_t b_len))
607
+
608
+ /*-
609
+ * Key management
610
+ *
611
+ * The Key Management takes care of provider side key objects, and includes
612
+ * all current functionality to create them, destroy them, set parameters
613
+ * and key material, etc, essentially everything that manipulates the keys
614
+ * themselves and their parameters.
615
+ *
616
+ * The key objects are commonly referred to as |keydata|, and it MUST be able
617
+ * to contain parameters if the key has any, the public key and the private
618
+ * key. All parts are optional, but their presence determines what can be
619
+ * done with the key object in terms of encryption, signature, and so on.
620
+ * The assumption from libcrypto is that the key object contains any of the
621
+ * following data combinations:
622
+ *
623
+ * - parameters only
624
+ * - public key only
625
+ * - public key + private key
626
+ * - parameters + public key
627
+ * - parameters + public key + private key
628
+ *
629
+ * What "parameters", "public key" and "private key" means in detail is left
630
+ * to the implementation. In the case of DH and DSA, they would typically
631
+ * include domain parameters, while for certain variants of RSA, they would
632
+ * typically include PSS or OAEP parameters.
633
+ *
634
+ * Key objects are created with OSSL_FUNC_keymgmt_new() and destroyed with
635
+ * OSSL_FUNC_keymgmt_free(). Key objects can have data filled in with
636
+ * OSSL_FUNC_keymgmt_import().
637
+ *
638
+ * Three functions are made available to check what selection of data is
639
+ * present in a key object: OSSL_FUNC_keymgmt_has_parameters(),
640
+ * OSSL_FUNC_keymgmt_has_public_key(), and OSSL_FUNC_keymgmt_has_private_key(),
641
+ */
642
+
643
+ /* Key data subset selection - individual bits */
644
+ # define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
645
+ # define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
646
+ # define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
647
+ # define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
648
+
649
+ /* Key data subset selection - combinations */
650
+ # define OSSL_KEYMGMT_SELECT_ALL_PARAMETERS \
651
+ ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
652
+ | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
653
+ # define OSSL_KEYMGMT_SELECT_KEYPAIR \
654
+ ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
655
+ # define OSSL_KEYMGMT_SELECT_ALL \
656
+ ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
657
+
658
+ # define OSSL_KEYMGMT_VALIDATE_FULL_CHECK 0
659
+ # define OSSL_KEYMGMT_VALIDATE_QUICK_CHECK 1
660
+
661
+ /* Basic key object creation */
662
+ # define OSSL_FUNC_KEYMGMT_NEW 1
663
+ OSSL_CORE_MAKE_FUNC(void *, keymgmt_new, (void *provctx))
664
+
665
+ /* Generation, a more complex constructor */
666
+ # define OSSL_FUNC_KEYMGMT_GEN_INIT 2
667
+ # define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE 3
668
+ # define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS 4
669
+ # define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS 5
670
+ # define OSSL_FUNC_KEYMGMT_GEN 6
671
+ # define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 7
672
+ # define OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS 15
673
+ # define OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS 16
674
+
675
+ OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen_init,
676
+ (void *provctx, int selection, const OSSL_PARAM params[]))
677
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_template,
678
+ (void *genctx, void *templ))
679
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_params,
680
+ (void *genctx, const OSSL_PARAM params[]))
681
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
682
+ keymgmt_gen_settable_params,
683
+ (void *genctx, void *provctx))
684
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_get_params,
685
+ (void *genctx, OSSL_PARAM params[]))
686
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_gen_gettable_params,
687
+ (void *genctx, void *provctx))
688
+ OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen,
689
+ (void *genctx, OSSL_CALLBACK *cb, void *cbarg))
690
+ OSSL_CORE_MAKE_FUNC(void, keymgmt_gen_cleanup, (void *genctx))
691
+
692
+ /* Key loading by object reference */
693
+ # define OSSL_FUNC_KEYMGMT_LOAD 8
694
+ OSSL_CORE_MAKE_FUNC(void *, keymgmt_load,
695
+ (const void *reference, size_t reference_sz))
696
+
697
+ /* Basic key object destruction */
698
+ # define OSSL_FUNC_KEYMGMT_FREE 10
699
+ OSSL_CORE_MAKE_FUNC(void, keymgmt_free, (void *keydata))
700
+
701
+ /* Key object information, with discovery */
702
+ #define OSSL_FUNC_KEYMGMT_GET_PARAMS 11
703
+ #define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS 12
704
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_get_params,
705
+ (void *keydata, OSSL_PARAM params[]))
706
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_gettable_params,
707
+ (void *provctx))
708
+
709
+ #define OSSL_FUNC_KEYMGMT_SET_PARAMS 13
710
+ #define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS 14
711
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_set_params,
712
+ (void *keydata, const OSSL_PARAM params[]))
713
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_settable_params,
714
+ (void *provctx))
715
+
716
+ /* Key checks - discovery of supported operations */
717
+ # define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20
718
+ OSSL_CORE_MAKE_FUNC(const char *, keymgmt_query_operation_name,
719
+ (int operation_id))
720
+
721
+ /* Key checks - key data content checks */
722
+ # define OSSL_FUNC_KEYMGMT_HAS 21
723
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_has, (const void *keydata, int selection))
724
+
725
+ /* Key checks - validation */
726
+ # define OSSL_FUNC_KEYMGMT_VALIDATE 22
727
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_validate, (const void *keydata, int selection,
728
+ int checktype))
729
+
730
+ /* Key checks - matching */
731
+ # define OSSL_FUNC_KEYMGMT_MATCH 23
732
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_match,
733
+ (const void *keydata1, const void *keydata2,
734
+ int selection))
735
+
736
+ /* Import and export functions, with discovery */
737
+ # define OSSL_FUNC_KEYMGMT_IMPORT 40
738
+ # define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41
739
+ # define OSSL_FUNC_KEYMGMT_EXPORT 42
740
+ # define OSSL_FUNC_KEYMGMT_EXPORT_TYPES 43
741
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_import,
742
+ (void *keydata, int selection, const OSSL_PARAM params[]))
743
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_import_types,
744
+ (int selection))
745
+ OSSL_CORE_MAKE_FUNC(int, keymgmt_export,
746
+ (void *keydata, int selection,
747
+ OSSL_CALLBACK *param_cb, void *cbarg))
748
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_export_types,
749
+ (int selection))
750
+
751
+ /* Dup function, constructor */
752
+ # define OSSL_FUNC_KEYMGMT_DUP 44
753
+ OSSL_CORE_MAKE_FUNC(void *, keymgmt_dup,
754
+ (const void *keydata_from, int selection))
755
+
756
+ /* Extended import and export functions */
757
+ # define OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX 45
758
+ # define OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX 46
759
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_import_types_ex,
760
+ (void *provctx, int selection))
761
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_export_types_ex,
762
+ (void *provctx, int selection))
763
+
764
+ /* Key Exchange */
765
+
766
+ # define OSSL_FUNC_KEYEXCH_NEWCTX 1
767
+ # define OSSL_FUNC_KEYEXCH_INIT 2
768
+ # define OSSL_FUNC_KEYEXCH_DERIVE 3
769
+ # define OSSL_FUNC_KEYEXCH_SET_PEER 4
770
+ # define OSSL_FUNC_KEYEXCH_FREECTX 5
771
+ # define OSSL_FUNC_KEYEXCH_DUPCTX 6
772
+ # define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS 7
773
+ # define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8
774
+ # define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS 9
775
+ # define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS 10
776
+
777
+ OSSL_CORE_MAKE_FUNC(void *, keyexch_newctx, (void *provctx))
778
+ OSSL_CORE_MAKE_FUNC(int, keyexch_init, (void *ctx, void *provkey,
779
+ const OSSL_PARAM params[]))
780
+ OSSL_CORE_MAKE_FUNC(int, keyexch_derive, (void *ctx, unsigned char *secret,
781
+ size_t *secretlen, size_t outlen))
782
+ OSSL_CORE_MAKE_FUNC(int, keyexch_set_peer, (void *ctx, void *provkey))
783
+ OSSL_CORE_MAKE_FUNC(void, keyexch_freectx, (void *ctx))
784
+ OSSL_CORE_MAKE_FUNC(void *, keyexch_dupctx, (void *ctx))
785
+ OSSL_CORE_MAKE_FUNC(int, keyexch_set_ctx_params, (void *ctx,
786
+ const OSSL_PARAM params[]))
787
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_settable_ctx_params,
788
+ (void *ctx, void *provctx))
789
+ OSSL_CORE_MAKE_FUNC(int, keyexch_get_ctx_params, (void *ctx,
790
+ OSSL_PARAM params[]))
791
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_gettable_ctx_params,
792
+ (void *ctx, void *provctx))
793
+
794
+ /* Signature */
795
+
796
+ # define OSSL_FUNC_SIGNATURE_NEWCTX 1
797
+ # define OSSL_FUNC_SIGNATURE_SIGN_INIT 2
798
+ # define OSSL_FUNC_SIGNATURE_SIGN 3
799
+ # define OSSL_FUNC_SIGNATURE_VERIFY_INIT 4
800
+ # define OSSL_FUNC_SIGNATURE_VERIFY 5
801
+ # define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT 6
802
+ # define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER 7
803
+ # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8
804
+ # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9
805
+ # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10
806
+ # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN 11
807
+ # define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 12
808
+ # define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 13
809
+ # define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 14
810
+ # define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY 15
811
+ # define OSSL_FUNC_SIGNATURE_FREECTX 16
812
+ # define OSSL_FUNC_SIGNATURE_DUPCTX 17
813
+ # define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 18
814
+ # define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 19
815
+ # define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 20
816
+ # define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 21
817
+ # define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 22
818
+ # define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
819
+ # define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24
820
+ # define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
821
+ # define OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES 26
822
+ # define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT 27
823
+ # define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE 28
824
+ # define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL 29
825
+ # define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT 30
826
+ # define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE 31
827
+ # define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL 32
828
+
829
+ OSSL_CORE_MAKE_FUNC(void *, signature_newctx, (void *provctx,
830
+ const char *propq))
831
+ OSSL_CORE_MAKE_FUNC(int, signature_sign_init, (void *ctx, void *provkey,
832
+ const OSSL_PARAM params[]))
833
+ OSSL_CORE_MAKE_FUNC(int, signature_sign, (void *ctx, unsigned char *sig,
834
+ size_t *siglen, size_t sigsize,
835
+ const unsigned char *tbs,
836
+ size_t tbslen))
837
+ OSSL_CORE_MAKE_FUNC(int, signature_sign_message_init,
838
+ (void *ctx, void *provkey, const OSSL_PARAM params[]))
839
+ OSSL_CORE_MAKE_FUNC(int, signature_sign_message_update,
840
+ (void *ctx, const unsigned char *in, size_t inlen))
841
+ OSSL_CORE_MAKE_FUNC(int, signature_sign_message_final,
842
+ (void *ctx, unsigned char *sig,
843
+ size_t *siglen, size_t sigsize))
844
+ OSSL_CORE_MAKE_FUNC(int, signature_verify_init, (void *ctx, void *provkey,
845
+ const OSSL_PARAM params[]))
846
+ OSSL_CORE_MAKE_FUNC(int, signature_verify, (void *ctx,
847
+ const unsigned char *sig,
848
+ size_t siglen,
849
+ const unsigned char *tbs,
850
+ size_t tbslen))
851
+ OSSL_CORE_MAKE_FUNC(int, signature_verify_message_init,
852
+ (void *ctx, void *provkey, const OSSL_PARAM params[]))
853
+ OSSL_CORE_MAKE_FUNC(int, signature_verify_message_update,
854
+ (void *ctx, const unsigned char *in, size_t inlen))
855
+ /*
856
+ * signature_verify_final requires that the signature to be verified against
857
+ * is specified via an OSSL_PARAM.
858
+ */
859
+ OSSL_CORE_MAKE_FUNC(int, signature_verify_message_final, (void *ctx))
860
+ OSSL_CORE_MAKE_FUNC(int, signature_verify_recover_init,
861
+ (void *ctx, void *provkey, const OSSL_PARAM params[]))
862
+ OSSL_CORE_MAKE_FUNC(int, signature_verify_recover,
863
+ (void *ctx, unsigned char *rout, size_t *routlen,
864
+ size_t routsize, const unsigned char *sig, size_t siglen))
865
+ OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_init,
866
+ (void *ctx, const char *mdname, void *provkey,
867
+ const OSSL_PARAM params[]))
868
+ OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_update,
869
+ (void *ctx, const unsigned char *data, size_t datalen))
870
+ OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_final,
871
+ (void *ctx, unsigned char *sig, size_t *siglen,
872
+ size_t sigsize))
873
+ OSSL_CORE_MAKE_FUNC(int, signature_digest_sign,
874
+ (void *ctx, unsigned char *sigret, size_t *siglen,
875
+ size_t sigsize, const unsigned char *tbs, size_t tbslen))
876
+ OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_init,
877
+ (void *ctx, const char *mdname, void *provkey,
878
+ const OSSL_PARAM params[]))
879
+ OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_update,
880
+ (void *ctx, const unsigned char *data, size_t datalen))
881
+ OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_final,
882
+ (void *ctx, const unsigned char *sig, size_t siglen))
883
+ OSSL_CORE_MAKE_FUNC(int, signature_digest_verify,
884
+ (void *ctx, const unsigned char *sig, size_t siglen,
885
+ const unsigned char *tbs, size_t tbslen))
886
+ OSSL_CORE_MAKE_FUNC(void, signature_freectx, (void *ctx))
887
+ OSSL_CORE_MAKE_FUNC(void *, signature_dupctx, (void *ctx))
888
+ OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_params,
889
+ (void *ctx, OSSL_PARAM params[]))
890
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_params,
891
+ (void *ctx, void *provctx))
892
+ OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_params,
893
+ (void *ctx, const OSSL_PARAM params[]))
894
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_params,
895
+ (void *ctx, void *provctx))
896
+ OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_md_params,
897
+ (void *ctx, OSSL_PARAM params[]))
898
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_md_params,
899
+ (void *ctx))
900
+ OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_md_params,
901
+ (void *ctx, const OSSL_PARAM params[]))
902
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_md_params,
903
+ (void *ctx))
904
+ OSSL_CORE_MAKE_FUNC(const char **, signature_query_key_types, (void))
905
+
906
+ /*-
907
+ * Symmetric key management
908
+ *
909
+ * The Key Management takes care of provider side of symmetric key objects, and
910
+ * includes essentially everything that manipulates the keys themselves and
911
+ * their parameters.
912
+ *
913
+ * The key objects are commonly referred to as |keydata|, and it MUST be able
914
+ * to contain parameters if the key has any, and the secret key.
915
+ *
916
+ * Key objects are created with OSSL_FUNC_skeymgmt_import() (there is no
917
+ * dedicated memory allocation function), exported with
918
+ * OSSL_FUNC_skeymgmt_export() and destroyed with OSSL_FUNC_keymgmt_free().
919
+ *
920
+ */
921
+
922
+ /* Key data subset selection - individual bits */
923
+ # define OSSL_SKEYMGMT_SELECT_PARAMETERS 0x01
924
+ # define OSSL_SKEYMGMT_SELECT_SECRET_KEY 0x02
925
+
926
+ /* Key data subset selection - combinations */
927
+ # define OSSL_SKEYMGMT_SELECT_ALL \
928
+ (OSSL_SKEYMGMT_SELECT_PARAMETERS | OSSL_SKEYMGMT_SELECT_SECRET_KEY)
929
+
930
+ # define OSSL_FUNC_SKEYMGMT_FREE 1
931
+ # define OSSL_FUNC_SKEYMGMT_IMPORT 2
932
+ # define OSSL_FUNC_SKEYMGMT_EXPORT 3
933
+ # define OSSL_FUNC_SKEYMGMT_GENERATE 4
934
+ # define OSSL_FUNC_SKEYMGMT_GET_KEY_ID 5
935
+ # define OSSL_FUNC_SKEYMGMT_IMP_SETTABLE_PARAMS 6
936
+ # define OSSL_FUNC_SKEYMGMT_GEN_SETTABLE_PARAMS 7
937
+
938
+ OSSL_CORE_MAKE_FUNC(void, skeymgmt_free, (void *keydata))
939
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
940
+ skeymgmt_imp_settable_params, (void *provctx))
941
+ OSSL_CORE_MAKE_FUNC(void *, skeymgmt_import, (void *provctx, int selection,
942
+ const OSSL_PARAM params[]))
943
+ OSSL_CORE_MAKE_FUNC(int, skeymgmt_export,
944
+ (void *keydata, int selection,
945
+ OSSL_CALLBACK *param_cb, void *cbarg))
946
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
947
+ skeymgmt_gen_settable_params, (void *provctx))
948
+ OSSL_CORE_MAKE_FUNC(void *, skeymgmt_generate, (void *provctx,
949
+ const OSSL_PARAM params[]))
950
+ OSSL_CORE_MAKE_FUNC(const char *, skeymgmt_get_key_id, (void *keydata))
951
+
952
+ /* Asymmetric Ciphers */
953
+
954
+ # define OSSL_FUNC_ASYM_CIPHER_NEWCTX 1
955
+ # define OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT 2
956
+ # define OSSL_FUNC_ASYM_CIPHER_ENCRYPT 3
957
+ # define OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT 4
958
+ # define OSSL_FUNC_ASYM_CIPHER_DECRYPT 5
959
+ # define OSSL_FUNC_ASYM_CIPHER_FREECTX 6
960
+ # define OSSL_FUNC_ASYM_CIPHER_DUPCTX 7
961
+ # define OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS 8
962
+ # define OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS 9
963
+ # define OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS 10
964
+ # define OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS 11
965
+
966
+ OSSL_CORE_MAKE_FUNC(void *, asym_cipher_newctx, (void *provctx))
967
+ OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt_init, (void *ctx, void *provkey,
968
+ const OSSL_PARAM params[]))
969
+ OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt, (void *ctx, unsigned char *out,
970
+ size_t *outlen,
971
+ size_t outsize,
972
+ const unsigned char *in,
973
+ size_t inlen))
974
+ OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt_init, (void *ctx, void *provkey,
975
+ const OSSL_PARAM params[]))
976
+ OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt, (void *ctx, unsigned char *out,
977
+ size_t *outlen,
978
+ size_t outsize,
979
+ const unsigned char *in,
980
+ size_t inlen))
981
+ OSSL_CORE_MAKE_FUNC(void, asym_cipher_freectx, (void *ctx))
982
+ OSSL_CORE_MAKE_FUNC(void *, asym_cipher_dupctx, (void *ctx))
983
+ OSSL_CORE_MAKE_FUNC(int, asym_cipher_get_ctx_params,
984
+ (void *ctx, OSSL_PARAM params[]))
985
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_gettable_ctx_params,
986
+ (void *ctx, void *provctx))
987
+ OSSL_CORE_MAKE_FUNC(int, asym_cipher_set_ctx_params,
988
+ (void *ctx, const OSSL_PARAM params[]))
989
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_settable_ctx_params,
990
+ (void *ctx, void *provctx))
991
+
992
+ /* Asymmetric Key encapsulation */
993
+ # define OSSL_FUNC_KEM_NEWCTX 1
994
+ # define OSSL_FUNC_KEM_ENCAPSULATE_INIT 2
995
+ # define OSSL_FUNC_KEM_ENCAPSULATE 3
996
+ # define OSSL_FUNC_KEM_DECAPSULATE_INIT 4
997
+ # define OSSL_FUNC_KEM_DECAPSULATE 5
998
+ # define OSSL_FUNC_KEM_FREECTX 6
999
+ # define OSSL_FUNC_KEM_DUPCTX 7
1000
+ # define OSSL_FUNC_KEM_GET_CTX_PARAMS 8
1001
+ # define OSSL_FUNC_KEM_GETTABLE_CTX_PARAMS 9
1002
+ # define OSSL_FUNC_KEM_SET_CTX_PARAMS 10
1003
+ # define OSSL_FUNC_KEM_SETTABLE_CTX_PARAMS 11
1004
+ # define OSSL_FUNC_KEM_AUTH_ENCAPSULATE_INIT 12
1005
+ # define OSSL_FUNC_KEM_AUTH_DECAPSULATE_INIT 13
1006
+
1007
+ OSSL_CORE_MAKE_FUNC(void *, kem_newctx, (void *provctx))
1008
+ OSSL_CORE_MAKE_FUNC(int, kem_encapsulate_init, (void *ctx, void *provkey,
1009
+ const OSSL_PARAM params[]))
1010
+ OSSL_CORE_MAKE_FUNC(int, kem_auth_encapsulate_init, (void *ctx, void *provkey,
1011
+ void *authprivkey,
1012
+ const OSSL_PARAM params[]))
1013
+ OSSL_CORE_MAKE_FUNC(int, kem_encapsulate, (void *ctx,
1014
+ unsigned char *out, size_t *outlen,
1015
+ unsigned char *secret,
1016
+ size_t *secretlen))
1017
+ OSSL_CORE_MAKE_FUNC(int, kem_decapsulate_init, (void *ctx, void *provkey,
1018
+ const OSSL_PARAM params[]))
1019
+ OSSL_CORE_MAKE_FUNC(int, kem_auth_decapsulate_init, (void *ctx, void *provkey,
1020
+ void *authpubkey,
1021
+ const OSSL_PARAM params[]))
1022
+ OSSL_CORE_MAKE_FUNC(int, kem_decapsulate, (void *ctx,
1023
+ unsigned char *out, size_t *outlen,
1024
+ const unsigned char *in, size_t inlen))
1025
+ OSSL_CORE_MAKE_FUNC(void, kem_freectx, (void *ctx))
1026
+ OSSL_CORE_MAKE_FUNC(void *, kem_dupctx, (void *ctx))
1027
+ OSSL_CORE_MAKE_FUNC(int, kem_get_ctx_params, (void *ctx, OSSL_PARAM params[]))
1028
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kem_gettable_ctx_params,
1029
+ (void *ctx, void *provctx))
1030
+ OSSL_CORE_MAKE_FUNC(int, kem_set_ctx_params,
1031
+ (void *ctx, const OSSL_PARAM params[]))
1032
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kem_settable_ctx_params,
1033
+ (void *ctx, void *provctx))
1034
+
1035
+ /* Encoders and decoders */
1036
+ # define OSSL_FUNC_ENCODER_NEWCTX 1
1037
+ # define OSSL_FUNC_ENCODER_FREECTX 2
1038
+ # define OSSL_FUNC_ENCODER_GET_PARAMS 3
1039
+ # define OSSL_FUNC_ENCODER_GETTABLE_PARAMS 4
1040
+ # define OSSL_FUNC_ENCODER_SET_CTX_PARAMS 5
1041
+ # define OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS 6
1042
+ # define OSSL_FUNC_ENCODER_DOES_SELECTION 10
1043
+ # define OSSL_FUNC_ENCODER_ENCODE 11
1044
+ # define OSSL_FUNC_ENCODER_IMPORT_OBJECT 20
1045
+ # define OSSL_FUNC_ENCODER_FREE_OBJECT 21
1046
+ OSSL_CORE_MAKE_FUNC(void *, encoder_newctx, (void *provctx))
1047
+ OSSL_CORE_MAKE_FUNC(void, encoder_freectx, (void *ctx))
1048
+ OSSL_CORE_MAKE_FUNC(int, encoder_get_params, (OSSL_PARAM params[]))
1049
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, encoder_gettable_params,
1050
+ (void *provctx))
1051
+ OSSL_CORE_MAKE_FUNC(int, encoder_set_ctx_params,
1052
+ (void *ctx, const OSSL_PARAM params[]))
1053
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, encoder_settable_ctx_params,
1054
+ (void *provctx))
1055
+
1056
+ OSSL_CORE_MAKE_FUNC(int, encoder_does_selection,
1057
+ (void *provctx, int selection))
1058
+ OSSL_CORE_MAKE_FUNC(int, encoder_encode,
1059
+ (void *ctx, OSSL_CORE_BIO *out,
1060
+ const void *obj_raw, const OSSL_PARAM obj_abstract[],
1061
+ int selection,
1062
+ OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
1063
+
1064
+ OSSL_CORE_MAKE_FUNC(void *, encoder_import_object,
1065
+ (void *ctx, int selection, const OSSL_PARAM params[]))
1066
+ OSSL_CORE_MAKE_FUNC(void, encoder_free_object, (void *obj))
1067
+
1068
+ # define OSSL_FUNC_DECODER_NEWCTX 1
1069
+ # define OSSL_FUNC_DECODER_FREECTX 2
1070
+ # define OSSL_FUNC_DECODER_GET_PARAMS 3
1071
+ # define OSSL_FUNC_DECODER_GETTABLE_PARAMS 4
1072
+ # define OSSL_FUNC_DECODER_SET_CTX_PARAMS 5
1073
+ # define OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS 6
1074
+ # define OSSL_FUNC_DECODER_DOES_SELECTION 10
1075
+ # define OSSL_FUNC_DECODER_DECODE 11
1076
+ # define OSSL_FUNC_DECODER_EXPORT_OBJECT 20
1077
+ OSSL_CORE_MAKE_FUNC(void *, decoder_newctx, (void *provctx))
1078
+ OSSL_CORE_MAKE_FUNC(void, decoder_freectx, (void *ctx))
1079
+ OSSL_CORE_MAKE_FUNC(int, decoder_get_params, (OSSL_PARAM params[]))
1080
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, decoder_gettable_params,
1081
+ (void *provctx))
1082
+ OSSL_CORE_MAKE_FUNC(int, decoder_set_ctx_params,
1083
+ (void *ctx, const OSSL_PARAM params[]))
1084
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, decoder_settable_ctx_params,
1085
+ (void *provctx))
1086
+
1087
+ OSSL_CORE_MAKE_FUNC(int, decoder_does_selection,
1088
+ (void *provctx, int selection))
1089
+ OSSL_CORE_MAKE_FUNC(int, decoder_decode,
1090
+ (void *ctx, OSSL_CORE_BIO *in, int selection,
1091
+ OSSL_CALLBACK *data_cb, void *data_cbarg,
1092
+ OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg))
1093
+ OSSL_CORE_MAKE_FUNC(int, decoder_export_object,
1094
+ (void *ctx, const void *objref, size_t objref_sz,
1095
+ OSSL_CALLBACK *export_cb, void *export_cbarg))
1096
+
1097
+ /*-
1098
+ * Store
1099
+ *
1100
+ * Objects are scanned by using the 'open', 'load', 'eof' and 'close'
1101
+ * functions, which implement an OSSL_STORE loader.
1102
+ *
1103
+ * store_load() works in a way that's very similar to the decoders, in
1104
+ * that they pass an abstract object through a callback, either as a DER
1105
+ * octet string or as an object reference, which libcrypto will have to
1106
+ * deal with.
1107
+ */
1108
+
1109
+ #define OSSL_FUNC_STORE_OPEN 1
1110
+ #define OSSL_FUNC_STORE_ATTACH 2
1111
+ #define OSSL_FUNC_STORE_SETTABLE_CTX_PARAMS 3
1112
+ #define OSSL_FUNC_STORE_SET_CTX_PARAMS 4
1113
+ #define OSSL_FUNC_STORE_LOAD 5
1114
+ #define OSSL_FUNC_STORE_EOF 6
1115
+ #define OSSL_FUNC_STORE_CLOSE 7
1116
+ #define OSSL_FUNC_STORE_EXPORT_OBJECT 8
1117
+ #define OSSL_FUNC_STORE_DELETE 9
1118
+ #define OSSL_FUNC_STORE_OPEN_EX 10
1119
+ OSSL_CORE_MAKE_FUNC(void *, store_open, (void *provctx, const char *uri))
1120
+ OSSL_CORE_MAKE_FUNC(void *, store_attach, (void *provctx, OSSL_CORE_BIO *in))
1121
+ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, store_settable_ctx_params,
1122
+ (void *provctx))
1123
+ OSSL_CORE_MAKE_FUNC(int, store_set_ctx_params,
1124
+ (void *loaderctx, const OSSL_PARAM params[]))
1125
+ OSSL_CORE_MAKE_FUNC(int, store_load,
1126
+ (void *loaderctx,
1127
+ OSSL_CALLBACK *object_cb, void *object_cbarg,
1128
+ OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg))
1129
+ OSSL_CORE_MAKE_FUNC(int, store_eof, (void *loaderctx))
1130
+ OSSL_CORE_MAKE_FUNC(int, store_close, (void *loaderctx))
1131
+ OSSL_CORE_MAKE_FUNC(int, store_export_object,
1132
+ (void *loaderctx, const void *objref, size_t objref_sz,
1133
+ OSSL_CALLBACK *export_cb, void *export_cbarg))
1134
+ OSSL_CORE_MAKE_FUNC(int, store_delete,
1135
+ (void *provctx, const char *uri, const OSSL_PARAM params[],
1136
+ OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg))
1137
+ OSSL_CORE_MAKE_FUNC(void *, store_open_ex,
1138
+ (void *provctx, const char *uri, const OSSL_PARAM params[],
1139
+ OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg))
1140
+
1141
+ # ifdef __cplusplus
1142
+ }
1143
+ # endif
1144
+
1145
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/core_object.h ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2020-2021 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
+ #ifndef OPENSSL_CORE_OBJECT_H
11
+ # define OPENSSL_CORE_OBJECT_H
12
+ # pragma once
13
+
14
+ # ifdef __cplusplus
15
+ extern "C" {
16
+ # endif
17
+
18
+ /*-
19
+ * Known object types
20
+ *
21
+ * These numbers are used as values for the OSSL_PARAM parameter
22
+ * OSSL_OBJECT_PARAM_TYPE.
23
+ *
24
+ * For most of these types, there's a corresponding libcrypto object type.
25
+ * The corresponding type is indicated with a comment after the number.
26
+ */
27
+ # define OSSL_OBJECT_UNKNOWN 0
28
+ # define OSSL_OBJECT_NAME 1 /* char * */
29
+ # define OSSL_OBJECT_PKEY 2 /* EVP_PKEY * */
30
+ # define OSSL_OBJECT_CERT 3 /* X509 * */
31
+ # define OSSL_OBJECT_CRL 4 /* X509_CRL * */
32
+
33
+ /*
34
+ * The rest of the associated OSSL_PARAM elements is described in core_names.h
35
+ */
36
+
37
+ # ifdef __cplusplus
38
+ }
39
+ # endif
40
+
41
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dsaerr.h ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Generated by util/mkerr.pl DO NOT EDIT
3
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
6
+ * this file except in compliance with the License. You can obtain a copy
7
+ * in the file LICENSE in the source distribution or at
8
+ * https://www.openssl.org/source/license.html
9
+ */
10
+
11
+ #ifndef OPENSSL_DSAERR_H
12
+ # define OPENSSL_DSAERR_H
13
+ # pragma once
14
+
15
+ # include <openssl/opensslconf.h>
16
+ # include <openssl/symhacks.h>
17
+ # include <openssl/cryptoerr_legacy.h>
18
+
19
+
20
+ # ifndef OPENSSL_NO_DSA
21
+
22
+
23
+ /*
24
+ * DSA reason codes.
25
+ */
26
+ # define DSA_R_BAD_FFC_PARAMETERS 114
27
+ # define DSA_R_BAD_Q_VALUE 102
28
+ # define DSA_R_BN_DECODE_ERROR 108
29
+ # define DSA_R_BN_ERROR 109
30
+ # define DSA_R_DECODE_ERROR 104
31
+ # define DSA_R_INVALID_DIGEST_TYPE 106
32
+ # define DSA_R_INVALID_PARAMETERS 112
33
+ # define DSA_R_MISSING_PARAMETERS 101
34
+ # define DSA_R_MISSING_PRIVATE_KEY 111
35
+ # define DSA_R_MODULUS_TOO_LARGE 103
36
+ # define DSA_R_NO_PARAMETERS_SET 107
37
+ # define DSA_R_PARAMETER_ENCODING_ERROR 105
38
+ # define DSA_R_P_NOT_PRIME 115
39
+ # define DSA_R_Q_NOT_PRIME 113
40
+ # define DSA_R_SEED_LEN_SMALL 110
41
+ # define DSA_R_TOO_MANY_RETRIES 116
42
+
43
+ # endif
44
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dtls1.h ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2005-2021 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
+ #ifndef OPENSSL_DTLS1_H
11
+ # define OPENSSL_DTLS1_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_DTLS1_H
17
+ # endif
18
+
19
+ # include <openssl/prov_ssl.h>
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ #include <openssl/opensslconf.h>
26
+
27
+ /* DTLS*_VERSION constants are defined in prov_ssl.h */
28
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
29
+ # define DTLS_MIN_VERSION DTLS1_VERSION
30
+ # define DTLS_MAX_VERSION DTLS1_2_VERSION
31
+ # endif
32
+ # define DTLS1_VERSION_MAJOR 0xFE
33
+
34
+ /* Special value for method supporting multiple versions */
35
+ # define DTLS_ANY_VERSION 0x1FFFF
36
+
37
+ /* lengths of messages */
38
+
39
+ # define DTLS1_COOKIE_LENGTH 255
40
+
41
+ # define DTLS1_RT_HEADER_LENGTH 13
42
+
43
+ # define DTLS1_HM_HEADER_LENGTH 12
44
+
45
+ # define DTLS1_HM_BAD_FRAGMENT -2
46
+ # define DTLS1_HM_FRAGMENT_RETRY -3
47
+
48
+ # define DTLS1_CCS_HEADER_LENGTH 1
49
+
50
+ # define DTLS1_AL_HEADER_LENGTH 2
51
+
52
+ # define DTLS1_TMO_ALERT_COUNT 12
53
+
54
+ #ifdef __cplusplus
55
+ }
56
+ #endif
57
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ecdh.h ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2002-2016 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
+ #include <openssl/ec.h>
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/encodererr.h ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Generated by util/mkerr.pl DO NOT EDIT
3
+ * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
6
+ * this file except in compliance with the License. You can obtain a copy
7
+ * in the file LICENSE in the source distribution or at
8
+ * https://www.openssl.org/source/license.html
9
+ */
10
+
11
+ #ifndef OPENSSL_ENCODERERR_H
12
+ # define OPENSSL_ENCODERERR_H
13
+ # pragma once
14
+
15
+ # include <openssl/opensslconf.h>
16
+ # include <openssl/symhacks.h>
17
+ # include <openssl/cryptoerr_legacy.h>
18
+
19
+
20
+
21
+ /*
22
+ * OSSL_ENCODER reason codes.
23
+ */
24
+ # define OSSL_ENCODER_R_ENCODER_NOT_FOUND 101
25
+ # define OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY 100
26
+ # define OSSL_ENCODER_R_MISSING_GET_PARAMS 102
27
+
28
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ess_no-asm.h ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/no-asm/include/openssl/ess.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/ess.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/ess.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/ess.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/ess.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/ess.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/ess.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ess.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ess.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/ess.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/ess.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ess.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/ess.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/ess.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/ess.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ess.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/ess.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/ess.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/ess.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/ess.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/ess.h"
48
+ #endif
49
+
50
+ /* GOST is not included in all platform */
51
+ #ifndef OPENSSL_NO_GOST
52
+ # define OPENSSL_NO_GOST
53
+ #endif
54
+ /* HW_PADLOCK is not included in all platform */
55
+ #ifndef OPENSSL_NO_HW_PADLOCK
56
+ # define OPENSSL_NO_HW_PADLOCK
57
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/evperr.h ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Generated by util/mkerr.pl DO NOT EDIT
3
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
6
+ * this file except in compliance with the License. You can obtain a copy
7
+ * in the file LICENSE in the source distribution or at
8
+ * https://www.openssl.org/source/license.html
9
+ */
10
+
11
+ #ifndef OPENSSL_EVPERR_H
12
+ # define OPENSSL_EVPERR_H
13
+ # pragma once
14
+
15
+ # include <openssl/opensslconf.h>
16
+ # include <openssl/symhacks.h>
17
+ # include <openssl/cryptoerr_legacy.h>
18
+
19
+
20
+
21
+ /*
22
+ * EVP reason codes.
23
+ */
24
+ # define EVP_R_AES_KEY_SETUP_FAILED 143
25
+ # define EVP_R_ARIA_KEY_SETUP_FAILED 176
26
+ # define EVP_R_BAD_ALGORITHM_NAME 200
27
+ # define EVP_R_BAD_DECRYPT 100
28
+ # define EVP_R_BAD_KEY_LENGTH 195
29
+ # define EVP_R_BUFFER_TOO_SMALL 155
30
+ # define EVP_R_CACHE_CONSTANTS_FAILED 225
31
+ # define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
32
+ # define EVP_R_CANNOT_GET_PARAMETERS 197
33
+ # define EVP_R_CANNOT_SET_PARAMETERS 198
34
+ # define EVP_R_CIPHER_NOT_GCM_MODE 184
35
+ # define EVP_R_CIPHER_PARAMETER_ERROR 122
36
+ # define EVP_R_COMMAND_NOT_SUPPORTED 147
37
+ # define EVP_R_CONFLICTING_ALGORITHM_NAME 201
38
+ # define EVP_R_COPY_ERROR 173
39
+ # define EVP_R_CTRL_NOT_IMPLEMENTED 132
40
+ # define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
41
+ # define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
42
+ # define EVP_R_DECODE_ERROR 114
43
+ # define EVP_R_DEFAULT_QUERY_PARSE_ERROR 210
44
+ # define EVP_R_DIFFERENT_KEY_TYPES 101
45
+ # define EVP_R_DIFFERENT_PARAMETERS 153
46
+ # define EVP_R_ERROR_LOADING_SECTION 165
47
+ # define EVP_R_EXPECTING_AN_HMAC_KEY 174
48
+ # define EVP_R_EXPECTING_AN_RSA_KEY 127
49
+ # define EVP_R_EXPECTING_A_DH_KEY 128
50
+ # define EVP_R_EXPECTING_A_DSA_KEY 129
51
+ # define EVP_R_EXPECTING_A_ECX_KEY 219
52
+ # define EVP_R_EXPECTING_A_EC_KEY 142
53
+ # define EVP_R_EXPECTING_A_POLY1305_KEY 164
54
+ # define EVP_R_EXPECTING_A_SIPHASH_KEY 175
55
+ # define EVP_R_FINAL_ERROR 188
56
+ # define EVP_R_GENERATE_ERROR 214
57
+ # define EVP_R_GETTING_ALGORITHMIDENTIFIER_NOT_SUPPORTED 229
58
+ # define EVP_R_GET_RAW_KEY_FAILED 182
59
+ # define EVP_R_ILLEGAL_SCRYPT_PARAMETERS 171
60
+ # define EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS 204
61
+ # define EVP_R_INACCESSIBLE_KEY 203
62
+ # define EVP_R_INITIALIZATION_ERROR 134
63
+ # define EVP_R_INPUT_NOT_INITIALIZED 111
64
+ # define EVP_R_INVALID_CUSTOM_LENGTH 185
65
+ # define EVP_R_INVALID_DIGEST 152
66
+ # define EVP_R_INVALID_IV_LENGTH 194
67
+ # define EVP_R_INVALID_KEY 163
68
+ # define EVP_R_INVALID_KEY_LENGTH 130
69
+ # define EVP_R_INVALID_LENGTH 221
70
+ # define EVP_R_INVALID_NULL_ALGORITHM 218
71
+ # define EVP_R_INVALID_OPERATION 148
72
+ # define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
73
+ # define EVP_R_INVALID_SALT_LENGTH 186
74
+ # define EVP_R_INVALID_SECRET_LENGTH 223
75
+ # define EVP_R_INVALID_SEED_LENGTH 220
76
+ # define EVP_R_INVALID_VALUE 222
77
+ # define EVP_R_KEYMGMT_EXPORT_FAILURE 205
78
+ # define EVP_R_KEY_SETUP_FAILED 180
79
+ # define EVP_R_LOCKING_NOT_SUPPORTED 213
80
+ # define EVP_R_MEMORY_LIMIT_EXCEEDED 172
81
+ # define EVP_R_MESSAGE_DIGEST_IS_NULL 159
82
+ # define EVP_R_METHOD_NOT_SUPPORTED 144
83
+ # define EVP_R_MISSING_PARAMETERS 103
84
+ # define EVP_R_NOT_ABLE_TO_COPY_CTX 190
85
+ # define EVP_R_NOT_XOF_OR_INVALID_LENGTH 178
86
+ # define EVP_R_NO_CIPHER_SET 131
87
+ # define EVP_R_NO_DEFAULT_DIGEST 158
88
+ # define EVP_R_NO_DIGEST_SET 139
89
+ # define EVP_R_NO_IMPORT_FUNCTION 206
90
+ # define EVP_R_NO_KEYMGMT_AVAILABLE 199
91
+ # define EVP_R_NO_KEYMGMT_PRESENT 196
92
+ # define EVP_R_NO_KEY_SET 154
93
+ # define EVP_R_NO_OPERATION_SET 149
94
+ # define EVP_R_NULL_MAC_PKEY_CTX 208
95
+ # define EVP_R_ONLY_ONESHOT_SUPPORTED 177
96
+ # define EVP_R_OPERATION_NOT_INITIALIZED 151
97
+ # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
98
+ # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_SIGNATURE_TYPE 226
99
+ # define EVP_R_OUTPUT_WOULD_OVERFLOW 202
100
+ # define EVP_R_PARAMETER_TOO_LARGE 187
101
+ # define EVP_R_PARTIALLY_OVERLAPPING 162
102
+ # define EVP_R_PBKDF2_ERROR 181
103
+ # define EVP_R_PIPELINE_NOT_SUPPORTED 230
104
+ # define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 179
105
+ # define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
106
+ # define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
107
+ # define EVP_R_PROVIDER_ASYM_CIPHER_FAILURE 232
108
+ # define EVP_R_PROVIDER_ASYM_CIPHER_NOT_SUPPORTED 235
109
+ # define EVP_R_PROVIDER_KEYMGMT_FAILURE 233
110
+ # define EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED 236
111
+ # define EVP_R_PROVIDER_SIGNATURE_FAILURE 234
112
+ # define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED 237
113
+ # define EVP_R_PUBLIC_KEY_NOT_RSA 106
114
+ # define EVP_R_SETTING_XOF_FAILED 227
115
+ # define EVP_R_SET_DEFAULT_PROPERTY_FAILURE 209
116
+ # define EVP_R_SIGNATURE_TYPE_AND_KEY_TYPE_INCOMPATIBLE 228
117
+ # define EVP_R_TOO_MANY_PIPES 231
118
+ # define EVP_R_TOO_MANY_RECORDS 183
119
+ # define EVP_R_UNABLE_TO_ENABLE_LOCKING 212
120
+ # define EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE 215
121
+ # define EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH 216
122
+ # define EVP_R_UNABLE_TO_LOCK_CONTEXT 211
123
+ # define EVP_R_UNABLE_TO_SET_CALLBACKS 217
124
+ # define EVP_R_UNKNOWN_BITS 166
125
+ # define EVP_R_UNKNOWN_CIPHER 160
126
+ # define EVP_R_UNKNOWN_DIGEST 161
127
+ # define EVP_R_UNKNOWN_KEY_TYPE 207
128
+ # define EVP_R_UNKNOWN_MAX_SIZE 167
129
+ # define EVP_R_UNKNOWN_OPTION 169
130
+ # define EVP_R_UNKNOWN_PBE_ALGORITHM 121
131
+ # define EVP_R_UNKNOWN_SECURITY_BITS 168
132
+ # define EVP_R_UNSUPPORTED_ALGORITHM 156
133
+ # define EVP_R_UNSUPPORTED_CIPHER 107
134
+ # define EVP_R_UNSUPPORTED_KEYLENGTH 123
135
+ # define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
136
+ # define EVP_R_UNSUPPORTED_KEY_SIZE 108
137
+ # define EVP_R_UNSUPPORTED_KEY_TYPE 224
138
+ # define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135
139
+ # define EVP_R_UNSUPPORTED_PRF 125
140
+ # define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
141
+ # define EVP_R_UNSUPPORTED_SALT_TYPE 126
142
+ # define EVP_R_UPDATE_ERROR 189
143
+ # define EVP_R_WRAP_MODE_NOT_ALLOWED 170
144
+ # define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
145
+ # define EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE 191
146
+ # define EVP_R_XTS_DUPLICATED_KEYS 192
147
+
148
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/macros.h ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2019-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
+ #ifndef OPENSSL_MACROS_H
11
+ # define OPENSSL_MACROS_H
12
+ # pragma once
13
+
14
+ #include <openssl/opensslconf.h>
15
+ #include <openssl/opensslv.h>
16
+
17
+
18
+ /* Helper macros for CPP string composition */
19
+ # define OPENSSL_MSTR_HELPER(x) #x
20
+ # define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
21
+
22
+ /*
23
+ * Sometimes OPENSSL_NO_xxx ends up with an empty file and some compilers
24
+ * don't like that. This will hopefully silence them.
25
+ */
26
+ # define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
27
+
28
+ /*
29
+ * Generic deprecation macro
30
+ *
31
+ * If OPENSSL_SUPPRESS_DEPRECATED is defined, then OSSL_DEPRECATED and
32
+ * OSSL_DEPRECATED_FOR become no-ops
33
+ */
34
+ # ifndef OSSL_DEPRECATED
35
+ # undef OSSL_DEPRECATED_FOR
36
+ # ifndef OPENSSL_SUPPRESS_DEPRECATED
37
+ # if defined(_MSC_VER)
38
+ /*
39
+ * MSVC supports __declspec(deprecated) since MSVC 2003 (13.10),
40
+ * and __declspec(deprecated(message)) since MSVC 2005 (14.00)
41
+ */
42
+ # if _MSC_VER >= 1400
43
+ # define OSSL_DEPRECATED(since) \
44
+ __declspec(deprecated("Since OpenSSL " # since))
45
+ # define OSSL_DEPRECATED_FOR(since, message) \
46
+ __declspec(deprecated("Since OpenSSL " # since ";" message))
47
+ # elif _MSC_VER >= 1310
48
+ # define OSSL_DEPRECATED(since) __declspec(deprecated)
49
+ # define OSSL_DEPRECATED_FOR(since, message) __declspec(deprecated)
50
+ # endif
51
+ # elif defined(__GNUC__)
52
+ /*
53
+ * According to GCC documentation, deprecations with message appeared in
54
+ * GCC 4.5.0
55
+ */
56
+ # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
57
+ # define OSSL_DEPRECATED(since) \
58
+ __attribute__((deprecated("Since OpenSSL " # since)))
59
+ # define OSSL_DEPRECATED_FOR(since, message) \
60
+ __attribute__((deprecated("Since OpenSSL " # since ";" message)))
61
+ # elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
62
+ # define OSSL_DEPRECATED(since) __attribute__((deprecated))
63
+ # define OSSL_DEPRECATED_FOR(since, message) __attribute__((deprecated))
64
+ # endif
65
+ # elif defined(__SUNPRO_C)
66
+ # if (__SUNPRO_C >= 0x5130)
67
+ # define OSSL_DEPRECATED(since) __attribute__ ((deprecated))
68
+ # define OSSL_DEPRECATED_FOR(since, message) __attribute__ ((deprecated))
69
+ # endif
70
+ # endif
71
+ # endif
72
+ # endif
73
+
74
+ /*
75
+ * Still not defined? Then define no-op macros. This means these macros
76
+ * are unsuitable for use in a typedef.
77
+ */
78
+ # ifndef OSSL_DEPRECATED
79
+ # define OSSL_DEPRECATED(since) extern
80
+ # define OSSL_DEPRECATED_FOR(since, message) extern
81
+ # endif
82
+
83
+ /*
84
+ * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
85
+ * declarations of functions deprecated in or before <version>. If this is
86
+ * undefined, the value of the macro OPENSSL_CONFIGURED_API (defined in
87
+ * <openssl/opensslconf.h>) is the default.
88
+ *
89
+ * For any version number up until version 1.1.x, <version> is expected to be
90
+ * the calculated version number 0xMNNFFPPSL.
91
+ * For version numbers 3.0 and on, <version> is expected to be a computation
92
+ * of the major and minor numbers in decimal using this formula:
93
+ *
94
+ * MAJOR * 10000 + MINOR * 100
95
+ *
96
+ * So version 3.0 becomes 30000, version 3.2 becomes 30200, etc.
97
+ */
98
+
99
+ /*
100
+ * We use the OPENSSL_API_COMPAT value to define API level macros. These
101
+ * macros are used to enable or disable features at that API version boundary.
102
+ */
103
+
104
+ # ifdef OPENSSL_API_LEVEL
105
+ # error "OPENSSL_API_LEVEL must not be defined by application"
106
+ # endif
107
+
108
+ /*
109
+ * We figure out what API level was intended by simple numeric comparison.
110
+ * The lowest old style number we recognise is 0x00908000L, so we take some
111
+ * safety margin and assume that anything below 0x00900000L is a new style
112
+ * number. This allows new versions up to and including v943.71.83.
113
+ */
114
+ # ifdef OPENSSL_API_COMPAT
115
+ # if OPENSSL_API_COMPAT < 0x900000L
116
+ # define OPENSSL_API_LEVEL (OPENSSL_API_COMPAT)
117
+ # else
118
+ # define OPENSSL_API_LEVEL \
119
+ (((OPENSSL_API_COMPAT >> 28) & 0xF) * 10000 \
120
+ + ((OPENSSL_API_COMPAT >> 20) & 0xFF) * 100 \
121
+ + ((OPENSSL_API_COMPAT >> 12) & 0xFF))
122
+ # endif
123
+ # endif
124
+
125
+ /*
126
+ * If OPENSSL_API_COMPAT wasn't given, we use default numbers to set
127
+ * the API compatibility level.
128
+ */
129
+ # ifndef OPENSSL_API_LEVEL
130
+ # if OPENSSL_CONFIGURED_API > 0
131
+ # define OPENSSL_API_LEVEL (OPENSSL_CONFIGURED_API)
132
+ # else
133
+ # define OPENSSL_API_LEVEL \
134
+ (OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100)
135
+ # endif
136
+ # endif
137
+
138
+ # if OPENSSL_API_LEVEL > OPENSSL_CONFIGURED_API
139
+ # error "The requested API level higher than the configured API compatibility level"
140
+ # endif
141
+
142
+ /*
143
+ * Check of sane values.
144
+ */
145
+ /* Can't go higher than the current version. */
146
+ # if OPENSSL_API_LEVEL > (OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100)
147
+ # error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
148
+ # endif
149
+ /* OpenSSL will have no version 2.y.z */
150
+ # if OPENSSL_API_LEVEL < 30000 && OPENSSL_API_LEVEL >= 20000
151
+ # error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
152
+ # endif
153
+ /* Below 0.9.8 is unacceptably low */
154
+ # if OPENSSL_API_LEVEL < 908
155
+ # error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
156
+ # endif
157
+
158
+ /*
159
+ * Define macros for deprecation and simulated removal purposes.
160
+ *
161
+ * The macros OSSL_DEPRECATEDIN_{major}_{minor} are always defined for
162
+ * all OpenSSL versions we care for. They can be used as attributes
163
+ * in function declarations where appropriate.
164
+ *
165
+ * The macros OPENSSL_NO_DEPRECATED_{major}_{minor} are defined for
166
+ * all OpenSSL versions up to or equal to the version given with
167
+ * OPENSSL_API_COMPAT. They are used as guards around anything that's
168
+ * deprecated up to that version, as an effect of the developer option
169
+ * 'no-deprecated'.
170
+ */
171
+
172
+ # undef OPENSSL_NO_DEPRECATED_3_4
173
+ # undef OPENSSL_NO_DEPRECATED_3_1
174
+ # undef OPENSSL_NO_DEPRECATED_3_0
175
+ # undef OPENSSL_NO_DEPRECATED_1_1_1
176
+ # undef OPENSSL_NO_DEPRECATED_1_1_0
177
+ # undef OPENSSL_NO_DEPRECATED_1_0_2
178
+ # undef OPENSSL_NO_DEPRECATED_1_0_1
179
+ # undef OPENSSL_NO_DEPRECATED_1_0_0
180
+ # undef OPENSSL_NO_DEPRECATED_0_9_8
181
+
182
+ # if OPENSSL_API_LEVEL >= 30500
183
+ # ifndef OPENSSL_NO_DEPRECATED
184
+ # define OSSL_DEPRECATEDIN_3_5 OSSL_DEPRECATED(3.5)
185
+ # define OSSL_DEPRECATEDIN_3_5_FOR(msg) OSSL_DEPRECATED_FOR(3.5, msg)
186
+ # else
187
+ # define OPENSSL_NO_DEPRECATED_3_5
188
+ # endif
189
+ # else
190
+ # define OSSL_DEPRECATEDIN_3_5
191
+ # define OSSL_DEPRECATEDIN_3_5_FOR(msg)
192
+ # endif
193
+ # if OPENSSL_API_LEVEL >= 30400
194
+ # ifndef OPENSSL_NO_DEPRECATED
195
+ # define OSSL_DEPRECATEDIN_3_4 OSSL_DEPRECATED(3.4)
196
+ # define OSSL_DEPRECATEDIN_3_4_FOR(msg) OSSL_DEPRECATED_FOR(3.4, msg)
197
+ # else
198
+ # define OPENSSL_NO_DEPRECATED_3_4
199
+ # endif
200
+ # else
201
+ # define OSSL_DEPRECATEDIN_3_4
202
+ # define OSSL_DEPRECATEDIN_3_4_FOR(msg)
203
+ # endif
204
+ # if OPENSSL_API_LEVEL >= 30100
205
+ # ifndef OPENSSL_NO_DEPRECATED
206
+ # define OSSL_DEPRECATEDIN_3_1 OSSL_DEPRECATED(3.1)
207
+ # define OSSL_DEPRECATEDIN_3_1_FOR(msg) OSSL_DEPRECATED_FOR(3.1, msg)
208
+ # else
209
+ # define OPENSSL_NO_DEPRECATED_3_1
210
+ # endif
211
+ # else
212
+ # define OSSL_DEPRECATEDIN_3_1
213
+ # define OSSL_DEPRECATEDIN_3_1_FOR(msg)
214
+ # endif
215
+ # if OPENSSL_API_LEVEL >= 30000
216
+ # ifndef OPENSSL_NO_DEPRECATED
217
+ # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)
218
+ # define OSSL_DEPRECATEDIN_3_0_FOR(msg) OSSL_DEPRECATED_FOR(3.0, msg)
219
+ # else
220
+ # define OPENSSL_NO_DEPRECATED_3_0
221
+ # endif
222
+ # else
223
+ # define OSSL_DEPRECATEDIN_3_0
224
+ # define OSSL_DEPRECATEDIN_3_0_FOR(msg)
225
+ # endif
226
+ # if OPENSSL_API_LEVEL >= 10101
227
+ # ifndef OPENSSL_NO_DEPRECATED
228
+ # define OSSL_DEPRECATEDIN_1_1_1 OSSL_DEPRECATED(1.1.1)
229
+ # define OSSL_DEPRECATEDIN_1_1_1_FOR(msg) OSSL_DEPRECATED_FOR(1.1.1, msg)
230
+ # else
231
+ # define OPENSSL_NO_DEPRECATED_1_1_1
232
+ # endif
233
+ # else
234
+ # define OSSL_DEPRECATEDIN_1_1_1
235
+ # define OSSL_DEPRECATEDIN_1_1_1_FOR(msg)
236
+ # endif
237
+ # if OPENSSL_API_LEVEL >= 10100
238
+ # ifndef OPENSSL_NO_DEPRECATED
239
+ # define OSSL_DEPRECATEDIN_1_1_0 OSSL_DEPRECATED(1.1.0)
240
+ # define OSSL_DEPRECATEDIN_1_1_0_FOR(msg) OSSL_DEPRECATED_FOR(1.1.0, msg)
241
+ # else
242
+ # define OPENSSL_NO_DEPRECATED_1_1_0
243
+ # endif
244
+ # else
245
+ # define OSSL_DEPRECATEDIN_1_1_0
246
+ # define OSSL_DEPRECATEDIN_1_1_0_FOR(msg)
247
+ # endif
248
+ # if OPENSSL_API_LEVEL >= 10002
249
+ # ifndef OPENSSL_NO_DEPRECATED
250
+ # define OSSL_DEPRECATEDIN_1_0_2 OSSL_DEPRECATED(1.0.2)
251
+ # define OSSL_DEPRECATEDIN_1_0_2_FOR(msg) OSSL_DEPRECATED_FOR(1.0.2, msg)
252
+ # else
253
+ # define OPENSSL_NO_DEPRECATED_1_0_2
254
+ # endif
255
+ # else
256
+ # define OSSL_DEPRECATEDIN_1_0_2
257
+ # define OSSL_DEPRECATEDIN_1_0_2_FOR(msg)
258
+ # endif
259
+ # if OPENSSL_API_LEVEL >= 10001
260
+ # ifndef OPENSSL_NO_DEPRECATED
261
+ # define OSSL_DEPRECATEDIN_1_0_1 OSSL_DEPRECATED(1.0.1)
262
+ # define OSSL_DEPRECATEDIN_1_0_1_FOR(msg) OSSL_DEPRECATED_FOR(1.0.1, msg)
263
+ # else
264
+ # define OPENSSL_NO_DEPRECATED_1_0_1
265
+ # endif
266
+ # else
267
+ # define OSSL_DEPRECATEDIN_1_0_1
268
+ # define OSSL_DEPRECATEDIN_1_0_1_FOR(msg)
269
+ # endif
270
+ # if OPENSSL_API_LEVEL >= 10000
271
+ # ifndef OPENSSL_NO_DEPRECATED
272
+ # define OSSL_DEPRECATEDIN_1_0_0 OSSL_DEPRECATED(1.0.0)
273
+ # define OSSL_DEPRECATEDIN_1_0_0_FOR(msg) OSSL_DEPRECATED_FOR(1.0.0, msg)
274
+ # else
275
+ # define OPENSSL_NO_DEPRECATED_1_0_0
276
+ # endif
277
+ # else
278
+ # define OSSL_DEPRECATEDIN_1_0_0
279
+ # define OSSL_DEPRECATEDIN_1_0_0_FOR(msg)
280
+ # endif
281
+ # if OPENSSL_API_LEVEL >= 908
282
+ # ifndef OPENSSL_NO_DEPRECATED
283
+ # define OSSL_DEPRECATEDIN_0_9_8 OSSL_DEPRECATED(0.9.8)
284
+ # define OSSL_DEPRECATEDIN_0_9_8_FOR(msg) OSSL_DEPRECATED_FOR(0.9.8, msg)
285
+ # else
286
+ # define OPENSSL_NO_DEPRECATED_0_9_8
287
+ # endif
288
+ # else
289
+ # define OSSL_DEPRECATEDIN_0_9_8
290
+ # define OSSL_DEPRECATEDIN_0_9_8_FOR(msg)
291
+ # endif
292
+
293
+ /*
294
+ * Make our own variants of __FILE__ and __LINE__, depending on configuration
295
+ */
296
+
297
+ # ifndef OPENSSL_FILE
298
+ # ifdef OPENSSL_NO_FILENAMES
299
+ # define OPENSSL_FILE ""
300
+ # define OPENSSL_LINE 0
301
+ # else
302
+ # define OPENSSL_FILE __FILE__
303
+ # define OPENSSL_LINE __LINE__
304
+ # endif
305
+ # endif
306
+
307
+ /*
308
+ * __func__ was standardized in C99, so for any compiler that claims
309
+ * to implement that language level or newer, we assume we can safely
310
+ * use that symbol.
311
+ *
312
+ * GNU C also provides __FUNCTION__ since version 2, which predates
313
+ * C99. We can, however, only use this if __STDC_VERSION__ exists,
314
+ * as it's otherwise not allowed according to ISO C standards (C90).
315
+ * (compiling with GNU C's -pedantic tells us so)
316
+ *
317
+ * If none of the above applies, we check if the compiler is MSVC,
318
+ * and use __FUNCTION__ if that's the case.
319
+ */
320
+ # ifndef OPENSSL_FUNC
321
+ # if defined(__STDC_VERSION__)
322
+ # if __STDC_VERSION__ >= 199901L
323
+ # define OPENSSL_FUNC __func__
324
+ # elif defined(__GNUC__) && __GNUC__ >= 2
325
+ # define OPENSSL_FUNC __FUNCTION__
326
+ # endif
327
+ # elif defined(_MSC_VER)
328
+ # define OPENSSL_FUNC __FUNCTION__
329
+ # endif
330
+ /*
331
+ * If all these possibilities are exhausted, we give up and use a
332
+ * static string.
333
+ */
334
+ # ifndef OPENSSL_FUNC
335
+ # define OPENSSL_FUNC "(unknown function)"
336
+ # endif
337
+ # endif
338
+
339
+ # ifndef OSSL_CRYPTO_ALLOC
340
+ # if defined(__GNUC__)
341
+ # define OSSL_CRYPTO_ALLOC __attribute__((__malloc__))
342
+ # elif defined(_MSC_VER)
343
+ # define OSSL_CRYPTO_ALLOC __declspec(restrict)
344
+ # else
345
+ # define OSSL_CRYPTO_ALLOC
346
+ # endif
347
+ # endif
348
+
349
+ #endif /* OPENSSL_MACROS_H */
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/md5.h ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 1995-2020 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
+ #ifndef OPENSSL_MD5_H
11
+ # define OPENSSL_MD5_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_MD5_H
17
+ # endif
18
+
19
+ # include <openssl/opensslconf.h>
20
+
21
+ # ifndef OPENSSL_NO_MD5
22
+ # include <openssl/e_os2.h>
23
+ # include <stddef.h>
24
+ # ifdef __cplusplus
25
+ extern "C" {
26
+ # endif
27
+
28
+ # define MD5_DIGEST_LENGTH 16
29
+
30
+ # if !defined(OPENSSL_NO_DEPRECATED_3_0)
31
+ /*
32
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33
+ * ! MD5_LONG has to be at least 32 bits wide. !
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ */
36
+ # define MD5_LONG unsigned int
37
+
38
+ # define MD5_CBLOCK 64
39
+ # define MD5_LBLOCK (MD5_CBLOCK/4)
40
+
41
+ typedef struct MD5state_st {
42
+ MD5_LONG A, B, C, D;
43
+ MD5_LONG Nl, Nh;
44
+ MD5_LONG data[MD5_LBLOCK];
45
+ unsigned int num;
46
+ } MD5_CTX;
47
+ # endif
48
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
49
+ OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
50
+ OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
51
+ OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
52
+ OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
53
+ unsigned char *md);
54
+ OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
55
+ # endif
56
+
57
+ # ifdef __cplusplus
58
+ }
59
+ # endif
60
+ # endif
61
+
62
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ocsp_no-asm.h ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/no-asm/include/openssl/ocsp.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/ocsp.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/ocsp.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/ocsp.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/ocsp.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/ocsp.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/ocsp.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ocsp.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ocsp.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/ocsp.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/ocsp.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ocsp.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/ocsp.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/ocsp.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/ocsp.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ocsp.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/ocsp.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/ocsp.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/ocsp.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/ocsp.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/ocsp.h"
48
+ #endif
49
+
50
+ /* GOST is not included in all platform */
51
+ #ifndef OPENSSL_NO_GOST
52
+ # define OPENSSL_NO_GOST
53
+ #endif
54
+ /* HW_PADLOCK is not included in all platform */
55
+ #ifndef OPENSSL_NO_HW_PADLOCK
56
+ # define OPENSSL_NO_HW_PADLOCK
57
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/opensslconf_asm.h ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ In OpenSSL, opensslconf.h was generated by Configure script with
3
+ specifying a target argument, where it includes several defines that
4
+ depend on OS and architecture platform.
5
+
6
+ In node, we statically mapped --dest-os and --dest-cpu options in
7
+ configure to the target of Configure in OpenSSL and make
8
+ `deps/openssl/conf/openssconf.h` so as to include each file
9
+ according to its target by checking pre-defined compiler macros.
10
+
11
+ Included opnesslconf.h files for supported target architectures can
12
+ be generated by `Makefile` and stored under
13
+ `archs/{target}/asm/opensslconf.h`. The Makefile also fixes several
14
+ defines to meet node build requirements.
15
+
16
+ Here is a map table of configure options in node, target arch of
17
+ Configure in OpenSSL and CI support.
18
+
19
+ | --dest-os | --dest-cpu | OpenSSL target arch | CI |
20
+ | --------- | ---------- | -------------------- | --- |
21
+ | aix | ppc | aix-gcc | o |
22
+ | aix | ppc64 | aix64-gcc-as | o |
23
+ | linux | ia32 | linux-elf | o |
24
+ | linux | x32 | linux-x32 | - |
25
+ | linux | x64 | linux-x86_64 | o |
26
+ | linux | arm | linux-armv4 | o |
27
+ | linux | arm64 | linux-aarch64 | o |
28
+ | linux | ppc | linux-ppc | o |
29
+ | linux | ppc64 | linux-ppc64 | o |
30
+ | linux | ppc64 | linux-ppc64le | o | (node_byteoder: little)
31
+ | linux | s390 | linux32-s390x | o |
32
+ | linux | s390x | linux64-s390x | o |
33
+ | mac | ia32 | darwin-i386-cc | - |
34
+ | mac | x64 | darwin64-x86-cc | o |
35
+ | mac | arm64 | darwin64-arm64-cc | - |
36
+ | win | ia32 | VC-WIN32 | - |
37
+ | win | x64 | VC-WIN64A | o |
38
+ | solaris | ia32 | solaris-x86-gcc | o |
39
+ | solaris | x64 | solaris64-x86_64-gcc | o |
40
+ | freebsd | ia32 | BSD-x86 | - |
41
+ | freebsd | x64 | BSD-x86_64 | o |
42
+ | openbsd | ia32 | BSD-x86 | - |
43
+ | openbsd | x64 | BSD-x86_64 | - |
44
+ | others | others | linux-elf | - |
45
+
46
+ --dest-os and --dest-cpu are mapped to pre-defined macros.
47
+
48
+ | --dest-os | pre-defined macro |
49
+ | ------------------ | ------------------------- |
50
+ | aix | _AIX |
51
+ | win | _WIN32 |
52
+ | win(64bit) | _WIN64 |
53
+ | mac | __APPLE__ && __MACH__ |
54
+ | solaris | __sun |
55
+ | freebsd | __FreeBSD__ |
56
+ | openbsd | __OpenBSD__ |
57
+ | linux (not andorid)| __linux__ && !__ANDROID__ |
58
+ | android | __ANDROID__ |
59
+
60
+ | --dest-cpu | pre-defined macro |
61
+ | ---------- | ----------------- |
62
+ | arm | __arm__ |
63
+ | arm64 | __aarch64__ |
64
+ | ia32 | __i386__ |
65
+ | ia32(win) | _M_IX86 |
66
+ | mips | __mips__ |
67
+ | mipsel | __MIPSEL__ |
68
+ | x32 | __ILP32__ |
69
+ | x64 | __x86_64__ |
70
+ | x64(win) | _M_X64 |
71
+ | ppc | __PPC__ |
72
+ | | _ARCH_PPC |
73
+ | ppc64 | __PPC64__ |
74
+ | | _ARCH_PPC64 |
75
+ | s390 | __s390__ |
76
+ | s390x | __s390x__ |
77
+
78
+ These are the list which is not implemented yet.
79
+
80
+ | --dest-os | --dest-cpu | OpenSSL target arch | CI |
81
+ | --------- | ---------- | -------------------- | --- |
82
+ | linux | mips | linux-mips32,linux-mips64,linux64-mips64? | --- |
83
+ | linux | mipsel | ? | --- |
84
+ | android | ia32 | android-x86 | --- |
85
+ | android | arm | android-armv7 | --- |
86
+ | android | mips | android-mips | --- |
87
+ | android | mipsel | ? | --- |
88
+
89
+ Supported target arch list in OpenSSL can be obtained by typing
90
+ `deps/openssl/openssl/Configure LIST`.
91
+
92
+ */
93
+
94
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
95
+ # include "./archs/linux-elf/asm/include/openssl/opensslconf.h"
96
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
97
+ # include "./archs/linux-x86_64/asm/include/openssl/opensslconf.h"
98
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
99
+ # include "./archs/linux-armv4/asm/include/openssl/opensslconf.h"
100
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
101
+ # include "./archs/linux-aarch64/asm/include/openssl/opensslconf.h"
102
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
103
+ # include "./archs/darwin-i386-cc/asm/include/openssl/opensslconf.h"
104
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
105
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h"
106
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
107
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/opensslconf.h"
108
+ #elif defined(_WIN32) && defined(_M_IX86)
109
+ # include "./archs/VC-WIN32/asm/include/openssl/opensslconf.h"
110
+ #elif defined(_WIN32) && defined(_M_X64)
111
+ # include "./archs/VC-WIN64A/asm/include/openssl/opensslconf.h"
112
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
113
+ # include "./archs/BSD-x86/asm/include/openssl/opensslconf.h"
114
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
115
+ # include "./archs/BSD-x86_64/asm/include/openssl/opensslconf.h"
116
+ #elif defined(__sun) && defined(__i386__)
117
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h"
118
+ #elif defined(__sun) && defined(__x86_64__)
119
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h"
120
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
121
+ # include "./archs/linux-ppc64le/asm/include/openssl/opensslconf.h"
122
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__)
123
+ # include "./archs/linux-ppc64/asm/include/openssl/opensslconf.h"
124
+ #elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__)
125
+ # include "./archs/linux-ppc/asm/include/openssl/opensslconf.h"
126
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
127
+ # include "./archs/aix64-gcc-as/asm/include/openssl/opensslconf.h"
128
+ #elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC)
129
+ # include "./archs/aix-gcc/asm/include/openssl/opensslconf.h"
130
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
131
+ # include "./archs/linux64-s390x/asm/include/openssl/opensslconf.h"
132
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
133
+ # include "./archs/linux32-s390x/asm/include/openssl/opensslconf.h"
134
+ #elif defined(OPENSSL_LINUX) && defined(__mips64) && defined(__MIPSEL__)
135
+ # include "./archs/linux64-mips64/asm/include/openssl/opensslconf.h"
136
+ #else
137
+ # include "./archs/linux-elf/asm/include/openssl/opensslconf.h"
138
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/opensslv_asm.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/asm/include/openssl/opensslv.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/opensslv.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/opensslv.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/opensslv.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/opensslv.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/opensslv.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/opensslv.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/opensslv.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/opensslv.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/opensslv.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/opensslv.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/opensslv.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/opensslv.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/opensslv.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/opensslv.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/opensslv.h"
44
+ #endif
45
+
46
+ /* GOST is not included in all platform */
47
+ #ifndef OPENSSL_NO_GOST
48
+ # define OPENSSL_NO_GOST
49
+ #endif
50
+ /* HW_PADLOCK is not included in all platform */
51
+ #ifndef OPENSSL_NO_HW_PADLOCK
52
+ # define OPENSSL_NO_HW_PADLOCK
53
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/param_names_asm.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/asm/include/internal/param_names.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/internal/param_names.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/internal/param_names.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/internal/param_names.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/internal/param_names.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/internal/param_names.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/internal/param_names.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/internal/param_names.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/internal/param_names.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/internal/param_names.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/internal/param_names.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/internal/param_names.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/internal/param_names.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/internal/param_names.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/internal/param_names.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/internal/param_names.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/internal/param_names.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/internal/param_names.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/internal/param_names.h"
44
+ #endif
45
+
46
+ /* GOST is not included in all platform */
47
+ #ifndef OPENSSL_NO_GOST
48
+ # define OPENSSL_NO_GOST
49
+ #endif
50
+ /* HW_PADLOCK is not included in all platform */
51
+ #ifndef OPENSSL_NO_HW_PADLOCK
52
+ # define OPENSSL_NO_HW_PADLOCK
53
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/param_names_no-asm.h ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/no-asm/include/internal/param_names.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/internal/param_names.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/internal/param_names.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/internal/param_names.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/internal/param_names.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/internal/param_names.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/internal/param_names.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/internal/param_names.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/internal/param_names.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/internal/param_names.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/internal/param_names.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/internal/param_names.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/internal/param_names.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/internal/param_names.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/internal/param_names.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/internal/param_names.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/internal/param_names.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/internal/param_names.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/internal/param_names.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/internal/param_names.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/internal/param_names.h"
48
+ #endif
49
+
50
+ /* GOST is not included in all platform */
51
+ #ifndef OPENSSL_NO_GOST
52
+ # define OPENSSL_NO_GOST
53
+ #endif
54
+ /* HW_PADLOCK is not included in all platform */
55
+ #ifndef OPENSSL_NO_HW_PADLOCK
56
+ # define OPENSSL_NO_HW_PADLOCK
57
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/params.h ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
3
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
6
+ * this file except in compliance with the License. You can obtain a copy
7
+ * in the file LICENSE in the source distribution or at
8
+ * https://www.openssl.org/source/license.html
9
+ */
10
+
11
+ #ifndef OPENSSL_PARAMS_H
12
+ # define OPENSSL_PARAMS_H
13
+ # pragma once
14
+
15
+ # include <openssl/core.h>
16
+ # include <openssl/bn.h>
17
+
18
+ # ifdef __cplusplus
19
+ extern "C" {
20
+ # endif
21
+
22
+ # define OSSL_PARAM_UNMODIFIED ((size_t)-1)
23
+
24
+ # define OSSL_PARAM_END \
25
+ { NULL, 0, NULL, 0, 0 }
26
+
27
+ # define OSSL_PARAM_DEFN(key, type, addr, sz) \
28
+ { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
29
+
30
+ /* Basic parameter types without return sizes */
31
+ # define OSSL_PARAM_int(key, addr) \
32
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int))
33
+ # define OSSL_PARAM_uint(key, addr) \
34
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
35
+ sizeof(unsigned int))
36
+ # define OSSL_PARAM_long(key, addr) \
37
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(long int))
38
+ # define OSSL_PARAM_ulong(key, addr) \
39
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
40
+ sizeof(unsigned long int))
41
+ # define OSSL_PARAM_int32(key, addr) \
42
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int32_t))
43
+ # define OSSL_PARAM_uint32(key, addr) \
44
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
45
+ sizeof(uint32_t))
46
+ # define OSSL_PARAM_int64(key, addr) \
47
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int64_t))
48
+ # define OSSL_PARAM_uint64(key, addr) \
49
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
50
+ sizeof(uint64_t))
51
+ # define OSSL_PARAM_size_t(key, addr) \
52
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), sizeof(size_t))
53
+ # define OSSL_PARAM_time_t(key, addr) \
54
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(time_t))
55
+ # define OSSL_PARAM_double(key, addr) \
56
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_REAL, (addr), sizeof(double))
57
+
58
+ # define OSSL_PARAM_BN(key, bn, sz) \
59
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (bn), (sz))
60
+ # define OSSL_PARAM_utf8_string(key, addr, sz) \
61
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
62
+ # define OSSL_PARAM_octet_string(key, addr, sz) \
63
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz)
64
+
65
+ # define OSSL_PARAM_utf8_ptr(key, addr, sz) \
66
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, (addr), sz)
67
+ # define OSSL_PARAM_octet_ptr(key, addr, sz) \
68
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, (addr), sz)
69
+
70
+ /* Search an OSSL_PARAM array for a matching name */
71
+ OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key);
72
+ const OSSL_PARAM *OSSL_PARAM_locate_const(const OSSL_PARAM *p, const char *key);
73
+
74
+ /* Basic parameter type run-time construction */
75
+ OSSL_PARAM OSSL_PARAM_construct_int(const char *key, int *buf);
76
+ OSSL_PARAM OSSL_PARAM_construct_uint(const char *key, unsigned int *buf);
77
+ OSSL_PARAM OSSL_PARAM_construct_long(const char *key, long int *buf);
78
+ OSSL_PARAM OSSL_PARAM_construct_ulong(const char *key, unsigned long int *buf);
79
+ OSSL_PARAM OSSL_PARAM_construct_int32(const char *key, int32_t *buf);
80
+ OSSL_PARAM OSSL_PARAM_construct_uint32(const char *key, uint32_t *buf);
81
+ OSSL_PARAM OSSL_PARAM_construct_int64(const char *key, int64_t *buf);
82
+ OSSL_PARAM OSSL_PARAM_construct_uint64(const char *key, uint64_t *buf);
83
+ OSSL_PARAM OSSL_PARAM_construct_size_t(const char *key, size_t *buf);
84
+ OSSL_PARAM OSSL_PARAM_construct_time_t(const char *key, time_t *buf);
85
+ OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf,
86
+ size_t bsize);
87
+ OSSL_PARAM OSSL_PARAM_construct_double(const char *key, double *buf);
88
+ OSSL_PARAM OSSL_PARAM_construct_utf8_string(const char *key, char *buf,
89
+ size_t bsize);
90
+ OSSL_PARAM OSSL_PARAM_construct_utf8_ptr(const char *key, char **buf,
91
+ size_t bsize);
92
+ OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf,
93
+ size_t bsize);
94
+ OSSL_PARAM OSSL_PARAM_construct_octet_ptr(const char *key, void **buf,
95
+ size_t bsize);
96
+ OSSL_PARAM OSSL_PARAM_construct_end(void);
97
+
98
+ int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
99
+ const OSSL_PARAM *paramdefs,
100
+ const char *key, const char *value,
101
+ size_t value_n, int *found);
102
+
103
+ int OSSL_PARAM_print_to_bio(const OSSL_PARAM *params, BIO *bio,
104
+ int print_values);
105
+
106
+ int OSSL_PARAM_get_int(const OSSL_PARAM *p, int *val);
107
+ int OSSL_PARAM_get_uint(const OSSL_PARAM *p, unsigned int *val);
108
+ int OSSL_PARAM_get_long(const OSSL_PARAM *p, long int *val);
109
+ int OSSL_PARAM_get_ulong(const OSSL_PARAM *p, unsigned long int *val);
110
+ int OSSL_PARAM_get_int32(const OSSL_PARAM *p, int32_t *val);
111
+ int OSSL_PARAM_get_uint32(const OSSL_PARAM *p, uint32_t *val);
112
+ int OSSL_PARAM_get_int64(const OSSL_PARAM *p, int64_t *val);
113
+ int OSSL_PARAM_get_uint64(const OSSL_PARAM *p, uint64_t *val);
114
+ int OSSL_PARAM_get_size_t(const OSSL_PARAM *p, size_t *val);
115
+ int OSSL_PARAM_get_time_t(const OSSL_PARAM *p, time_t *val);
116
+
117
+ int OSSL_PARAM_set_int(OSSL_PARAM *p, int val);
118
+ int OSSL_PARAM_set_uint(OSSL_PARAM *p, unsigned int val);
119
+ int OSSL_PARAM_set_long(OSSL_PARAM *p, long int val);
120
+ int OSSL_PARAM_set_ulong(OSSL_PARAM *p, unsigned long int val);
121
+ int OSSL_PARAM_set_int32(OSSL_PARAM *p, int32_t val);
122
+ int OSSL_PARAM_set_uint32(OSSL_PARAM *p, uint32_t val);
123
+ int OSSL_PARAM_set_int64(OSSL_PARAM *p, int64_t val);
124
+ int OSSL_PARAM_set_uint64(OSSL_PARAM *p, uint64_t val);
125
+ int OSSL_PARAM_set_size_t(OSSL_PARAM *p, size_t val);
126
+ int OSSL_PARAM_set_time_t(OSSL_PARAM *p, time_t val);
127
+
128
+ int OSSL_PARAM_get_double(const OSSL_PARAM *p, double *val);
129
+ int OSSL_PARAM_set_double(OSSL_PARAM *p, double val);
130
+
131
+ int OSSL_PARAM_get_BN(const OSSL_PARAM *p, BIGNUM **val);
132
+ int OSSL_PARAM_set_BN(OSSL_PARAM *p, const BIGNUM *val);
133
+
134
+ int OSSL_PARAM_get_utf8_string(const OSSL_PARAM *p, char **val, size_t max_len);
135
+ int OSSL_PARAM_set_utf8_string(OSSL_PARAM *p, const char *val);
136
+
137
+ int OSSL_PARAM_get_octet_string(const OSSL_PARAM *p, void **val, size_t max_len,
138
+ size_t *used_len);
139
+ int OSSL_PARAM_set_octet_string(OSSL_PARAM *p, const void *val, size_t len);
140
+
141
+ int OSSL_PARAM_get_utf8_ptr(const OSSL_PARAM *p, const char **val);
142
+ int OSSL_PARAM_set_utf8_ptr(OSSL_PARAM *p, const char *val);
143
+
144
+ int OSSL_PARAM_get_octet_ptr(const OSSL_PARAM *p, const void **val,
145
+ size_t *used_len);
146
+ int OSSL_PARAM_set_octet_ptr(OSSL_PARAM *p, const void *val,
147
+ size_t used_len);
148
+
149
+ int OSSL_PARAM_get_utf8_string_ptr(const OSSL_PARAM *p, const char **val);
150
+ int OSSL_PARAM_get_octet_string_ptr(const OSSL_PARAM *p, const void **val,
151
+ size_t *used_len);
152
+
153
+ int OSSL_PARAM_modified(const OSSL_PARAM *p);
154
+ void OSSL_PARAM_set_all_unmodified(OSSL_PARAM *p);
155
+
156
+ OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *p);
157
+ OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *p1, const OSSL_PARAM *p2);
158
+ void OSSL_PARAM_free(OSSL_PARAM *p);
159
+
160
+ # ifdef __cplusplus
161
+ }
162
+ # endif
163
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/pem.h ADDED
@@ -0,0 +1,548 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 1995-2025 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
+ #ifndef OPENSSL_PEM_H
11
+ # define OPENSSL_PEM_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_PEM_H
17
+ # endif
18
+
19
+ # include <openssl/e_os2.h>
20
+ # include <openssl/bio.h>
21
+ # include <openssl/safestack.h>
22
+ # include <openssl/evp.h>
23
+ # include <openssl/x509.h>
24
+ # include <openssl/pemerr.h>
25
+ # ifndef OPENSSL_NO_STDIO
26
+ # include <stdio.h>
27
+ # endif
28
+
29
+ #ifdef __cplusplus
30
+ extern "C" {
31
+ #endif
32
+
33
+ # define PEM_BUFSIZE 1024
34
+
35
+ # define PEM_STRING_X509_OLD "X509 CERTIFICATE"
36
+ # define PEM_STRING_X509 "CERTIFICATE"
37
+ # define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
38
+ # define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
39
+ # define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
40
+ # define PEM_STRING_X509_CRL "X509 CRL"
41
+ # define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
42
+ # define PEM_STRING_PUBLIC "PUBLIC KEY"
43
+ # define PEM_STRING_RSA "RSA PRIVATE KEY"
44
+ # define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
45
+ # define PEM_STRING_DSA "DSA PRIVATE KEY"
46
+ # define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
47
+ # define PEM_STRING_PKCS7 "PKCS7"
48
+ # define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
49
+ # define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
50
+ # define PEM_STRING_PKCS8INF "PRIVATE KEY"
51
+ # define PEM_STRING_DHPARAMS "DH PARAMETERS"
52
+ # define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
53
+ # define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
54
+ # define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
55
+ # define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
56
+ # define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
57
+ # define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
58
+ # define PEM_STRING_PARAMETERS "PARAMETERS"
59
+ # define PEM_STRING_CMS "CMS"
60
+ # define PEM_STRING_SM2PRIVATEKEY "SM2 PRIVATE KEY"
61
+ # define PEM_STRING_SM2PARAMETERS "SM2 PARAMETERS"
62
+ # define PEM_STRING_ACERT "ATTRIBUTE CERTIFICATE"
63
+
64
+ # define PEM_TYPE_ENCRYPTED 10
65
+ # define PEM_TYPE_MIC_ONLY 20
66
+ # define PEM_TYPE_MIC_CLEAR 30
67
+ # define PEM_TYPE_CLEAR 40
68
+
69
+ /*
70
+ * These macros make the PEM_read/PEM_write functions easier to maintain and
71
+ * write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or
72
+ * IMPLEMENT_PEM_rw_cb(...)
73
+ */
74
+
75
+ # define PEM_read_cb_fnsig(name, type, INTYPE, readname) \
76
+ type *PEM_##readname##_##name(INTYPE *out, type **x, \
77
+ pem_password_cb *cb, void *u)
78
+ # define PEM_read_cb_ex_fnsig(name, type, INTYPE, readname) \
79
+ type *PEM_##readname##_##name##_ex(INTYPE *out, type **x, \
80
+ pem_password_cb *cb, void *u, \
81
+ OSSL_LIB_CTX *libctx, \
82
+ const char *propq)
83
+
84
+ # define PEM_write_fnsig(name, type, OUTTYPE, writename) \
85
+ int PEM_##writename##_##name(OUTTYPE *out, const type *x)
86
+ # define PEM_write_cb_fnsig(name, type, OUTTYPE, writename) \
87
+ int PEM_##writename##_##name(OUTTYPE *out, const type *x, \
88
+ const EVP_CIPHER *enc, \
89
+ const unsigned char *kstr, int klen, \
90
+ pem_password_cb *cb, void *u)
91
+ # define PEM_write_ex_fnsig(name, type, OUTTYPE, writename) \
92
+ int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
93
+ OSSL_LIB_CTX *libctx, \
94
+ const char *propq)
95
+ # define PEM_write_cb_ex_fnsig(name, type, OUTTYPE, writename) \
96
+ int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
97
+ const EVP_CIPHER *enc, \
98
+ const unsigned char *kstr, int klen, \
99
+ pem_password_cb *cb, void *u, \
100
+ OSSL_LIB_CTX *libctx, \
101
+ const char *propq)
102
+
103
+ # ifdef OPENSSL_NO_STDIO
104
+
105
+ # define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
106
+ # define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/
107
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
108
+ # define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/
109
+ # endif
110
+ # define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/
111
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
112
+ # define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/
113
+ # endif
114
+ # else
115
+
116
+ # define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
117
+ type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u) \
118
+ { \
119
+ return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str, fp, \
120
+ (void **)x, cb, u); \
121
+ }
122
+
123
+ # define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
124
+ PEM_write_fnsig(name, type, FILE, write) \
125
+ { \
126
+ return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
127
+ x, NULL, NULL, 0, NULL, NULL); \
128
+ }
129
+
130
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
131
+ # define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
132
+ IMPLEMENT_PEM_write_fp(name, type, str, asn1)
133
+ # endif
134
+
135
+ # define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
136
+ PEM_write_cb_fnsig(name, type, FILE, write) \
137
+ { \
138
+ return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
139
+ x, enc, kstr, klen, cb, u); \
140
+ }
141
+
142
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
143
+ # define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
144
+ IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
145
+ # endif
146
+ # endif
147
+
148
+ # define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
149
+ type *PEM_read_bio_##name(BIO *bp, type **x, \
150
+ pem_password_cb *cb, void *u) \
151
+ { \
152
+ return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str, bp, \
153
+ (void **)x, cb, u); \
154
+ }
155
+
156
+ # define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
157
+ PEM_write_fnsig(name, type, BIO, write_bio) \
158
+ { \
159
+ return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
160
+ x, NULL,NULL,0,NULL,NULL); \
161
+ }
162
+
163
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
164
+ # define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
165
+ IMPLEMENT_PEM_write_bio(name, type, str, asn1)
166
+ # endif
167
+
168
+ # define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
169
+ PEM_write_cb_fnsig(name, type, BIO, write_bio) \
170
+ { \
171
+ return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
172
+ x, enc, kstr, klen, cb, u); \
173
+ }
174
+
175
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
176
+ # define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
177
+ IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1)
178
+ # endif
179
+
180
+ # define IMPLEMENT_PEM_write(name, type, str, asn1) \
181
+ IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
182
+ IMPLEMENT_PEM_write_fp(name, type, str, asn1)
183
+
184
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
185
+ # define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
186
+ IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
187
+ IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
188
+ # endif
189
+
190
+ # define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
191
+ IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
192
+ IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
193
+
194
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
195
+ # define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
196
+ IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
197
+ IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
198
+ # endif
199
+
200
+ # define IMPLEMENT_PEM_read(name, type, str, asn1) \
201
+ IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
202
+ IMPLEMENT_PEM_read_fp(name, type, str, asn1)
203
+
204
+ # define IMPLEMENT_PEM_rw(name, type, str, asn1) \
205
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
206
+ IMPLEMENT_PEM_write(name, type, str, asn1)
207
+
208
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
209
+ # define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
210
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
211
+ IMPLEMENT_PEM_write_const(name, type, str, asn1)
212
+ # endif
213
+
214
+ # define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
215
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
216
+ IMPLEMENT_PEM_write_cb(name, type, str, asn1)
217
+
218
+ /* These are the same except they are for the declarations */
219
+
220
+ /*
221
+ * The mysterious 'extern' that's passed to some macros is innocuous,
222
+ * and is there to quiet pre-C99 compilers that may complain about empty
223
+ * arguments in macro calls.
224
+ */
225
+ # if defined(OPENSSL_NO_STDIO)
226
+
227
+ # define DECLARE_PEM_read_fp_attr(attr, name, type) /**/
228
+ # define DECLARE_PEM_read_fp_ex_attr(attr, name, type) /**/
229
+ # define DECLARE_PEM_write_fp_attr(attr, name, type) /**/
230
+ # define DECLARE_PEM_write_fp_ex_attr(attr, name, type) /**/
231
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
232
+ # define DECLARE_PEM_write_fp_const_attr(attr, name, type) /**/
233
+ # endif
234
+ # define DECLARE_PEM_write_cb_fp_attr(attr, name, type) /**/
235
+ # define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) /**/
236
+
237
+ # else
238
+
239
+ # define DECLARE_PEM_read_fp_attr(attr, name, type) \
240
+ attr PEM_read_cb_fnsig(name, type, FILE, read);
241
+ # define DECLARE_PEM_read_fp_ex_attr(attr, name, type) \
242
+ attr PEM_read_cb_fnsig(name, type, FILE, read); \
243
+ attr PEM_read_cb_ex_fnsig(name, type, FILE, read);
244
+
245
+ # define DECLARE_PEM_write_fp_attr(attr, name, type) \
246
+ attr PEM_write_fnsig(name, type, FILE, write);
247
+ # define DECLARE_PEM_write_fp_ex_attr(attr, name, type) \
248
+ attr PEM_write_fnsig(name, type, FILE, write); \
249
+ attr PEM_write_ex_fnsig(name, type, FILE, write);
250
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
251
+ # define DECLARE_PEM_write_fp_const_attr(attr, name, type) \
252
+ attr PEM_write_fnsig(name, type, FILE, write);
253
+ # endif
254
+ # define DECLARE_PEM_write_cb_fp_attr(attr, name, type) \
255
+ attr PEM_write_cb_fnsig(name, type, FILE, write);
256
+ # define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) \
257
+ attr PEM_write_cb_fnsig(name, type, FILE, write); \
258
+ attr PEM_write_cb_ex_fnsig(name, type, FILE, write);
259
+
260
+ # endif
261
+
262
+ # define DECLARE_PEM_read_fp(name, type) \
263
+ DECLARE_PEM_read_fp_attr(extern, name, type)
264
+ # define DECLARE_PEM_write_fp(name, type) \
265
+ DECLARE_PEM_write_fp_attr(extern, name, type)
266
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
267
+ # define DECLARE_PEM_write_fp_const(name, type) \
268
+ DECLARE_PEM_write_fp_const_attr(extern, name, type)
269
+ # endif
270
+ # define DECLARE_PEM_write_cb_fp(name, type) \
271
+ DECLARE_PEM_write_cb_fp_attr(extern, name, type)
272
+
273
+ # define DECLARE_PEM_read_bio_attr(attr, name, type) \
274
+ attr PEM_read_cb_fnsig(name, type, BIO, read_bio);
275
+ # define DECLARE_PEM_read_bio_ex_attr(attr, name, type) \
276
+ attr PEM_read_cb_fnsig(name, type, BIO, read_bio); \
277
+ attr PEM_read_cb_ex_fnsig(name, type, BIO, read_bio);
278
+ # define DECLARE_PEM_read_bio(name, type) \
279
+ DECLARE_PEM_read_bio_attr(extern, name, type)
280
+ # define DECLARE_PEM_read_bio_ex(name, type) \
281
+ DECLARE_PEM_read_bio_ex_attr(extern, name, type)
282
+
283
+ # define DECLARE_PEM_write_bio_attr(attr, name, type) \
284
+ attr PEM_write_fnsig(name, type, BIO, write_bio);
285
+ # define DECLARE_PEM_write_bio_ex_attr(attr, name, type) \
286
+ attr PEM_write_fnsig(name, type, BIO, write_bio); \
287
+ attr PEM_write_ex_fnsig(name, type, BIO, write_bio);
288
+ # define DECLARE_PEM_write_bio(name, type) \
289
+ DECLARE_PEM_write_bio_attr(extern, name, type)
290
+ # define DECLARE_PEM_write_bio_ex(name, type) \
291
+ DECLARE_PEM_write_bio_ex_attr(extern, name, type)
292
+
293
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
294
+ # define DECLARE_PEM_write_bio_const_attr(attr, name, type) \
295
+ attr PEM_write_fnsig(name, type, BIO, write_bio);
296
+ # define DECLARE_PEM_write_bio_const(name, type) \
297
+ DECLARE_PEM_write_bio_const_attr(extern, name, type)
298
+ # endif
299
+
300
+ # define DECLARE_PEM_write_cb_bio_attr(attr, name, type) \
301
+ attr PEM_write_cb_fnsig(name, type, BIO, write_bio);
302
+ # define DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \
303
+ attr PEM_write_cb_fnsig(name, type, BIO, write_bio); \
304
+ attr PEM_write_cb_ex_fnsig(name, type, BIO, write_bio);
305
+ # define DECLARE_PEM_write_cb_bio(name, type) \
306
+ DECLARE_PEM_write_cb_bio_attr(extern, name, type)
307
+ # define DECLARE_PEM_write_cb_ex_bio(name, type) \
308
+ DECLARE_PEM_write_cb_bio_ex_attr(extern, name, type)
309
+
310
+ # define DECLARE_PEM_write_attr(attr, name, type) \
311
+ DECLARE_PEM_write_bio_attr(attr, name, type) \
312
+ DECLARE_PEM_write_fp_attr(attr, name, type)
313
+ # define DECLARE_PEM_write_ex_attr(attr, name, type) \
314
+ DECLARE_PEM_write_bio_ex_attr(attr, name, type) \
315
+ DECLARE_PEM_write_fp_ex_attr(attr, name, type)
316
+ # define DECLARE_PEM_write(name, type) \
317
+ DECLARE_PEM_write_attr(extern, name, type)
318
+ # define DECLARE_PEM_write_ex(name, type) \
319
+ DECLARE_PEM_write_ex_attr(extern, name, type)
320
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
321
+ # define DECLARE_PEM_write_const_attr(attr, name, type) \
322
+ DECLARE_PEM_write_bio_const_attr(attr, name, type) \
323
+ DECLARE_PEM_write_fp_const_attr(attr, name, type)
324
+ # define DECLARE_PEM_write_const(name, type) \
325
+ DECLARE_PEM_write_const_attr(extern, name, type)
326
+ # endif
327
+ # define DECLARE_PEM_write_cb_attr(attr, name, type) \
328
+ DECLARE_PEM_write_cb_bio_attr(attr, name, type) \
329
+ DECLARE_PEM_write_cb_fp_attr(attr, name, type)
330
+ # define DECLARE_PEM_write_cb_ex_attr(attr, name, type) \
331
+ DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \
332
+ DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type)
333
+ # define DECLARE_PEM_write_cb(name, type) \
334
+ DECLARE_PEM_write_cb_attr(extern, name, type)
335
+ # define DECLARE_PEM_write_cb_ex(name, type) \
336
+ DECLARE_PEM_write_cb_ex_attr(extern, name, type)
337
+ # define DECLARE_PEM_read_attr(attr, name, type) \
338
+ DECLARE_PEM_read_bio_attr(attr, name, type) \
339
+ DECLARE_PEM_read_fp_attr(attr, name, type)
340
+ # define DECLARE_PEM_read_ex_attr(attr, name, type) \
341
+ DECLARE_PEM_read_bio_ex_attr(attr, name, type) \
342
+ DECLARE_PEM_read_fp_ex_attr(attr, name, type)
343
+ # define DECLARE_PEM_read(name, type) \
344
+ DECLARE_PEM_read_attr(extern, name, type)
345
+ # define DECLARE_PEM_read_ex(name, type) \
346
+ DECLARE_PEM_read_ex_attr(extern, name, type)
347
+ # define DECLARE_PEM_rw_attr(attr, name, type) \
348
+ DECLARE_PEM_read_attr(attr, name, type) \
349
+ DECLARE_PEM_write_attr(attr, name, type)
350
+ # define DECLARE_PEM_rw_ex_attr(attr, name, type) \
351
+ DECLARE_PEM_read_ex_attr(attr, name, type) \
352
+ DECLARE_PEM_write_ex_attr(attr, name, type)
353
+ # define DECLARE_PEM_rw(name, type) \
354
+ DECLARE_PEM_rw_attr(extern, name, type)
355
+ # define DECLARE_PEM_rw_ex(name, type) \
356
+ DECLARE_PEM_rw_ex_attr(extern, name, type)
357
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
358
+ # define DECLARE_PEM_rw_const_attr(attr, name, type) \
359
+ DECLARE_PEM_read_attr(attr, name, type) \
360
+ DECLARE_PEM_write_const_attr(attr, name, type)
361
+ # define DECLARE_PEM_rw_const(name, type) \
362
+ DECLARE_PEM_rw_const_attr(extern, name, type)
363
+ # endif
364
+ # define DECLARE_PEM_rw_cb_attr(attr, name, type) \
365
+ DECLARE_PEM_read_attr(attr, name, type) \
366
+ DECLARE_PEM_write_cb_attr(attr, name, type)
367
+ # define DECLARE_PEM_rw_cb_ex_attr(attr, name, type) \
368
+ DECLARE_PEM_read_ex_attr(attr, name, type) \
369
+ DECLARE_PEM_write_cb_ex_attr(attr, name, type)
370
+ # define DECLARE_PEM_rw_cb(name, type) \
371
+ DECLARE_PEM_rw_cb_attr(extern, name, type)
372
+ # define DECLARE_PEM_rw_cb_ex(name, type) \
373
+ DECLARE_PEM_rw_cb_ex_attr(extern, name, type)
374
+
375
+ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
376
+ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
377
+ pem_password_cb *callback, void *u);
378
+
379
+ int PEM_read_bio(BIO *bp, char **name, char **header,
380
+ unsigned char **data, long *len);
381
+ # define PEM_FLAG_SECURE 0x1
382
+ # define PEM_FLAG_EAY_COMPATIBLE 0x2
383
+ # define PEM_FLAG_ONLY_B64 0x4
384
+ int PEM_read_bio_ex(BIO *bp, char **name, char **header,
385
+ unsigned char **data, long *len, unsigned int flags);
386
+ int PEM_bytes_read_bio_secmem(unsigned char **pdata, long *plen, char **pnm,
387
+ const char *name, BIO *bp, pem_password_cb *cb,
388
+ void *u);
389
+ int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
390
+ const unsigned char *data, long len);
391
+ int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
392
+ const char *name, BIO *bp, pem_password_cb *cb,
393
+ void *u);
394
+ void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
395
+ pem_password_cb *cb, void *u);
396
+ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
397
+ const void *x, const EVP_CIPHER *enc,
398
+ const unsigned char *kstr, int klen,
399
+ pem_password_cb *cb, void *u);
400
+ int PEM_ASN1_write_bio_ctx(OSSL_i2d_of_void_ctx *i2d, void *vctx,
401
+ const char *name, BIO *bp, const void *x,
402
+ const EVP_CIPHER *enc, const unsigned char *kstr,
403
+ int klen, pem_password_cb *cb, void *u);
404
+
405
+ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
406
+ pem_password_cb *cb, void *u);
407
+ STACK_OF(X509_INFO)
408
+ *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
409
+ pem_password_cb *cb, void *u, OSSL_LIB_CTX *libctx,
410
+ const char *propq);
411
+
412
+ int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc,
413
+ const unsigned char *kstr, int klen,
414
+ pem_password_cb *cd, void *u);
415
+
416
+ #ifndef OPENSSL_NO_STDIO
417
+ int PEM_read(FILE *fp, char **name, char **header,
418
+ unsigned char **data, long *len);
419
+ int PEM_write(FILE *fp, const char *name, const char *hdr,
420
+ const unsigned char *data, long len);
421
+ void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
422
+ pem_password_cb *cb, void *u);
423
+ int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
424
+ const void *x, const EVP_CIPHER *enc,
425
+ const unsigned char *kstr, int klen,
426
+ pem_password_cb *callback, void *u);
427
+ STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
428
+ pem_password_cb *cb, void *u);
429
+ STACK_OF(X509_INFO)
430
+ *PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
431
+ void *u, OSSL_LIB_CTX *libctx, const char *propq);
432
+ #endif
433
+
434
+ int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
435
+ int PEM_SignUpdate(EVP_MD_CTX *ctx, const unsigned char *d, unsigned int cnt);
436
+ int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
437
+ unsigned int *siglen, EVP_PKEY *pkey);
438
+
439
+ /* The default pem_password_cb that's used internally */
440
+ int PEM_def_callback(char *buf, int num, int rwflag, void *userdata);
441
+ void PEM_proc_type(char *buf, int type);
442
+ void PEM_dek_info(char *buf, const char *type, int len, const char *str);
443
+
444
+ # include <openssl/symhacks.h>
445
+
446
+ DECLARE_PEM_rw(X509, X509)
447
+ DECLARE_PEM_rw(X509_AUX, X509)
448
+ DECLARE_PEM_rw(X509_REQ, X509_REQ)
449
+ DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
450
+ DECLARE_PEM_rw(X509_CRL, X509_CRL)
451
+ DECLARE_PEM_rw(X509_PUBKEY, X509_PUBKEY)
452
+ DECLARE_PEM_rw(PKCS7, PKCS7)
453
+ DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
454
+ DECLARE_PEM_rw(PKCS8, X509_SIG)
455
+ DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
456
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
457
+ DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, RSAPrivateKey, RSA)
458
+ DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSAPublicKey, RSA)
459
+ DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSA_PUBKEY, RSA)
460
+ # endif
461
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
462
+ # ifndef OPENSSL_NO_DSA
463
+ DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, DSAPrivateKey, DSA)
464
+ DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSA_PUBKEY, DSA)
465
+ DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSAparams, DSA)
466
+ # endif
467
+ # endif
468
+
469
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
470
+ # ifndef OPENSSL_NO_EC
471
+ DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, ECPKParameters, EC_GROUP)
472
+ DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, ECPrivateKey, EC_KEY)
473
+ DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, EC_PUBKEY, EC_KEY)
474
+ # endif
475
+ # endif
476
+
477
+ # ifndef OPENSSL_NO_DH
478
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
479
+ DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DHparams, DH)
480
+ DECLARE_PEM_write_attr(OSSL_DEPRECATEDIN_3_0, DHxparams, DH)
481
+ # endif
482
+ # endif
483
+ DECLARE_PEM_rw_cb_ex(PrivateKey, EVP_PKEY)
484
+ DECLARE_PEM_rw_ex(PUBKEY, EVP_PKEY)
485
+
486
+ int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x,
487
+ const EVP_CIPHER *enc,
488
+ const unsigned char *kstr, int klen,
489
+ pem_password_cb *cb, void *u);
490
+
491
+ /* Why do these take a signed char *kstr? */
492
+ int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, const EVP_PKEY *x, int nid,
493
+ const char *kstr, int klen,
494
+ pem_password_cb *cb, void *u);
495
+ int PEM_write_bio_PKCS8PrivateKey(BIO *, const EVP_PKEY *, const EVP_CIPHER *,
496
+ const char *kstr, int klen,
497
+ pem_password_cb *cb, void *u);
498
+ int i2d_PKCS8PrivateKey_bio(BIO *bp, const EVP_PKEY *x, const EVP_CIPHER *enc,
499
+ const char *kstr, int klen,
500
+ pem_password_cb *cb, void *u);
501
+ int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, const EVP_PKEY *x, int nid,
502
+ const char *kstr, int klen,
503
+ pem_password_cb *cb, void *u);
504
+ EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
505
+ void *u);
506
+
507
+ # ifndef OPENSSL_NO_STDIO
508
+ int i2d_PKCS8PrivateKey_fp(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
509
+ const char *kstr, int klen,
510
+ pem_password_cb *cb, void *u);
511
+ int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, const EVP_PKEY *x, int nid,
512
+ const char *kstr, int klen,
513
+ pem_password_cb *cb, void *u);
514
+ int PEM_write_PKCS8PrivateKey_nid(FILE *fp, const EVP_PKEY *x, int nid,
515
+ const char *kstr, int klen,
516
+ pem_password_cb *cb, void *u);
517
+
518
+ EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
519
+ void *u);
520
+
521
+ int PEM_write_PKCS8PrivateKey(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
522
+ const char *kstr, int klen,
523
+ pem_password_cb *cd, void *u);
524
+ # endif
525
+ EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
526
+ OSSL_LIB_CTX *libctx, const char *propq);
527
+ EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
528
+ int PEM_write_bio_Parameters(BIO *bp, const EVP_PKEY *x);
529
+
530
+ EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
531
+ EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
532
+ EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
533
+ EVP_PKEY *b2i_PublicKey_bio(BIO *in);
534
+ int i2b_PrivateKey_bio(BIO *out, const EVP_PKEY *pk);
535
+ int i2b_PublicKey_bio(BIO *out, const EVP_PKEY *pk);
536
+ EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
537
+ EVP_PKEY *b2i_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u,
538
+ OSSL_LIB_CTX *libctx, const char *propq);
539
+ int i2b_PVK_bio(BIO *out, const EVP_PKEY *pk, int enclevel,
540
+ pem_password_cb *cb, void *u);
541
+ int i2b_PVK_bio_ex(BIO *out, const EVP_PKEY *pk, int enclevel,
542
+ pem_password_cb *cb, void *u,
543
+ OSSL_LIB_CTX *libctx, const char *propq);
544
+
545
+ # ifdef __cplusplus
546
+ }
547
+ # endif
548
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/rsa.h ADDED
@@ -0,0 +1,615 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 1995-2021 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
+ #ifndef OPENSSL_RSA_H
11
+ # define OPENSSL_RSA_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_RSA_H
17
+ # endif
18
+
19
+ # include <openssl/opensslconf.h>
20
+
21
+ # include <openssl/asn1.h>
22
+ # include <openssl/bio.h>
23
+ # include <openssl/crypto.h>
24
+ # include <openssl/types.h>
25
+ # ifndef OPENSSL_NO_DEPRECATED_1_1_0
26
+ # include <openssl/bn.h>
27
+ # endif
28
+ # include <openssl/rsaerr.h>
29
+ # include <openssl/safestack.h>
30
+ # ifndef OPENSSL_NO_STDIO
31
+ # include <stdio.h>
32
+ # endif
33
+
34
+ # ifdef __cplusplus
35
+ extern "C" {
36
+ # endif
37
+
38
+ # ifndef OPENSSL_RSA_MAX_MODULUS_BITS
39
+ # define OPENSSL_RSA_MAX_MODULUS_BITS 16384
40
+ # endif
41
+
42
+ # define RSA_3 0x3L
43
+ # define RSA_F4 0x10001L
44
+
45
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
46
+ /* The types RSA and RSA_METHOD are defined in ossl_typ.h */
47
+
48
+ # define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 2048
49
+
50
+ # ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
51
+ # define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
52
+ # endif
53
+
54
+ /* exponent limit enforced for "large" modulus only */
55
+ # ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
56
+ # define OPENSSL_RSA_MAX_PUBEXP_BITS 64
57
+ # endif
58
+ /* based on RFC 8017 appendix A.1.2 */
59
+ # define RSA_ASN1_VERSION_DEFAULT 0
60
+ # define RSA_ASN1_VERSION_MULTI 1
61
+
62
+ # define RSA_DEFAULT_PRIME_NUM 2
63
+
64
+ # define RSA_METHOD_FLAG_NO_CHECK 0x0001
65
+ # define RSA_FLAG_CACHE_PUBLIC 0x0002
66
+ # define RSA_FLAG_CACHE_PRIVATE 0x0004
67
+ # define RSA_FLAG_BLINDING 0x0008
68
+ # define RSA_FLAG_THREAD_SAFE 0x0010
69
+ /*
70
+ * This flag means the private key operations will be handled by rsa_mod_exp
71
+ * and that they do not depend on the private key components being present:
72
+ * for example a key stored in external hardware. Without this flag
73
+ * bn_mod_exp gets called when private key components are absent.
74
+ */
75
+ # define RSA_FLAG_EXT_PKEY 0x0020
76
+
77
+ /*
78
+ * new with 0.9.6j and 0.9.7b; the built-in
79
+ * RSA implementation now uses blinding by
80
+ * default (ignoring RSA_FLAG_BLINDING),
81
+ * but other engines might not need it
82
+ */
83
+ # define RSA_FLAG_NO_BLINDING 0x0080
84
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
85
+ /*
86
+ * Does nothing. Previously this switched off constant time behaviour.
87
+ */
88
+ # ifndef OPENSSL_NO_DEPRECATED_1_1_0
89
+ # define RSA_FLAG_NO_CONSTTIME 0x0000
90
+ # endif
91
+ /* deprecated name for the flag*/
92
+ /*
93
+ * new with 0.9.7h; the built-in RSA
94
+ * implementation now uses constant time
95
+ * modular exponentiation for secret exponents
96
+ * by default. This flag causes the
97
+ * faster variable sliding window method to
98
+ * be used for all exponents.
99
+ */
100
+ # ifndef OPENSSL_NO_DEPRECATED_0_9_8
101
+ # define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME
102
+ # endif
103
+
104
+ /*-
105
+ * New with 3.0: use part of the flags to denote exact type of RSA key,
106
+ * some of which are limited to specific signature and encryption schemes.
107
+ * These different types share the same RSA structure, but indicate the
108
+ * use of certain fields in that structure.
109
+ * Currently known are:
110
+ * RSA - this is the "normal" unlimited RSA structure (typenum 0)
111
+ * RSASSA-PSS - indicates that the PSS parameters are used.
112
+ * RSAES-OAEP - no specific field used for the moment, but OAEP padding
113
+ * is expected. (currently unused)
114
+ *
115
+ * 4 bits allow for 16 types
116
+ */
117
+ # define RSA_FLAG_TYPE_MASK 0xF000
118
+ # define RSA_FLAG_TYPE_RSA 0x0000
119
+ # define RSA_FLAG_TYPE_RSASSAPSS 0x1000
120
+ # define RSA_FLAG_TYPE_RSAESOAEP 0x2000
121
+
122
+ int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad_mode);
123
+ int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *pad_mode);
124
+
125
+ int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
126
+ int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen);
127
+
128
+ int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits);
129
+ int EVP_PKEY_CTX_set1_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
130
+ int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
131
+ int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
132
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
133
+ OSSL_DEPRECATEDIN_3_0
134
+ int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
135
+ # endif
136
+
137
+ /* Salt length matches digest */
138
+ # define RSA_PSS_SALTLEN_DIGEST -1
139
+ /* Verify only: auto detect salt length */
140
+ # define RSA_PSS_SALTLEN_AUTO -2
141
+ /* Set salt length to maximum possible */
142
+ # define RSA_PSS_SALTLEN_MAX -3
143
+ /* Auto-detect on verify, set salt length to min(maximum possible, digest
144
+ * length) on sign */
145
+ # define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX -4
146
+ /* Old compatible max salt length for sign only */
147
+ # define RSA_PSS_SALTLEN_MAX_SIGN -2
148
+
149
+ int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
150
+ int EVP_PKEY_CTX_set_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
151
+ const char *mdprops);
152
+ int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
153
+ int EVP_PKEY_CTX_get_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, char *name,
154
+ size_t namelen);
155
+ int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
156
+ int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name(EVP_PKEY_CTX *ctx,
157
+ const char *mdname);
158
+
159
+ int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
160
+ int EVP_PKEY_CTX_set_rsa_pss_keygen_md_name(EVP_PKEY_CTX *ctx,
161
+ const char *mdname,
162
+ const char *mdprops);
163
+
164
+ int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
165
+ int EVP_PKEY_CTX_set_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
166
+ const char *mdprops);
167
+ int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
168
+ int EVP_PKEY_CTX_get_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, char *name,
169
+ size_t namelen);
170
+ int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, void *label, int llen);
171
+ int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
172
+
173
+ # define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1)
174
+ # define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2)
175
+
176
+ # define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3)
177
+ # define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)
178
+ # define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5)
179
+
180
+ # define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6)
181
+ # define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7)
182
+ # define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8)
183
+
184
+ # define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9)
185
+ # define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10)
186
+
187
+ # define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11)
188
+ # define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12)
189
+
190
+ # define EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES (EVP_PKEY_ALG_CTRL + 13)
191
+
192
+ # define EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION (EVP_PKEY_ALG_CTRL + 14)
193
+
194
+ # define RSA_PKCS1_PADDING 1
195
+ # define RSA_NO_PADDING 3
196
+ # define RSA_PKCS1_OAEP_PADDING 4
197
+ # define RSA_X931_PADDING 5
198
+
199
+ /* EVP_PKEY_ only */
200
+ # define RSA_PKCS1_PSS_PADDING 6
201
+ # define RSA_PKCS1_WITH_TLS_PADDING 7
202
+
203
+ /* internal RSA_ only */
204
+ # define RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING 8
205
+
206
+ # define RSA_PKCS1_PADDING_SIZE 11
207
+
208
+ # define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
209
+ # define RSA_get_app_data(s) RSA_get_ex_data(s,0)
210
+
211
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
212
+ OSSL_DEPRECATEDIN_3_0 RSA *RSA_new(void);
213
+ OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine);
214
+ OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa);
215
+ OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
216
+ OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa);
217
+
218
+ OSSL_DEPRECATEDIN_3_0 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
219
+ OSSL_DEPRECATEDIN_3_0 int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
220
+ OSSL_DEPRECATEDIN_3_0 int RSA_set0_crt_params(RSA *r,
221
+ BIGNUM *dmp1, BIGNUM *dmq1,
222
+ BIGNUM *iqmp);
223
+ OSSL_DEPRECATEDIN_3_0 int RSA_set0_multi_prime_params(RSA *r,
224
+ BIGNUM *primes[],
225
+ BIGNUM *exps[],
226
+ BIGNUM *coeffs[],
227
+ int pnum);
228
+ OSSL_DEPRECATEDIN_3_0 void RSA_get0_key(const RSA *r,
229
+ const BIGNUM **n, const BIGNUM **e,
230
+ const BIGNUM **d);
231
+ OSSL_DEPRECATEDIN_3_0 void RSA_get0_factors(const RSA *r,
232
+ const BIGNUM **p, const BIGNUM **q);
233
+ OSSL_DEPRECATEDIN_3_0 int RSA_get_multi_prime_extra_count(const RSA *r);
234
+ OSSL_DEPRECATEDIN_3_0 int RSA_get0_multi_prime_factors(const RSA *r,
235
+ const BIGNUM *primes[]);
236
+ OSSL_DEPRECATEDIN_3_0 void RSA_get0_crt_params(const RSA *r,
237
+ const BIGNUM **dmp1,
238
+ const BIGNUM **dmq1,
239
+ const BIGNUM **iqmp);
240
+ OSSL_DEPRECATEDIN_3_0
241
+ int RSA_get0_multi_prime_crt_params(const RSA *r, const BIGNUM *exps[],
242
+ const BIGNUM *coeffs[]);
243
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_n(const RSA *d);
244
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_e(const RSA *d);
245
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_d(const RSA *d);
246
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_p(const RSA *d);
247
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_q(const RSA *d);
248
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmp1(const RSA *r);
249
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmq1(const RSA *r);
250
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_iqmp(const RSA *r);
251
+ OSSL_DEPRECATEDIN_3_0 const RSA_PSS_PARAMS *RSA_get0_pss_params(const RSA *r);
252
+ OSSL_DEPRECATEDIN_3_0 void RSA_clear_flags(RSA *r, int flags);
253
+ OSSL_DEPRECATEDIN_3_0 int RSA_test_flags(const RSA *r, int flags);
254
+ OSSL_DEPRECATEDIN_3_0 void RSA_set_flags(RSA *r, int flags);
255
+ OSSL_DEPRECATEDIN_3_0 int RSA_get_version(RSA *r);
256
+ OSSL_DEPRECATEDIN_3_0 ENGINE *RSA_get0_engine(const RSA *r);
257
+ # endif /* !OPENSSL_NO_DEPRECATED_3_0 */
258
+
259
+ # define EVP_RSA_gen(bits) \
260
+ EVP_PKEY_Q_keygen(NULL, NULL, "RSA", (size_t)(0 + (bits)))
261
+
262
+ /* Deprecated version */
263
+ # ifndef OPENSSL_NO_DEPRECATED_0_9_8
264
+ OSSL_DEPRECATEDIN_0_9_8 RSA *RSA_generate_key(int bits, unsigned long e, void
265
+ (*callback) (int, int, void *),
266
+ void *cb_arg);
267
+ # endif
268
+
269
+ /* New version */
270
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
271
+ OSSL_DEPRECATEDIN_3_0 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e,
272
+ BN_GENCB *cb);
273
+ /* Multi-prime version */
274
+ OSSL_DEPRECATEDIN_3_0 int RSA_generate_multi_prime_key(RSA *rsa, int bits,
275
+ int primes, BIGNUM *e,
276
+ BN_GENCB *cb);
277
+
278
+ OSSL_DEPRECATEDIN_3_0
279
+ int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2,
280
+ BIGNUM *q1, BIGNUM *q2,
281
+ const BIGNUM *Xp1, const BIGNUM *Xp2,
282
+ const BIGNUM *Xp, const BIGNUM *Xq1,
283
+ const BIGNUM *Xq2, const BIGNUM *Xq,
284
+ const BIGNUM *e, BN_GENCB *cb);
285
+ OSSL_DEPRECATEDIN_3_0 int RSA_X931_generate_key_ex(RSA *rsa, int bits,
286
+ const BIGNUM *e,
287
+ BN_GENCB *cb);
288
+
289
+ OSSL_DEPRECATEDIN_3_0 int RSA_check_key(const RSA *);
290
+ OSSL_DEPRECATEDIN_3_0 int RSA_check_key_ex(const RSA *, BN_GENCB *cb);
291
+ /* next 4 return -1 on error */
292
+ OSSL_DEPRECATEDIN_3_0
293
+ int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to,
294
+ RSA *rsa, int padding);
295
+ OSSL_DEPRECATEDIN_3_0
296
+ int RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
297
+ RSA *rsa, int padding);
298
+ OSSL_DEPRECATEDIN_3_0
299
+ int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
300
+ RSA *rsa, int padding);
301
+ OSSL_DEPRECATEDIN_3_0
302
+ int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
303
+ RSA *rsa, int padding);
304
+ OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r);
305
+ /* "up" the RSA object's reference count */
306
+ OSSL_DEPRECATEDIN_3_0 int RSA_up_ref(RSA *r);
307
+ OSSL_DEPRECATEDIN_3_0 int RSA_flags(const RSA *r);
308
+
309
+ OSSL_DEPRECATEDIN_3_0 void RSA_set_default_method(const RSA_METHOD *meth);
310
+ OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_default_method(void);
311
+ OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_null_method(void);
312
+ OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_method(const RSA *rsa);
313
+ OSSL_DEPRECATEDIN_3_0 int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
314
+
315
+ /* these are the actual RSA functions */
316
+ OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_PKCS1_OpenSSL(void);
317
+
318
+ DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0,
319
+ RSA, RSAPublicKey)
320
+ DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0,
321
+ RSA, RSAPrivateKey)
322
+ # endif /* !OPENSSL_NO_DEPRECATED_3_0 */
323
+
324
+ int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2);
325
+
326
+ struct rsa_pss_params_st {
327
+ X509_ALGOR *hashAlgorithm;
328
+ X509_ALGOR *maskGenAlgorithm;
329
+ ASN1_INTEGER *saltLength;
330
+ ASN1_INTEGER *trailerField;
331
+ /* Decoded hash algorithm from maskGenAlgorithm */
332
+ X509_ALGOR *maskHash;
333
+ };
334
+
335
+ DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
336
+ DECLARE_ASN1_DUP_FUNCTION(RSA_PSS_PARAMS)
337
+
338
+ typedef struct rsa_oaep_params_st {
339
+ X509_ALGOR *hashFunc;
340
+ X509_ALGOR *maskGenFunc;
341
+ X509_ALGOR *pSourceFunc;
342
+ /* Decoded hash algorithm from maskGenFunc */
343
+ X509_ALGOR *maskHash;
344
+ } RSA_OAEP_PARAMS;
345
+
346
+ DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS)
347
+
348
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
349
+ # ifndef OPENSSL_NO_STDIO
350
+ OSSL_DEPRECATEDIN_3_0 int RSA_print_fp(FILE *fp, const RSA *r, int offset);
351
+ # endif
352
+
353
+ OSSL_DEPRECATEDIN_3_0 int RSA_print(BIO *bp, const RSA *r, int offset);
354
+
355
+ /*
356
+ * The following 2 functions sign and verify a X509_SIG ASN1 object inside
357
+ * PKCS#1 padded RSA encryption
358
+ */
359
+ OSSL_DEPRECATEDIN_3_0 int RSA_sign(int type, const unsigned char *m,
360
+ unsigned int m_length, unsigned char *sigret,
361
+ unsigned int *siglen, RSA *rsa);
362
+ OSSL_DEPRECATEDIN_3_0 int RSA_verify(int type, const unsigned char *m,
363
+ unsigned int m_length,
364
+ const unsigned char *sigbuf,
365
+ unsigned int siglen, RSA *rsa);
366
+
367
+ /*
368
+ * The following 2 function sign and verify a ASN1_OCTET_STRING object inside
369
+ * PKCS#1 padded RSA encryption
370
+ */
371
+ OSSL_DEPRECATEDIN_3_0
372
+ int RSA_sign_ASN1_OCTET_STRING(int type,
373
+ const unsigned char *m, unsigned int m_length,
374
+ unsigned char *sigret, unsigned int *siglen,
375
+ RSA *rsa);
376
+ OSSL_DEPRECATEDIN_3_0
377
+ int RSA_verify_ASN1_OCTET_STRING(int type,
378
+ const unsigned char *m, unsigned int m_length,
379
+ unsigned char *sigbuf, unsigned int siglen,
380
+ RSA *rsa);
381
+
382
+ OSSL_DEPRECATEDIN_3_0 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
383
+ OSSL_DEPRECATEDIN_3_0 void RSA_blinding_off(RSA *rsa);
384
+ OSSL_DEPRECATEDIN_3_0 BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
385
+
386
+ OSSL_DEPRECATEDIN_3_0
387
+ int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
388
+ const unsigned char *f, int fl);
389
+ OSSL_DEPRECATEDIN_3_0
390
+ int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
391
+ const unsigned char *f, int fl,
392
+ int rsa_len);
393
+ OSSL_DEPRECATEDIN_3_0
394
+ int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
395
+ const unsigned char *f, int fl);
396
+ OSSL_DEPRECATEDIN_3_0
397
+ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
398
+ const unsigned char *f, int fl,
399
+ int rsa_len);
400
+ OSSL_DEPRECATEDIN_3_0 int PKCS1_MGF1(unsigned char *mask, long len,
401
+ const unsigned char *seed, long seedlen,
402
+ const EVP_MD *dgst);
403
+ OSSL_DEPRECATEDIN_3_0
404
+ int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
405
+ const unsigned char *f, int fl,
406
+ const unsigned char *p, int pl);
407
+ OSSL_DEPRECATEDIN_3_0
408
+ int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
409
+ const unsigned char *f, int fl, int rsa_len,
410
+ const unsigned char *p, int pl);
411
+ OSSL_DEPRECATEDIN_3_0
412
+ int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
413
+ const unsigned char *from, int flen,
414
+ const unsigned char *param, int plen,
415
+ const EVP_MD *md, const EVP_MD *mgf1md);
416
+ OSSL_DEPRECATEDIN_3_0
417
+ int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
418
+ const unsigned char *from, int flen,
419
+ int num,
420
+ const unsigned char *param, int plen,
421
+ const EVP_MD *md, const EVP_MD *mgf1md);
422
+ OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_none(unsigned char *to, int tlen,
423
+ const unsigned char *f, int fl);
424
+ OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_none(unsigned char *to, int tlen,
425
+ const unsigned char *f, int fl,
426
+ int rsa_len);
427
+ OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_X931(unsigned char *to, int tlen,
428
+ const unsigned char *f, int fl);
429
+ OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_X931(unsigned char *to, int tlen,
430
+ const unsigned char *f, int fl,
431
+ int rsa_len);
432
+ OSSL_DEPRECATEDIN_3_0 int RSA_X931_hash_id(int nid);
433
+
434
+ OSSL_DEPRECATEDIN_3_0
435
+ int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
436
+ const EVP_MD *Hash, const unsigned char *EM,
437
+ int sLen);
438
+ OSSL_DEPRECATEDIN_3_0
439
+ int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
440
+ const unsigned char *mHash, const EVP_MD *Hash,
441
+ int sLen);
442
+
443
+ OSSL_DEPRECATEDIN_3_0
444
+ int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
445
+ const EVP_MD *Hash, const EVP_MD *mgf1Hash,
446
+ const unsigned char *EM, int sLen);
447
+
448
+ OSSL_DEPRECATEDIN_3_0
449
+ int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
450
+ const unsigned char *mHash,
451
+ const EVP_MD *Hash, const EVP_MD *mgf1Hash,
452
+ int sLen);
453
+
454
+ # define RSA_get_ex_new_index(l, p, newf, dupf, freef) \
455
+ CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef)
456
+ OSSL_DEPRECATEDIN_3_0 int RSA_set_ex_data(RSA *r, int idx, void *arg);
457
+ OSSL_DEPRECATEDIN_3_0 void *RSA_get_ex_data(const RSA *r, int idx);
458
+
459
+ DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPublicKey)
460
+ DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPrivateKey)
461
+
462
+ /*
463
+ * If this flag is set the RSA method is FIPS compliant and can be used in
464
+ * FIPS mode. This is set in the validated module method. If an application
465
+ * sets this flag in its own methods it is its responsibility to ensure the
466
+ * result is compliant.
467
+ */
468
+
469
+ # define RSA_FLAG_FIPS_METHOD 0x0400
470
+
471
+ /*
472
+ * If this flag is set the operations normally disabled in FIPS mode are
473
+ * permitted it is then the applications responsibility to ensure that the
474
+ * usage is compliant.
475
+ */
476
+
477
+ # define RSA_FLAG_NON_FIPS_ALLOW 0x0400
478
+ /*
479
+ * Application has decided PRNG is good enough to generate a key: don't
480
+ * check.
481
+ */
482
+ # define RSA_FLAG_CHECKED 0x0800
483
+
484
+ OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_new(const char *name, int flags);
485
+ OSSL_DEPRECATEDIN_3_0 void RSA_meth_free(RSA_METHOD *meth);
486
+ OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth);
487
+ OSSL_DEPRECATEDIN_3_0 const char *RSA_meth_get0_name(const RSA_METHOD *meth);
488
+ OSSL_DEPRECATEDIN_3_0 int RSA_meth_set1_name(RSA_METHOD *meth,
489
+ const char *name);
490
+ OSSL_DEPRECATEDIN_3_0 int RSA_meth_get_flags(const RSA_METHOD *meth);
491
+ OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_flags(RSA_METHOD *meth, int flags);
492
+ OSSL_DEPRECATEDIN_3_0 void *RSA_meth_get0_app_data(const RSA_METHOD *meth);
493
+ OSSL_DEPRECATEDIN_3_0 int RSA_meth_set0_app_data(RSA_METHOD *meth,
494
+ void *app_data);
495
+ OSSL_DEPRECATEDIN_3_0
496
+ int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) (int flen,
497
+ const unsigned char *from,
498
+ unsigned char *to,
499
+ RSA *rsa, int padding);
500
+ OSSL_DEPRECATEDIN_3_0
501
+ int RSA_meth_set_pub_enc(RSA_METHOD *rsa,
502
+ int (*pub_enc) (int flen, const unsigned char *from,
503
+ unsigned char *to, RSA *rsa,
504
+ int padding));
505
+ OSSL_DEPRECATEDIN_3_0
506
+ int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) (int flen,
507
+ const unsigned char *from,
508
+ unsigned char *to,
509
+ RSA *rsa, int padding);
510
+ OSSL_DEPRECATEDIN_3_0
511
+ int RSA_meth_set_pub_dec(RSA_METHOD *rsa,
512
+ int (*pub_dec) (int flen, const unsigned char *from,
513
+ unsigned char *to, RSA *rsa,
514
+ int padding));
515
+ OSSL_DEPRECATEDIN_3_0
516
+ int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) (int flen,
517
+ const unsigned char *from,
518
+ unsigned char *to,
519
+ RSA *rsa, int padding);
520
+ OSSL_DEPRECATEDIN_3_0
521
+ int RSA_meth_set_priv_enc(RSA_METHOD *rsa,
522
+ int (*priv_enc) (int flen, const unsigned char *from,
523
+ unsigned char *to, RSA *rsa,
524
+ int padding));
525
+ OSSL_DEPRECATEDIN_3_0
526
+ int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) (int flen,
527
+ const unsigned char *from,
528
+ unsigned char *to,
529
+ RSA *rsa, int padding);
530
+ OSSL_DEPRECATEDIN_3_0
531
+ int RSA_meth_set_priv_dec(RSA_METHOD *rsa,
532
+ int (*priv_dec) (int flen, const unsigned char *from,
533
+ unsigned char *to, RSA *rsa,
534
+ int padding));
535
+ OSSL_DEPRECATEDIN_3_0
536
+ int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r0,
537
+ const BIGNUM *i,
538
+ RSA *rsa, BN_CTX *ctx);
539
+ OSSL_DEPRECATEDIN_3_0
540
+ int RSA_meth_set_mod_exp(RSA_METHOD *rsa,
541
+ int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa,
542
+ BN_CTX *ctx));
543
+ OSSL_DEPRECATEDIN_3_0
544
+ int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r,
545
+ const BIGNUM *a,
546
+ const BIGNUM *p,
547
+ const BIGNUM *m,
548
+ BN_CTX *ctx,
549
+ BN_MONT_CTX *m_ctx);
550
+ OSSL_DEPRECATEDIN_3_0
551
+ int RSA_meth_set_bn_mod_exp(RSA_METHOD *rsa,
552
+ int (*bn_mod_exp) (BIGNUM *r,
553
+ const BIGNUM *a,
554
+ const BIGNUM *p,
555
+ const BIGNUM *m,
556
+ BN_CTX *ctx,
557
+ BN_MONT_CTX *m_ctx));
558
+ OSSL_DEPRECATEDIN_3_0
559
+ int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa);
560
+ OSSL_DEPRECATEDIN_3_0
561
+ int RSA_meth_set_init(RSA_METHOD *rsa, int (*init) (RSA *rsa));
562
+ OSSL_DEPRECATEDIN_3_0
563
+ int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa);
564
+ OSSL_DEPRECATEDIN_3_0
565
+ int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish) (RSA *rsa));
566
+ OSSL_DEPRECATEDIN_3_0
567
+ int (*RSA_meth_get_sign(const RSA_METHOD *meth)) (int type,
568
+ const unsigned char *m,
569
+ unsigned int m_length,
570
+ unsigned char *sigret,
571
+ unsigned int *siglen,
572
+ const RSA *rsa);
573
+ OSSL_DEPRECATEDIN_3_0
574
+ int RSA_meth_set_sign(RSA_METHOD *rsa,
575
+ int (*sign) (int type, const unsigned char *m,
576
+ unsigned int m_length,
577
+ unsigned char *sigret, unsigned int *siglen,
578
+ const RSA *rsa));
579
+ OSSL_DEPRECATEDIN_3_0
580
+ int (*RSA_meth_get_verify(const RSA_METHOD *meth)) (int dtype,
581
+ const unsigned char *m,
582
+ unsigned int m_length,
583
+ const unsigned char *sigbuf,
584
+ unsigned int siglen,
585
+ const RSA *rsa);
586
+ OSSL_DEPRECATEDIN_3_0
587
+ int RSA_meth_set_verify(RSA_METHOD *rsa,
588
+ int (*verify) (int dtype, const unsigned char *m,
589
+ unsigned int m_length,
590
+ const unsigned char *sigbuf,
591
+ unsigned int siglen, const RSA *rsa));
592
+ OSSL_DEPRECATEDIN_3_0
593
+ int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) (RSA *rsa, int bits,
594
+ BIGNUM *e, BN_GENCB *cb);
595
+ OSSL_DEPRECATEDIN_3_0
596
+ int RSA_meth_set_keygen(RSA_METHOD *rsa,
597
+ int (*keygen) (RSA *rsa, int bits, BIGNUM *e,
598
+ BN_GENCB *cb));
599
+ OSSL_DEPRECATEDIN_3_0
600
+ int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth)) (RSA *rsa,
601
+ int bits,
602
+ int primes,
603
+ BIGNUM *e,
604
+ BN_GENCB *cb);
605
+ OSSL_DEPRECATEDIN_3_0
606
+ int RSA_meth_set_multi_prime_keygen(RSA_METHOD *meth,
607
+ int (*keygen) (RSA *rsa, int bits,
608
+ int primes, BIGNUM *e,
609
+ BN_GENCB *cb));
610
+ #endif /* !OPENSSL_NO_DEPRECATED_3_0 */
611
+
612
+ # ifdef __cplusplus
613
+ }
614
+ # endif
615
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ssl.h ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #if defined(OPENSSL_NO_ASM)
2
+ # include "./ssl_no-asm.h"
3
+ #else
4
+ # include "./ssl_asm.h"
5
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ssl2.h ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 1995-2016 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
+ #ifndef OPENSSL_SSL2_H
11
+ # define OPENSSL_SSL2_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_SSL2_H
17
+ # endif
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ # define SSL2_VERSION 0x0002
24
+
25
+ # define SSL2_MT_CLIENT_HELLO 1
26
+
27
+ #ifdef __cplusplus
28
+ }
29
+ #endif
30
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ssl_no-asm.h ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/no-asm/include/openssl/ssl.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/ssl.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/ssl.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/ssl.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/ssl.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/ssl.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/ssl.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ssl.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ssl.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/ssl.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/ssl.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ssl.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/ssl.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/ssl.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/ssl.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ssl.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/ssl.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/ssl.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/ssl.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/ssl.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/ssl.h"
48
+ #endif
49
+
50
+ /* GOST is not included in all platform */
51
+ #ifndef OPENSSL_NO_GOST
52
+ # define OPENSSL_NO_GOST
53
+ #endif
54
+ /* HW_PADLOCK is not included in all platform */
55
+ #ifndef OPENSSL_NO_HW_PADLOCK
56
+ # define OPENSSL_NO_HW_PADLOCK
57
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/sslerr.h ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Generated by util/mkerr.pl DO NOT EDIT
3
+ * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
6
+ * this file except in compliance with the License. You can obtain a copy
7
+ * in the file LICENSE in the source distribution or at
8
+ * https://www.openssl.org/source/license.html
9
+ */
10
+
11
+ #ifndef OPENSSL_SSLERR_H
12
+ # define OPENSSL_SSLERR_H
13
+ # pragma once
14
+
15
+ # include <openssl/opensslconf.h>
16
+ # include <openssl/symhacks.h>
17
+ # include <openssl/sslerr_legacy.h>
18
+
19
+
20
+
21
+ /*
22
+ * SSL reason codes.
23
+ */
24
+ # define SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY 291
25
+ # define SSL_R_APP_DATA_IN_HANDSHAKE 100
26
+ # define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
27
+ # define SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE 158
28
+ # define SSL_R_BAD_CERTIFICATE 348
29
+ # define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
30
+ # define SSL_R_BAD_CIPHER 186
31
+ # define SSL_R_BAD_COMPRESSION_ALGORITHM 326
32
+ # define SSL_R_BAD_DATA 390
33
+ # define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
34
+ # define SSL_R_BAD_DECOMPRESSION 107
35
+ # define SSL_R_BAD_DH_VALUE 102
36
+ # define SSL_R_BAD_DIGEST_LENGTH 111
37
+ # define SSL_R_BAD_EARLY_DATA 233
38
+ # define SSL_R_BAD_ECC_CERT 304
39
+ # define SSL_R_BAD_ECPOINT 306
40
+ # define SSL_R_BAD_EXTENSION 110
41
+ # define SSL_R_BAD_HANDSHAKE_LENGTH 332
42
+ # define SSL_R_BAD_HANDSHAKE_STATE 236
43
+ # define SSL_R_BAD_HELLO_REQUEST 105
44
+ # define SSL_R_BAD_HRR_VERSION 263
45
+ # define SSL_R_BAD_KEY_SHARE 108
46
+ # define SSL_R_BAD_KEY_UPDATE 122
47
+ # define SSL_R_BAD_LEGACY_VERSION 292
48
+ # define SSL_R_BAD_LENGTH 271
49
+ # define SSL_R_BAD_PACKET 240
50
+ # define SSL_R_BAD_PACKET_LENGTH 115
51
+ # define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
52
+ # define SSL_R_BAD_PSK 219
53
+ # define SSL_R_BAD_PSK_IDENTITY 114
54
+ # define SSL_R_BAD_RECORD_TYPE 443
55
+ # define SSL_R_BAD_RSA_ENCRYPT 119
56
+ # define SSL_R_BAD_SIGNATURE 123
57
+ # define SSL_R_BAD_SRP_A_LENGTH 347
58
+ # define SSL_R_BAD_SRP_PARAMETERS 371
59
+ # define SSL_R_BAD_SRTP_MKI_VALUE 352
60
+ # define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353
61
+ # define SSL_R_BAD_SSL_FILETYPE 124
62
+ # define SSL_R_BAD_VALUE 384
63
+ # define SSL_R_BAD_WRITE_RETRY 127
64
+ # define SSL_R_BINDER_DOES_NOT_VERIFY 253
65
+ # define SSL_R_BIO_NOT_SET 128
66
+ # define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
67
+ # define SSL_R_BN_LIB 130
68
+ # define SSL_R_CALLBACK_FAILED 234
69
+ # define SSL_R_CANNOT_CHANGE_CIPHER 109
70
+ # define SSL_R_CANNOT_GET_GROUP_NAME 299
71
+ # define SSL_R_CA_DN_LENGTH_MISMATCH 131
72
+ # define SSL_R_CA_KEY_TOO_SMALL 397
73
+ # define SSL_R_CA_MD_TOO_WEAK 398
74
+ # define SSL_R_CCS_RECEIVED_EARLY 133
75
+ # define SSL_R_CERTIFICATE_VERIFY_FAILED 134
76
+ # define SSL_R_CERT_CB_ERROR 377
77
+ # define SSL_R_CERT_LENGTH_MISMATCH 135
78
+ # define SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED 218
79
+ # define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
80
+ # define SSL_R_CLIENTHELLO_TLSEXT 226
81
+ # define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
82
+ # define SSL_R_COMPRESSION_DISABLED 343
83
+ # define SSL_R_COMPRESSION_FAILURE 141
84
+ # define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
85
+ # define SSL_R_COMPRESSION_LIBRARY_ERROR 142
86
+ # define SSL_R_CONNECTION_TYPE_NOT_SET 144
87
+ # define SSL_R_CONN_USE_ONLY 356
88
+ # define SSL_R_CONTEXT_NOT_DANE_ENABLED 167
89
+ # define SSL_R_COOKIE_GEN_CALLBACK_FAILURE 400
90
+ # define SSL_R_COOKIE_MISMATCH 308
91
+ # define SSL_R_COPY_PARAMETERS_FAILED 296
92
+ # define SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED 206
93
+ # define SSL_R_DANE_ALREADY_ENABLED 172
94
+ # define SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL 173
95
+ # define SSL_R_DANE_NOT_ENABLED 175
96
+ # define SSL_R_DANE_TLSA_BAD_CERTIFICATE 180
97
+ # define SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE 184
98
+ # define SSL_R_DANE_TLSA_BAD_DATA_LENGTH 189
99
+ # define SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH 192
100
+ # define SSL_R_DANE_TLSA_BAD_MATCHING_TYPE 200
101
+ # define SSL_R_DANE_TLSA_BAD_PUBLIC_KEY 201
102
+ # define SSL_R_DANE_TLSA_BAD_SELECTOR 202
103
+ # define SSL_R_DANE_TLSA_NULL_DATA 203
104
+ # define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
105
+ # define SSL_R_DATA_LENGTH_TOO_LONG 146
106
+ # define SSL_R_DECRYPTION_FAILED 147
107
+ # define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
108
+ # define SSL_R_DH_KEY_TOO_SMALL 394
109
+ # define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
110
+ # define SSL_R_DIGEST_CHECK_FAILED 149
111
+ # define SSL_R_DOMAIN_USE_ONLY 422
112
+ # define SSL_R_DTLS_MESSAGE_TOO_BIG 334
113
+ # define SSL_R_DUPLICATE_COMPRESSION_ID 309
114
+ # define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318
115
+ # define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374
116
+ # define SSL_R_EE_KEY_TOO_SMALL 399
117
+ # define SSL_R_EMPTY_RAW_PUBLIC_KEY 349
118
+ # define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354
119
+ # define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
120
+ # define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
121
+ # define SSL_R_ERROR_IN_SYSTEM_DEFAULT_CONFIG 419
122
+ # define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204
123
+ # define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194
124
+ # define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
125
+ # define SSL_R_EXTENSION_NOT_RECEIVED 279
126
+ # define SSL_R_EXTRA_DATA_IN_MESSAGE 153
127
+ # define SSL_R_EXT_LENGTH_MISMATCH 163
128
+ # define SSL_R_FAILED_TO_GET_PARAMETER 316
129
+ # define SSL_R_FAILED_TO_INIT_ASYNC 405
130
+ # define SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE 417
131
+ # define SSL_R_FEATURE_NOT_RENEGOTIABLE 413
132
+ # define SSL_R_FRAGMENTED_CLIENT_HELLO 401
133
+ # define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
134
+ # define SSL_R_HTTPS_PROXY_REQUEST 155
135
+ # define SSL_R_HTTP_REQUEST 156
136
+ # define SSL_R_ILLEGAL_POINT_COMPRESSION 162
137
+ # define SSL_R_ILLEGAL_SUITEB_DIGEST 380
138
+ # define SSL_R_INAPPROPRIATE_FALLBACK 373
139
+ # define SSL_R_INCONSISTENT_COMPRESSION 340
140
+ # define SSL_R_INCONSISTENT_EARLY_DATA_ALPN 222
141
+ # define SSL_R_INCONSISTENT_EARLY_DATA_SNI 231
142
+ # define SSL_R_INCONSISTENT_EXTMS 104
143
+ # define SSL_R_INSUFFICIENT_SECURITY 241
144
+ # define SSL_R_INVALID_ALERT 205
145
+ # define SSL_R_INVALID_CCS_MESSAGE 260
146
+ # define SSL_R_INVALID_CERTIFICATE_OR_ALG 238
147
+ # define SSL_R_INVALID_COMMAND 280
148
+ # define SSL_R_INVALID_COMPRESSION_ALGORITHM 341
149
+ # define SSL_R_INVALID_CONFIG 283
150
+ # define SSL_R_INVALID_CONFIGURATION_NAME 113
151
+ # define SSL_R_INVALID_CONTEXT 282
152
+ # define SSL_R_INVALID_CT_VALIDATION_TYPE 212
153
+ # define SSL_R_INVALID_KEY_UPDATE_TYPE 120
154
+ # define SSL_R_INVALID_MAX_EARLY_DATA 174
155
+ # define SSL_R_INVALID_NULL_CMD_NAME 385
156
+ # define SSL_R_INVALID_RAW_PUBLIC_KEY 350
157
+ # define SSL_R_INVALID_RECORD 317
158
+ # define SSL_R_INVALID_SEQUENCE_NUMBER 402
159
+ # define SSL_R_INVALID_SERVERINFO_DATA 388
160
+ # define SSL_R_INVALID_SESSION_ID 999
161
+ # define SSL_R_INVALID_SRP_USERNAME 357
162
+ # define SSL_R_INVALID_STATUS_RESPONSE 328
163
+ # define SSL_R_INVALID_TICKET_KEYS_LENGTH 325
164
+ # define SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED 333
165
+ # define SSL_R_LENGTH_MISMATCH 159
166
+ # define SSL_R_LENGTH_TOO_LONG 404
167
+ # define SSL_R_LENGTH_TOO_SHORT 160
168
+ # define SSL_R_LIBRARY_BUG 274
169
+ # define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
170
+ # define SSL_R_LISTENER_USE_ONLY 421
171
+ # define SSL_R_MAXIMUM_ENCRYPTED_PKTS_REACHED 395
172
+ # define SSL_R_MISSING_DSA_SIGNING_CERT 165
173
+ # define SSL_R_MISSING_ECDSA_SIGNING_CERT 381
174
+ # define SSL_R_MISSING_FATAL 256
175
+ # define SSL_R_MISSING_PARAMETERS 290
176
+ # define SSL_R_MISSING_PSK_KEX_MODES_EXTENSION 310
177
+ # define SSL_R_MISSING_QUIC_TLS_FUNCTIONS 423
178
+ # define SSL_R_MISSING_RSA_CERTIFICATE 168
179
+ # define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
180
+ # define SSL_R_MISSING_RSA_SIGNING_CERT 170
181
+ # define SSL_R_MISSING_SIGALGS_EXTENSION 112
182
+ # define SSL_R_MISSING_SIGNING_CERT 221
183
+ # define SSL_R_MISSING_SRP_PARAM 358
184
+ # define SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION 209
185
+ # define SSL_R_MISSING_SUPPORTED_VERSIONS_EXTENSION 420
186
+ # define SSL_R_MISSING_TMP_DH_KEY 171
187
+ # define SSL_R_MISSING_TMP_ECDH_KEY 311
188
+ # define SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA 293
189
+ # define SSL_R_NOT_ON_RECORD_BOUNDARY 182
190
+ # define SSL_R_NOT_REPLACING_CERTIFICATE 289
191
+ # define SSL_R_NOT_SERVER 284
192
+ # define SSL_R_NO_APPLICATION_PROTOCOL 235
193
+ # define SSL_R_NO_CERTIFICATES_RETURNED 176
194
+ # define SSL_R_NO_CERTIFICATE_ASSIGNED 177
195
+ # define SSL_R_NO_CERTIFICATE_SET 179
196
+ # define SSL_R_NO_CHANGE_FOLLOWING_HRR 214
197
+ # define SSL_R_NO_CIPHERS_AVAILABLE 181
198
+ # define SSL_R_NO_CIPHERS_SPECIFIED 183
199
+ # define SSL_R_NO_CIPHER_MATCH 185
200
+ # define SSL_R_NO_CLIENT_CERT_METHOD 331
201
+ # define SSL_R_NO_COMPRESSION_SPECIFIED 187
202
+ # define SSL_R_NO_COOKIE_CALLBACK_SET 287
203
+ # define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330
204
+ # define SSL_R_NO_METHOD_SPECIFIED 188
205
+ # define SSL_R_NO_PEM_EXTENSIONS 389
206
+ # define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
207
+ # define SSL_R_NO_PROTOCOLS_AVAILABLE 191
208
+ # define SSL_R_NO_RENEGOTIATION 339
209
+ # define SSL_R_NO_REQUIRED_DIGEST 324
210
+ # define SSL_R_NO_SHARED_CIPHER 193
211
+ # define SSL_R_NO_SHARED_GROUPS 410
212
+ # define SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS 376
213
+ # define SSL_R_NO_SRTP_PROFILES 359
214
+ # define SSL_R_NO_STREAM 355
215
+ # define SSL_R_NO_SUITABLE_DIGEST_ALGORITHM 297
216
+ # define SSL_R_NO_SUITABLE_GROUPS 295
217
+ # define SSL_R_NO_SUITABLE_KEY_SHARE 101
218
+ # define SSL_R_NO_SUITABLE_RECORD_LAYER 322
219
+ # define SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM 118
220
+ # define SSL_R_NO_VALID_SCTS 216
221
+ # define SSL_R_NO_VERIFY_COOKIE_CALLBACK 403
222
+ # define SSL_R_NULL_SSL_CTX 195
223
+ # define SSL_R_NULL_SSL_METHOD_PASSED 196
224
+ # define SSL_R_OCSP_CALLBACK_FAILURE 305
225
+ # define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
226
+ # define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344
227
+ # define SSL_R_OVERFLOW_ERROR 237
228
+ # define SSL_R_PACKET_LENGTH_TOO_LONG 198
229
+ # define SSL_R_PARSE_TLSEXT 227
230
+ # define SSL_R_PATH_TOO_LONG 270
231
+ # define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
232
+ # define SSL_R_PEM_NAME_BAD_PREFIX 391
233
+ # define SSL_R_PEM_NAME_TOO_SHORT 392
234
+ # define SSL_R_PIPELINE_FAILURE 406
235
+ # define SSL_R_POLL_REQUEST_NOT_SUPPORTED 418
236
+ # define SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR 278
237
+ # define SSL_R_PRIVATE_KEY_MISMATCH 288
238
+ # define SSL_R_PROTOCOL_IS_SHUTDOWN 207
239
+ # define SSL_R_PSK_IDENTITY_NOT_FOUND 223
240
+ # define SSL_R_PSK_NO_CLIENT_CB 224
241
+ # define SSL_R_PSK_NO_SERVER_CB 225
242
+ # define SSL_R_QUIC_HANDSHAKE_LAYER_ERROR 393
243
+ # define SSL_R_QUIC_NETWORK_ERROR 387
244
+ # define SSL_R_QUIC_PROTOCOL_ERROR 382
245
+ # define SSL_R_READ_BIO_NOT_SET 211
246
+ # define SSL_R_READ_TIMEOUT_EXPIRED 312
247
+ # define SSL_R_RECORDS_NOT_RELEASED 321
248
+ # define SSL_R_RECORD_LAYER_FAILURE 313
249
+ # define SSL_R_RECORD_LENGTH_MISMATCH 213
250
+ # define SSL_R_RECORD_TOO_SMALL 298
251
+ # define SSL_R_REMOTE_PEER_ADDRESS_NOT_SET 346
252
+ # define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335
253
+ # define SSL_R_RENEGOTIATION_ENCODING_ERR 336
254
+ # define SSL_R_RENEGOTIATION_MISMATCH 337
255
+ # define SSL_R_REQUEST_PENDING 285
256
+ # define SSL_R_REQUEST_SENT 286
257
+ # define SSL_R_REQUIRED_CIPHER_MISSING 215
258
+ # define SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING 342
259
+ # define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345
260
+ # define SSL_R_SCT_VERIFICATION_FAILED 208
261
+ # define SSL_R_SEQUENCE_CTR_WRAPPED 327
262
+ # define SSL_R_SERVERHELLO_TLSEXT 275
263
+ # define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
264
+ # define SSL_R_SHUTDOWN_WHILE_IN_INIT 407
265
+ # define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360
266
+ # define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
267
+ # define SSL_R_SRP_A_CALC 361
268
+ # define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362
269
+ # define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363
270
+ # define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364
271
+ # define SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH 232
272
+ # define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319
273
+ # define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320
274
+ # define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
275
+ # define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
276
+ # define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
277
+ # define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
278
+ # define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
279
+ # define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
280
+ # define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
281
+ # define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
282
+ # define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
283
+ # define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
284
+ # define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
285
+ # define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
286
+ # define SSL_R_SSL_COMMAND_SECTION_EMPTY 117
287
+ # define SSL_R_SSL_COMMAND_SECTION_NOT_FOUND 125
288
+ # define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
289
+ # define SSL_R_SSL_HANDSHAKE_FAILURE 229
290
+ # define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
291
+ # define SSL_R_SSL_NEGATIVE_LENGTH 372
292
+ # define SSL_R_SSL_SECTION_EMPTY 126
293
+ # define SSL_R_SSL_SECTION_NOT_FOUND 136
294
+ # define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
295
+ # define SSL_R_SSL_SESSION_ID_CONFLICT 302
296
+ # define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
297
+ # define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
298
+ # define SSL_R_SSL_SESSION_ID_TOO_LONG 408
299
+ # define SSL_R_SSL_SESSION_VERSION_MISMATCH 210
300
+ # define SSL_R_STILL_IN_INIT 121
301
+ # define SSL_R_STREAM_COUNT_LIMITED 411
302
+ # define SSL_R_STREAM_FINISHED 365
303
+ # define SSL_R_STREAM_RECV_ONLY 366
304
+ # define SSL_R_STREAM_RESET 375
305
+ # define SSL_R_STREAM_SEND_ONLY 379
306
+ # define SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED 1116
307
+ # define SSL_R_TLSV13_ALERT_MISSING_EXTENSION 1109
308
+ # define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
309
+ # define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
310
+ # define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
311
+ # define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
312
+ # define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
313
+ # define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
314
+ # define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
315
+ # define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
316
+ # define SSL_R_TLSV1_ALERT_NO_APPLICATION_PROTOCOL 1120
317
+ # define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
318
+ # define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
319
+ # define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
320
+ # define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
321
+ # define SSL_R_TLSV1_ALERT_UNKNOWN_PSK_IDENTITY 1115
322
+ # define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
323
+ # define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
324
+ # define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
325
+ # define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
326
+ # define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
327
+ # define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
328
+ # define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367
329
+ # define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
330
+ # define SSL_R_TOO_MANY_KEY_UPDATES 132
331
+ # define SSL_R_TOO_MANY_WARN_ALERTS 409
332
+ # define SSL_R_TOO_MUCH_EARLY_DATA 164
333
+ # define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
334
+ # define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
335
+ # define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
336
+ # define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
337
+ # define SSL_R_UNEXPECTED_CCS_MESSAGE 262
338
+ # define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178
339
+ # define SSL_R_UNEXPECTED_EOF_WHILE_READING 294
340
+ # define SSL_R_UNEXPECTED_MESSAGE 244
341
+ # define SSL_R_UNEXPECTED_RECORD 245
342
+ # define SSL_R_UNINITIALIZED 276
343
+ # define SSL_R_UNKNOWN_ALERT_TYPE 246
344
+ # define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
345
+ # define SSL_R_UNKNOWN_CIPHER_RETURNED 248
346
+ # define SSL_R_UNKNOWN_CIPHER_TYPE 249
347
+ # define SSL_R_UNKNOWN_CMD_NAME 386
348
+ # define SSL_R_UNKNOWN_COMMAND 139
349
+ # define SSL_R_UNKNOWN_DIGEST 368
350
+ # define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
351
+ # define SSL_R_UNKNOWN_MANDATORY_PARAMETER 323
352
+ # define SSL_R_UNKNOWN_PKEY_TYPE 251
353
+ # define SSL_R_UNKNOWN_PROTOCOL 252
354
+ # define SSL_R_UNKNOWN_SSL_VERSION 254
355
+ # define SSL_R_UNKNOWN_STATE 255
356
+ # define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338
357
+ # define SSL_R_UNSOLICITED_EXTENSION 217
358
+ # define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
359
+ # define SSL_R_UNSUPPORTED_CONFIG_VALUE 414
360
+ # define SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS 415
361
+ # define SSL_R_UNSUPPORTED_CONFIG_VALUE_OP 416
362
+ # define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
363
+ # define SSL_R_UNSUPPORTED_PROTOCOL 258
364
+ # define SSL_R_UNSUPPORTED_SSL_VERSION 259
365
+ # define SSL_R_UNSUPPORTED_STATUS_TYPE 329
366
+ # define SSL_R_UNSUPPORTED_WRITE_FLAG 412
367
+ # define SSL_R_USE_SRTP_NOT_NEGOTIATED 369
368
+ # define SSL_R_VERSION_TOO_HIGH 166
369
+ # define SSL_R_VERSION_TOO_LOW 396
370
+ # define SSL_R_WRONG_CERTIFICATE_TYPE 383
371
+ # define SSL_R_WRONG_CIPHER_RETURNED 261
372
+ # define SSL_R_WRONG_CURVE 378
373
+ # define SSL_R_WRONG_RPK_TYPE 351
374
+ # define SSL_R_WRONG_SIGNATURE_LENGTH 264
375
+ # define SSL_R_WRONG_SIGNATURE_SIZE 265
376
+ # define SSL_R_WRONG_SIGNATURE_TYPE 370
377
+ # define SSL_R_WRONG_SSL_VERSION 266
378
+ # define SSL_R_WRONG_VERSION_NUMBER 267
379
+ # define SSL_R_X509_LIB 268
380
+ # define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
381
+
382
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ui_no-asm.h ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/no-asm/include/openssl/ui.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/ui.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/ui.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/ui.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/ui.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/ui.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/ui.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/ui.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/ui.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/ui.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/ui.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/ui.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/ui.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/ui.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/ui.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/ui.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/ui.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/ui.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/ui.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/ui.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/ui.h"
48
+ #endif
49
+
50
+ /* GOST is not included in all platform */
51
+ #ifndef OPENSSL_NO_GOST
52
+ # define OPENSSL_NO_GOST
53
+ #endif
54
+ /* HW_PADLOCK is not included in all platform */
55
+ #ifndef OPENSSL_NO_HW_PADLOCK
56
+ # define OPENSSL_NO_HW_PADLOCK
57
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/x509_asm.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/asm/include/openssl/x509.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/x509.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/x509.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/x509.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/x509.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/x509.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/x509.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/x509.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/x509.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/x509.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/x509.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/x509.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/x509.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/x509.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/x509.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/x509.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/x509.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/x509.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/x509.h"
44
+ #endif
45
+
46
+ /* GOST is not included in all platform */
47
+ #ifndef OPENSSL_NO_GOST
48
+ # define OPENSSL_NO_GOST
49
+ #endif
50
+ /* HW_PADLOCK is not included in all platform */
51
+ #ifndef OPENSSL_NO_HW_PADLOCK
52
+ # define OPENSSL_NO_HW_PADLOCK
53
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/x509v3_asm.h ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #undef OPENSSL_LINUX
2
+ #if defined(__linux) && !defined(__ANDROID__)
3
+ # define OPENSSL_LINUX 1
4
+ #endif
5
+
6
+ #if defined(OPENSSL_LINUX) && defined(__i386__)
7
+ # include "./archs/linux-elf/asm/include/openssl/x509v3.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/x509v3.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/x509v3.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/x509v3.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/x509v3.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/x509v3.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/x509v3.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/x509v3.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/x509v3.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/x509v3.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/x509v3.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/x509v3.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/x509v3.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/x509v3.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/x509v3.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/x509v3.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/x509v3.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/x509v3.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/x509v3.h"
44
+ #endif
45
+
46
+ /* GOST is not included in all platform */
47
+ #ifndef OPENSSL_NO_GOST
48
+ # define OPENSSL_NO_GOST
49
+ #endif
50
+ /* HW_PADLOCK is not included in all platform */
51
+ #ifndef OPENSSL_NO_HW_PADLOCK
52
+ # define OPENSSL_NO_HW_PADLOCK
53
+ #endif
requirements.txt ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ math_verify
2
+ deepspeed==0.14.5
3
+ trl==0.18.0
4
+ transformers>=4.51.3
5
+ # transformers==4.49.0.dev0
6
+ rouge-score
7
+ vllm==0.8.5.post1
8
+ # vllm==0.7.2
9
+ pydantic==2.10.6
10
+ fastapi==0.115.12
11
+ requests
12
+ cryptography==44.0.2
13
+ fastapi==0.115.12
14
+ frozenlist==1.5.0
15
+ grpcio==1.71.0
16
+ jsonschema==4.23.0
17
+ nvidia-ml-py==12.570.86
18
+ pandas==2.2.3
19
+ pyasn1==0.6.1
20
+ pyasn1-modules==0.4.2
21
+ pydantic==2.10.6
22
+ pyjwt==2.10.1
23
+ smart-open==7.1.0
24
+ starlette==0.46.2
25
+ urllib3==2.4.0
26
+ uvicorn==0.34.1
27
+ watchfiles==1.0.5
28
+ json_repair
29
+ qwen-agent
30
+ # clip_client
31
+ protobuf==3.20.3
32
+ codetiming==1.4.0
33
+ imageio
34
+ fire
35
+ peft
36
+ # pip install --upgrade "pydantic>=2.0"
37
+ # pip install --upgrade openai