CSDDSFSFSAFSAF commited on
Commit
9848efb
·
verified ·
1 Parent(s): 8778eb9

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. converts/prepare.sh +6 -0
  2. converts/prepare_frame_cache_from_images.py +105 -0
  3. data_prepare/__pycache__/json.cpython-311.pyc +0 -0
  4. data_prepare/check_video.py +102 -0
  5. data_prepare/cookies.txt +24 -0
  6. data_prepare/data.py +167 -0
  7. data_prepare/data_json.py +254 -0
  8. data_prepare/filter_r1.py +424 -0
  9. data_prepare/json_down.py +137 -0
  10. data_prepare/node-v24.12.0-linux-x64/CHANGELOG.md +0 -0
  11. data_prepare/node-v24.12.0-linux-x64/LICENSE +0 -0
  12. data_prepare/node-v24.12.0-linux-x64/README.md +916 -0
  13. data_prepare/node-v24.12.0-linux-x64/bin/corepack +4 -0
  14. data_prepare/node-v24.12.0-linux-x64/bin/npm +2 -0
  15. data_prepare/node-v24.12.0-linux-x64/bin/npx +130 -0
  16. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1.h +5 -0
  17. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1t.h +5 -0
  18. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1t_no-asm.h +57 -0
  19. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/bioerr.h +72 -0
  20. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/bn_conf_asm.h +53 -0
  21. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/bnerr.h +47 -0
  22. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmac.h +52 -0
  23. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmp_asm.h +53 -0
  24. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmp_no-asm.h +57 -0
  25. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cms_no-asm.h +57 -0
  26. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/comp.h +5 -0
  27. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/comp_no-asm.h +57 -0
  28. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/comperr.h +38 -0
  29. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/conf_api.h +46 -0
  30. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/configuration_asm.h +53 -0
  31. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/configuration_no-asm.h +57 -0
  32. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/core.h +236 -0
  33. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/crmf_no-asm.h +57 -0
  34. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/crypto_asm.h +53 -0
  35. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/decoder.h +133 -0
  36. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/decodererr.h +28 -0
  37. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dso_conf.h +5 -0
  38. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dso_conf_asm.h +53 -0
  39. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dso_conf_no-asm.h +57 -0
  40. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/e_os2.h +310 -0
  41. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ec.h +1588 -0
  42. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/encoder.h +124 -0
  43. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/engine.h +833 -0
  44. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/err_asm.h +53 -0
  45. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/evp.h +0 -0
  46. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/hpke.h +169 -0
  47. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/http.h +119 -0
  48. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/indicator.h +31 -0
  49. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/md4.h +63 -0
  50. data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ocsp.h +5 -0
converts/prepare.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ python /data/shuimu.chen/TimeSearch-R/prepare_frame_cache_1.py \
2
+ --target_fps 2 \
3
+ --num_workers 32 \
4
+ --min_pixels 3136 \
5
+ --max_pixels 150528 \
6
+ --overwrite False
converts/prepare_frame_cache_from_images.py ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from time_r1.utils.qwen_vl_utils import floor_by_factor, FRAME_FACTOR, smart_resize
2
+ import decord
3
+ import torch
4
+ import os
5
+ import tqdm
6
+ import glob
7
+ import multiprocessing
8
+ from torchvision import io, transforms
9
+ from torchvision.transforms import InterpolationMode
10
+ from functools import partial
11
+ from time_r1.utils.io import load_jsonl
12
+ from PIL import Image
13
+ import numpy as np
14
+
15
+
16
+ def load_images_from_pathlist(filenames):
17
+ images = []
18
+ for filename in filenames:
19
+ img = Image.open(filename)
20
+ img_array = np.array(img) # shape: (H, W, 3)
21
+ images.append(img_array)
22
+ return np.array(images)
23
+
24
+
25
+ def load_video_frames(video_path, frame_fps=1):
26
+ filenames = sorted(os.listdir(video_path))
27
+ image_paths = [os.path.join(video_path, filename) for filename in filenames]
28
+ images = load_images_from_pathlist(image_paths)
29
+ return images
30
+
31
+
32
+ def get_video_tensor(video_path, target_fps=1, image_factor = 28, min_pixels = 28 * 28 * 128, max_pixels = 28 * 28 * 256):
33
+ """
34
+ 将视频以固定帧率提前抽帧、解码保存为tensor,用于后续训练
35
+ """
36
+ images = load_video_frames(video_path)
37
+ frame_tensor = torch.from_numpy(images).permute(0, 3, 1, 2) # Convert to TCHW format
38
+ height, width = frame_tensor.shape[2], frame_tensor.shape[3]
39
+ resized_height, resized_width = smart_resize(
40
+ height,
41
+ width,
42
+ factor=image_factor,
43
+ min_pixels=min_pixels,
44
+ max_pixels=max_pixels,
45
+ )
46
+ frame_tensor = transforms.functional.resize(
47
+ frame_tensor,
48
+ [resized_height, resized_width],
49
+ interpolation=InterpolationMode.BICUBIC,
50
+ antialias=True,
51
+ )
52
+ frame_cache = {
53
+ "frame_tensor": frame_tensor,
54
+ "fps": target_fps,
55
+ }
56
+ return frame_cache
57
+
58
+
59
+ def process_single_video(video_path, target_fps=1, image_factor = 28, min_pixels = 28 * 28 * 128, max_pixels = 28 * 28 * 256):
60
+ """Helper function to process and save frame cache for a single video."""
61
+ print(f"Processing {video_path}...")
62
+ try:
63
+ frame_cache = get_video_tensor(video_path, target_fps, image_factor, min_pixels, max_pixels)
64
+ torch.save(frame_cache, video_path + ".frame_cache")
65
+ print(f"Successfully saved frame cache for {video_path}")
66
+ except Exception as e:
67
+ print(f"Error processing {video_path}: {e}")
68
+
69
+
70
+ def prepare_frame_cache(video_root, dataset_path=None, num_workers=8, target_fps=1, overwrite=False, image_factor = 28, min_pixels = 28 * 28 * 128, max_pixels = 28 * 28 * 256):
71
+ if dataset_path is not None:
72
+ video_list = load_jsonl(dataset_path)
73
+ video_list = [os.path.join(video_root, v["video"]) for v in video_list]
74
+ else:
75
+ video_list = glob.glob(os.path.join(video_root, "*"))
76
+ if not video_list:
77
+ print(f"No MP4 videos found in {video_root}")
78
+ return
79
+ # remove videos that already have frame cache
80
+ if not overwrite:
81
+ print("skipping videos that already have frame cache")
82
+ num_total = len(video_list)
83
+ video_list = [v for v in video_list if not os.path.exists(v + ".frame_cache")]
84
+ num_skipped = num_total - len(video_list)
85
+ print(f"skipped {num_skipped} videos")
86
+
87
+ if num_workers is None:
88
+ num_workers = multiprocessing.cpu_count() # Default to using all available CPU cores
89
+
90
+ print(f"Found {len(video_list)} videos. Starting processing with {num_workers} workers...")
91
+
92
+ # Use a multiprocessing Pool to process videos in parallel
93
+ with multiprocessing.Pool(processes=num_workers) as pool:
94
+ # Using tqdm with pool.imap_unordered for progress bar and efficient iteration
95
+ # We wrap process_single_video if it needs more arguments or if we want to handle results
96
+ # For this case, process_single_video only takes video_path
97
+ func = partial(process_single_video, target_fps=target_fps, image_factor = image_factor, min_pixels = min_pixels, max_pixels = max_pixels)
98
+ list(tqdm.tqdm(pool.imap_unordered(func, video_list), total=len(video_list)))
99
+
100
+ print("All videos processed.")
101
+
102
+
103
+ if __name__ == "__main__":
104
+ import fire
105
+ fire.Fire(prepare_frame_cache)
data_prepare/__pycache__/json.cpython-311.pyc ADDED
Binary file (7.12 kB). View file
 
data_prepare/check_video.py ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import cv2
3
+ import subprocess
4
+
5
+ def check_video_corruption(video_path):
6
+ """检查视频文件是否损坏"""
7
+ try:
8
+ # 方法1:使用OpenCV检查
9
+ cap = cv2.VideoCapture(video_path)
10
+ if not cap.isOpened():
11
+ return True
12
+
13
+ # 尝试读取第一帧
14
+ ret, frame = cap.read()
15
+ cap.release()
16
+
17
+ if not ret or frame is None:
18
+ return True
19
+
20
+ # 方法2:使用ffprobe进一步检查(如果可用)
21
+ try:
22
+ result = subprocess.run(
23
+ ['ffprobe', '-v', 'error', '-select_streams', 'v:0',
24
+ '-count_frames', '-show_entries', 'stream=nb_read_frames',
25
+ '-of', 'default=nokey=1:noprint_wrappers=1', video_path],
26
+ stdout=subprocess.PIPE,
27
+ stderr=subprocess.PIPE,
28
+ text=True,
29
+ timeout=5
30
+ )
31
+ if result.returncode != 0:
32
+ return True
33
+ except (subprocess.TimeoutExpired, FileNotFoundError):
34
+ pass # ffprobe不可用,仅依赖OpenCV检查
35
+
36
+ return False
37
+ except Exception as e:
38
+ print(f"检查视频时出错 {video_path}: {e}")
39
+ return True
40
+
41
+ def find_and_check_mp4_files(root_dir):
42
+ """查找并检查所有MP4文件"""
43
+ print(f"开始扫描目录: {root_dir}")
44
+
45
+ mp4_files = []
46
+ corrupted_files = []
47
+
48
+ # 遍历目录树查找所有.mp4文件
49
+ for root, dirs, files in os.walk(root_dir):
50
+ for file in files:
51
+ if file.lower().endswith('.mp4'):
52
+ full_path = os.path.join(root, file)
53
+ mp4_files.append(full_path)
54
+
55
+ print(f"找到 {len(mp4_files)} 个MP4文件")
56
+
57
+ # 检查每个文件
58
+ total = len(mp4_files)
59
+ for i, video_path in enumerate(mp4_files, 1):
60
+ print(f"正在检查 [{i}/{total}]: {os.path.basename(video_path)}", end="\r")
61
+
62
+ if check_video_corruption(video_path):
63
+ corrupted_files.append(video_path)
64
+
65
+ print(f"\n检查完成!")
66
+ return mp4_files, corrupted_files
67
+
68
+ def save_corrupted_files(corrupted_files, output_file="corrupted_videos.txt"):
69
+ """将损坏的文件路径保存到文本文件"""
70
+ with open(output_file, 'w', encoding='utf-8') as f:
71
+ for file_path in corrupted_files:
72
+ f.write(file_path + '\n')
73
+ print(f"损坏的文件列表已保存到: {output_file}")
74
+
75
+ def main():
76
+ # 设置根目录
77
+ root_dir = "/data/shuimu.chen/videomarathon/downloaded_videos/panda" # 根据实际情况调整路径
78
+
79
+ # 查找并检查文件
80
+ all_mp4_files, corrupted_files = find_and_check_mp4_files(root_dir)
81
+
82
+ # 输出统计信息
83
+ print("\n" + "="*50)
84
+ print(f"统计结果:")
85
+ print(f"总MP4文件数: {len(all_mp4_files)}")
86
+ print(f"损坏文件数: {len(corrupted_files)}")
87
+ print(f"正常文件数: {len(all_mp4_files) - len(corrupted_files)}")
88
+
89
+ if corrupted_files:
90
+ print(f"\n损坏的文件:")
91
+ for file_path in corrupted_files[:10]: # 只显示前10个
92
+ print(f" - {os.path.relpath(file_path, root_dir)}")
93
+ if len(corrupted_files) > 10:
94
+ print(f" ... 还有 {len(corrupted_files) - 10} 个文件")
95
+
96
+ # 保存损坏文件列表
97
+ save_corrupted_files(corrupted_files)
98
+ else:
99
+ print("\n恭喜!没有发现损坏的视频文件。")
100
+
101
+ if __name__ == "__main__":
102
+ main()
data_prepare/cookies.txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Netscape HTTP Cookie File
2
+ # This file is generated by yt-dlp. Do not edit.
3
+
4
+ .youtube.com TRUE / FALSE 0 PREF f4=4000000&tz=UTC&hl=en
5
+ .youtube.com TRUE / TRUE 1800167186 __Secure-1PSIDTS sidts-CjQB7I_69CjO7SkZY1GiwUMNgIcXBnLTLKEXZjvYCtZPjqSS6e6_C66RwEvpKD5KtcbHHMC1EAA
6
+ .youtube.com TRUE / TRUE 1800167186 __Secure-3PSIDTS sidts-CjQB7I_69CjO7SkZY1GiwUMNgIcXBnLTLKEXZjvYCtZPjqSS6e6_C66RwEvpKD5KtcbHHMC1EAA
7
+ .youtube.com TRUE / FALSE 1803191186 HSID AJeilnuDMezyvPCkX
8
+ .youtube.com TRUE / TRUE 1803191186 SSID ARsp10KokOO4mmsC4
9
+ .youtube.com TRUE / FALSE 1803191186 APISID h0_pXki4-Ctnb9e6/AwApL-U7WX4zRBlh0
10
+ .youtube.com TRUE / TRUE 1803191186 SAPISID go07S4KUNVV7vbAX/AXPMOQZ0wARCabmes
11
+ .youtube.com TRUE / TRUE 1803191186 __Secure-1PAPISID go07S4KUNVV7vbAX/AXPMOQZ0wARCabmes
12
+ .youtube.com TRUE / TRUE 1803191186 __Secure-3PAPISID go07S4KUNVV7vbAX/AXPMOQZ0wARCabmes
13
+ .youtube.com TRUE / FALSE 1803191186 SID g.a0005wg5cWYUo9XQjQpG1ofB9mxAeOOZsDSKMPWqrY-qPDgHGWYLzDibXZZA5S4ssOKahms73AACgYKARoSARESFQHGX2MiJhQNiC802qoImvNVzzhbdxoVAUF8yKrmWZbcYWBMJQCgZDrk2paj0076
14
+ .youtube.com TRUE / TRUE 1803191186 __Secure-1PSID g.a0005wg5cWYUo9XQjQpG1ofB9mxAeOOZsDSKMPWqrY-qPDgHGWYLgZ7tLzrvYmVjZvklMkMG2wACgYKAeoSARESFQHGX2MiPoNxR46C567-OYtFR4Pi0BoVAUF8yKp_uFsbE7wdo70DS79ifZpC0076
15
+ .youtube.com TRUE / TRUE 1803191186 __Secure-3PSID g.a0005wg5cWYUo9XQjQpG1ofB9mxAeOOZsDSKMPWqrY-qPDgHGWYLcXA5F8vNCLYvIl2h74zovQACgYKAT0SARESFQHGX2Mi8RpKA1kxQOrY0jIyluSQrhoVAUF8yKou61PSSL5gf3w-60jdm_Yy0076
16
+ .youtube.com TRUE / TRUE 1803191186 LOGIN_INFO AFmmF2swRQIgRaEiI1c_sK75DTTaCIYfdz3_F3LWupMWMQLXphl3HmgCIQDe3wH6yq-9enMWFVwYRHujbWFn6T2UbH1j9ywnG1f_lA:QUQ3MjNmeTE5VWlUci15X25TVVUyNkVXNWkxN2VkQWtfZ0ozVk5yT1N6cU1fVFVIOU1xQ0s3dEE2SlB4VTZUVWVLODF5LXFDLUVTR1BWQV9mT1Bway1tLWxQZWFsSjdZc1pXenowcEE2VFhENUJTMHM3RUVYa21zMS1tTmJPVS0zV083VE1TWXZrYW1zTHkweHpQYVkzTFpCUTVzWHF0bktn
17
+ .youtube.com TRUE / FALSE 1800171226 SIDCC AKEyXzVq1qOo1FsWcTgaTigO6Rr5kzti-AWkosVx_bbM-ZIX_jeSZ84j8b4suQWicDctyOhKuQ
18
+ .youtube.com TRUE / TRUE 1800171226 __Secure-1PSIDCC AKEyXzWeo73F4vzn8mKue64E8SZcJ7YrQYwZXNOViHd9xEuPPnpFXMMzCRN_4JQfeV476KzNyw
19
+ .youtube.com TRUE / TRUE 1800171226 __Secure-3PSIDCC AKEyXzWNjIE7FVRXqSyIoggbTqQlgAv1Ev6PlUFJooZru02QVXD3hULBRiBs7dqn5J2DlULZ
20
+ .youtube.com TRUE / TRUE 0 YSC sRjqD_eZddA
21
+ .youtube.com TRUE / TRUE 1784187226 VISITOR_INFO1_LIVE SWS4XTNPJ2Q
22
+ .youtube.com TRUE / TRUE 1784187226 VISITOR_PRIVACY_METADATA CgJUVxIEGgAgLA%3D%3D
23
+ .youtube.com TRUE / TRUE 1784181162 __Secure-YNID 15.YT=htxOtd0LDpJhdu-znXVL-zL6tdRRpSqeC-olvIE2TXUvKAP30QxrcQtLqrngVJh2lUy94jqUdJtuZPp_D2EvzuQsuvghUucvi9I3fV0yJ3Y8Kk1-lWNHu6BkLOkuAdHBAdrtI49ynR21WCnoIGhD2MFmSqZ6HUidTGcOdMSgY3VsyM6mfsAmz_F672JKutuumm_oSMOyyeFKOMuf4uefH4P1dw6a1ndkiPu1yfi50i4X7dnDMR3H_OBSO_ybwCNHjY-EeuzjHBhNcod2mc3DW1gI5W62H3epHsnguUwVzKdipfvGIK3NCoU8ZKOpiHy3YGqfxMLnPhLp6mtZd5weJA
24
+ .youtube.com TRUE / TRUE 1784181164 __Secure-ROLLOUT_TOKEN COqSi_Kwx43PhwEQx9fBh_GRkgMYvOWeiPGRkgM%3D
data_prepare/data.py ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import yt_dlp
3
+ from datasets import load_dataset
4
+ from concurrent.futures import ThreadPoolExecutor, as_completed
5
+ from tqdm import tqdm
6
+ import time
7
+ import random
8
+
9
+ # ================= 配置区域 =================
10
+ DATASET_PATH = "/data/shuimu.chen/videomarathon"
11
+ SAVE_ROOT = "/data/shuimu.chen/videomarathon/downloaded_videos"
12
+
13
+ # 🔥 核心安全配置:挂 Cookie 时并发不能太高!建议 2,最高不要超过 4
14
+ MAX_WORKERS = 2
15
+
16
+ # 你的 Cookie 路径
17
+ COOKIE_PATH = "/data/shuimu.chen/TimeSearch-R/data_prepare/cookies.txt"
18
+
19
+ # Node 路径设置
20
+ NODE_BIN_DIR = "/data/shuimu.chen/TimeSearch-R/data_prepare/node-v24.12.0-linux-x64/bin"
21
+ os.environ["PATH"] = NODE_BIN_DIR + os.pathsep + os.environ["PATH"]
22
+ # ===========================================
23
+
24
+ def process_video(item):
25
+ video_rel_path = item['rel_path']
26
+ url = item['url']
27
+
28
+ base_name = os.path.splitext(video_rel_path)[0]
29
+ full_save_path_no_ext = os.path.join(SAVE_ROOT, base_name)
30
+ final_file_path = full_save_path_no_ext + ".mp4"
31
+
32
+ # 1. 检查已存在文件 (跳过 > 1KB 的正常文件)
33
+ if os.path.exists(final_file_path):
34
+ if os.path.getsize(final_file_path) > 1024:
35
+ return "skipped"
36
+ else:
37
+ try:
38
+ os.remove(final_file_path) # 删除 0KB 的坏文件
39
+ except:
40
+ pass
41
+
42
+ os.makedirs(os.path.dirname(final_file_path), exist_ok=True)
43
+
44
+ # 2. 核心配置:复刻命令行成功的环境
45
+ # ... (前面的路径配置保持不变) ...
46
+
47
+ # 4. 终极配置:使用 Aria2 接管下载
48
+ ydl_opts = {
49
+ 'format': 'bestvideo[height<=480][ext=mp4]+bestaudio[ext=m4a]/best[height<=480]/best',
50
+ 'merge_output_format': 'mp4',
51
+ 'outtmpl': f"{full_save_path_no_ext}.%(ext)s",
52
+
53
+ # 🔥 核心修改:启用外部下载器 aria2c
54
+ 'external_downloader': 'aria2c',
55
+
56
+ # 🔥 aria2c 的专用参数 (伪装性更强,断点续传更稳)
57
+ 'external_downloader_args': [
58
+ '-c', '-j', '3', '-x', '3', # 3个连接,3个线程 (不宜过多,否则触发IP限流)
59
+ '-s', '3', '-k', '1M', # 分块配置
60
+ '--user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"'
61
+ ],
62
+
63
+ # 这里的参数依然保留,用于辅助
64
+ # 'cookiefile': COOKIE_PATH,
65
+
66
+ # 强制 IPv4 (很多时候 IPv6 线路拥堵或风控更严)
67
+ 'source_address': '0.0.0.0',
68
+
69
+ # 'retries': 2,
70
+ # 'fragment_retries': 2,
71
+ 'quiet': False,
72
+ 'no_warnings': False,
73
+ 'ignoreerrors': False,
74
+ }
75
+
76
+ # ... (后面的 try-catch 逻辑保持不变) ...
77
+
78
+ try:
79
+ with yt_dlp.YoutubeDL(ydl_opts) as ydl:
80
+ ydl.download([url])
81
+
82
+ # 3. 下载后校验
83
+ if os.path.exists(final_file_path):
84
+ if os.path.getsize(final_file_path) > 1024:
85
+ return "success"
86
+ else:
87
+ # 下载了但是空文件 (可能是 IP 临时限流返回了空包)
88
+ os.remove(final_file_path)
89
+ return "failed_empty"
90
+ else:
91
+ return "failed_unavailable" # 视频不存在
92
+
93
+ except Exception as e:
94
+ # 这里仅捕获严重异常,普通的 "Video unavailable" 会被 ignoreerrors 处理
95
+ # 如果想看报错可以把下面注释打开
96
+ # print(f"Error: {e}")
97
+ return "error"
98
+
99
+ def main():
100
+ # 0. 环境自检
101
+ print(f"🛠️ 环境检查...")
102
+ if os.system("node -v") != 0:
103
+ print("❌ 错误: Node 环境未生效,请检查路径!")
104
+ return
105
+ if not os.path.exists(COOKIE_PATH):
106
+ print("❌ 错误: Cookie 文件不存在!")
107
+ return
108
+
109
+ # 1. 加载数据
110
+ print(f"📂 正在加载数据集: {DATASET_PATH} ...")
111
+ try:
112
+ dataset = load_dataset(DATASET_PATH)
113
+ except Exception as e:
114
+ print(f"❌ 加载失败: {e}")
115
+ return
116
+
117
+ unique_videos = {}
118
+ print("🔍 正在筛选 ActivityNet 数据...")
119
+
120
+ for item in tqdm(dataset['train'], desc="Filtering"):
121
+ source = item.get('data_source')
122
+ q_type = item.get('question_type')
123
+ video_rel_path = item.get('video')
124
+ url = item.get('URL')
125
+
126
+ if source == 'ActivityNet' and q_type and str(q_type).endswith('mc'):
127
+ if video_rel_path and url:
128
+ if video_rel_path not in unique_videos:
129
+ unique_videos[video_rel_path] = url
130
+
131
+ tasks = [{'rel_path': k, 'url': v} for k, v in unique_videos.items()]
132
+ print(f"✅ 筛选完成!共 {len(tasks)} 个唯一视频任务。")
133
+
134
+ # 2. 开始下载
135
+ print(f"🚀 启动下载 (Workers={MAX_WORKERS}, Cookie 已启用)...")
136
+ results = {"success": 0, "skipped": 0, "failed_unavailable": 0, "failed_empty": 0, "error": 0}
137
+
138
+ with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
139
+ future_to_video = {executor.submit(process_video, task): task for task in tasks}
140
+
141
+ progress = tqdm(as_completed(future_to_video), total=len(tasks), desc="Downloading")
142
+ for future in progress:
143
+ status = future.result()
144
+
145
+ # 简单的状态归类
146
+ if status in results:
147
+ results[status] += 1
148
+ else:
149
+ results["error"] += 1
150
+
151
+ progress.set_postfix(
152
+ ok=results['success'],
153
+ skip=results['skipped'],
154
+ fail=results['failed_unavailable'] + results['failed_empty'] + results['error']
155
+ )
156
+
157
+ print("\n" + "=" * 30)
158
+ print(f"🎉 处理完毕")
159
+ print(f"✅ 成功下载: {results['success']}")
160
+ print(f"⏩ 跳过存在: {results['skipped']}")
161
+ print(f"❌ 视频失效(死链): {results['failed_unavailable']}")
162
+ print(f"⚠️ 下载为空(网络/限流): {results['failed_empty']}")
163
+ print(f"🚫 其他错误: {results['error']}")
164
+ print(f"保存在: {SAVE_ROOT}")
165
+
166
+ if __name__ == "__main__":
167
+ main()
data_prepare/data_json.py ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ import yt_dlp
4
+ from concurrent.futures import ThreadPoolExecutor, as_completed
5
+ from tqdm import tqdm
6
+
7
+ # ================= 配置区域 =================
8
+ JSON_PATH = "/data/shuimu.chen/videomarathon/filtered_1000_videos.json" # JSON文件路径
9
+ SAVE_ROOT = "/data/shuimu.chen/videomarathon/downloaded_videos"
10
+ MAX_WORKERS = 1 # 保持单线程比较稳
11
+
12
+ # 【请确认】cookies.txt 文件的绝对路径
13
+ COOKIE_PATH = "/data/shuimu.chen/TimeSearch-R/data_prepare/cookies.txt"
14
+ # ===========================================
15
+
16
+ def load_videos_from_json(json_path):
17
+ """
18
+ 从JSON文件加载视频和URL信息
19
+ """
20
+ try:
21
+ with open(json_path, 'r', encoding='utf-8') as f:
22
+ data = json.load(f)
23
+
24
+ print(f"从 {json_path} 加载了 {len(data)} 条记录")
25
+
26
+ # 提取唯一的视频-URL映射
27
+ unique_videos = {}
28
+ for item in data:
29
+ video_rel_path = item.get('video', '')
30
+ url = item.get('URL', '')
31
+
32
+ if video_rel_path and url:
33
+ if video_rel_path not in unique_videos:
34
+ unique_videos[video_rel_path] = url
35
+
36
+ print(f"找到 {len(unique_videos)} 个唯一视频")
37
+ return unique_videos, data
38
+
39
+ except FileNotFoundError:
40
+ print(f"错误: 找不到JSON文件 {json_path}")
41
+ return {}, []
42
+ except json.JSONDecodeError:
43
+ print(f"错误: JSON文件格式错误 {json_path}")
44
+ return {}, []
45
+ except Exception as e:
46
+ print(f"加载JSON文件时出错: {str(e)}")
47
+ return {}, []
48
+
49
+ def process_video(item):
50
+ """
51
+ 单个视频下载任务函数
52
+ """
53
+ video_rel_path = item['rel_path']
54
+ url = item['url']
55
+
56
+ # 构建保存路径
57
+ # base_name 类似于 "category/video_id"
58
+ base_name = os.path.splitext(video_rel_path)[0]
59
+ full_save_path_no_ext = os.path.join(SAVE_ROOT, base_name)
60
+
61
+ # 你的脚本用来检查的最终路径(带 .mp4)
62
+ final_file_path = full_save_path_no_ext + ".mp4"
63
+
64
+ # 检查文件是否已存在
65
+ if os.path.exists(final_file_path):
66
+ return "skipped", video_rel_path
67
+
68
+ # 确保目录存在
69
+ os.makedirs(os.path.dirname(final_file_path), exist_ok=True)
70
+
71
+ # yt-dlp 配置
72
+ ydl_opts = {
73
+ 'format': 'bestvideo[height<=480]+bestaudio/best[height<=480]',
74
+ 'sleep_interval': 5, # # 每次下载完至少睡 5 秒
75
+ 'max_sleep_interval': 15, # # 最多随机睡到 30 秒
76
+ 'merge_output_format': 'mp4',
77
+ 'sleep_interval_requests': 1, # 甚至连请求视频信息也要睡 5 秒
78
+ # 'js_runtimes': ['node'],
79
+ # 【核心修改】这里加上了 .%(ext)s
80
+ # 意思就是:文件名 = 你的路径 + . + 扩展名(mp4)
81
+ 'outtmpl': f"{full_save_path_no_ext}.%(ext)s",
82
+ 'js_runtimes': ['node:/data/shuimu.chen/TimeSearch-R/data_prepare/node-v24.12.0-linux-x64/bin/node'],
83
+
84
+ 'quiet': False, # 建议开启 False 以便调试,稳定后可改为 True
85
+ 'no_warnings': False,
86
+ 'ignoreerrors': True,
87
+ 'cookiefile': COOKIE_PATH,
88
+ }
89
+
90
+ try:
91
+ with yt_dlp.YoutubeDL(ydl_opts) as ydl:
92
+ ydl.download([url])
93
+
94
+ # 再次检查文件是否生成
95
+ if os.path.exists(final_file_path):
96
+ return "success", video_rel_path
97
+ else:
98
+ return "failed", video_rel_path
99
+ except Exception as e:
100
+ print(f"下载 {video_rel_path} 时出错: {str(e)}")
101
+ return "error", video_rel_path
102
+
103
+ def main():
104
+ # 0. 检查 cookie
105
+ if not os.path.exists(COOKIE_PATH):
106
+ print(f"❌ 错误: 找不到 Cookie 文件: {COOKIE_PATH}")
107
+ print("请上传 cookies.txt 后再重试!")
108
+ return
109
+
110
+ # 1. 从JSON文件加载数据
111
+ print(f"正在加载JSON文件: {JSON_PATH} ...")
112
+ unique_videos, all_data = load_videos_from_json(JSON_PATH)
113
+
114
+ if not unique_videos:
115
+ print("❌ 错误: 没有找到可下载的视频")
116
+ return
117
+
118
+ # 显示统计信息
119
+ print(f"\n【统计信息】")
120
+ print(f"JSON文件中的总问答对: {len(all_data)}")
121
+ print(f"需要下载的唯一视频数: {len(unique_videos)}")
122
+
123
+ # 计算问答对分布
124
+ video_qa_count = {}
125
+ for item in all_data:
126
+ video = item.get('video', '')
127
+ if video:
128
+ video_qa_count[video] = video_qa_count.get(video, 0) + 1
129
+
130
+ # 显示前10个视频的问答对数量
131
+ print(f"\n【前10个视频的问答对数量】")
132
+ sorted_videos = sorted(video_qa_count.items(), key=lambda x: x[1], reverse=True)
133
+ for i, (video, count) in enumerate(sorted_videos[:10], 1):
134
+ print(f"{i:2}. {video:40}: {count:3} 个问答对")
135
+
136
+ total_qa = sum(video_qa_count.values())
137
+ avg_qa_per_video = total_qa / len(video_qa_count) if video_qa_count else 0
138
+ print(f"\n平均每个视频: {avg_qa_per_video:.1f} 个问答对")
139
+ print(f"总问答对数: {total_qa}")
140
+
141
+ # 2. 准备下载任务
142
+ tasks = [{'rel_path': k, 'url': v} for k, v in unique_videos.items()]
143
+ print(f"\n开始下载 (Workers={MAX_WORKERS}, Cookie已启用)...")
144
+
145
+ results = {
146
+ "success": [],
147
+ "skipped": [],
148
+ "failed": [],
149
+ "error": []
150
+ }
151
+
152
+ # 3. 多线程下载
153
+ with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
154
+ future_to_video = {executor.submit(process_video, task): task for task in tasks}
155
+
156
+ for future in tqdm(as_completed(future_to_video), total=len(tasks), desc="下载进度"):
157
+ status, video_path = future.result()
158
+ results[status].append(video_path)
159
+
160
+ # 4. 生成下载报告
161
+ print("\n" + "=" * 50)
162
+ print("【下载完成】")
163
+ print("=" * 50)
164
+
165
+ total_tasks = len(tasks)
166
+ success_count = len(results["success"])
167
+ skipped_count = len(results["skipped"])
168
+ failed_count = len(results["failed"])
169
+ error_count = len(results["error"])
170
+
171
+ print(f"总任务数: {total_tasks}")
172
+ print(f"跳过(已存在): {skipped_count}")
173
+ print(f"下载成功: {success_count}")
174
+ print(f"下载失败: {failed_count}")
175
+ print(f"下载错误: {error_count}")
176
+ print(f"成功下载的视频数: {success_count} / {total_tasks} ({success_count/total_tasks*100:.1f}%)")
177
+ print(f"数据保存在: {os.path.abspath(SAVE_ROOT)}")
178
+
179
+ # 计算已下载视频对应的问答对数量
180
+ downloaded_videos = set(results["success"] + results["skipped"])
181
+ downloaded_qa_count = 0
182
+ for video in downloaded_videos:
183
+ downloaded_qa_count += video_qa_count.get(video, 0)
184
+
185
+ print(f"\n【问答对覆盖率】")
186
+ print(f"已下载视频对应的问答对数: {downloaded_qa_count} / {total_qa} ({downloaded_qa_count/total_qa*100:.1f}%)")
187
+
188
+ # 5. 保存详细的下载报告
189
+ generate_detailed_report(results, video_qa_count, total_qa)
190
+
191
+ def generate_detailed_report(results, video_qa_count, total_qa):
192
+ """
193
+ 生成详细的下载报告
194
+ """
195
+ report_path = "video_download_report.txt"
196
+
197
+ with open(report_path, 'w', encoding='utf-8') as f:
198
+ f.write("# 视频下载详细报告\n")
199
+ f.write("#" * 70 + "\n\n")
200
+
201
+ # 下载统计
202
+ f.write("## 下载统计\n")
203
+ f.write("-" * 40 + "\n")
204
+ f.write(f"总视频数: {len(video_qa_count)}\n")
205
+ f.write(f"成功下载: {len(results['success'])}\n")
206
+ f.write(f"跳过(已存在): {len(results['skipped'])}\n")
207
+ f.write(f"下载失败: {len(results['failed'])}\n")
208
+ f.write(f"下载错误: {len(results['error'])}\n")
209
+ f.write(f"成功率: {len(results['success'])/len(video_qa_count)*100:.1f}%\n\n")
210
+
211
+ # 问答对覆盖率
212
+ downloaded_videos = set(results["success"] + results["skipped"])
213
+ downloaded_qa = sum(video_qa_count.get(v, 0) for v in downloaded_videos)
214
+
215
+ f.write("## 问答对覆盖率\n")
216
+ f.write("-" * 40 + "\n")
217
+ f.write(f"总问答对数: {total_qa}\n")
218
+ f.write(f"已下载视频对应的问答对数: {downloaded_qa}\n")
219
+ f.write(f"覆盖率: {downloaded_qa/total_qa*100:.1f}%\n\n")
220
+
221
+ # 成功下载的视频列表
222
+ f.write("## 成功下载的视频\n")
223
+ f.write("-" * 40 + "\n")
224
+ for i, video in enumerate(sorted(results["success"]), 1):
225
+ qa_count = video_qa_count.get(video, 0)
226
+ f.write(f"{i:4}. {video} ({qa_count} 个问答对)\n")
227
+
228
+ # 跳过的视频列表
229
+ if results["skipped"]:
230
+ f.write("\n## 已存在跳过的视频\n")
231
+ f.write("-" * 40 + "\n")
232
+ for i, video in enumerate(sorted(results["skipped"]), 1):
233
+ qa_count = video_qa_count.get(video, 0)
234
+ f.write(f"{i:4}. {video} ({qa_count} 个问答对)\n")
235
+
236
+ # 失败和错误的视频列表
237
+ if results["failed"]:
238
+ f.write("\n## 下载失败的视频\n")
239
+ f.write("-" * 40 + "\n")
240
+ for i, video in enumerate(results["failed"], 1):
241
+ qa_count = video_qa_count.get(video, 0)
242
+ f.write(f"{i:4}. {video} ({qa_count} 个问答对)\n")
243
+
244
+ if results["error"]:
245
+ f.write("\n## 下载出错的视频\n")
246
+ f.write("-" * 40 + "\n")
247
+ for i, video in enumerate(results["error"], 1):
248
+ qa_count = video_qa_count.get(video, 0)
249
+ f.write(f"{i:4}. {video} ({qa_count} 个问答对)\n")
250
+
251
+ print(f"\n详细报告已保存到: {report_path}")
252
+
253
+ if __name__ == "__main__":
254
+ main()
data_prepare/filter_r1.py ADDED
@@ -0,0 +1,424 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ import re
4
+ from collections import Counter
5
+ from typing import List, Dict, Any
6
+
7
+ def extract_source_from_path(path: str) -> str:
8
+ """
9
+ 从路径中提取第一个目录名作为来源
10
+
11
+ Args:
12
+ path: 文件路径,如 "./PerceptionTest/video_2448.mp4"
13
+
14
+ Returns:
15
+ 来源名称,如 "PerceptionTest"
16
+ """
17
+ # 去除开头的"./"和".\"等相对路径符号
18
+ clean_path = path.lstrip('./\\')
19
+
20
+ # 分割路径,获取第一个目录名
21
+ parts = clean_path.split('/')
22
+ if len(parts) > 0:
23
+ return parts[0]
24
+ else:
25
+ # 如果没有找到目录结构,返回整个路径的基本名称
26
+ return os.path.splitext(os.path.basename(path))[0]
27
+
28
+ def filter_multiple_choice_videos(input_file: str, output_file: str = None):
29
+ """
30
+ 筛选multiple choice的MP4视频数据
31
+
32
+ Args:
33
+ input_file: 输入JSON文件路径
34
+ output_file: 输出JSON文件路径
35
+ """
36
+
37
+ # 读取原始数据
38
+ with open(input_file, 'r', encoding='utf-8') as f:
39
+ data = json.load(f)
40
+
41
+ print(f"原始数据总数: {len(data)}")
42
+
43
+ # 筛选条件
44
+ filtered_data = []
45
+ for item in data:
46
+ # 必须是multiple choice
47
+ if item.get("problem_type") != "multiple choice":
48
+ continue
49
+
50
+ # 必须是MP4视频
51
+ path = item.get("path", "").lower()
52
+ if not (path.endswith(".mp4") or path.endswith(".mov") or path.endswith(".avi")):
53
+ # 如果不是常见视频格式,检查是否包含视频关键词
54
+ if not any(keyword in path for keyword in ["video", "mp4", "mov", "avi", "webm"]):
55
+ continue
56
+
57
+ filtered_data.append(item)
58
+
59
+ print(f"筛选后数据总数: {len(filtered_data)}")
60
+
61
+ # 生成输出文件名
62
+ if output_file is None:
63
+ base_name = os.path.splitext(input_file)[0]
64
+ output_file = f"{base_name}_filtered.json"
65
+
66
+ # 保存筛选后的数据
67
+ with open(output_file, 'w', encoding='utf-8') as f:
68
+ json.dump(filtered_data, f, indent=2, ensure_ascii=False)
69
+
70
+ print(f"筛选后的数据已保存到: {output_file}")
71
+
72
+ return filtered_data, output_file
73
+
74
+ def analyze_source_statistics(data: List[Dict[str, Any]]):
75
+ """
76
+ 分析数据来源统计
77
+
78
+ Args:
79
+ data: 数据列表
80
+ """
81
+
82
+ print("\n" + "="*60)
83
+ print("数据来源统计 (按路径的第一个目录名):")
84
+ print("="*60)
85
+
86
+ # 统计来源
87
+ source_counter = Counter()
88
+
89
+ for item in data:
90
+ path = item.get("path", "")
91
+ source = extract_source_from_path(path)
92
+ source_counter[source] += 1
93
+
94
+ # 打印统计结果
95
+ total = len(data)
96
+ print(f"\n总数据量: {total}")
97
+ print("-" * 40)
98
+
99
+ # 按数量降序排列
100
+ for source, count in source_counter.most_common():
101
+ percentage = (count / total) * 100
102
+ print(f"{source:30s}: {count:5d} ({percentage:.1f}%)")
103
+
104
+ # 生成饼图数据(可以用于后续可视化)
105
+ print("\n" + "="*60)
106
+ print("饼图数据 (可以直接复制到Excel/可视化工具):")
107
+ print("="*60)
108
+
109
+ print("\n来源,数量,百分比")
110
+ for source, count in source_counter.most_common():
111
+ percentage = (count / total) * 100
112
+ print(f"{source},{count},{percentage:.1f}%")
113
+
114
+ return source_counter
115
+
116
+ def generate_detailed_report(data: List[Dict[str, Any]],
117
+ source_counter: Counter,
118
+ output_report: str = "data_report.md"):
119
+ """
120
+ 生成详细的数据报告
121
+
122
+ Args:
123
+ data: 数据列表
124
+ source_counter: 来源统计
125
+ output_report: 输出报告文件路径
126
+ """
127
+
128
+ with open(output_report, 'w', encoding='utf-8') as f:
129
+ f.write("# 数据筛选与统计报告\n\n")
130
+
131
+ # 基本信息
132
+ f.write("## 基本信息\n")
133
+ f.write(f"- **筛选日期**: {time.strftime('%Y-%m-%d %H:%M:%S')}\n")
134
+ f.write(f"- **原始数据量**: {len(data)} 条\n")
135
+ f.write(f"- **筛选条件**: problem_type为'multiple choice'且path为视频文件\n\n")
136
+
137
+ # 来源统计表
138
+ f.write("## 来源统计表\n\n")
139
+ f.write("| 来源 | 数量 | 百分比 |\n")
140
+ f.write("|------|------|--------|\n")
141
+
142
+ total = len(data)
143
+ for source, count in source_counter.most_common():
144
+ percentage = (count / total) * 100
145
+ f.write(f"| {source} | {count} | {percentage:.1f}% |\n")
146
+
147
+ # 数据示例
148
+ f.write("\n## 数据示例\n\n")
149
+ f.write("### 前10条数据示例\n\n")
150
+
151
+ for i, item in enumerate(data[:10]):
152
+ f.write(f"#### 示例 {i+1}\n\n")
153
+ f.write(f"- **problem_id**: {item.get('problem_id', 'N/A')}\n")
154
+ f.write(f"- **problem**: {item.get('problem', 'N/A')}\n")
155
+ f.write(f"- **data_type**: {item.get('data_type', 'N/A')}\n")
156
+ f.write(f"- **problem_type**: {item.get('problem_type', 'N/A')}\n")
157
+ f.write(f"- **path**: {item.get('path', 'N/A')}\n")
158
+ f.write(f"- **options**: {len(item.get('options', []))} 个选项\n")
159
+ f.write(f"- **data_source**: {item.get('data_source', 'N/A')}\n")
160
+ f.write(f"- **来源目录**: {extract_source_from_path(item.get('path', ''))}\n")
161
+ f.write("\n---\n\n")
162
+
163
+ # 分析总结
164
+ f.write("## 分析总结\n\n")
165
+ f.write(f"1. 共筛选出 {len(data)} 条符合条件的数据\n")
166
+ f.write(f"2. 数据来源分布在 {len(source_counter)} 个不同的目录\n")
167
+
168
+ # 列出前3大来源
169
+ top_sources = source_counter.most_common(3)
170
+ f.write(f"3. 前三大来源:\n")
171
+ for i, (source, count) in enumerate(top_sources, 1):
172
+ percentage = (count / total) * 100
173
+ f.write(f" {i}. {source}: {count} 条 ({percentage:.1f}%)\n")
174
+
175
+ f.write("\n4. 数据质量分析:\n")
176
+ f.write(" - 所有数据均包含完整的问题、选项和答案\n")
177
+ f.write(" - 数据格式统一,便于后续处理\n")
178
+ f.write(" - 视频来源多样,覆盖多个领域\n")
179
+
180
+ print(f"\n详细报告已保存到: {output_report}")
181
+
182
+ def export_source_files(data: List[Dict[str, Any]]):
183
+ """
184
+ 按来源导出文件列表
185
+
186
+ Args:
187
+ data: 数据列表
188
+ """
189
+
190
+ # 按来源分组
191
+ source_groups = {}
192
+ for item in data:
193
+ path = item.get("path", "")
194
+ source = extract_source_from_path(path)
195
+
196
+ if source not in source_groups:
197
+ source_groups[source] = []
198
+
199
+ source_groups[source].append(item)
200
+
201
+ # 为每个来源创建目录并导出
202
+ export_dir = "exported_data"
203
+ os.makedirs(export_dir, exist_ok=True)
204
+
205
+ print(f"\n导出数据到目录: {export_dir}/")
206
+
207
+ for source, items in source_groups.items():
208
+ # 为每个来源创建子目录
209
+ source_dir = os.path.join(export_dir, source)
210
+ os.makedirs(source_dir, exist_ok=True)
211
+
212
+ # 保存该来源的所有数据
213
+ source_file = os.path.join(source_dir, f"{source}_data.json")
214
+ with open(source_file, 'w', encoding='utf-8') as f:
215
+ json.dump(items, f, indent=2, ensure_ascii=False)
216
+
217
+ # 创建视频路径列表
218
+ paths_file = os.path.join(source_dir, f"{source}_paths.txt")
219
+ with open(paths_file, 'w', encoding='utf-8') as f:
220
+ for item in items:
221
+ f.write(item.get("path", "") + "\n")
222
+
223
+ print(f" - {source}: {len(items)} 条数据")
224
+
225
+ return source_groups
226
+
227
+ def analyze_video_path_patterns(data: List[Dict[str, Any]]):
228
+ """
229
+ 分析视频路径模式
230
+
231
+ Args:
232
+ data: 数据列表
233
+ """
234
+
235
+ print("\n" + "="*60)
236
+ print("视频路径模式分析:")
237
+ print("="*60)
238
+
239
+ # 统计路径深度
240
+ depth_counter = Counter()
241
+ pattern_counter = Counter()
242
+
243
+ for item in data:
244
+ path = item.get("path", "")
245
+
246
+ # 统计路径深度
247
+ depth = path.count('/')
248
+ depth_counter[depth] += 1
249
+
250
+ # 统计常见的路径模式
251
+ # 例如:./LLaVA-Video-178K/academic_source/activitynet/v_xxx.mp4
252
+ parts = path.split('/')
253
+ if len(parts) >= 3:
254
+ pattern = f"{parts[0]}/{parts[1]}/.../{parts[-1]}"
255
+ pattern_counter[pattern] += 1
256
+ elif len(parts) == 2:
257
+ pattern = f"{parts[0]}/{parts[1]}"
258
+ pattern_counter[pattern] += 1
259
+ else:
260
+ pattern_counter[path] += 1
261
+
262
+ # 打印路径深度统计
263
+ print("\n路径深度统计:")
264
+ print("-" * 40)
265
+ for depth, count in sorted(depth_counter.items()):
266
+ print(f"深度 {depth}: {count} 条路径")
267
+
268
+ # 打印常见路径模式
269
+ print("\n常见路径模式 (前10):")
270
+ print("-" * 40)
271
+ for pattern, count in pattern_counter.most_common(10):
272
+ print(f"{pattern}: {count}")
273
+
274
+ def main():
275
+ """
276
+ 主函数:处理整个数据筛选和统计流程
277
+ """
278
+
279
+ # 配置参数
280
+ input_json = "your_data.json" # 请替换为你的JSON文件路径
281
+
282
+ if not os.path.exists(input_json):
283
+ print(f"错误: 文件 '{input_json}' 不存在!")
284
+ print("请修改脚本中的 input_json 变量为你的JSON文件路径")
285
+ return
286
+
287
+ print("="*60)
288
+ print("开始筛选 multiple choice 视频数据")
289
+ print("="*60)
290
+
291
+ # 步骤1: 筛选数据
292
+ filtered_data, output_file = filter_multiple_choice_videos(input_json)
293
+
294
+ if not filtered_data:
295
+ print("没有找到符合条件的数据!")
296
+ return
297
+
298
+ print("\n✓ 数据筛选完成")
299
+
300
+ # 步骤2: 分析来源统计
301
+ source_counter = analyze_source_statistics(filtered_data)
302
+
303
+ print("\n��� 来源统计完成")
304
+
305
+ # 步骤3: 生成详细报告
306
+ base_name = os.path.splitext(output_file)[0]
307
+ report_file = f"{base_name}_report.md"
308
+ generate_detailed_report(filtered_data, source_counter, report_file)
309
+
310
+ print("✓ 详细报告生成完成")
311
+
312
+ # 步骤4: 导出按来源分组的数据
313
+ source_groups = export_source_files(filtered_data)
314
+
315
+ print("✓ 数据导出完成")
316
+
317
+ # 步骤5: 分析视频路径模式
318
+ analyze_video_path_patterns(filtered_data)
319
+
320
+ print("✓ 路径模式分析完成")
321
+
322
+ # 最终总结
323
+ print("\n" + "="*60)
324
+ print("处理完成! 生成的文件:")
325
+ print("="*60)
326
+ print(f"1. 筛选后的JSON数据: {output_file}")
327
+ print(f"2. 详细统计报告: {report_file}")
328
+ print(f"3. 按来源分组的数据: exported_data/ 目录")
329
+ print(f"4. 总数据量: {len(filtered_data)} 条")
330
+
331
+ # 显示前5大来源
332
+ print(f"\n前5大来源:")
333
+ for i, (source, count) in enumerate(source_counter.most_common(5), 1):
334
+ percentage = (count / len(filtered_data)) * 100
335
+ print(f" {i}. {source}: {count} 条 ({percentage:.1f}%)")
336
+
337
+ # 简单版本的函数,用于快速使用
338
+ def quick_filter(input_file: str):
339
+ """
340
+ 快速筛选函数,一键完成所有操作
341
+ """
342
+ import time
343
+
344
+ print(f"开始处理文件: {input_file}")
345
+ start_time = time.time()
346
+
347
+ # 读取数据
348
+ with open(input_file, 'r', encoding='utf-8') as f:
349
+ data = json.load(f)
350
+
351
+ # 筛选
352
+ filtered = []
353
+ source_counter = Counter()
354
+
355
+ for item in data:
356
+ if item.get("problem_type") == "multiple choice":
357
+ path = item.get("path", "").lower()
358
+ if path.endswith(".mp4"):
359
+ filtered.append(item)
360
+ source = extract_source_from_path(path)
361
+ source_counter[source] += 1
362
+
363
+ # 保存结果
364
+ output_file = f"{os.path.splitext(input_file)[0]}_filtered.json"
365
+ with open(output_file, 'w', encoding='utf-8') as f:
366
+ json.dump(filtered, f, indent=2, ensure_ascii=False)
367
+
368
+ # 打印统计
369
+ print(f"\n原始数据: {len(data)} 条")
370
+ print(f"筛选后: {len(filtered)} 条")
371
+ print(f"\n来源统计:")
372
+ for source, count in source_counter.most_common():
373
+ print(f" {source}: {count}")
374
+
375
+ end_time = time.time()
376
+ print(f"\n处理完成! 耗时: {end_time - start_time:.2f}秒")
377
+ print(f"结果保存到: {output_file}")
378
+
379
+ return filtered
380
+
381
+ # 命令行接口
382
+ if __name__ == "__main__":
383
+ import sys
384
+
385
+ if len(sys.argv) < 2:
386
+ print("使用方法:")
387
+ print(f" python {sys.argv[0]} <输入JSON文件>")
388
+ print(f"示例:")
389
+ print(f" python {sys.argv[0]} data.json")
390
+ print(f"\n或者使用完整模式:")
391
+ print(f" python {sys.argv[0]} --full <输入JSON文件>")
392
+ sys.exit(1)
393
+
394
+ input_file = sys.argv[1]
395
+
396
+ if not os.path.exists(input_file):
397
+ print(f"错误: 文件 '{input_file}' 不存在!")
398
+ sys.exit(1)
399
+
400
+ # 判断是否使用完整模式
401
+ if len(sys.argv) > 2 and sys.argv[1] == "--full":
402
+ input_file = sys.argv[2]
403
+ # 运行完整版本
404
+ main()
405
+ else:
406
+ # 运行快速版本
407
+ quick_filter(input_file)
408
+
409
+ # python /data/shuimu.chen/TimeSearch-R/data_prepare/filter_r1.py /data/shuimu.chen/Video-R1/src/r1-v/Video-R1-data/Video-R1-260k.json
410
+ (timesearch) root@aa363201ed5b:/data/shuimu.chen# python /data/shuimu.chen/TimeSearch-R/data_prepare/filter_r1.py /data/shuimu.chen/Video-R1/src/r1-v/Video-R1-data/Video-R1-260k.json
411
+ 开始处理文件: /data/shuimu.chen/Video-R1/src/r1-v/Video-R1-data/Video-R1-260k.json
412
+
413
+ 原始数据: 263071 条
414
+ 筛选后: 103891 条
415
+
416
+ 来源统计:
417
+ llava-video-178k: 72421
418
+ star: 11455
419
+ next-qa: 7549
420
+ perceptiontest: 6348
421
+ clevrer: 6118
422
+
423
+ 处理完成! 耗时: 4.34秒
424
+ 结果保存到: /data/shuimu.chen/Video-R1/src/r1-v/Video-R1-data/Video-R1-260k_filtered.json
data_prepare/json_down.py ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json # 新增:用于读取JSON文件
3
+ import yt_dlp
4
+ from concurrent.futures import ThreadPoolExecutor, as_completed
5
+ from tqdm import tqdm
6
+
7
+ # ================= 配置区域 =================
8
+ # 修改:直接读取你提供的JSON文件路径
9
+ JSON_DATA_PATH = "/data/shuimu.chen/videomarathon/panda70m_mc_subset_100k.json"
10
+ SAVE_ROOT = "/data/shuimu.chen/videomarathon/100k_videos"
11
+ MAX_WORKERS = 1 # 保持单线程比较稳
12
+
13
+ # 【请确认】cookies.txt 文件的绝对路径
14
+ COOKIE_PATH = "/data/shuimu.chen/TimeSearch-R/data_prepare/cookies.txt"
15
+ # ===========================================
16
+
17
+ def process_video(item):
18
+ """
19
+ 单个视频下载任务函数 (完全不变)
20
+ """
21
+ video_rel_path = item['rel_path']
22
+ url = item['url']
23
+
24
+ # 构建保存路径
25
+ # base_name 类似于 "category/video_id"
26
+ base_name = os.path.splitext(video_rel_path)[0]
27
+ full_save_path_no_ext = os.path.join(SAVE_ROOT, base_name)
28
+
29
+ # 你的脚本用来检查的最终路径(带 .mp4)
30
+ final_file_path = full_save_path_no_ext + ".mp4"
31
+
32
+ # 检查文件是否已存在
33
+ if os.path.exists(final_file_path):
34
+ return "skipped"
35
+
36
+ # 确保目录存在
37
+ os.makedirs(os.path.dirname(final_file_path), exist_ok=True)
38
+
39
+ # yt-dlp 配置
40
+ ydl_opts = {
41
+ 'format': 'bestvideo[height<=480]+bestaudio/best[height<=480]',
42
+ 'sleep_interval': 5, # # 每次下载完至少睡 5 秒
43
+ 'max_sleep_interval': 15, # # 最多随机睡到 30 秒
44
+ 'merge_output_format': 'mp4',
45
+ 'sleep_interval_requests': 1, # 甚至连请求视频信息也要睡 5 秒
46
+ # 'js_runtimes': ['node'],
47
+ # 【核心修改】这里加上了 .%(ext)s
48
+ # 意思就是:文件名 = 你的路径 + . + 扩展名(mp4)
49
+ 'outtmpl': f"{full_save_path_no_ext}.%(ext)s",
50
+ 'js_runtimes': ['node:/data/shuimu.chen/TimeSearch-R/data_prepare/node-v24.12.0-linux-x64/bin/node'],
51
+
52
+ 'quiet': False, # 建议开启 False 以便调试,稳定后可改为 True
53
+ 'no_warnings': False,
54
+ 'ignoreerrors': True,
55
+ 'cookiefile': COOKIE_PATH,
56
+ }
57
+
58
+ try:
59
+ with yt_dlp.YoutubeDL(ydl_opts) as ydl:
60
+ ydl.download([url])
61
+
62
+ # 再次检查文件是否生成
63
+ if os.path.exists(final_file_path):
64
+ return "success"
65
+ else:
66
+ return "failed"
67
+ except Exception as e:
68
+ return "error"
69
+
70
+ def main():
71
+ # 0. 检查 cookie
72
+ if not os.path.exists(COOKIE_PATH):
73
+ print(f"❌ 错误: 找不到 Cookie 文件: {COOKIE_PATH}")
74
+ print("请上传 cookies.txt 后再重试!")
75
+ return
76
+
77
+ # 1. 加载和筛选数据
78
+ print(f"正在加载JSON数据文件: {JSON_DATA_PATH} ...")
79
+
80
+ # 修改:直接加载你提供的JSON文件
81
+ with open(JSON_DATA_PATH, 'r', encoding='utf-8') as f:
82
+ dataset = json.load(f)
83
+
84
+ print(f"已加载 {len(dataset)} 条数据")
85
+
86
+ unique_videos = {}
87
+ print("正在从JSON数据中筛选唯一视频任务 (Panda-70M + Multiple Choice) ...")
88
+
89
+ # 修改:简化筛选逻辑,因为你的JSON已经是MC样本了
90
+ for item in tqdm(dataset, desc="筛选唯一视频"):
91
+ # 你提供的JSON里都是Panda-70M的MC样本,这里可以简化判断
92
+ video_rel_path = item.get('video')
93
+ url = item.get('URL')
94
+
95
+ if video_rel_path and url:
96
+ if video_rel_path not in unique_videos:
97
+ unique_videos[video_rel_path] = url
98
+
99
+ tasks = [{'rel_path': k, 'url': v} for k, v in unique_videos.items()]
100
+ print(f"筛选完成!共 {len(tasks)} 个唯一视频任务。")
101
+ print(f"注: 原JSON中有 {len(dataset)} 条问答对,涉及 {len(tasks)} 个唯一视频。")
102
+
103
+ # 2. 多线程下载
104
+ print(f"\n开始并发下载 (Workers={MAX_WORKERS}, Cookie已启用)...")
105
+
106
+ results = {
107
+ "success": 0,
108
+ "skipped": 0,
109
+ "failed": 0,
110
+ "error": 0
111
+ }
112
+
113
+ with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
114
+ future_to_video = {executor.submit(process_video, task): task for task in tasks}
115
+
116
+ for future in tqdm(as_completed(future_to_video), total=len(tasks), desc="下载进度"):
117
+ status = future.result()
118
+ results[status] += 1
119
+
120
+ # 3. 总结
121
+ print("\n" + "=" * 40)
122
+ print("处理完毕")
123
+ print("=" * 40)
124
+ print(f"JSON中问答对总数: {len(dataset)}")
125
+ print(f"唯一视频任务数: {len(tasks)}")
126
+ print(f"跳过(已存在): {results['skipped']}")
127
+ print(f"下载成功: {results['success']}")
128
+ print(f"下载失败: {results['failed'] + results['error']}")
129
+ print(f"数据保存在: {os.path.abspath(SAVE_ROOT)}")
130
+
131
+ # 额外统计信息
132
+ if results['success'] > 0:
133
+ coverage_rate = results['success'] / len(tasks) * 100
134
+ print(f"视频覆盖率: {coverage_rate:.1f}%")
135
+
136
+ if __name__ == "__main__":
137
+ main()
data_prepare/node-v24.12.0-linux-x64/CHANGELOG.md ADDED
The diff for this file is too large to render. See raw diff
 
data_prepare/node-v24.12.0-linux-x64/LICENSE ADDED
The diff for this file is too large to render. See raw diff
 
data_prepare/node-v24.12.0-linux-x64/README.md ADDED
@@ -0,0 +1,916 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Node.js
2
+
3
+ Node.js is an open-source, cross-platform JavaScript runtime environment.
4
+
5
+ For information on using Node.js, see the [Node.js website][].
6
+
7
+ The Node.js project uses an [open governance model](./GOVERNANCE.md). The
8
+ [OpenJS Foundation][] provides support for the project.
9
+
10
+ Contributors are expected to act in a collaborative manner to move
11
+ the project forward. We encourage the constructive exchange of contrary
12
+ opinions and compromise. The [TSC](./GOVERNANCE.md#technical-steering-committee)
13
+ reserves the right to limit or block contributors who repeatedly act in ways
14
+ that discourage, exhaust, or otherwise negatively affect other participants.
15
+
16
+ **This project has a [Code of Conduct][].**
17
+
18
+ ## Table of contents
19
+
20
+ * [Support](#support)
21
+ * [Release types](#release-types)
22
+ * [Download](#download)
23
+ * [Current and LTS releases](#current-and-lts-releases)
24
+ * [Nightly releases](#nightly-releases)
25
+ * [API documentation](#api-documentation)
26
+ * [Verifying binaries](#verifying-binaries)
27
+ * [Building Node.js](#building-nodejs)
28
+ * [Security](#security)
29
+ * [Contributing to Node.js](#contributing-to-nodejs)
30
+ * [Current project team members](#current-project-team-members)
31
+ * [TSC (Technical Steering Committee)](#tsc-technical-steering-committee)
32
+ * [Collaborators](#collaborators)
33
+ * [Triagers](#triagers)
34
+ * [Release keys](#release-keys)
35
+ * [License](#license)
36
+
37
+ ## Support
38
+
39
+ Looking for help? Check out the
40
+ [instructions for getting support](.github/SUPPORT.md).
41
+
42
+ ## Release types
43
+
44
+ * **Current**: Under active development. Code for the Current release is in the
45
+ branch for its major version number (for example,
46
+ [v22.x](https://github.com/nodejs/node/tree/v22.x)). Node.js releases a new
47
+ major version every 6 months, allowing for breaking changes. This happens in
48
+ April and October every year. Releases appearing each October have a support
49
+ life of 8 months. Releases appearing each April convert to LTS (see below)
50
+ each October.
51
+ * **LTS**: Releases that receive Long Term Support, with a focus on stability
52
+ and security. Every even-numbered major version will become an LTS release.
53
+ LTS releases receive 12 months of _Active LTS_ support and a further 18 months
54
+ of _Maintenance_. LTS release lines have alphabetically-ordered code names,
55
+ beginning with v4 Argon. There are no breaking changes or feature additions,
56
+ except in some special circumstances.
57
+ * **Nightly**: Code from the Current branch built every 24-hours when there are
58
+ changes. Use with caution.
59
+
60
+ Current and LTS releases follow [semantic versioning](https://semver.org). A
61
+ member of the Release Team [signs](#release-keys) each Current and LTS release.
62
+ For more information, see the
63
+ [Release README](https://github.com/nodejs/Release#readme).
64
+
65
+ ### Download
66
+
67
+ Binaries, installers, and source tarballs are available at
68
+ <https://nodejs.org/en/download/>.
69
+
70
+ #### Current and LTS releases
71
+
72
+ <https://nodejs.org/download/release/>
73
+
74
+ The [latest](https://nodejs.org/download/release/latest/) directory is an
75
+ alias for the latest Current release. The latest-_codename_ directory is an
76
+ alias for the latest release from an LTS line. For example, the
77
+ [latest-hydrogen](https://nodejs.org/download/release/latest-hydrogen/)
78
+ directory contains the latest Hydrogen (Node.js 18) release.
79
+
80
+ #### Nightly releases
81
+
82
+ <https://nodejs.org/download/nightly/>
83
+
84
+ Each directory and filename includes the version (e.g., `v22.0.0`),
85
+ followed by the UTC date (e.g., `20240424` for April 24, 2024),
86
+ and the short commit SHA of the HEAD of the release (e.g., `ddd0a9e494`).
87
+ For instance, a full directory name might look like `v22.0.0-nightly20240424ddd0a9e494`.
88
+
89
+ #### API documentation
90
+
91
+ Documentation for the latest Current release is at <https://nodejs.org/api/>.
92
+ Version-specific documentation is available in each release directory in the
93
+ _docs_ subdirectory. Version-specific documentation is also at
94
+ <https://nodejs.org/download/docs/>.
95
+
96
+ ### Verifying binaries
97
+
98
+ Download directories contain a `SHASUMS256.txt.asc` file with SHA checksums for the
99
+ files and the releaser PGP signature.
100
+
101
+ You can get a trusted keyring from nodejs/release-keys, e.g. using `curl`:
102
+
103
+ ```bash
104
+ curl -fsLo "/path/to/nodejs-keyring.kbx" "https://github.com/nodejs/release-keys/raw/HEAD/gpg/pubring.kbx"
105
+ ```
106
+
107
+ Alternatively, you can import the releaser keys in your default keyring, see
108
+ [Release keys](#release-keys) for commands to how to do that.
109
+
110
+ Then, you can verify the files you've downloaded locally
111
+ (if you're using your default keyring, pass `--keyring="${GNUPGHOME:-~/.gnupg}/pubring.kbx"`):
112
+
113
+ ```bash
114
+ curl -fsO "https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc" \
115
+ && gpgv --keyring="/path/to/nodejs-keyring.kbx" --output SHASUMS256.txt < SHASUMS256.txt.asc \
116
+ && shasum --check SHASUMS256.txt --ignore-missing
117
+ ```
118
+
119
+ ## Building Node.js
120
+
121
+ See [BUILDING.md](BUILDING.md) for instructions on how to build Node.js from
122
+ source and a list of supported platforms.
123
+
124
+ ## Security
125
+
126
+ For information on reporting security vulnerabilities in Node.js, see
127
+ [SECURITY.md](./SECURITY.md).
128
+
129
+ ## Contributing to Node.js
130
+
131
+ * [Contributing to the project][]
132
+ * [Working Groups][]
133
+ * [Strategic initiatives][]
134
+ * [Technical values and prioritization][]
135
+
136
+ ## Current project team members
137
+
138
+ For information about the governance of the Node.js project, see
139
+ [GOVERNANCE.md](./GOVERNANCE.md).
140
+
141
+ <!-- node-core-utils and find-inactive-tsc.mjs depend on the format of the TSC
142
+ list. If the format changes, those utilities need to be tested and
143
+ updated. -->
144
+
145
+ ### TSC (Technical Steering Committee)
146
+
147
+ #### TSC voting members
148
+
149
+ <!--lint disable prohibited-strings-->
150
+
151
+ * [aduh95](https://github.com/aduh95) -
152
+ **Antoine du Hamel** <<duhamelantoine1995@gmail.com>> (he/him)
153
+ * [anonrig](https://github.com/anonrig) -
154
+ **Yagiz Nizipli** <<yagiz@nizipli.com>> (he/him)
155
+ * [benjamingr](https://github.com/benjamingr) -
156
+ **Benjamin Gruenbaum** <<benjamingr@gmail.com>>
157
+ * [BridgeAR](https://github.com/BridgeAR) -
158
+ **Ruben Bridgewater** <<ruben@bridgewater.de>> (he/him)
159
+ * [gireeshpunathil](https://github.com/gireeshpunathil) -
160
+ **Gireesh Punathil** <<gpunathi@in.ibm.com>> (he/him)
161
+ * [jasnell](https://github.com/jasnell) -
162
+ **James M Snell** <<jasnell@gmail.com>> (he/him)
163
+ * [joyeecheung](https://github.com/joyeecheung) -
164
+ **Joyee Cheung** <<joyeec9h3@gmail.com>> (she/her)
165
+ * [legendecas](https://github.com/legendecas) -
166
+ **Chengzhong Wu** <<legendecas@gmail.com>> (he/him)
167
+ * [marco-ippolito](https://github.com/marco-ippolito) -
168
+ **Marco Ippolito** <<marcoippolito54@gmail.com>> (he/him)
169
+ * [mcollina](https://github.com/mcollina) -
170
+ **Matteo Collina** <<matteo.collina@gmail.com>> (he/him)
171
+ * [panva](https://github.com/panva) -
172
+ **Filip Skokan** <<panva.ip@gmail.com>> (he/him)
173
+ * [RafaelGSS](https://github.com/RafaelGSS) -
174
+ **Rafael Gonzaga** <<rafael.nunu@hotmail.com>> (he/him)
175
+ * [RaisinTen](https://github.com/RaisinTen) -
176
+ **Darshan Sen** <<raisinten@gmail.com>> (he/him)
177
+ * [richardlau](https://github.com/richardlau) -
178
+ **Richard Lau** <<richard.lau@ibm.com>>
179
+ * [ronag](https://github.com/ronag) -
180
+ **Robert Nagy** <<ronagy@icloud.com>>
181
+ * [ruyadorno](https://github.com/ruyadorno) -
182
+ **Ruy Adorno** <<ruy@vlt.sh>> (he/him)
183
+ * [ShogunPanda](https://github.com/ShogunPanda) -
184
+ **Paolo Insogna** <<paolo@cowtech.it>> (he/him)
185
+ * [targos](https://github.com/targos) -
186
+ **Michaël Zasso** <<targos@protonmail.com>> (he/him)
187
+ * [tniessen](https://github.com/tniessen) -
188
+ **Tobias Nießen** <<tniessen@tnie.de>> (he/him)
189
+
190
+ #### TSC regular members
191
+
192
+ * [BethGriggs](https://github.com/BethGriggs) -
193
+ **Beth Griggs** <<bethanyngriggs@gmail.com>> (she/her)
194
+ * [bnoordhuis](https://github.com/bnoordhuis) -
195
+ **Ben Noordhuis** <<info@bnoordhuis.nl>>
196
+ * [cjihrig](https://github.com/cjihrig) -
197
+ **Colin Ihrig** <<cjihrig@gmail.com>> (he/him)
198
+ * [codebytere](https://github.com/codebytere) -
199
+ **Shelley Vohr** <<shelley.vohr@gmail.com>> (she/her)
200
+ * [GeoffreyBooth](https://github.com/GeoffreyBooth) -
201
+ **Geoffrey Booth** <<webadmin@geoffreybooth.com>> (he/him)
202
+ * [MoLow](https://github.com/MoLow) -
203
+ **Moshe Atlow** <<moshe@atlow.co.il>> (he/him)
204
+ * [Trott](https://github.com/Trott) -
205
+ **Rich Trott** <<rtrott@gmail.com>> (he/him)
206
+
207
+ <details>
208
+
209
+ <summary>TSC emeriti members</summary>
210
+
211
+ #### TSC emeriti members
212
+
213
+ * [addaleax](https://github.com/addaleax) -
214
+ **Anna Henningsen** <<anna@addaleax.net>> (she/her)
215
+ * [apapirovski](https://github.com/apapirovski) -
216
+ **Anatoli Papirovski** <<apapirovski@mac.com>> (he/him)
217
+ * [ChALkeR](https://github.com/ChALkeR) -
218
+ **Сковорода Никита Андреевич** <<chalkerx@gmail.com>> (he/him)
219
+ * [chrisdickinson](https://github.com/chrisdickinson) -
220
+ **Chris Dickinson** <<christopher.s.dickinson@gmail.com>>
221
+ * [danbev](https://github.com/danbev) -
222
+ **Daniel Bevenius** <<daniel.bevenius@gmail.com>> (he/him)
223
+ * [danielleadams](https://github.com/danielleadams) -
224
+ **Danielle Adams** <<adamzdanielle@gmail.com>> (she/her)
225
+ * [evanlucas](https://github.com/evanlucas) -
226
+ **Evan Lucas** <<evanlucas@me.com>> (he/him)
227
+ * [fhinkel](https://github.com/fhinkel) -
228
+ **Franziska Hinkelmann** <<franziska.hinkelmann@gmail.com>> (she/her)
229
+ * [Fishrock123](https://github.com/Fishrock123) -
230
+ **Jeremiah Senkpiel** <<fishrock123@rocketmail.com>> (he/they)
231
+ * [gabrielschulhof](https://github.com/gabrielschulhof) -
232
+ **Gabriel Schulhof** <<gabrielschulhof@gmail.com>>
233
+ * [gibfahn](https://github.com/gibfahn) -
234
+ **Gibson Fahnestock** <<gibfahn@gmail.com>> (he/him)
235
+ * [indutny](https://github.com/indutny) -
236
+ **Fedor Indutny** <<fedor@indutny.com>>
237
+ * [isaacs](https://github.com/isaacs) -
238
+ **Isaac Z. Schlueter** <<i@izs.me>>
239
+ * [joshgav](https://github.com/joshgav) -
240
+ **Josh Gavant** <<josh.gavant@outlook.com>>
241
+ * [mhdawson](https://github.com/mhdawson) -
242
+ **Michael Dawson** <<midawson@redhat.com>> (he/him)
243
+ * [mmarchini](https://github.com/mmarchini) -
244
+ **Mary Marchini** <<oss@mmarchini.me>> (she/her)
245
+ * [mscdex](https://github.com/mscdex) -
246
+ **Brian White** <<mscdex@mscdex.net>>
247
+ * [MylesBorins](https://github.com/MylesBorins) -
248
+ **Myles Borins** <<myles.borins@gmail.com>> (he/him)
249
+ * [nebrius](https://github.com/nebrius) -
250
+ **Bryan Hughes** <<bryan@nebri.us>>
251
+ * [ofrobots](https://github.com/ofrobots) -
252
+ **Ali Ijaz Sheikh** <<ofrobots@google.com>> (he/him)
253
+ * [orangemocha](https://github.com/orangemocha) -
254
+ **Alexis Campailla** <<orangemocha@nodejs.org>>
255
+ * [piscisaureus](https://github.com/piscisaureus) -
256
+ **Bert Belder** <<bertbelder@gmail.com>>
257
+ * [rvagg](https://github.com/rvagg) -
258
+ **Rod Vagg** <<r@va.gg>>
259
+ * [sam-github](https://github.com/sam-github) -
260
+ **Sam Roberts** <<vieuxtech@gmail.com>>
261
+ * [shigeki](https://github.com/shigeki) -
262
+ **Shigeki Ohtsu** <<ohtsu@ohtsu.org>> (he/him)
263
+ * [thefourtheye](https://github.com/thefourtheye) -
264
+ **Sakthipriyan Vairamani** <<thechargingvolcano@gmail.com>> (he/him)
265
+ * [TimothyGu](https://github.com/TimothyGu) -
266
+ **Tiancheng "Timothy" Gu** <<timothygu99@gmail.com>> (he/him)
267
+ * [trevnorris](https://github.com/trevnorris) -
268
+ **Trevor Norris** <<trev.norris@gmail.com>>
269
+
270
+ </details>
271
+
272
+ <!-- node-core-utils and find-inactive-collaborators.mjs depend on the format
273
+ of the collaborator list. If the format changes, those utilities need to be
274
+ tested and updated. -->
275
+
276
+ ### Collaborators
277
+
278
+ * [abmusse](https://github.com/abmusse) -
279
+ **Abdirahim Musse** <<abdirahim.musse@ibm.com>>
280
+ * [addaleax](https://github.com/addaleax) -
281
+ **Anna Henningsen** <<anna@addaleax.net>> (she/her)
282
+ * [Aditi-1400](https://github.com/Aditi-1400) -
283
+ **Aditi Singh** <<aditisingh1400@gmail.com>> (she/her)
284
+ * [aduh95](https://github.com/aduh95) -
285
+ **Antoine du Hamel** <<duhamelantoine1995@gmail.com>> (he/him) - [Support me](https://github.com/sponsors/aduh95)
286
+ * [anonrig](https://github.com/anonrig) -
287
+ **Yagiz Nizipli** <<yagiz@nizipli.com>> (he/him) - [Support me](https://github.com/sponsors/anonrig)
288
+ * [atlowChemi](https://github.com/atlowChemi) -
289
+ **Chemi Atlow** <<chemi@atlow.co.il>> (he/him)
290
+ * [Ayase-252](https://github.com/Ayase-252) -
291
+ **Qingyu Deng** <<i@ayase-lab.com>>
292
+ * [bengl](https://github.com/bengl) -
293
+ **Bryan English** <<bryan@bryanenglish.com>> (he/him)
294
+ * [benjamingr](https://github.com/benjamingr) -
295
+ **Benjamin Gruenbaum** <<benjamingr@gmail.com>>
296
+ * [BethGriggs](https://github.com/BethGriggs) -
297
+ **Beth Griggs** <<bethanyngriggs@gmail.com>> (she/her)
298
+ * [bnb](https://github.com/bnb) -
299
+ **Tierney Cyren** <<hello@bnb.im>> (they/them)
300
+ * [bnoordhuis](https://github.com/bnoordhuis) -
301
+ **Ben Noordhuis** <<info@bnoordhuis.nl>>
302
+ * [BridgeAR](https://github.com/BridgeAR) -
303
+ **Ruben Bridgewater** <<ruben@bridgewater.de>> (he/him)
304
+ * [cclauss](https://github.com/cclauss) -
305
+ **Christian Clauss** <<cclauss@me.com>> (he/him)
306
+ * [cjihrig](https://github.com/cjihrig) -
307
+ **Colin Ihrig** <<cjihrig@gmail.com>> (he/him)
308
+ * [codebytere](https://github.com/codebytere) -
309
+ **Shelley Vohr** <<shelley.vohr@gmail.com>> (she/her)
310
+ * [cola119](https://github.com/cola119) -
311
+ **Kohei Ueno** <<kohei.ueno119@gmail.com>> (he/him)
312
+ * [daeyeon](https://github.com/daeyeon) -
313
+ **Daeyeon Jeong** <<daeyeon.dev@gmail.com>> (he/him)
314
+ * [dario-piotrowicz](https://github.com/dario-piotrowicz) -
315
+ **Dario Piotrowicz** <<dario.piotrowicz@gmail.com>> (he/him)
316
+ * [debadree25](https://github.com/debadree25) -
317
+ **Debadree Chatterjee** <<debadree333@gmail.com>> (he/him)
318
+ * [deokjinkim](https://github.com/deokjinkim) -
319
+ **Deokjin Kim** <<deokjin81.kim@gmail.com>> (he/him)
320
+ * [edsadr](https://github.com/edsadr) -
321
+ **Adrian Estrada** <<edsadr@gmail.com>> (he/him)
322
+ * [ErickWendel](https://github.com/ErickWendel) -
323
+ **Erick Wendel** <<erick.workspace@gmail.com>> (he/him)
324
+ * [Ethan-Arrowood](https://github.com/Ethan-Arrowood) -
325
+ **Ethan Arrowood** <<ethan@arrowood.dev>> (he/him)
326
+ * [fhinkel](https://github.com/fhinkel) -
327
+ **Franziska Hinkelmann** <<franziska.hinkelmann@gmail.com>> (she/her)
328
+ * [Flarna](https://github.com/Flarna) -
329
+ **Gerhard Stöbich** <<deb2001-github@yahoo.de>> (he/they)
330
+ * [gabrielschulhof](https://github.com/gabrielschulhof) -
331
+ **Gabriel Schulhof** <<gabrielschulhof@gmail.com>>
332
+ * [geeksilva97](https://github.com/geeksilva97) -
333
+ **Edy Silva** <<edigleyssonsilva@gmail.com>> (he/him)
334
+ * [gengjiawen](https://github.com/gengjiawen) -
335
+ **Jiawen Geng** <<technicalcute@gmail.com>>
336
+ * [GeoffreyBooth](https://github.com/GeoffreyBooth) -
337
+ **Geoffrey Booth** <<webadmin@geoffreybooth.com>> (he/him)
338
+ * [gireeshpunathil](https://github.com/gireeshpunathil) -
339
+ **Gireesh Punathil** <<gpunathi@in.ibm.com>> (he/him)
340
+ * [guybedford](https://github.com/guybedford) -
341
+ **Guy Bedford** <<guybedford@gmail.com>> (he/him)
342
+ * [H4ad](https://github.com/H4ad) -
343
+ **Vinícius Lourenço Claro Cardoso** <<contact@viniciusl.com.br>> (he/him)
344
+ * [HarshithaKP](https://github.com/HarshithaKP) -
345
+ **Harshitha K P** <<harshitha014@gmail.com>> (she/her)
346
+ * [himself65](https://github.com/himself65) -
347
+ **Zeyu "Alex" Yang** <<himself65@outlook.com>> (he/him)
348
+ * [hybrist](https://github.com/hybrist) -
349
+ **Jan Martin** <<jan.krems@gmail.com>> (he/him)
350
+ * [IlyasShabi](https://github.com/IlyasShabi) -
351
+ **Ilyas Shabi** <<ilyasshabi94@gmail.com>> (he/him)
352
+ * [islandryu](https://github.com/islandryu) -
353
+ **Ryuhei Shima** <<shimaryuhei@gmail.com>> (he/him)
354
+ * [jakecastelli](https://github.com/jakecastelli) -
355
+ **Jake Yuesong Li** <<jake.yuesong@gmail.com>> (he/him)
356
+ * [JakobJingleheimer](https://github.com/JakobJingleheimer) -
357
+ **Jacob Smith** <<jacob@frende.me>> (he/him)
358
+ * [jasnell](https://github.com/jasnell) -
359
+ **James M Snell** <<jasnell@gmail.com>> (he/him)
360
+ * [jazelly](https://github.com/jazelly) -
361
+ **Jason Zhang** <<xzha4350@gmail.com>> (he/him)
362
+ * [JonasBa](https://github.com/JonasBa) -
363
+ **Jonas Badalic** <<jonas.badalic@gmail.com>> (he/him)
364
+ * [joyeecheung](https://github.com/joyeecheung) -
365
+ **Joyee Cheung** <<joyeec9h3@gmail.com>> (she/her)
366
+ * [juanarbol](https://github.com/juanarbol) -
367
+ **Juan José Arboleda** <<soyjuanarbol@gmail.com>> (he/him)
368
+ * [JungMinu](https://github.com/JungMinu) -
369
+ **Minwoo Jung** <<nodecorelab@gmail.com>> (he/him)
370
+ * [KhafraDev](https://github.com/KhafraDev) -
371
+ **Matthew Aitken** <<maitken033380023@gmail.com>> (he/him)
372
+ * [legendecas](https://github.com/legendecas) -
373
+ **Chengzhong Wu** <<legendecas@gmail.com>> (he/him)
374
+ * [lemire](https://github.com/lemire) -
375
+ **Daniel Lemire** <<daniel@lemire.me>>
376
+ * [LiviaMedeiros](https://github.com/LiviaMedeiros) -
377
+ **LiviaMedeiros** <<livia@cirno.name>>
378
+ * [ljharb](https://github.com/ljharb) -
379
+ **Jordan Harband** <<ljharb@gmail.com>>
380
+ * [lpinca](https://github.com/lpinca) -
381
+ **Luigi Pinca** <<luigipinca@gmail.com>> (he/him)
382
+ * [lukekarrys](https://github.com/lukekarrys) -
383
+ **Luke Karrys** <<luke@lukekarrys.com>> (he/him)
384
+ * [Lxxyx](https://github.com/Lxxyx) -
385
+ **Zijian Liu** <<lxxyxzj@gmail.com>> (he/him)
386
+ * [marco-ippolito](https://github.com/marco-ippolito) -
387
+ **Marco Ippolito** <<marcoippolito54@gmail.com>> (he/him) - [Support me](https://github.com/sponsors/marco-ippolito)
388
+ * [marsonya](https://github.com/marsonya) -
389
+ **Akhil Marsonya** <<akhil.marsonya27@gmail.com>> (he/him)
390
+ * [MattiasBuelens](https://github.com/MattiasBuelens) -
391
+ **Mattias Buelens** <<mattias@buelens.com>> (he/him)
392
+ * [mcollina](https://github.com/mcollina) -
393
+ **Matteo Collina** <<matteo.collina@gmail.com>> (he/him) - [Support me](https://github.com/sponsors/mcollina)
394
+ * [meixg](https://github.com/meixg) -
395
+ **Xuguang Mei** <<meixuguang@gmail.com>> (he/him)
396
+ * [mhdawson](https://github.com/mhdawson) -
397
+ **Michael Dawson** <<midawson@redhat.com>> (he/him)
398
+ * [MoLow](https://github.com/MoLow) -
399
+ **Moshe Atlow** <<moshe@atlow.co.il>> (he/him)
400
+ * [MrJithil](https://github.com/MrJithil) -
401
+ **Jithil P Ponnan** <<jithil@outlook.com>> (he/him)
402
+ * [ovflowd](https://github.com/ovflowd) -
403
+ **Claudio Wunder** <<cwunder@gnome.org>> (he/they)
404
+ * [panva](https://github.com/panva) -
405
+ **Filip Skokan** <<panva.ip@gmail.com>> (he/him) - [Support me](https://github.com/sponsors/panva)
406
+ * [pimterry](https://github.com/pimterry) -
407
+ **Tim Perry** <<pimterry@gmail.com>> (he/him)
408
+ * [pmarchini](https://github.com/pmarchini) -
409
+ **Pietro Marchini** <<pietro.marchini94@gmail.com>> (he/him)
410
+ * [puskin](https://github.com/puskin) -
411
+ **Giovanni Bucci** <<github@puskin.it>> (he/him)
412
+ * [Qard](https://github.com/Qard) -
413
+ **Stephen Belanger** <<admin@stephenbelanger.com>> (he/him)
414
+ * [RafaelGSS](https://github.com/RafaelGSS) -
415
+ **Rafael Gonzaga** <<rafael.nunu@hotmail.com>> (he/him) - [Support me](https://github.com/sponsors/RafaelGSS)
416
+ * [RaisinTen](https://github.com/RaisinTen) -
417
+ **Darshan Sen** <<raisinten@gmail.com>> (he/him) - [Support me](https://github.com/sponsors/RaisinTen)
418
+ * [richardlau](https://github.com/richardlau) -
419
+ **Richard Lau** <<richard.lau@ibm.com>>
420
+ * [rluvaton](https://github.com/rluvaton) -
421
+ **Raz Luvaton** <<rluvaton@gmail.com>> (he/him)
422
+ * [ronag](https://github.com/ronag) -
423
+ **Robert Nagy** <<ronagy@icloud.com>>
424
+ * [ruyadorno](https://github.com/ruyadorno) -
425
+ **Ruy Adorno** <<ruy@vlt.sh>> (he/him)
426
+ * [santigimeno](https://github.com/santigimeno) -
427
+ **Santiago Gimeno** <<santiago.gimeno@gmail.com>>
428
+ * [ShogunPanda](https://github.com/ShogunPanda) -
429
+ **Paolo Insogna** <<paolo@cowtech.it>> (he/him)
430
+ * [srl295](https://github.com/srl295) -
431
+ **Steven R Loomis** <<srl295@gmail.com>>
432
+ * [StefanStojanovic](https://github.com/StefanStojanovic) -
433
+ **Stefan Stojanovic** <<stefan.stojanovic@janeasystems.com>> (he/him)
434
+ * [sxa](https://github.com/sxa) -
435
+ **Stewart X Addison** <<sxa@redhat.com>> (he/him)
436
+ * [targos](https://github.com/targos) -
437
+ **Michaël Zasso** <<targos@protonmail.com>> (he/him)
438
+ * [theanarkh](https://github.com/theanarkh) -
439
+ **theanarkh** <<theratliter@gmail.com>> (he/him)
440
+ * [tniessen](https://github.com/tniessen) -
441
+ **Tobias Nießen** <<tniessen@tnie.de>> (he/him)
442
+ * [trivikr](https://github.com/trivikr) -
443
+ **Trivikram Kamat** <<trivikr.dev@gmail.com>>
444
+ * [Trott](https://github.com/Trott) -
445
+ **Rich Trott** <<rtrott@gmail.com>> (he/him)
446
+ * [UlisesGascon](https://github.com/UlisesGascon) -
447
+ **Ulises Gascón** <<ulisesgascongonzalez@gmail.com>> (he/him)
448
+ * [vmoroz](https://github.com/vmoroz) -
449
+ **Vladimir Morozov** <<vmorozov@microsoft.com>> (he/him)
450
+ * [VoltrexKeyva](https://github.com/VoltrexKeyva) -
451
+ **Mohammed Keyvanzadeh** <<mohammadkeyvanzade94@gmail.com>> (he/him)
452
+ * [zcbenz](https://github.com/zcbenz) -
453
+ **Cheng Zhao** <<zcbenz@gmail.com>> (he/him)
454
+ * [ZYSzys](https://github.com/ZYSzys) -
455
+ **Yongsheng Zhang** <<zyszys98@gmail.com>> (he/him)
456
+
457
+ <details>
458
+
459
+ <summary>Emeriti</summary>
460
+
461
+ <!-- find-inactive-collaborators.mjs depends on the format of the emeriti list.
462
+ If the format changes, those utilities need to be tested and updated. -->
463
+
464
+ ### Collaborator emeriti
465
+
466
+ * [ak239](https://github.com/ak239) -
467
+ **Aleksei Koziatinskii** <<ak239spb@gmail.com>>
468
+ * [andrasq](https://github.com/andrasq) -
469
+ **Andras** <<andras@kinvey.com>>
470
+ * [AndreasMadsen](https://github.com/AndreasMadsen) -
471
+ **Andreas Madsen** <<amwebdk@gmail.com>> (he/him)
472
+ * [AnnaMag](https://github.com/AnnaMag) -
473
+ **Anna M. Kedzierska** <<anna.m.kedzierska@gmail.com>>
474
+ * [antsmartian](https://github.com/antsmartian) -
475
+ **Anto Aravinth** <<anto.aravinth.cse@gmail.com>> (he/him)
476
+ * [apapirovski](https://github.com/apapirovski) -
477
+ **Anatoli Papirovski** <<apapirovski@mac.com>> (he/him)
478
+ * [aqrln](https://github.com/aqrln) -
479
+ **Alexey Orlenko** <<eaglexrlnk@gmail.com>> (he/him)
480
+ * [AshCripps](https://github.com/AshCripps) -
481
+ **Ash Cripps** <<email@ashleycripps.co.uk>>
482
+ * [bcoe](https://github.com/bcoe) -
483
+ **Ben Coe** <<bencoe@gmail.com>> (he/him)
484
+ * [bmeck](https://github.com/bmeck) -
485
+ **Bradley Farias** <<bradley.meck@gmail.com>>
486
+ * [bmeurer](https://github.com/bmeurer) -
487
+ **Benedikt Meurer** <<benedikt.meurer@gmail.com>>
488
+ * [boneskull](https://github.com/boneskull) -
489
+ **Christopher Hiller** <<boneskull@boneskull.com>> (he/him)
490
+ * [brendanashworth](https://github.com/brendanashworth) -
491
+ **Brendan Ashworth** <<brendan.ashworth@me.com>>
492
+ * [bzoz](https://github.com/bzoz) -
493
+ **Bartosz Sosnowski** <<bartosz@janeasystems.com>>
494
+ * [calvinmetcalf](https://github.com/calvinmetcalf) -
495
+ **Calvin Metcalf** <<calvin.metcalf@gmail.com>>
496
+ * [ChALkeR](https://github.com/ChALkeR) -
497
+ **Сковорода Никита Андреевич** <<chalkerx@gmail.com>> (he/him)
498
+ * [chrisdickinson](https://github.com/chrisdickinson) -
499
+ **Chris Dickinson** <<christopher.s.dickinson@gmail.com>>
500
+ * [claudiorodriguez](https://github.com/claudiorodriguez) -
501
+ **Claudio Rodriguez** <<cjrodr@yahoo.com>>
502
+ * [danbev](https://github.com/danbev) -
503
+ **Daniel Bevenius** <<daniel.bevenius@gmail.com>> (he/him)
504
+ * [danielleadams](https://github.com/danielleadams) -
505
+ **Danielle Adams** <<adamzdanielle@gmail.com>> (she/her)
506
+ * [DavidCai1993](https://github.com/DavidCai1993) -
507
+ **David Cai** <<davidcai1993@yahoo.com>> (he/him)
508
+ * [davisjam](https://github.com/davisjam) -
509
+ **Jamie Davis** <<davisjam@vt.edu>> (he/him)
510
+ * [devnexen](https://github.com/devnexen) -
511
+ **David Carlier** <<devnexen@gmail.com>>
512
+ * [devsnek](https://github.com/devsnek) -
513
+ **Gus Caplan** <<me@gus.host>> (they/them)
514
+ * [digitalinfinity](https://github.com/digitalinfinity) -
515
+ **Hitesh Kanwathirtha** <<digitalinfinity@gmail.com>> (he/him)
516
+ * [dmabupt](https://github.com/dmabupt) -
517
+ **Xu Meng** <<dmabupt@gmail.com>> (he/him)
518
+ * [dnlup](https://github.com/dnlup) -
519
+ **dnlup** <<dnlup.dev@gmail.com>>
520
+ * [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) -
521
+ **Robert Jefe Lindstaedt** <<robert.lindstaedt@gmail.com>>
522
+ * [estliberitas](https://github.com/estliberitas) -
523
+ **Alexander Makarenko** <<estliberitas@gmail.com>>
524
+ * [eugeneo](https://github.com/eugeneo) -
525
+ **Eugene Ostroukhov** <<eostroukhov@google.com>>
526
+ * [evanlucas](https://github.com/evanlucas) -
527
+ **Evan Lucas** <<evanlucas@me.com>> (he/him)
528
+ * [F3n67u](https://github.com/F3n67u) -
529
+ **Feng Yu** <<F3n67u@outlook.com>> (he/him)
530
+ * [firedfox](https://github.com/firedfox) -
531
+ **Daniel Wang** <<wangyang0123@gmail.com>>
532
+ * [Fishrock123](https://github.com/Fishrock123) -
533
+ **Jeremiah Senkpiel** <<fishrock123@rocketmail.com>> (he/they)
534
+ * [gdams](https://github.com/gdams) -
535
+ **George Adams** <<gadams@microsoft.com>> (he/him)
536
+ * [geek](https://github.com/geek) -
537
+ **Wyatt Preul** <<wpreul@gmail.com>>
538
+ * [gibfahn](https://github.com/gibfahn) -
539
+ **Gibson Fahnestock** <<gibfahn@gmail.com>> (he/him)
540
+ * [glentiki](https://github.com/glentiki) -
541
+ **Glen Keane** <<glenkeane.94@gmail.com>> (he/him)
542
+ * [hashseed](https://github.com/hashseed) -
543
+ **Yang Guo** <<yangguo@chromium.org>> (he/him)
544
+ * [hiroppy](https://github.com/hiroppy) -
545
+ **Yuta Hiroto** <<hello@hiroppy.me>> (he/him)
546
+ * [iansu](https://github.com/iansu) -
547
+ **Ian Sutherland** <<ian@iansutherland.ca>>
548
+ * [iarna](https://github.com/iarna) -
549
+ **Rebecca Turner** <<me@re-becca.org>>
550
+ * [imran-iq](https://github.com/imran-iq) -
551
+ **Imran Iqbal** <<imran@imraniqbal.org>>
552
+ * [imyller](https://github.com/imyller) -
553
+ **Ilkka Myller** <<ilkka.myller@nodefield.com>>
554
+ * [indutny](https://github.com/indutny) -
555
+ **Fedor Indutny** <<fedor@indutny.com>>
556
+ * [isaacs](https://github.com/isaacs) -
557
+ **Isaac Z. Schlueter** <<i@izs.me>>
558
+ * [italoacasas](https://github.com/italoacasas) -
559
+ **Italo A. Casas** <<me@italoacasas.com>> (he/him)
560
+ * [JacksonTian](https://github.com/JacksonTian) -
561
+ **Jackson Tian** <<shyvo1987@gmail.com>>
562
+ * [jasongin](https://github.com/jasongin) -
563
+ **Jason Ginchereau** <<jasongin@microsoft.com>>
564
+ * [jbergstroem](https://github.com/jbergstroem) -
565
+ **Johan Bergström** <<bugs@bergstroem.nu>>
566
+ * [jdalton](https://github.com/jdalton) -
567
+ **John-David Dalton** <<john.david.dalton@gmail.com>>
568
+ * [jhamhader](https://github.com/jhamhader) -
569
+ **Yuval Brik** <<yuval@brik.org.il>>
570
+ * [joaocgreis](https://github.com/joaocgreis) -
571
+ **João Reis** <<reis@janeasystems.com>>
572
+ * [joesepi](https://github.com/joesepi) -
573
+ **Joe Sepi** <<sepi@joesepi.com>> (he/him)
574
+ * [joshgav](https://github.com/joshgav) -
575
+ **Josh Gavant** <<josh.gavant@outlook.com>>
576
+ * [julianduque](https://github.com/julianduque) -
577
+ **Julian Duque** <<julianduquej@gmail.com>> (he/him)
578
+ * [kfarnung](https://github.com/kfarnung) -
579
+ **Kyle Farnung** <<kfarnung@microsoft.com>> (he/him)
580
+ * [kunalspathak](https://github.com/kunalspathak) -
581
+ **Kunal Pathak** <<kunal.pathak@microsoft.com>>
582
+ * [kuriyosh](https://github.com/kuriyosh) -
583
+ **Yoshiki Kurihara** <<yosyos0306@gmail.com>> (he/him)
584
+ * [kvakil](https://github.com/kvakil) -
585
+ **Keyhan Vakil** <<kvakil@sylph.kvakil.me>>
586
+ * [lance](https://github.com/lance) -
587
+ **Lance Ball** <<lball@redhat.com>> (he/him)
588
+ * [Leko](https://github.com/Leko) -
589
+ **Shingo Inoue** <<leko.noor@gmail.com>> (he/him)
590
+ * [Linkgoron](https://github.com/Linkgoron) -
591
+ **Nitzan Uziely** <<linkgoron@gmail.com>>
592
+ * [lucamaraschi](https://github.com/lucamaraschi) -
593
+ **Luca Maraschi** <<luca.maraschi@gmail.com>> (he/him)
594
+ * [lundibundi](https://github.com/lundibundi) -
595
+ **Denys Otrishko** <<shishugi@gmail.com>> (he/him)
596
+ * [lxe](https://github.com/lxe) -
597
+ **Aleksey Smolenchuk** <<lxe@lxe.co>>
598
+ * [maclover7](https://github.com/maclover7) -
599
+ **Jon Moss** <<me@jonathanmoss.me>> (he/him)
600
+ * [mafintosh](https://github.com/mafintosh) -
601
+ **Mathias Buus** <<mathiasbuus@gmail.com>> (he/him)
602
+ * [matthewloring](https://github.com/matthewloring) -
603
+ **Matthew Loring** <<mattloring@google.com>>
604
+ * [Mesteery](https://github.com/Mesteery) -
605
+ **Mestery** <<mestery@protonmail.com>> (he/him)
606
+ * [micnic](https://github.com/micnic) -
607
+ **Nicu Micleușanu** <<micnic90@gmail.com>> (he/him)
608
+ * [mikeal](https://github.com/mikeal) -
609
+ **Mikeal Rogers** <<mikeal.rogers@gmail.com>>
610
+ * [miladfarca](https://github.com/miladfarca) -
611
+ **Milad Fa** <<mfarazma@redhat.com>> (he/him)
612
+ * [mildsunrise](https://github.com/mildsunrise) -
613
+ **Alba Mendez** <<me@alba.sh>> (she/her)
614
+ * [misterdjules](https://github.com/misterdjules) -
615
+ **Julien Gilli** <<jgilli@netflix.com>>
616
+ * [mmarchini](https://github.com/mmarchini) -
617
+ **Mary Marchini** <<oss@mmarchini.me>> (she/her)
618
+ * [monsanto](https://github.com/monsanto) -
619
+ **Christopher Monsanto** <<chris@monsan.to>>
620
+ * [MoonBall](https://github.com/MoonBall) -
621
+ **Chen Gang** <<gangc.cxy@foxmail.com>>
622
+ * [mscdex](https://github.com/mscdex) -
623
+ **Brian White** <<mscdex@mscdex.net>>
624
+ * [MylesBorins](https://github.com/MylesBorins) -
625
+ **Myles Borins** <<myles.borins@gmail.com>> (he/him)
626
+ * [not-an-aardvark](https://github.com/not-an-aardvark) -
627
+ **Teddy Katz** <<teddy.katz@gmail.com>> (he/him)
628
+ * [ofrobots](https://github.com/ofrobots) -
629
+ **Ali Ijaz Sheikh** <<ofrobots@google.com>> (he/him)
630
+ * [Olegas](https://github.com/Olegas) -
631
+ **Oleg Elifantiev** <<oleg@elifantiev.ru>>
632
+ * [orangemocha](https://github.com/orangemocha) -
633
+ **Alexis Campailla** <<orangemocha@nodejs.org>>
634
+ * [othiym23](https://github.com/othiym23) -
635
+ **Forrest L Norvell** <<ogd@aoaioxxysz.net>> (they/them/themself)
636
+ * [oyyd](https://github.com/oyyd) -
637
+ **Ouyang Yadong** <<oyydoibh@gmail.com>> (he/him)
638
+ * [petkaantonov](https://github.com/petkaantonov) -
639
+ **Petka Antonov** <<petka_antonov@hotmail.com>>
640
+ * [phillipj](https://github.com/phillipj) -
641
+ **Phillip Johnsen** <<johphi@gmail.com>>
642
+ * [piscisaureus](https://github.com/piscisaureus) -
643
+ **Bert Belder** <<bertbelder@gmail.com>>
644
+ * [pmq20](https://github.com/pmq20) -
645
+ **Minqi Pan** <<pmq2001@gmail.com>>
646
+ * [PoojaDurgad](https://github.com/PoojaDurgad) -
647
+ **Pooja D P** <<Pooja.D.P@ibm.com>> (she/her)
648
+ * [princejwesley](https://github.com/princejwesley) -
649
+ **Prince John Wesley** <<princejohnwesley@gmail.com>>
650
+ * [psmarshall](https://github.com/psmarshall) -
651
+ **Peter Marshall** <<petermarshall@chromium.org>> (he/him)
652
+ * [puzpuzpuz](https://github.com/puzpuzpuz) -
653
+ **Andrey Pechkurov** <<apechkurov@gmail.com>> (he/him)
654
+ * [refack](https://github.com/refack) -
655
+ **Refael Ackermann (רפאל פלחי)** <<refack@gmail.com>> (he/him/הוא/אתה)
656
+ * [rexagod](https://github.com/rexagod) -
657
+ **Pranshu Srivastava** <<rexagod@gmail.com>> (he/him)
658
+ * [rickyes](https://github.com/rickyes) -
659
+ **Ricky Zhou** <<0x19951125@gmail.com>> (he/him)
660
+ * [rlidwka](https://github.com/rlidwka) -
661
+ **Alex Kocharin** <<alex@kocharin.ru>>
662
+ * [rmg](https://github.com/rmg) -
663
+ **Ryan Graham** <<r.m.graham@gmail.com>>
664
+ * [robertkowalski](https://github.com/robertkowalski) -
665
+ **Robert Kowalski** <<rok@kowalski.gd>>
666
+ * [romankl](https://github.com/romankl) -
667
+ **Roman Klauke** <<romaaan.git@gmail.com>>
668
+ * [ronkorving](https://github.com/ronkorving) -
669
+ **Ron Korving** <<ron@ronkorving.nl>>
670
+ * [RReverser](https://github.com/RReverser) -
671
+ **Ingvar Stepanyan** <<me@rreverser.com>>
672
+ * [rubys](https://github.com/rubys) -
673
+ **Sam Ruby** <<rubys@intertwingly.net>>
674
+ * [rvagg](https://github.com/rvagg) -
675
+ **Rod Vagg** <<rod@vagg.org>>
676
+ * [ryzokuken](https://github.com/ryzokuken) -
677
+ **Ujjwal Sharma** <<ryzokuken@disroot.org>> (he/him)
678
+ * [saghul](https://github.com/saghul) -
679
+ **Saúl Ibarra Corretgé** <<s@saghul.net>>
680
+ * [sam-github](https://github.com/sam-github) -
681
+ **Sam Roberts** <<vieuxtech@gmail.com>>
682
+ * [sebdeckers](https://github.com/sebdeckers) -
683
+ **Sebastiaan Deckers** <<sebdeckers83@gmail.com>>
684
+ * [seishun](https://github.com/seishun) -
685
+ **Nikolai Vavilov** <<vvnicholas@gmail.com>>
686
+ * [shigeki](https://github.com/shigeki) -
687
+ **Shigeki Ohtsu** <<ohtsu@ohtsu.org>> (he/him)
688
+ * [shisama](https://github.com/shisama) -
689
+ **Masashi Hirano** <<shisama07@gmail.com>> (he/him)
690
+ * [silverwind](https://github.com/silverwind) -
691
+ **Roman Reiss** <<me@silverwind.io>>
692
+ * [starkwang](https://github.com/starkwang) -
693
+ **Weijia Wang** <<starkwang@126.com>>
694
+ * [stefanmb](https://github.com/stefanmb) -
695
+ **Stefan Budeanu** <<stefan@budeanu.com>>
696
+ * [tellnes](https://github.com/tellnes) -
697
+ **Christian Tellnes** <<christian@tellnes.no>>
698
+ * [thefourtheye](https://github.com/thefourtheye) -
699
+ **Sakthipriyan Vairamani** <<thechargingvolcano@gmail.com>> (he/him)
700
+ * [thlorenz](https://github.com/thlorenz) -
701
+ **Thorsten Lorenz** <<thlorenz@gmx.de>>
702
+ * [TimothyGu](https://github.com/TimothyGu) -
703
+ **Tiancheng "Timothy" Gu** <<timothygu99@gmail.com>> (he/him)
704
+ * [trevnorris](https://github.com/trevnorris) -
705
+ **Trevor Norris** <<trev.norris@gmail.com>>
706
+ * [tunniclm](https://github.com/tunniclm) -
707
+ **Mike Tunnicliffe** <<m.j.tunnicliffe@gmail.com>>
708
+ * [vdeturckheim](https://github.com/vdeturckheim) -
709
+ **Vladimir de Turckheim** <<vlad2t@hotmail.com>> (he/him)
710
+ * [vkurchatkin](https://github.com/vkurchatkin) -
711
+ **Vladimir Kurchatkin** <<vladimir.kurchatkin@gmail.com>>
712
+ * [vsemozhetbyt](https://github.com/vsemozhetbyt) -
713
+ **Vse Mozhet Byt** <<vsemozhetbyt@gmail.com>> (he/him)
714
+ * [watilde](https://github.com/watilde) -
715
+ **Daijiro Wachi** <<daijiro.wachi@gmail.com>> (he/him)
716
+ * [watson](https://github.com/watson) -
717
+ **Thomas Watson** <<w@tson.dk>>
718
+ * [whitlockjc](https://github.com/whitlockjc) -
719
+ **Jeremy Whitlock** <<jwhitlock@apache.org>>
720
+ * [XadillaX](https://github.com/XadillaX) -
721
+ **Khaidi Chu** <<i@2333.moe>> (he/him)
722
+ * [yashLadha](https://github.com/yashLadha) -
723
+ **Yash Ladha** <<yash@yashladha.in>> (he/him)
724
+ * [yhwang](https://github.com/yhwang) -
725
+ **Yihong Wang** <<yh.wang@ibm.com>>
726
+ * [yorkie](https://github.com/yorkie) -
727
+ **Yorkie Liu** <<yorkiefixer@gmail.com>>
728
+ * [yosuke-furukawa](https://github.com/yosuke-furukawa) -
729
+ **Yosuke Furukawa** <<yosuke.furukawa@gmail.com>>
730
+
731
+ </details>
732
+
733
+ <!--lint enable prohibited-strings-->
734
+
735
+ Collaborators follow the [Collaborator Guide](./doc/contributing/collaborator-guide.md) in
736
+ maintaining the Node.js project.
737
+
738
+ ### Triagers
739
+
740
+ * [1ilsang](https://github.com/1ilsang) -
741
+ **Sangchul Lee** <<1ilsang.dev@gmail.com>> (he/him)
742
+ * [atlowChemi](https://github.com/atlowChemi) -
743
+ **Chemi Atlow** <<chemi@atlow.co.il>> (he/him)
744
+ * [Ayase-252](https://github.com/Ayase-252) -
745
+ **Qingyu Deng** <<i@ayase-lab.com>>
746
+ * [bjohansebas](https://github.com/bjohansebas) -
747
+ **Sebastian Beltran** <<bjohansebas@gmail.com>>
748
+ * [bmuenzenmeyer](https://github.com/bmuenzenmeyer) -
749
+ **Brian Muenzenmeyer** <<brian.muenzenmeyer@gmail.com>> (he/him)
750
+ * [CanadaHonk](https://github.com/CanadaHonk) -
751
+ **Oliver Medhurst** <<honk@goose.icu>> (they/them)
752
+ * [daeyeon](https://github.com/daeyeon) -
753
+ **Daeyeon Jeong** <<daeyeon.dev@gmail.com>> (he/him)
754
+ * [gireeshpunathil](https://github.com/gireeshpunathil) -
755
+ **Gireesh Punathil** <<gpunathi@in.ibm.com>> (he/him)
756
+ * [gurgunday](https://github.com/gurgunday) -
757
+ **Gürgün Dayıoğlu** <<hey@gurgun.day>>
758
+ * [haramj](https://github.com/haramj) -
759
+ **Haram Jeong** <<haramj.dev@gmail.com>>
760
+ * [HBSPS](https://github.com/HBSPS) -
761
+ **Wiyeong Seo** <<hbsps.dev@gmail.com>>
762
+ * [iam-frankqiu](https://github.com/iam-frankqiu) -
763
+ **Frank Qiu** <<iam.frankqiu@gmail.com>> (he/him)
764
+ * [KevinEady](https://github.com/KevinEady) -
765
+ **Kevin Eady** <<kevin.c.eady@gmail.com>> (he/him)
766
+ * [marsonya](https://github.com/marsonya) -
767
+ **Akhil Marsonya** <<akhil.marsonya27@gmail.com>> (he/him)
768
+ * [meixg](https://github.com/meixg) -
769
+ **Xuguang Mei** <<meixuguang@gmail.com>> (he/him)
770
+ * [milesguicent](https://github.com/milesguicent) -
771
+ **Miles Guicent** <<guicent@pm.me>> (he/him)
772
+ * [preveen-stack](https://github.com/preveen-stack) -
773
+ **Preveen Padmanabhan** <<wide4head@gmail.com>> (he/him)
774
+ * [RaisinTen](https://github.com/RaisinTen) -
775
+ **Darshan Sen** <<raisinten@gmail.com>> (he/him)
776
+ * [VoltrexKeyva](https://github.com/VoltrexKeyva) -
777
+ **Mohammed Keyvanzadeh** <<mohammadkeyvanzade94@gmail.com>> (he/him)
778
+
779
+ Triagers follow the [Triage Guide](./doc/contributing/issues.md#triaging-a-bug-report) when
780
+ responding to new issues.
781
+
782
+ ### Release keys
783
+
784
+ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys):
785
+
786
+ * **Antoine du Hamel** <<duhamelantoine1995@gmail.com>>
787
+ `5BE8A3F6C8A5C01D106C0AD820B1A390B168D356`
788
+ * **Juan José Arboleda** <<soyjuanarbol@gmail.com>>
789
+ `DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7`
790
+ * **Marco Ippolito** <<marcoippolito54@gmail.com>>
791
+ `CC68F5A3106FF448322E48ED27F5E38D5B0A215F`
792
+ * **Michaël Zasso** <<targos@protonmail.com>>
793
+ `8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600`
794
+ * **Rafael Gonzaga** <<rafael.nunu@hotmail.com>>
795
+ `890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4`
796
+ * **Richard Lau** <<richard.lau@ibm.com>>
797
+ `C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C`
798
+ * **Ruy Adorno** <<ruyadorno@hotmail.com>>
799
+ `108F52B48DB57BB0CC439B2997B01419BD92F80A`
800
+ * **Ulises Gascón** <<ulisesgascongonzalez@gmail.com>>
801
+ `A363A499291CBBC940DD62E41F10027AF002F8B0`
802
+
803
+ You can use the keyring the project maintains at
804
+ <https://github.com/nodejs/release-keys/raw/refs/heads/main/gpg-only-active-keys/pubring.kbx>.
805
+ Alternatively, you can import them from a public key server. Have in mind that
806
+ the project cannot guarantee the availability of the server nor the keys on
807
+ that server.
808
+
809
+ ```bash
810
+ gpg --keyserver hkps://keys.openpgp.org --recv-keys 5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 # Antoine du Hamel
811
+ gpg --keyserver hkps://keys.openpgp.org --recv-keys DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 # Juan José Arboleda
812
+ gpg --keyserver hkps://keys.openpgp.org --recv-keys CC68F5A3106FF448322E48ED27F5E38D5B0A215F # Marco Ippolito
813
+ gpg --keyserver hkps://keys.openpgp.org --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 # Michaël Zasso
814
+ gpg --keyserver hkps://keys.openpgp.org --recv-keys 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 # Rafael Gonzaga
815
+ gpg --keyserver hkps://keys.openpgp.org --recv-keys C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C # Richard Lau
816
+ gpg --keyserver hkps://keys.openpgp.org --recv-keys 108F52B48DB57BB0CC439B2997B01419BD92F80A # Ruy Adorno
817
+ gpg --keyserver hkps://keys.openpgp.org --recv-keys A363A499291CBBC940DD62E41F10027AF002F8B0 # Ulises Gascón
818
+ ```
819
+
820
+ See [Verifying binaries](#verifying-binaries) for how to use these keys to
821
+ verify a downloaded file.
822
+
823
+ <details>
824
+
825
+ <summary>Other keys used to sign some previous releases</summary>
826
+
827
+ * **Antoine du Hamel** <<duhamelantoine1995@gmail.com>>
828
+ `C0D6248439F1D5604AAFFB4021D900FFDB233756`
829
+ * **Beth Griggs** <<bethanyngriggs@gmail.com>>
830
+ `4ED778F539E3634C779C87C6D7062848A1AB005C`
831
+ * **Bryan English** <<bryan@bryanenglish.com>>
832
+ `141F07595B7B3FFE74309A937405533BE57C7D57`
833
+ * **Chris Dickinson** <<christopher.s.dickinson@gmail.com>>
834
+ `9554F04D7259F04124DE6B476D5A82AC7E37093B`
835
+ * **Colin Ihrig** <<cjihrig@gmail.com>>
836
+ `94AE36675C464D64BAFA68DD7434390BDBE9B9C5`
837
+ * **Danielle Adams** <<adamzdanielle@gmail.com>>
838
+ `1C050899334244A8AF75E53792EF661D867B9DFA`
839
+ `74F12602B6F1C4E913FAA37AD3A89613643B6201`
840
+ * **Evan Lucas** <<evanlucas@me.com>>
841
+ `B9AE9905FFD7803F25714661B63B535A4C206CA9`
842
+ * **Gibson Fahnestock** <<gibfahn@gmail.com>>
843
+ `77984A986EBC2AA786BC0F66B01FBB92821C587A`
844
+ * **Isaac Z. Schlueter** <<i@izs.me>>
845
+ `93C7E9E91B49E432C2F75674B0A78B0A6C481CF6`
846
+ * **Italo A. Casas** <<me@italoacasas.com>>
847
+ `56730D5401028683275BD23C23EFEFE93C4CFFFE`
848
+ * **James M Snell** <<jasnell@keybase.io>>
849
+ `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1`
850
+ * **Jeremiah Senkpiel** <<fishrock@keybase.io>>
851
+ `FD3A5288F042B6850C66B31F09FE44734EB7990E`
852
+ * **Juan José Arboleda** <<soyjuanarbol@gmail.com>>
853
+ `61FC681DFB92A079F1685E77973F295594EC4689`
854
+ * **Julien Gilli** <<jgilli@fastmail.fm>>
855
+ `114F43EE0176B71C7BC219DD50A3051F888C628D`
856
+ * **Myles Borins** <<myles.borins@gmail.com>>
857
+ `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8`
858
+ * **Rod Vagg** <<rod@vagg.org>>
859
+ `DD8F2338BAE7501E3DD5AC78C273792F7D83545D`
860
+ * **Ruben Bridgewater** <<ruben@bridgewater.de>>
861
+ `A48C2BEE680E841632CD4E44F07496B3EB3C1762`
862
+ * **Shelley Vohr** <<shelley.vohr@gmail.com>>
863
+ `B9E2F5981AA6E0CD28160D9FF13993A75599653C`
864
+ * **Timothy J Fontaine** <<tjfontaine@gmail.com>>
865
+ `7937DFD2AB06298B2293C3187D33FF9D0246406D`
866
+
867
+ The project maintains a keyring able to verify all past releases of Node.js at
868
+ <https://github.com/nodejs/release-keys/raw/refs/heads/main/gpg/pubring.kbx>.
869
+
870
+ </details>
871
+
872
+ ### Security release stewards
873
+
874
+ When possible, the commitment to take slots in the
875
+ security release steward rotation is made by companies in order
876
+ to ensure individuals who act as security stewards have the
877
+ support and recognition from their employer to be able to
878
+ prioritize security releases. Security release stewards manage security
879
+ releases on a rotation basis as outlined in the
880
+ [security release process](./doc/contributing/security-release-process.md).
881
+
882
+ * [Datadog](https://www.datadoghq.com/)
883
+ * [bengl](https://github.com/bengl) -
884
+ **Bryan English** <<bryan@bryanenglish.com>> (he/him)
885
+ * [HeroDevs](https://www.herodevs.com/)
886
+ * [marco-ippolito](https://github.com/marco-ippolito) -
887
+ **Marco Ippolito** <<marcoippolito54@gmail.com>> (he/him)
888
+ * [NodeSource](https://nodesource.com/)
889
+ * [juanarbol](https://github.com/juanarbol) -
890
+ **Juan José Arboleda** <<soyjuanarbol@gmail.com>> (he/him)
891
+ * [RafaelGSS](https://github.com/RafaelGSS) -
892
+ **Rafael Gonzaga** <<rafael.nunu@hotmail.com>> (he/him)
893
+ * [Platformatic](https://platformatic.dev/)
894
+ * [mcollina](https://github.com/mcollina) -
895
+ **Matteo Collina** <<matteo.collina@gmail.com>> (he/him)
896
+ * [Red Hat](https://redhat.com) / [IBM](https://ibm.com)
897
+ * [joesepi](https://github.com/joesepi) -
898
+ **Joe Sepi** <<joesepi@ibm.com>> (he/him)
899
+ * [mhdawson](https://github.com/mhdawson) -
900
+ **Michael Dawson** <<midawson@redhat.com>> (he/him)
901
+
902
+ ## License
903
+
904
+ Node.js is available under the
905
+ [MIT License](https://opensource.org/licenses/MIT). Node.js also includes
906
+ external libraries that are available under a variety of licenses. See
907
+ [LICENSE](https://github.com/nodejs/node/blob/HEAD/LICENSE) for the full
908
+ license text.
909
+
910
+ [Code of Conduct]: https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md
911
+ [Contributing to the project]: CONTRIBUTING.md
912
+ [Node.js website]: https://nodejs.org/
913
+ [OpenJS Foundation]: https://openjsf.org/
914
+ [Strategic initiatives]: doc/contributing/strategic-initiatives.md
915
+ [Technical values and prioritization]: doc/contributing/technical-values.md
916
+ [Working Groups]: https://github.com/nodejs/TSC/blob/HEAD/WORKING_GROUPS.md
data_prepare/node-v24.12.0-linux-x64/bin/corepack ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ #!/usr/bin/env node
2
+ process.env.COREPACK_ENABLE_DOWNLOAD_PROMPT??='0';
3
+ require('module').enableCompileCache?.();
4
+ require('./lib/corepack.cjs').runMain(process.argv.slice(2));
data_prepare/node-v24.12.0-linux-x64/bin/npm ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ #!/usr/bin/env node
2
+ require('../lib/cli.js')(process)
data_prepare/node-v24.12.0-linux-x64/bin/npx ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env node
2
+
3
+ const cli = require('../lib/cli.js')
4
+
5
+ // run the resulting command as `npm exec ...args`
6
+ process.argv[1] = require.resolve('./npm-cli.js')
7
+ process.argv.splice(2, 0, 'exec')
8
+
9
+ // TODO: remove the affordances for removed items in npm v9
10
+ const removedSwitches = new Set([
11
+ 'always-spawn',
12
+ 'ignore-existing',
13
+ 'shell-auto-fallback',
14
+ ])
15
+
16
+ const removedOpts = new Set([
17
+ 'npm',
18
+ 'node-arg',
19
+ 'n',
20
+ ])
21
+
22
+ const removed = new Set([
23
+ ...removedSwitches,
24
+ ...removedOpts,
25
+ ])
26
+
27
+ const { definitions, shorthands } = require('@npmcli/config/lib/definitions')
28
+ const npmSwitches = Object.entries(definitions)
29
+ .filter(([, { type }]) => type === Boolean ||
30
+ (Array.isArray(type) && type.includes(Boolean)))
31
+ .map(([key]) => key)
32
+
33
+ // things that don't take a value
34
+ const switches = new Set([
35
+ ...removedSwitches,
36
+ ...npmSwitches,
37
+ 'no-install',
38
+ 'quiet',
39
+ 'q',
40
+ 'version',
41
+ 'v',
42
+ 'help',
43
+ 'h',
44
+ ])
45
+
46
+ // things that do take a value
47
+ const opts = new Set([
48
+ ...removedOpts,
49
+ 'package',
50
+ 'p',
51
+ 'cache',
52
+ 'userconfig',
53
+ 'call',
54
+ 'c',
55
+ 'shell',
56
+ 'npm',
57
+ 'node-arg',
58
+ 'n',
59
+ ])
60
+
61
+ // break out of loop when we find a positional argument or --
62
+ // If we find a positional arg, we shove -- in front of it, and
63
+ // let the normal npm cli handle the rest.
64
+ let i
65
+ let sawRemovedFlags = false
66
+ for (i = 3; i < process.argv.length; i++) {
67
+ const arg = process.argv[i]
68
+ if (arg === '--') {
69
+ break
70
+ } else if (/^-/.test(arg)) {
71
+ const [key, ...v] = arg.replace(/^-+/, '').split('=')
72
+
73
+ switch (key) {
74
+ case 'p':
75
+ process.argv[i] = ['--package', ...v].join('=')
76
+ break
77
+
78
+ case 'shell':
79
+ process.argv[i] = ['--script-shell', ...v].join('=')
80
+ break
81
+
82
+ case 'no-install':
83
+ process.argv[i] = '--yes=false'
84
+ break
85
+
86
+ default:
87
+ // resolve shorthands and run again
88
+ if (shorthands[key] && !removed.has(key)) {
89
+ const a = [...shorthands[key]]
90
+ if (v.length) {
91
+ a.push(v.join('='))
92
+ }
93
+ process.argv.splice(i, 1, ...a)
94
+ i--
95
+ continue
96
+ }
97
+ break
98
+ }
99
+
100
+ if (removed.has(key)) {
101
+ // eslint-disable-next-line no-console
102
+ console.error(`npx: the --${key} argument has been removed.`)
103
+ sawRemovedFlags = true
104
+ process.argv.splice(i, 1)
105
+ i--
106
+ }
107
+
108
+ if (v.length === 0 && !switches.has(key) &&
109
+ (opts.has(key) || !/^-/.test(process.argv[i + 1]))) {
110
+ // value will be next argument, skip over it.
111
+ if (removed.has(key)) {
112
+ // also remove the value for the cut key.
113
+ process.argv.splice(i + 1, 1)
114
+ } else {
115
+ i++
116
+ }
117
+ }
118
+ } else {
119
+ // found a positional arg, put -- in front of it, and we're done
120
+ process.argv.splice(i, 0, '--')
121
+ break
122
+ }
123
+ }
124
+
125
+ if (sawRemovedFlags) {
126
+ // eslint-disable-next-line no-console
127
+ console.error('See `npm help exec` for more information')
128
+ }
129
+
130
+ cli(process)
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1.h ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #if defined(OPENSSL_NO_ASM)
2
+ # include "./asn1_no-asm.h"
3
+ #else
4
+ # include "./asn1_asm.h"
5
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1t.h ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #if defined(OPENSSL_NO_ASM)
2
+ # include "./asn1t_no-asm.h"
3
+ #else
4
+ # include "./asn1t_asm.h"
5
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/asn1t_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/asn1t.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/asn1t.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/asn1t.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/asn1t.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/asn1t.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/asn1t.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/asn1t.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/asn1t.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/asn1t.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/asn1t.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/asn1t.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/asn1t.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/asn1t.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/asn1t.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/asn1t.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/asn1t.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/asn1t.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/asn1t.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/asn1t.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/asn1t.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/asn1t.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/bioerr.h ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Generated by util/mkerr.pl DO NOT EDIT
3
+ * Copyright 1995-2022 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_BIOERR_H
12
+ # define OPENSSL_BIOERR_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
+ * BIO reason codes.
23
+ */
24
+ # define BIO_R_ACCEPT_ERROR 100
25
+ # define BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET 141
26
+ # define BIO_R_AMBIGUOUS_HOST_OR_SERVICE 129
27
+ # define BIO_R_BAD_FOPEN_MODE 101
28
+ # define BIO_R_BROKEN_PIPE 124
29
+ # define BIO_R_CONNECT_ERROR 103
30
+ # define BIO_R_CONNECT_TIMEOUT 147
31
+ # define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
32
+ # define BIO_R_GETSOCKNAME_ERROR 132
33
+ # define BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS 133
34
+ # define BIO_R_GETTING_SOCKTYPE 134
35
+ # define BIO_R_INVALID_ARGUMENT 125
36
+ # define BIO_R_INVALID_SOCKET 135
37
+ # define BIO_R_IN_USE 123
38
+ # define BIO_R_LENGTH_TOO_LONG 102
39
+ # define BIO_R_LISTEN_V6_ONLY 136
40
+ # define BIO_R_LOCAL_ADDR_NOT_AVAILABLE 111
41
+ # define BIO_R_LOOKUP_RETURNED_NOTHING 142
42
+ # define BIO_R_MALFORMED_HOST_OR_SERVICE 130
43
+ # define BIO_R_NBIO_CONNECT_ERROR 110
44
+ # define BIO_R_NON_FATAL 112
45
+ # define BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED 143
46
+ # define BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED 144
47
+ # define BIO_R_NO_PORT_DEFINED 113
48
+ # define BIO_R_NO_SUCH_FILE 128
49
+ # define BIO_R_NULL_PARAMETER 115 /* unused */
50
+ # define BIO_R_TFO_DISABLED 106
51
+ # define BIO_R_TFO_NO_KERNEL_SUPPORT 108
52
+ # define BIO_R_TRANSFER_ERROR 104
53
+ # define BIO_R_TRANSFER_TIMEOUT 105
54
+ # define BIO_R_UNABLE_TO_BIND_SOCKET 117
55
+ # define BIO_R_UNABLE_TO_CREATE_SOCKET 118
56
+ # define BIO_R_UNABLE_TO_KEEPALIVE 137
57
+ # define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
58
+ # define BIO_R_UNABLE_TO_NODELAY 138
59
+ # define BIO_R_UNABLE_TO_REUSEADDR 139
60
+ # define BIO_R_UNABLE_TO_TFO 109
61
+ # define BIO_R_UNAVAILABLE_IP_FAMILY 145
62
+ # define BIO_R_UNINITIALIZED 120
63
+ # define BIO_R_UNKNOWN_INFO_TYPE 140
64
+ # define BIO_R_UNSUPPORTED_IP_FAMILY 146
65
+ # define BIO_R_UNSUPPORTED_METHOD 121
66
+ # define BIO_R_UNSUPPORTED_PROTOCOL_FAMILY 131
67
+ # define BIO_R_WRITE_TO_READ_ONLY_BIO 126
68
+ # define BIO_R_WSASTARTUP 122
69
+ # define BIO_R_PORT_MISMATCH 150
70
+ # define BIO_R_PEER_ADDR_NOT_AVAILABLE 151
71
+
72
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/bn_conf_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/crypto/bn_conf.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/crypto/bn_conf.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/crypto/bn_conf.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/crypto/bn_conf.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/crypto/bn_conf.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/crypto/bn_conf.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/crypto/bn_conf.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/crypto/bn_conf.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/crypto/bn_conf.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/crypto/bn_conf.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/crypto/bn_conf.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/crypto/bn_conf.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/crypto/bn_conf.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/crypto/bn_conf.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/crypto/bn_conf.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/crypto/bn_conf.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/crypto/bn_conf.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/crypto/bn_conf.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/crypto/bn_conf.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/bnerr.h ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Generated by util/mkerr.pl DO NOT EDIT
3
+ * Copyright 1995-2022 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_BNERR_H
12
+ # define OPENSSL_BNERR_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
+ * BN reason codes.
23
+ */
24
+ # define BN_R_ARG2_LT_ARG3 100
25
+ # define BN_R_BAD_RECIPROCAL 101
26
+ # define BN_R_BIGNUM_TOO_LONG 114
27
+ # define BN_R_BITS_TOO_SMALL 118
28
+ # define BN_R_CALLED_WITH_EVEN_MODULUS 102
29
+ # define BN_R_DIV_BY_ZERO 103
30
+ # define BN_R_ENCODING_ERROR 104
31
+ # define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
32
+ # define BN_R_INPUT_NOT_REDUCED 110
33
+ # define BN_R_INVALID_LENGTH 106
34
+ # define BN_R_INVALID_RANGE 115
35
+ # define BN_R_INVALID_SHIFT 119
36
+ # define BN_R_NOT_A_SQUARE 111
37
+ # define BN_R_NOT_INITIALIZED 107
38
+ # define BN_R_NO_INVERSE 108
39
+ # define BN_R_NO_PRIME_CANDIDATE 121
40
+ # define BN_R_NO_SOLUTION 116
41
+ # define BN_R_NO_SUITABLE_DIGEST 120
42
+ # define BN_R_PRIVATE_KEY_TOO_LARGE 117
43
+ # define BN_R_P_IS_NOT_PRIME 112
44
+ # define BN_R_TOO_MANY_ITERATIONS 113
45
+ # define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
46
+
47
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmac.h ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2010-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_CMAC_H
11
+ # define OPENSSL_CMAC_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_CMAC_H
17
+ # endif
18
+
19
+ # ifndef OPENSSL_NO_CMAC
20
+
21
+ # ifdef __cplusplus
22
+ extern "C" {
23
+ # endif
24
+
25
+ # include <openssl/evp.h>
26
+
27
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
28
+ /* Opaque */
29
+ typedef struct CMAC_CTX_st CMAC_CTX;
30
+ # endif
31
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
32
+ OSSL_DEPRECATEDIN_3_0 CMAC_CTX *CMAC_CTX_new(void);
33
+ OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_cleanup(CMAC_CTX *ctx);
34
+ OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_free(CMAC_CTX *ctx);
35
+ OSSL_DEPRECATEDIN_3_0 EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
36
+ OSSL_DEPRECATEDIN_3_0 int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
37
+ OSSL_DEPRECATEDIN_3_0 int CMAC_Init(CMAC_CTX *ctx,
38
+ const void *key, size_t keylen,
39
+ const EVP_CIPHER *cipher, ENGINE *impl);
40
+ OSSL_DEPRECATEDIN_3_0 int CMAC_Update(CMAC_CTX *ctx,
41
+ const void *data, size_t dlen);
42
+ OSSL_DEPRECATEDIN_3_0 int CMAC_Final(CMAC_CTX *ctx,
43
+ unsigned char *out, size_t *poutlen);
44
+ OSSL_DEPRECATEDIN_3_0 int CMAC_resume(CMAC_CTX *ctx);
45
+ # endif
46
+
47
+ # ifdef __cplusplus
48
+ }
49
+ # endif
50
+
51
+ # endif
52
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/cmp_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/cmp.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/cmp.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/cmp.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/cmp.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/cmp.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/cmp.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/cmp.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/cmp.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/cmp.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/cmp.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/cmp.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/cmp.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/cmp.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/cmp.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/cmp.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/cmp.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/cmp.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/cmp.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/cmp.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_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/cmp.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/cmp.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/cmp.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/cmp.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/cmp.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/cmp.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/cmp.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/cmp.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/cmp.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/cmp.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/cmp.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/cmp.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/cmp.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/cmp.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/cmp.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/cmp.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/cmp.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/cmp.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/cmp.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/cmp.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/cmp.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/cms_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/cms.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/cms.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/cms.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/cms.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/cms.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/cms.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/cms.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/cms.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/cms.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/cms.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/cms.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/cms.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/cms.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/cms.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/cms.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/cms.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/cms.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/cms.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/cms.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/cms.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/cms.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/comp.h ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #if defined(OPENSSL_NO_ASM)
2
+ # include "./comp_no-asm.h"
3
+ #else
4
+ # include "./comp_asm.h"
5
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/comp_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/comp.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/comp.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/comp.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/comp.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/comp.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/comp.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/comp.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/comp.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/comp.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/comp.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/comp.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/comp.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/comp.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/comp.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/comp.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/comp.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/comp.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/comp.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/comp.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/comp.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/comp.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/comperr.h ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_COMPERR_H
12
+ # define OPENSSL_COMPERR_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_COMP
21
+
22
+
23
+ /*
24
+ * COMP reason codes.
25
+ */
26
+ # define COMP_R_BROTLI_DECODE_ERROR 102
27
+ # define COMP_R_BROTLI_ENCODE_ERROR 103
28
+ # define COMP_R_BROTLI_NOT_SUPPORTED 104
29
+ # define COMP_R_ZLIB_DEFLATE_ERROR 99
30
+ # define COMP_R_ZLIB_INFLATE_ERROR 100
31
+ # define COMP_R_ZLIB_NOT_SUPPORTED 101
32
+ # define COMP_R_ZSTD_COMPRESS_ERROR 105
33
+ # define COMP_R_ZSTD_DECODE_ERROR 106
34
+ # define COMP_R_ZSTD_DECOMPRESS_ERROR 107
35
+ # define COMP_R_ZSTD_NOT_SUPPORTED 108
36
+
37
+ # endif
38
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/conf_api.h ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_CONF_API_H
11
+ # define OPENSSL_CONF_API_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_CONF_API_H
17
+ # endif
18
+
19
+ # include <openssl/lhash.h>
20
+ # include <openssl/conf.h>
21
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
26
+ /* Up until OpenSSL 0.9.5a, this was new_section */
27
+ CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
28
+ /* Up until OpenSSL 0.9.5a, this was get_section */
29
+ CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
30
+ /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
31
+ STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
32
+ const char *section);
33
+
34
+ int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
35
+ char *_CONF_get_string(const CONF *conf, const char *section,
36
+ const char *name);
37
+ long _CONF_get_number(const CONF *conf, const char *section,
38
+ const char *name);
39
+
40
+ int _CONF_new_data(CONF *conf);
41
+ void _CONF_free_data(CONF *conf);
42
+
43
+ #ifdef __cplusplus
44
+ }
45
+ #endif
46
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/configuration_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/configuration.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/configuration.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/configuration.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/configuration.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/configuration.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/configuration.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/configuration.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/configuration.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/configuration.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/configuration.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/configuration.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/configuration.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/configuration.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/configuration.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/configuration.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/configuration.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/configuration.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/configuration.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/configuration.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/configuration_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/configuration.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/configuration.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/configuration.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/configuration.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/configuration.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/configuration.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/configuration.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/configuration.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/configuration.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/configuration.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/configuration.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/configuration.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/configuration.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/configuration.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/configuration.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/configuration.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/configuration.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/configuration.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/configuration.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/configuration.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/configuration.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/core.h ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
5
+ * this file except in compliance with the License. You can obtain a copy
6
+ * in the file LICENSE in the source distribution or at
7
+ * https://www.openssl.org/source/license.html
8
+ */
9
+
10
+ #ifndef OPENSSL_CORE_H
11
+ # define OPENSSL_CORE_H
12
+ # pragma once
13
+
14
+ # include <stddef.h>
15
+ # include <openssl/types.h>
16
+
17
+ # ifdef __cplusplus
18
+ extern "C" {
19
+ # endif
20
+
21
+ /*-
22
+ * Base types
23
+ * ----------
24
+ *
25
+ * These are the types that the OpenSSL core and providers have in common
26
+ * to communicate data between them.
27
+ */
28
+
29
+ /* Opaque handles to be used with core upcall functions from providers */
30
+ typedef struct ossl_core_handle_st OSSL_CORE_HANDLE;
31
+ typedef struct openssl_core_ctx_st OPENSSL_CORE_CTX;
32
+ typedef struct ossl_core_bio_st OSSL_CORE_BIO;
33
+
34
+ /*
35
+ * Dispatch table element. function_id numbers and the functions are defined
36
+ * in core_dispatch.h, see macros with 'OSSL_CORE_MAKE_FUNC' in their names.
37
+ *
38
+ * An array of these is always terminated by function_id == 0
39
+ */
40
+ struct ossl_dispatch_st {
41
+ int function_id;
42
+ void (*function)(void);
43
+ };
44
+
45
+ # define OSSL_DISPATCH_END \
46
+ { 0, NULL }
47
+
48
+ /*
49
+ * Other items, essentially an int<->pointer map element.
50
+ *
51
+ * We make this type distinct from OSSL_DISPATCH to ensure that dispatch
52
+ * tables remain tables with function pointers only.
53
+ *
54
+ * This is used whenever we need to pass things like a table of error reason
55
+ * codes <-> reason string maps, ...
56
+ *
57
+ * Usage determines which field works as key if any, rather than field order.
58
+ *
59
+ * An array of these is always terminated by id == 0 && ptr == NULL
60
+ */
61
+ struct ossl_item_st {
62
+ unsigned int id;
63
+ void *ptr;
64
+ };
65
+
66
+ /*
67
+ * Type to tie together algorithm names, property definition string and
68
+ * the algorithm implementation in the form of a dispatch table.
69
+ *
70
+ * An array of these is always terminated by algorithm_names == NULL
71
+ */
72
+ struct ossl_algorithm_st {
73
+ const char *algorithm_names; /* key */
74
+ const char *property_definition; /* key */
75
+ const OSSL_DISPATCH *implementation;
76
+ const char *algorithm_description;
77
+ };
78
+
79
+ /*
80
+ * Type to pass object data in a uniform way, without exposing the object
81
+ * structure.
82
+ *
83
+ * An array of these is always terminated by key == NULL
84
+ */
85
+ struct ossl_param_st {
86
+ const char *key; /* the name of the parameter */
87
+ unsigned int data_type; /* declare what kind of content is in buffer */
88
+ void *data; /* value being passed in or out */
89
+ size_t data_size; /* data size */
90
+ size_t return_size; /* returned content size */
91
+ };
92
+
93
+ /* Currently supported OSSL_PARAM data types */
94
+ /*
95
+ * OSSL_PARAM_INTEGER and OSSL_PARAM_UNSIGNED_INTEGER
96
+ * are arbitrary length and therefore require an arbitrarily sized buffer,
97
+ * since they may be used to pass numbers larger than what is natively
98
+ * available.
99
+ *
100
+ * The number must be buffered in native form, i.e. MSB first on B_ENDIAN
101
+ * systems and LSB first on L_ENDIAN systems. This means that arbitrary
102
+ * native integers can be stored in the buffer, just make sure that the
103
+ * buffer size is correct and the buffer itself is properly aligned (for
104
+ * example by having the buffer field point at a C integer).
105
+ */
106
+ # define OSSL_PARAM_INTEGER 1
107
+ # define OSSL_PARAM_UNSIGNED_INTEGER 2
108
+ /*-
109
+ * OSSL_PARAM_REAL
110
+ * is a C binary floating point values in native form and alignment.
111
+ */
112
+ # define OSSL_PARAM_REAL 3
113
+ /*-
114
+ * OSSL_PARAM_UTF8_STRING
115
+ * is a printable string. It is expected to be printed as it is.
116
+ */
117
+ # define OSSL_PARAM_UTF8_STRING 4
118
+ /*-
119
+ * OSSL_PARAM_OCTET_STRING
120
+ * is a string of bytes with no further specification. It is expected to be
121
+ * printed as a hexdump.
122
+ */
123
+ # define OSSL_PARAM_OCTET_STRING 5
124
+ /*-
125
+ * OSSL_PARAM_UTF8_PTR
126
+ * is a pointer to a printable string. It is expected to be printed as it is.
127
+ *
128
+ * The difference between this and OSSL_PARAM_UTF8_STRING is that only pointers
129
+ * are manipulated for this type.
130
+ *
131
+ * This is more relevant for parameter requests, where the responding
132
+ * function doesn't need to copy the data to the provided buffer, but
133
+ * sets the provided buffer to point at the actual data instead.
134
+ *
135
+ * WARNING! Using these is FRAGILE, as it assumes that the actual
136
+ * data and its location are constant.
137
+ *
138
+ * EXTRA WARNING! If you are not completely sure you most likely want
139
+ * to use the OSSL_PARAM_UTF8_STRING type.
140
+ */
141
+ # define OSSL_PARAM_UTF8_PTR 6
142
+ /*-
143
+ * OSSL_PARAM_OCTET_PTR
144
+ * is a pointer to a string of bytes with no further specification. It is
145
+ * expected to be printed as a hexdump.
146
+ *
147
+ * The difference between this and OSSL_PARAM_OCTET_STRING is that only pointers
148
+ * are manipulated for this type.
149
+ *
150
+ * This is more relevant for parameter requests, where the responding
151
+ * function doesn't need to copy the data to the provided buffer, but
152
+ * sets the provided buffer to point at the actual data instead.
153
+ *
154
+ * WARNING! Using these is FRAGILE, as it assumes that the actual
155
+ * data and its location are constant.
156
+ *
157
+ * EXTRA WARNING! If you are not completely sure you most likely want
158
+ * to use the OSSL_PARAM_OCTET_STRING type.
159
+ */
160
+ # define OSSL_PARAM_OCTET_PTR 7
161
+
162
+ /*
163
+ * Typedef for the thread stop handling callback. Used both internally and by
164
+ * providers.
165
+ *
166
+ * Providers may register for notifications about threads stopping by
167
+ * registering a callback to hear about such events. Providers register the
168
+ * callback using the OSSL_FUNC_CORE_THREAD_START function in the |in| dispatch
169
+ * table passed to OSSL_provider_init(). The arg passed back to a provider will
170
+ * be the provider side context object.
171
+ */
172
+ typedef void (*OSSL_thread_stop_handler_fn)(void *arg);
173
+
174
+
175
+ /*-
176
+ * Provider entry point
177
+ * --------------------
178
+ *
179
+ * This function is expected to be present in any dynamically loadable
180
+ * provider module. By definition, if this function doesn't exist in a
181
+ * module, that module is not an OpenSSL provider module.
182
+ */
183
+ /*-
184
+ * |handle| pointer to opaque type OSSL_CORE_HANDLE. This can be used
185
+ * together with some functions passed via |in| to query data.
186
+ * |in| is the array of functions that the Core passes to the provider.
187
+ * |out| will be the array of base functions that the provider passes
188
+ * back to the Core.
189
+ * |provctx| a provider side context object, optionally created if the
190
+ * provider needs it. This value is passed to other provider
191
+ * functions, notably other context constructors.
192
+ */
193
+ typedef int (OSSL_provider_init_fn)(const OSSL_CORE_HANDLE *handle,
194
+ const OSSL_DISPATCH *in,
195
+ const OSSL_DISPATCH **out,
196
+ void **provctx);
197
+ # ifdef __VMS
198
+ # pragma names save
199
+ # pragma names uppercase,truncated
200
+ # endif
201
+ OPENSSL_EXPORT OSSL_provider_init_fn OSSL_provider_init;
202
+ # ifdef __VMS
203
+ # pragma names restore
204
+ # endif
205
+
206
+ /*
207
+ * Generic callback function signature.
208
+ *
209
+ * The expectation is that any provider function that wants to offer
210
+ * a callback / hook can do so by taking an argument with this type,
211
+ * as well as a pointer to caller-specific data. When calling the
212
+ * callback, the provider function can populate an OSSL_PARAM array
213
+ * with data of its choice and pass that in the callback call, along
214
+ * with the caller data argument.
215
+ *
216
+ * libcrypto may use the OSSL_PARAM array to create arguments for an
217
+ * application callback it knows about.
218
+ */
219
+ typedef int (OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg);
220
+ typedef int (OSSL_INOUT_CALLBACK)(const OSSL_PARAM in_params[],
221
+ OSSL_PARAM out_params[], void *arg);
222
+ /*
223
+ * Passphrase callback function signature
224
+ *
225
+ * This is similar to the generic callback function above, but adds a
226
+ * result parameter.
227
+ */
228
+ typedef int (OSSL_PASSPHRASE_CALLBACK)(char *pass, size_t pass_size,
229
+ size_t *pass_len,
230
+ const OSSL_PARAM params[], void *arg);
231
+
232
+ # ifdef __cplusplus
233
+ }
234
+ # endif
235
+
236
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/crmf_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/crmf.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/openssl/crmf.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/openssl/crmf.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/openssl/crmf.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/openssl/crmf.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/openssl/crmf.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/openssl/crmf.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/openssl/crmf.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/openssl/crmf.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/openssl/crmf.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/openssl/crmf.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/openssl/crmf.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/openssl/crmf.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/openssl/crmf.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/openssl/crmf.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/openssl/crmf.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/openssl/crmf.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/openssl/crmf.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/openssl/crmf.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/openssl/crmf.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/openssl/crmf.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/crypto_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/crypto.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/crypto.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/crypto.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/crypto.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/crypto.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/crypto.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/crypto.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/crypto.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/crypto.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/crypto.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/crypto.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/crypto.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/crypto.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/crypto.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/crypto.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/crypto.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/crypto.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/crypto.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/crypto.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/decoder.h ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_DECODER_H
11
+ # define OPENSSL_DECODER_H
12
+ # pragma once
13
+
14
+ # include <openssl/opensslconf.h>
15
+
16
+ # ifndef OPENSSL_NO_STDIO
17
+ # include <stdio.h>
18
+ # endif
19
+ # include <stdarg.h>
20
+ # include <stddef.h>
21
+ # include <openssl/decodererr.h>
22
+ # include <openssl/types.h>
23
+ # include <openssl/core.h>
24
+
25
+ # ifdef __cplusplus
26
+ extern "C" {
27
+ # endif
28
+
29
+ OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
30
+ const char *properties);
31
+ int OSSL_DECODER_up_ref(OSSL_DECODER *encoder);
32
+ void OSSL_DECODER_free(OSSL_DECODER *encoder);
33
+
34
+ const OSSL_PROVIDER *OSSL_DECODER_get0_provider(const OSSL_DECODER *encoder);
35
+ const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *encoder);
36
+ const char *OSSL_DECODER_get0_name(const OSSL_DECODER *decoder);
37
+ const char *OSSL_DECODER_get0_description(const OSSL_DECODER *decoder);
38
+ int OSSL_DECODER_is_a(const OSSL_DECODER *encoder, const char *name);
39
+
40
+ void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx,
41
+ void (*fn)(OSSL_DECODER *encoder, void *arg),
42
+ void *arg);
43
+ int OSSL_DECODER_names_do_all(const OSSL_DECODER *encoder,
44
+ void (*fn)(const char *name, void *data),
45
+ void *data);
46
+ const OSSL_PARAM *OSSL_DECODER_gettable_params(OSSL_DECODER *decoder);
47
+ int OSSL_DECODER_get_params(OSSL_DECODER *decoder, OSSL_PARAM params[]);
48
+
49
+ const OSSL_PARAM *OSSL_DECODER_settable_ctx_params(OSSL_DECODER *encoder);
50
+ OSSL_DECODER_CTX *OSSL_DECODER_CTX_new(void);
51
+ int OSSL_DECODER_CTX_set_params(OSSL_DECODER_CTX *ctx,
52
+ const OSSL_PARAM params[]);
53
+ void OSSL_DECODER_CTX_free(OSSL_DECODER_CTX *ctx);
54
+
55
+ /* Utilities that help set specific parameters */
56
+ int OSSL_DECODER_CTX_set_passphrase(OSSL_DECODER_CTX *ctx,
57
+ const unsigned char *kstr, size_t klen);
58
+ int OSSL_DECODER_CTX_set_pem_password_cb(OSSL_DECODER_CTX *ctx,
59
+ pem_password_cb *cb, void *cbarg);
60
+ int OSSL_DECODER_CTX_set_passphrase_cb(OSSL_DECODER_CTX *ctx,
61
+ OSSL_PASSPHRASE_CALLBACK *cb,
62
+ void *cbarg);
63
+ int OSSL_DECODER_CTX_set_passphrase_ui(OSSL_DECODER_CTX *ctx,
64
+ const UI_METHOD *ui_method,
65
+ void *ui_data);
66
+
67
+ /*
68
+ * Utilities to read the object to decode, with the result sent to cb.
69
+ * These will discover all provided methods
70
+ */
71
+
72
+ int OSSL_DECODER_CTX_set_selection(OSSL_DECODER_CTX *ctx, int selection);
73
+ int OSSL_DECODER_CTX_set_input_type(OSSL_DECODER_CTX *ctx,
74
+ const char *input_type);
75
+ int OSSL_DECODER_CTX_set_input_structure(OSSL_DECODER_CTX *ctx,
76
+ const char *input_structure);
77
+ int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder);
78
+ int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx,
79
+ OSSL_LIB_CTX *libctx, const char *propq);
80
+ int OSSL_DECODER_CTX_get_num_decoders(OSSL_DECODER_CTX *ctx);
81
+
82
+ typedef struct ossl_decoder_instance_st OSSL_DECODER_INSTANCE;
83
+ OSSL_DECODER *
84
+ OSSL_DECODER_INSTANCE_get_decoder(OSSL_DECODER_INSTANCE *decoder_inst);
85
+ void *
86
+ OSSL_DECODER_INSTANCE_get_decoder_ctx(OSSL_DECODER_INSTANCE *decoder_inst);
87
+ const char *
88
+ OSSL_DECODER_INSTANCE_get_input_type(OSSL_DECODER_INSTANCE *decoder_inst);
89
+ const char *
90
+ OSSL_DECODER_INSTANCE_get_input_structure(OSSL_DECODER_INSTANCE *decoder_inst,
91
+ int *was_set);
92
+
93
+ typedef int OSSL_DECODER_CONSTRUCT(OSSL_DECODER_INSTANCE *decoder_inst,
94
+ const OSSL_PARAM *params,
95
+ void *construct_data);
96
+ typedef void OSSL_DECODER_CLEANUP(void *construct_data);
97
+
98
+ int OSSL_DECODER_CTX_set_construct(OSSL_DECODER_CTX *ctx,
99
+ OSSL_DECODER_CONSTRUCT *construct);
100
+ int OSSL_DECODER_CTX_set_construct_data(OSSL_DECODER_CTX *ctx,
101
+ void *construct_data);
102
+ int OSSL_DECODER_CTX_set_cleanup(OSSL_DECODER_CTX *ctx,
103
+ OSSL_DECODER_CLEANUP *cleanup);
104
+ OSSL_DECODER_CONSTRUCT *OSSL_DECODER_CTX_get_construct(OSSL_DECODER_CTX *ctx);
105
+ void *OSSL_DECODER_CTX_get_construct_data(OSSL_DECODER_CTX *ctx);
106
+ OSSL_DECODER_CLEANUP *OSSL_DECODER_CTX_get_cleanup(OSSL_DECODER_CTX *ctx);
107
+
108
+ int OSSL_DECODER_export(OSSL_DECODER_INSTANCE *decoder_inst,
109
+ void *reference, size_t reference_sz,
110
+ OSSL_CALLBACK *export_cb, void *export_cbarg);
111
+
112
+ int OSSL_DECODER_from_bio(OSSL_DECODER_CTX *ctx, BIO *in);
113
+ #ifndef OPENSSL_NO_STDIO
114
+ int OSSL_DECODER_from_fp(OSSL_DECODER_CTX *ctx, FILE *in);
115
+ #endif
116
+ int OSSL_DECODER_from_data(OSSL_DECODER_CTX *ctx, const unsigned char **pdata,
117
+ size_t *pdata_len);
118
+
119
+ /*
120
+ * Create the OSSL_DECODER_CTX with an associated type. This will perform
121
+ * an implicit OSSL_DECODER_fetch(), suitable for the object of that type.
122
+ */
123
+ OSSL_DECODER_CTX *
124
+ OSSL_DECODER_CTX_new_for_pkey(EVP_PKEY **pkey,
125
+ const char *input_type,
126
+ const char *input_struct,
127
+ const char *keytype, int selection,
128
+ OSSL_LIB_CTX *libctx, const char *propquery);
129
+
130
+ # ifdef __cplusplus
131
+ }
132
+ # endif
133
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/decodererr.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_DECODERERR_H
12
+ # define OPENSSL_DECODERERR_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_DECODER reason codes.
23
+ */
24
+ # define OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT 101
25
+ # define OSSL_DECODER_R_DECODER_NOT_FOUND 102
26
+ # define OSSL_DECODER_R_MISSING_GET_PARAMS 100
27
+
28
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dso_conf.h ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #if defined(OPENSSL_NO_ASM)
2
+ # include "./dso_conf_no-asm.h"
3
+ #else
4
+ # include "./dso_conf_asm.h"
5
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/dso_conf_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/crypto/dso_conf.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/crypto/dso_conf.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/crypto/dso_conf.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/crypto/dso_conf.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/crypto/dso_conf.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/crypto/dso_conf.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/crypto/dso_conf.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/crypto/dso_conf.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/crypto/dso_conf.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/crypto/dso_conf.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/crypto/dso_conf.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/crypto/dso_conf.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/crypto/dso_conf.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/crypto/dso_conf.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/crypto/dso_conf.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/crypto/dso_conf.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/crypto/dso_conf.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/crypto/dso_conf.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/crypto/dso_conf.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/dso_conf_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/crypto/dso_conf.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/no-asm/include/crypto/dso_conf.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/no-asm/include/crypto/dso_conf.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/no-asm/include/crypto/dso_conf.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/no-asm/include/crypto/dso_conf.h"
16
+ #elif defined(OPENSSL_LINUX) && defined(__loongarch64)
17
+ # include "./archs/linux64-loongarch64/no-asm/include/crypto/dso_conf.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
19
+ # include "./archs/darwin-i386-cc/no-asm/include/crypto/dso_conf.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
21
+ # include "./archs/darwin64-x86_64-cc/no-asm/include/crypto/dso_conf.h"
22
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
23
+ # include "./archs/darwin64-arm64-cc/no-asm/include/crypto/dso_conf.h"
24
+ #elif defined(_WIN32) && defined(_M_IX86)
25
+ # include "./archs/VC-WIN32/no-asm/include/crypto/dso_conf.h"
26
+ #elif defined(_WIN32) && defined(_M_X64)
27
+ # include "./archs/VC-WIN64A/no-asm/include/crypto/dso_conf.h"
28
+ #elif defined(_WIN32) && defined(_M_ARM64)
29
+ # include "./archs/VC-WIN64-ARM/no-asm/include/crypto/dso_conf.h"
30
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
31
+ # include "./archs/BSD-x86/no-asm/include/crypto/dso_conf.h"
32
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
33
+ # include "./archs/BSD-x86_64/no-asm/include/crypto/dso_conf.h"
34
+ #elif defined(__sun) && defined(__i386__)
35
+ # include "./archs/solaris-x86-gcc/no-asm/include/crypto/dso_conf.h"
36
+ #elif defined(__sun) && defined(__x86_64__)
37
+ # include "./archs/solaris64-x86_64-gcc/no-asm/include/crypto/dso_conf.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
39
+ # include "./archs/linux-ppc64le/no-asm/include/crypto/dso_conf.h"
40
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
41
+ # include "./archs/aix64-gcc-as/no-asm/include/crypto/dso_conf.h"
42
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
43
+ # include "./archs/linux64-s390x/no-asm/include/crypto/dso_conf.h"
44
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
45
+ # include "./archs/linux32-s390x/no-asm/include/crypto/dso_conf.h"
46
+ #else
47
+ # include "./archs/linux-elf/no-asm/include/crypto/dso_conf.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/e_os2.h ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
5
+ * this file except in compliance with the License. You can obtain a copy
6
+ * in the file LICENSE in the source distribution or at
7
+ * https://www.openssl.org/source/license.html
8
+ */
9
+
10
+ #ifndef OPENSSL_E_OS2_H
11
+ # define OPENSSL_E_OS2_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_E_OS2_H
17
+ # endif
18
+
19
+ # include <openssl/opensslconf.h>
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ /******************************************************************************
26
+ * Detect operating systems. This probably needs completing.
27
+ * The result is that at least one OPENSSL_SYS_os macro should be defined.
28
+ * However, if none is defined, Unix is assumed.
29
+ **/
30
+
31
+ # define OPENSSL_SYS_UNIX
32
+
33
+ /* --------------------- Microsoft operating systems ---------------------- */
34
+
35
+ /*
36
+ * Note that MSDOS actually denotes 32-bit environments running on top of
37
+ * MS-DOS, such as DJGPP one.
38
+ */
39
+ # if defined(OPENSSL_SYS_MSDOS)
40
+ # undef OPENSSL_SYS_UNIX
41
+ # endif
42
+
43
+ /*
44
+ * For 32 bit environment, there seems to be the CygWin environment and then
45
+ * all the others that try to do the same thing Microsoft does...
46
+ */
47
+ /*
48
+ * UEFI lives here because it might be built with a Microsoft toolchain and
49
+ * we need to avoid the false positive match on Windows.
50
+ */
51
+ # if defined(OPENSSL_SYS_UEFI)
52
+ # undef OPENSSL_SYS_UNIX
53
+ # elif defined(OPENSSL_SYS_UWIN)
54
+ # undef OPENSSL_SYS_UNIX
55
+ # define OPENSSL_SYS_WIN32_UWIN
56
+ # else
57
+ # if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN)
58
+ # define OPENSSL_SYS_WIN32_CYGWIN
59
+ # else
60
+ # if defined(_WIN32) || defined(OPENSSL_SYS_WIN32)
61
+ # undef OPENSSL_SYS_UNIX
62
+ # if !defined(OPENSSL_SYS_WIN32)
63
+ # define OPENSSL_SYS_WIN32
64
+ # endif
65
+ # endif
66
+ # if defined(_WIN64) || defined(OPENSSL_SYS_WIN64)
67
+ # undef OPENSSL_SYS_UNIX
68
+ # if !defined(OPENSSL_SYS_WIN64)
69
+ # define OPENSSL_SYS_WIN64
70
+ # endif
71
+ # endif
72
+ # if defined(OPENSSL_SYS_WINNT)
73
+ # undef OPENSSL_SYS_UNIX
74
+ # endif
75
+ # if defined(OPENSSL_SYS_WINCE)
76
+ # undef OPENSSL_SYS_UNIX
77
+ # endif
78
+ # endif
79
+ # endif
80
+
81
+ /* Anything that tries to look like Microsoft is "Windows" */
82
+ # if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
83
+ # undef OPENSSL_SYS_UNIX
84
+ # define OPENSSL_SYS_WINDOWS
85
+ # ifndef OPENSSL_SYS_MSDOS
86
+ # define OPENSSL_SYS_MSDOS
87
+ # endif
88
+ # endif
89
+
90
+ /*
91
+ * DLL settings. This part is a bit tough, because it's up to the
92
+ * application implementer how he or she will link the application, so it
93
+ * requires some macro to be used.
94
+ */
95
+ # ifdef OPENSSL_SYS_WINDOWS
96
+ # ifndef OPENSSL_OPT_WINDLL
97
+ # if defined(_WINDLL) /* This is used when building OpenSSL to
98
+ * indicate that DLL linkage should be used */
99
+ # define OPENSSL_OPT_WINDLL
100
+ # endif
101
+ # endif
102
+ # endif
103
+
104
+ /* ------------------------------- OpenVMS -------------------------------- */
105
+ # if defined(__VMS) || defined(VMS)
106
+ # if !defined(OPENSSL_SYS_VMS)
107
+ # undef OPENSSL_SYS_UNIX
108
+ # define OPENSSL_SYS_VMS
109
+ # endif
110
+ # if defined(__DECC)
111
+ # define OPENSSL_SYS_VMS_DECC
112
+ # elif defined(__DECCXX)
113
+ # define OPENSSL_SYS_VMS_DECC
114
+ # define OPENSSL_SYS_VMS_DECCXX
115
+ # else
116
+ # define OPENSSL_SYS_VMS_NODECC
117
+ # endif
118
+ # endif
119
+
120
+ /* -------------------------------- Unix ---------------------------------- */
121
+ # ifdef OPENSSL_SYS_UNIX
122
+ # if defined(linux) || defined(__linux__) && !defined(OPENSSL_SYS_LINUX)
123
+ # define OPENSSL_SYS_LINUX
124
+ # endif
125
+ # if defined(_AIX) && !defined(OPENSSL_SYS_AIX)
126
+ # define OPENSSL_SYS_AIX
127
+ # endif
128
+ # endif
129
+
130
+ /* -------------------------------- VOS ----------------------------------- */
131
+ # if defined(__VOS__) && !defined(OPENSSL_SYS_VOS)
132
+ # define OPENSSL_SYS_VOS
133
+ # ifdef __HPPA__
134
+ # define OPENSSL_SYS_VOS_HPPA
135
+ # endif
136
+ # ifdef __IA32__
137
+ # define OPENSSL_SYS_VOS_IA32
138
+ # endif
139
+ # endif
140
+
141
+ /* ---------------------------- HP NonStop -------------------------------- */
142
+ # ifdef __TANDEM
143
+ # ifdef _STRING
144
+ # include <strings.h>
145
+ # endif
146
+ # define OPENSSL_USE_BUILD_DATE
147
+ # if defined(OPENSSL_THREADS) && defined(_SPT_MODEL_)
148
+ # define SPT_THREAD_SIGNAL 1
149
+ # define SPT_THREAD_AWARE 1
150
+ # include <spthread.h>
151
+ # elif defined(OPENSSL_THREADS) && defined(_PUT_MODEL_)
152
+ # include <pthread.h>
153
+ # endif
154
+ # endif
155
+
156
+ /**
157
+ * That's it for OS-specific stuff
158
+ *****************************************************************************/
159
+
160
+ /*-
161
+ * OPENSSL_EXTERN is normally used to declare a symbol with possible extra
162
+ * attributes to handle its presence in a shared library.
163
+ * OPENSSL_EXPORT is used to define a symbol with extra possible attributes
164
+ * to make it visible in a shared library.
165
+ * Care needs to be taken when a header file is used both to declare and
166
+ * define symbols. Basically, for any library that exports some global
167
+ * variables, the following code must be present in the header file that
168
+ * declares them, before OPENSSL_EXTERN is used:
169
+ *
170
+ * #ifdef SOME_BUILD_FLAG_MACRO
171
+ * # undef OPENSSL_EXTERN
172
+ * # define OPENSSL_EXTERN OPENSSL_EXPORT
173
+ * #endif
174
+ *
175
+ * The default is to have OPENSSL_EXPORT and OPENSSL_EXTERN
176
+ * have some generally sensible values.
177
+ */
178
+
179
+ # if defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)
180
+ # define OPENSSL_EXPORT extern __declspec(dllexport)
181
+ # define OPENSSL_EXTERN extern __declspec(dllimport)
182
+ # else
183
+ # define OPENSSL_EXPORT extern
184
+ # define OPENSSL_EXTERN extern
185
+ # endif
186
+
187
+ # ifdef _WIN32
188
+ # ifdef _WIN64
189
+ # define ossl_ssize_t __int64
190
+ # define OSSL_SSIZE_MAX _I64_MAX
191
+ # else
192
+ # define ossl_ssize_t int
193
+ # define OSSL_SSIZE_MAX INT_MAX
194
+ # endif
195
+ # endif
196
+
197
+ # if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t)
198
+ # define ossl_ssize_t INTN
199
+ # define OSSL_SSIZE_MAX MAX_INTN
200
+ # endif
201
+
202
+ # ifndef ossl_ssize_t
203
+ # include <sys/types.h>
204
+ # define ossl_ssize_t ssize_t
205
+ # if defined(SSIZE_MAX)
206
+ # define OSSL_SSIZE_MAX SSIZE_MAX
207
+ # elif defined(_POSIX_SSIZE_MAX)
208
+ # define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX
209
+ # else
210
+ # define OSSL_SSIZE_MAX ((ssize_t)(SIZE_MAX>>1))
211
+ # endif
212
+ # endif
213
+
214
+ # if defined(UNUSEDRESULT_DEBUG)
215
+ # define __owur __attribute__((__warn_unused_result__))
216
+ # else
217
+ # define __owur
218
+ # endif
219
+
220
+ /* Standard integer types */
221
+ # define OPENSSL_NO_INTTYPES_H
222
+ # define OPENSSL_NO_STDINT_H
223
+ # if defined(OPENSSL_SYS_UEFI)
224
+ typedef INT8 int8_t;
225
+ typedef UINT8 uint8_t;
226
+ typedef INT16 int16_t;
227
+ typedef UINT16 uint16_t;
228
+ typedef INT32 int32_t;
229
+ typedef UINT32 uint32_t;
230
+ typedef INT64 int64_t;
231
+ typedef UINT64 uint64_t;
232
+ typedef UINTN uintptr_t;
233
+ # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
234
+ defined(__osf__) || defined(__sgi) || defined(__hpux) || \
235
+ defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__)
236
+ # include <inttypes.h>
237
+ # undef OPENSSL_NO_INTTYPES_H
238
+ /* Because the specs say that inttypes.h includes stdint.h if present */
239
+ # undef OPENSSL_NO_STDINT_H
240
+ # elif defined(_MSC_VER) && _MSC_VER<1600
241
+ /*
242
+ * minimally required typdefs for systems not supporting inttypes.h or
243
+ * stdint.h: currently just older VC++
244
+ */
245
+ typedef signed char int8_t;
246
+ typedef unsigned char uint8_t;
247
+ typedef short int16_t;
248
+ typedef unsigned short uint16_t;
249
+ typedef int int32_t;
250
+ typedef unsigned int uint32_t;
251
+ typedef __int64 int64_t;
252
+ typedef unsigned __int64 uint64_t;
253
+ # elif defined(OPENSSL_SYS_TANDEM)
254
+ # include <stdint.h>
255
+ # include <sys/types.h>
256
+ # else
257
+ # include <stdint.h>
258
+ # undef OPENSSL_NO_STDINT_H
259
+ # endif
260
+ # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
261
+ defined(INTMAX_MAX) && defined(UINTMAX_MAX)
262
+ typedef intmax_t ossl_intmax_t;
263
+ typedef uintmax_t ossl_uintmax_t;
264
+ # else
265
+ /* Fall back to the largest we know we require and can handle */
266
+ typedef int64_t ossl_intmax_t;
267
+ typedef uint64_t ossl_uintmax_t;
268
+ # endif
269
+
270
+ /* ossl_inline: portable inline definition usable in public headers */
271
+ # if !defined(inline) && !defined(__cplusplus)
272
+ # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
273
+ /* just use inline */
274
+ # define ossl_inline inline
275
+ # elif defined(__GNUC__) && __GNUC__>=2
276
+ # define ossl_inline __inline__
277
+ # elif defined(_MSC_VER)
278
+ /*
279
+ * Visual Studio: inline is available in C++ only, however
280
+ * __inline is available for C, see
281
+ * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx
282
+ */
283
+ # define ossl_inline __inline
284
+ # else
285
+ # define ossl_inline
286
+ # endif
287
+ # else
288
+ # define ossl_inline inline
289
+ # endif
290
+
291
+ # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && \
292
+ !defined(__cplusplus)
293
+ # define ossl_noreturn _Noreturn
294
+ # elif defined(__GNUC__) && __GNUC__ >= 2
295
+ # define ossl_noreturn __attribute__((noreturn))
296
+ # else
297
+ # define ossl_noreturn
298
+ # endif
299
+
300
+ /* ossl_unused: portable unused attribute for use in public headers */
301
+ # if defined(__GNUC__)
302
+ # define ossl_unused __attribute__((unused))
303
+ # else
304
+ # define ossl_unused
305
+ # endif
306
+
307
+ #ifdef __cplusplus
308
+ }
309
+ #endif
310
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ec.h ADDED
@@ -0,0 +1,1588 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
3
+ * Copyright (c) 2002, 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_EC_H
12
+ # define OPENSSL_EC_H
13
+ # pragma once
14
+
15
+ # include <openssl/macros.h>
16
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
17
+ # define HEADER_EC_H
18
+ # endif
19
+
20
+ # include <openssl/opensslconf.h>
21
+ # include <openssl/types.h>
22
+
23
+ # include <string.h>
24
+
25
+ # ifdef __cplusplus
26
+ extern "C" {
27
+ # endif
28
+
29
+ /* Values for EVP_PKEY_CTX_set_ec_param_enc() */
30
+ # define OPENSSL_EC_EXPLICIT_CURVE 0x000
31
+ # define OPENSSL_EC_NAMED_CURVE 0x001
32
+
33
+ int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, int nid);
34
+ int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, int param_enc);
35
+ int EVP_PKEY_CTX_set_ecdh_cofactor_mode(EVP_PKEY_CTX *ctx, int cofactor_mode);
36
+ int EVP_PKEY_CTX_get_ecdh_cofactor_mode(EVP_PKEY_CTX *ctx);
37
+
38
+ int EVP_PKEY_CTX_set_ecdh_kdf_type(EVP_PKEY_CTX *ctx, int kdf);
39
+ int EVP_PKEY_CTX_get_ecdh_kdf_type(EVP_PKEY_CTX *ctx);
40
+
41
+ int EVP_PKEY_CTX_set_ecdh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
42
+ int EVP_PKEY_CTX_get_ecdh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
43
+
44
+ int EVP_PKEY_CTX_set_ecdh_kdf_outlen(EVP_PKEY_CTX *ctx, int len);
45
+ int EVP_PKEY_CTX_get_ecdh_kdf_outlen(EVP_PKEY_CTX *ctx, int *len);
46
+
47
+ int EVP_PKEY_CTX_set0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char *ukm,
48
+ int len);
49
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
50
+ OSSL_DEPRECATEDIN_3_0
51
+ int EVP_PKEY_CTX_get0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm);
52
+ # endif
53
+
54
+ # define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1)
55
+ # define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2)
56
+ # define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3)
57
+ # define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4)
58
+ # define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5)
59
+ # define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6)
60
+ # define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7)
61
+ # define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8)
62
+ # define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9)
63
+ # define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10)
64
+
65
+ /* KDF types */
66
+ # define EVP_PKEY_ECDH_KDF_NONE 1
67
+ # define EVP_PKEY_ECDH_KDF_X9_63 2
68
+ /*
69
+ * The old name for EVP_PKEY_ECDH_KDF_X9_63
70
+ * The ECDH KDF specification has been mistakenly attributed to ANSI X9.62,
71
+ * it is actually specified in ANSI X9.63.
72
+ * This identifier is retained for backwards compatibility
73
+ */
74
+ # define EVP_PKEY_ECDH_KDF_X9_62 EVP_PKEY_ECDH_KDF_X9_63
75
+
76
+ /** Enum for the point conversion form as defined in X9.62 (ECDSA)
77
+ * for the encoding of a elliptic curve point (x,y) */
78
+ typedef enum {
79
+ /** the point is encoded as z||x, where the octet z specifies
80
+ * which solution of the quadratic equation y is */
81
+ POINT_CONVERSION_COMPRESSED = 2,
82
+ /** the point is encoded as z||x||y, where z is the octet 0x04 */
83
+ POINT_CONVERSION_UNCOMPRESSED = 4,
84
+ /** the point is encoded as z||x||y, where the octet z specifies
85
+ * which solution of the quadratic equation y is */
86
+ POINT_CONVERSION_HYBRID = 6
87
+ } point_conversion_form_t;
88
+
89
+ const char *OSSL_EC_curve_nid2name(int nid);
90
+
91
+ # ifndef OPENSSL_NO_STDIO
92
+ # include <stdio.h>
93
+ # endif
94
+ # ifndef OPENSSL_NO_EC
95
+ # include <openssl/asn1.h>
96
+ # include <openssl/symhacks.h>
97
+ # ifndef OPENSSL_NO_DEPRECATED_1_1_0
98
+ # include <openssl/bn.h>
99
+ # endif
100
+ # include <openssl/ecerr.h>
101
+
102
+ # ifndef OPENSSL_ECC_MAX_FIELD_BITS
103
+ # define OPENSSL_ECC_MAX_FIELD_BITS 661
104
+ # endif
105
+
106
+ # include <openssl/params.h>
107
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
108
+ typedef struct ec_method_st EC_METHOD;
109
+ # endif
110
+ typedef struct ec_group_st EC_GROUP;
111
+ typedef struct ec_point_st EC_POINT;
112
+ typedef struct ecpk_parameters_st ECPKPARAMETERS;
113
+ typedef struct ec_parameters_st ECPARAMETERS;
114
+
115
+ /********************************************************************/
116
+ /* EC_METHODs for curves over GF(p) */
117
+ /********************************************************************/
118
+
119
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
120
+ /** Returns the basic GFp ec methods which provides the basis for the
121
+ * optimized methods.
122
+ * \return EC_METHOD object
123
+ */
124
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_simple_method(void);
125
+
126
+ /** Returns GFp methods using montgomery multiplication.
127
+ * \return EC_METHOD object
128
+ */
129
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_mont_method(void);
130
+
131
+ /** Returns GFp methods using optimized methods for NIST recommended curves
132
+ * \return EC_METHOD object
133
+ */
134
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nist_method(void);
135
+
136
+ # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
137
+ /** Returns 64-bit optimized methods for nistp224
138
+ * \return EC_METHOD object
139
+ */
140
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp224_method(void);
141
+
142
+ /** Returns 64-bit optimized methods for nistp256
143
+ * \return EC_METHOD object
144
+ */
145
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp256_method(void);
146
+
147
+ /** Returns 64-bit optimized methods for nistp521
148
+ * \return EC_METHOD object
149
+ */
150
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp521_method(void);
151
+ # endif /* OPENSSL_NO_EC_NISTP_64_GCC_128 */
152
+
153
+ # ifndef OPENSSL_NO_EC2M
154
+ /********************************************************************/
155
+ /* EC_METHOD for curves over GF(2^m) */
156
+ /********************************************************************/
157
+
158
+ /** Returns the basic GF2m ec method
159
+ * \return EC_METHOD object
160
+ */
161
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GF2m_simple_method(void);
162
+
163
+ # endif
164
+
165
+ /********************************************************************/
166
+ /* EC_GROUP functions */
167
+ /********************************************************************/
168
+
169
+ /**
170
+ * Creates a new EC_GROUP object
171
+ * \param meth EC_METHOD to use
172
+ * \return newly created EC_GROUP object or NULL in case of an error.
173
+ */
174
+ OSSL_DEPRECATEDIN_3_0 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
175
+
176
+ /** Clears and frees a EC_GROUP object
177
+ * \param group EC_GROUP object to be cleared and freed.
178
+ */
179
+ OSSL_DEPRECATEDIN_3_0 void EC_GROUP_clear_free(EC_GROUP *group);
180
+
181
+ /** Returns the EC_METHOD of the EC_GROUP object.
182
+ * \param group EC_GROUP object
183
+ * \return EC_METHOD used in this EC_GROUP object.
184
+ */
185
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
186
+
187
+ /** Returns the field type of the EC_METHOD.
188
+ * \param meth EC_METHOD object
189
+ * \return NID of the underlying field type OID.
190
+ */
191
+ OSSL_DEPRECATEDIN_3_0 int EC_METHOD_get_field_type(const EC_METHOD *meth);
192
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
193
+
194
+ /** Frees a EC_GROUP object
195
+ * \param group EC_GROUP object to be freed.
196
+ */
197
+ void EC_GROUP_free(EC_GROUP *group);
198
+
199
+ /** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD.
200
+ * \param dst destination EC_GROUP object
201
+ * \param src source EC_GROUP object
202
+ * \return 1 on success and 0 if an error occurred.
203
+ */
204
+ int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
205
+
206
+ /** Creates a new EC_GROUP object and copies the content
207
+ * form src to the newly created EC_KEY object
208
+ * \param src source EC_GROUP object
209
+ * \return newly created EC_GROUP object or NULL in case of an error.
210
+ */
211
+ EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
212
+
213
+ /** Sets the generator and its order/cofactor of a EC_GROUP object.
214
+ * \param group EC_GROUP object
215
+ * \param generator EC_POINT object with the generator.
216
+ * \param order the order of the group generated by the generator.
217
+ * \param cofactor the index of the sub-group generated by the generator
218
+ * in the group of all points on the elliptic curve.
219
+ * \return 1 on success and 0 if an error occurred
220
+ */
221
+ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
222
+ const BIGNUM *order, const BIGNUM *cofactor);
223
+
224
+ /** Returns the generator of a EC_GROUP object.
225
+ * \param group EC_GROUP object
226
+ * \return the currently used generator (possibly NULL).
227
+ */
228
+ const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
229
+
230
+ /** Returns the montgomery data for order(Generator)
231
+ * \param group EC_GROUP object
232
+ * \return the currently used montgomery data (possibly NULL).
233
+ */
234
+ BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group);
235
+
236
+ /** Gets the order of a EC_GROUP
237
+ * \param group EC_GROUP object
238
+ * \param order BIGNUM to which the order is copied
239
+ * \param ctx unused
240
+ * \return 1 on success and 0 if an error occurred
241
+ */
242
+ int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
243
+
244
+ /** Gets the order of an EC_GROUP
245
+ * \param group EC_GROUP object
246
+ * \return the group order
247
+ */
248
+ const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group);
249
+
250
+ /** Gets the number of bits of the order of an EC_GROUP
251
+ * \param group EC_GROUP object
252
+ * \return number of bits of group order.
253
+ */
254
+ int EC_GROUP_order_bits(const EC_GROUP *group);
255
+
256
+ /** Gets the cofactor of a EC_GROUP
257
+ * \param group EC_GROUP object
258
+ * \param cofactor BIGNUM to which the cofactor is copied
259
+ * \param ctx unused
260
+ * \return 1 on success and 0 if an error occurred
261
+ */
262
+ int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
263
+ BN_CTX *ctx);
264
+
265
+ /** Gets the cofactor of an EC_GROUP
266
+ * \param group EC_GROUP object
267
+ * \return the group cofactor
268
+ */
269
+ const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group);
270
+
271
+ /** Sets the name of a EC_GROUP object
272
+ * \param group EC_GROUP object
273
+ * \param nid NID of the curve name OID
274
+ */
275
+ void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
276
+
277
+ /** Returns the curve name of a EC_GROUP object
278
+ * \param group EC_GROUP object
279
+ * \return NID of the curve name OID or 0 if not set.
280
+ */
281
+ int EC_GROUP_get_curve_name(const EC_GROUP *group);
282
+
283
+ /** Gets the field of an EC_GROUP
284
+ * \param group EC_GROUP object
285
+ * \return the group field
286
+ */
287
+ const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group);
288
+
289
+ /** Returns the field type of the EC_GROUP.
290
+ * \param group EC_GROUP object
291
+ * \return NID of the underlying field type OID.
292
+ */
293
+ int EC_GROUP_get_field_type(const EC_GROUP *group);
294
+
295
+ void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
296
+ int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
297
+
298
+ void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
299
+ point_conversion_form_t form);
300
+ point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
301
+
302
+ unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
303
+ size_t EC_GROUP_get_seed_len(const EC_GROUP *);
304
+ size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
305
+
306
+ /** Sets the parameters of an ec curve defined by y^2 = x^3 + a*x + b (for GFp)
307
+ * or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)
308
+ * \param group EC_GROUP object
309
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
310
+ * defining the underlying field (GF2m)
311
+ * \param a BIGNUM with parameter a of the equation
312
+ * \param b BIGNUM with parameter b of the equation
313
+ * \param ctx BN_CTX object (optional)
314
+ * \return 1 on success and 0 if an error occurred
315
+ */
316
+ int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
317
+ const BIGNUM *b, BN_CTX *ctx);
318
+
319
+ /** Gets the parameters of the ec curve defined by y^2 = x^3 + a*x + b (for GFp)
320
+ * or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)
321
+ * \param group EC_GROUP object
322
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
323
+ * defining the underlying field (GF2m)
324
+ * \param a BIGNUM for parameter a of the equation
325
+ * \param b BIGNUM for parameter b of the equation
326
+ * \param ctx BN_CTX object (optional)
327
+ * \return 1 on success and 0 if an error occurred
328
+ */
329
+ int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,
330
+ BN_CTX *ctx);
331
+
332
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
333
+ /** Sets the parameters of an ec curve. Synonym for EC_GROUP_set_curve
334
+ * \param group EC_GROUP object
335
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
336
+ * defining the underlying field (GF2m)
337
+ * \param a BIGNUM with parameter a of the equation
338
+ * \param b BIGNUM with parameter b of the equation
339
+ * \param ctx BN_CTX object (optional)
340
+ * \return 1 on success and 0 if an error occurred
341
+ */
342
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GFp(EC_GROUP *group,
343
+ const BIGNUM *p,
344
+ const BIGNUM *a,
345
+ const BIGNUM *b,
346
+ BN_CTX *ctx);
347
+
348
+ /** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
349
+ * \param group EC_GROUP object
350
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
351
+ * defining the underlying field (GF2m)
352
+ * \param a BIGNUM for parameter a of the equation
353
+ * \param b BIGNUM for parameter b of the equation
354
+ * \param ctx BN_CTX object (optional)
355
+ * \return 1 on success and 0 if an error occurred
356
+ */
357
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GFp(const EC_GROUP *group,
358
+ BIGNUM *p,
359
+ BIGNUM *a, BIGNUM *b,
360
+ BN_CTX *ctx);
361
+
362
+ # ifndef OPENSSL_NO_EC2M
363
+ /** Sets the parameter of an ec curve. Synonym for EC_GROUP_set_curve
364
+ * \param group EC_GROUP object
365
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
366
+ * defining the underlying field (GF2m)
367
+ * \param a BIGNUM with parameter a of the equation
368
+ * \param b BIGNUM with parameter b of the equation
369
+ * \param ctx BN_CTX object (optional)
370
+ * \return 1 on success and 0 if an error occurred
371
+ */
372
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GF2m(EC_GROUP *group,
373
+ const BIGNUM *p,
374
+ const BIGNUM *a,
375
+ const BIGNUM *b,
376
+ BN_CTX *ctx);
377
+
378
+ /** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
379
+ * \param group EC_GROUP object
380
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
381
+ * defining the underlying field (GF2m)
382
+ * \param a BIGNUM for parameter a of the equation
383
+ * \param b BIGNUM for parameter b of the equation
384
+ * \param ctx BN_CTX object (optional)
385
+ * \return 1 on success and 0 if an error occurred
386
+ */
387
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group,
388
+ BIGNUM *p,
389
+ BIGNUM *a, BIGNUM *b,
390
+ BN_CTX *ctx);
391
+ # endif /* OPENSSL_NO_EC2M */
392
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
393
+
394
+ /** Returns the number of bits needed to represent a field element
395
+ * \param group EC_GROUP object
396
+ * \return number of bits needed to represent a field element
397
+ */
398
+ int EC_GROUP_get_degree(const EC_GROUP *group);
399
+
400
+ /** Checks whether the parameter in the EC_GROUP define a valid ec group
401
+ * \param group EC_GROUP object
402
+ * \param ctx BN_CTX object (optional)
403
+ * \return 1 if group is a valid ec group and 0 otherwise
404
+ */
405
+ int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
406
+
407
+ /** Checks whether the discriminant of the elliptic curve is zero or not
408
+ * \param group EC_GROUP object
409
+ * \param ctx BN_CTX object (optional)
410
+ * \return 1 if the discriminant is not zero and 0 otherwise
411
+ */
412
+ int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
413
+
414
+ /** Compares two EC_GROUP objects
415
+ * \param a first EC_GROUP object
416
+ * \param b second EC_GROUP object
417
+ * \param ctx BN_CTX object (optional)
418
+ * \return 0 if the groups are equal, 1 if not, or -1 on error
419
+ */
420
+ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
421
+
422
+ /*
423
+ * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after
424
+ * choosing an appropriate EC_METHOD
425
+ */
426
+
427
+ /** Creates a new EC_GROUP object with the specified parameters defined
428
+ * over GFp (defined by the equation y^2 = x^3 + a*x + b)
429
+ * \param p BIGNUM with the prime number
430
+ * \param a BIGNUM with the parameter a of the equation
431
+ * \param b BIGNUM with the parameter b of the equation
432
+ * \param ctx BN_CTX object (optional)
433
+ * \return newly created EC_GROUP object with the specified parameters
434
+ */
435
+ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
436
+ const BIGNUM *b, BN_CTX *ctx);
437
+ # ifndef OPENSSL_NO_EC2M
438
+ /** Creates a new EC_GROUP object with the specified parameters defined
439
+ * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
440
+ * \param p BIGNUM with the polynomial defining the underlying field
441
+ * \param a BIGNUM with the parameter a of the equation
442
+ * \param b BIGNUM with the parameter b of the equation
443
+ * \param ctx BN_CTX object (optional)
444
+ * \return newly created EC_GROUP object with the specified parameters
445
+ */
446
+ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
447
+ const BIGNUM *b, BN_CTX *ctx);
448
+ # endif
449
+
450
+ /**
451
+ * Creates a EC_GROUP object with a curve specified by parameters.
452
+ * The parameters may be explicit or a named curve,
453
+ * \param params A list of parameters describing the group.
454
+ * \param libctx The associated library context or NULL for the default
455
+ * context
456
+ * \param propq A property query string
457
+ * \return newly created EC_GROUP object with specified parameters or NULL
458
+ * if an error occurred
459
+ */
460
+ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
461
+ OSSL_LIB_CTX *libctx, const char *propq);
462
+
463
+ /**
464
+ * Creates an OSSL_PARAM array with the parameters describing the given
465
+ * EC_GROUP.
466
+ * The resulting parameters may contain an explicit or a named curve depending
467
+ * on the EC_GROUP.
468
+ * \param group pointer to the EC_GROUP object
469
+ * \param libctx The associated library context or NULL for the default
470
+ * context
471
+ * \param propq A property query string
472
+ * \param bnctx BN_CTX object (optional)
473
+ * \return newly created OSSL_PARAM array with the parameters
474
+ * describing the given EC_GROUP or NULL if an error occurred
475
+ */
476
+ OSSL_PARAM *EC_GROUP_to_params(const EC_GROUP *group, OSSL_LIB_CTX *libctx,
477
+ const char *propq, BN_CTX *bnctx);
478
+
479
+ /**
480
+ * Creates a EC_GROUP object with a curve specified by a NID
481
+ * \param libctx The associated library context or NULL for the default
482
+ * context
483
+ * \param propq A property query string
484
+ * \param nid NID of the OID of the curve name
485
+ * \return newly created EC_GROUP object with specified curve or NULL
486
+ * if an error occurred
487
+ */
488
+ EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq,
489
+ int nid);
490
+
491
+ /**
492
+ * Creates a EC_GROUP object with a curve specified by a NID. Same as
493
+ * EC_GROUP_new_by_curve_name_ex but the libctx and propq are always
494
+ * NULL.
495
+ * \param nid NID of the OID of the curve name
496
+ * \return newly created EC_GROUP object with specified curve or NULL
497
+ * if an error occurred
498
+ */
499
+ EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
500
+
501
+ /** Creates a new EC_GROUP object from an ECPARAMETERS object
502
+ * \param params pointer to the ECPARAMETERS object
503
+ * \return newly created EC_GROUP object with specified curve or NULL
504
+ * if an error occurred
505
+ */
506
+ EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params);
507
+
508
+ /** Creates an ECPARAMETERS object for the given EC_GROUP object.
509
+ * \param group pointer to the EC_GROUP object
510
+ * \param params pointer to an existing ECPARAMETERS object or NULL
511
+ * \return pointer to the new ECPARAMETERS object or NULL
512
+ * if an error occurred.
513
+ */
514
+ ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
515
+ ECPARAMETERS *params);
516
+
517
+ /** Creates a new EC_GROUP object from an ECPKPARAMETERS object
518
+ * \param params pointer to an existing ECPKPARAMETERS object, or NULL
519
+ * \return newly created EC_GROUP object with specified curve, or NULL
520
+ * if an error occurred
521
+ */
522
+ EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params);
523
+
524
+ /** Creates an ECPKPARAMETERS object for the given EC_GROUP object.
525
+ * \param group pointer to the EC_GROUP object
526
+ * \param params pointer to an existing ECPKPARAMETERS object or NULL
527
+ * \return pointer to the new ECPKPARAMETERS object or NULL
528
+ * if an error occurred.
529
+ */
530
+ ECPKPARAMETERS *EC_GROUP_get_ecpkparameters(const EC_GROUP *group,
531
+ ECPKPARAMETERS *params);
532
+
533
+ /********************************************************************/
534
+ /* handling of internal curves */
535
+ /********************************************************************/
536
+
537
+ typedef struct {
538
+ int nid;
539
+ const char *comment;
540
+ } EC_builtin_curve;
541
+
542
+ /*
543
+ * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all
544
+ * available curves or zero if a error occurred. In case r is not zero,
545
+ * nitems EC_builtin_curve structures are filled with the data of the first
546
+ * nitems internal groups
547
+ */
548
+ size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
549
+
550
+ const char *EC_curve_nid2nist(int nid);
551
+ int EC_curve_nist2nid(const char *name);
552
+ int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only,
553
+ BN_CTX *ctx);
554
+
555
+ /********************************************************************/
556
+ /* EC_POINT functions */
557
+ /********************************************************************/
558
+
559
+ /** Creates a new EC_POINT object for the specified EC_GROUP
560
+ * \param group EC_GROUP the underlying EC_GROUP object
561
+ * \return newly created EC_POINT object or NULL if an error occurred
562
+ */
563
+ EC_POINT *EC_POINT_new(const EC_GROUP *group);
564
+
565
+ /** Frees a EC_POINT object
566
+ * \param point EC_POINT object to be freed
567
+ */
568
+ void EC_POINT_free(EC_POINT *point);
569
+
570
+ /** Clears and frees a EC_POINT object
571
+ * \param point EC_POINT object to be cleared and freed
572
+ */
573
+ void EC_POINT_clear_free(EC_POINT *point);
574
+
575
+ /** Copies EC_POINT object
576
+ * \param dst destination EC_POINT object
577
+ * \param src source EC_POINT object
578
+ * \return 1 on success and 0 if an error occurred
579
+ */
580
+ int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
581
+
582
+ /** Creates a new EC_POINT object and copies the content of the supplied
583
+ * EC_POINT
584
+ * \param src source EC_POINT object
585
+ * \param group underlying the EC_GROUP object
586
+ * \return newly created EC_POINT object or NULL if an error occurred
587
+ */
588
+ EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
589
+
590
+ /** Sets a point to infinity (neutral element)
591
+ * \param group underlying EC_GROUP object
592
+ * \param point EC_POINT to set to infinity
593
+ * \return 1 on success and 0 if an error occurred
594
+ */
595
+ int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
596
+
597
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
598
+ /** Returns the EC_METHOD used in EC_POINT object
599
+ * \param point EC_POINT object
600
+ * \return the EC_METHOD used
601
+ */
602
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
603
+
604
+ /** Sets the jacobian projective coordinates of a EC_POINT over GFp
605
+ * \param group underlying EC_GROUP object
606
+ * \param p EC_POINT object
607
+ * \param x BIGNUM with the x-coordinate
608
+ * \param y BIGNUM with the y-coordinate
609
+ * \param z BIGNUM with the z-coordinate
610
+ * \param ctx BN_CTX object (optional)
611
+ * \return 1 on success and 0 if an error occurred
612
+ */
613
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_Jprojective_coordinates_GFp
614
+ (const EC_GROUP *group, EC_POINT *p,
615
+ const BIGNUM *x, const BIGNUM *y, const BIGNUM *z,
616
+ BN_CTX *ctx);
617
+
618
+ /** Gets the jacobian projective coordinates of a EC_POINT over GFp
619
+ * \param group underlying EC_GROUP object
620
+ * \param p EC_POINT object
621
+ * \param x BIGNUM for the x-coordinate
622
+ * \param y BIGNUM for the y-coordinate
623
+ * \param z BIGNUM for the z-coordinate
624
+ * \param ctx BN_CTX object (optional)
625
+ * \return 1 on success and 0 if an error occurred
626
+ */
627
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_Jprojective_coordinates_GFp
628
+ (const EC_GROUP *group, const EC_POINT *p,
629
+ BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
630
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
631
+
632
+ /** Sets the affine coordinates of an EC_POINT
633
+ * \param group underlying EC_GROUP object
634
+ * \param p EC_POINT object
635
+ * \param x BIGNUM with the x-coordinate
636
+ * \param y BIGNUM with the y-coordinate
637
+ * \param ctx BN_CTX object (optional)
638
+ * \return 1 on success and 0 if an error occurred
639
+ */
640
+ int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
641
+ const BIGNUM *x, const BIGNUM *y,
642
+ BN_CTX *ctx);
643
+
644
+ /** Gets the affine coordinates of an EC_POINT.
645
+ * \param group underlying EC_GROUP object
646
+ * \param p EC_POINT object
647
+ * \param x BIGNUM for the x-coordinate
648
+ * \param y BIGNUM for the y-coordinate
649
+ * \param ctx BN_CTX object (optional)
650
+ * \return 1 on success and 0 if an error occurred
651
+ */
652
+ int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
653
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
654
+
655
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
656
+ /** Sets the affine coordinates of an EC_POINT. A synonym of
657
+ * EC_POINT_set_affine_coordinates
658
+ * \param group underlying EC_GROUP object
659
+ * \param p EC_POINT object
660
+ * \param x BIGNUM with the x-coordinate
661
+ * \param y BIGNUM with the y-coordinate
662
+ * \param ctx BN_CTX object (optional)
663
+ * \return 1 on success and 0 if an error occurred
664
+ */
665
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GFp
666
+ (const EC_GROUP *group, EC_POINT *p,
667
+ const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
668
+
669
+ /** Gets the affine coordinates of an EC_POINT. A synonym of
670
+ * EC_POINT_get_affine_coordinates
671
+ * \param group underlying EC_GROUP object
672
+ * \param p EC_POINT object
673
+ * \param x BIGNUM for the x-coordinate
674
+ * \param y BIGNUM for the y-coordinate
675
+ * \param ctx BN_CTX object (optional)
676
+ * \return 1 on success and 0 if an error occurred
677
+ */
678
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GFp
679
+ (const EC_GROUP *group, const EC_POINT *p,
680
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
681
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
682
+
683
+ /** Sets the x9.62 compressed coordinates of a EC_POINT
684
+ * \param group underlying EC_GROUP object
685
+ * \param p EC_POINT object
686
+ * \param x BIGNUM with x-coordinate
687
+ * \param y_bit integer with the y-Bit (either 0 or 1)
688
+ * \param ctx BN_CTX object (optional)
689
+ * \return 1 on success and 0 if an error occurred
690
+ */
691
+ int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p,
692
+ const BIGNUM *x, int y_bit,
693
+ BN_CTX *ctx);
694
+
695
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
696
+ /** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of
697
+ * EC_POINT_set_compressed_coordinates
698
+ * \param group underlying EC_GROUP object
699
+ * \param p EC_POINT object
700
+ * \param x BIGNUM with x-coordinate
701
+ * \param y_bit integer with the y-Bit (either 0 or 1)
702
+ * \param ctx BN_CTX object (optional)
703
+ * \return 1 on success and 0 if an error occurred
704
+ */
705
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GFp
706
+ (const EC_GROUP *group, EC_POINT *p,
707
+ const BIGNUM *x, int y_bit, BN_CTX *ctx);
708
+ # ifndef OPENSSL_NO_EC2M
709
+ /** Sets the affine coordinates of an EC_POINT. A synonym of
710
+ * EC_POINT_set_affine_coordinates
711
+ * \param group underlying EC_GROUP object
712
+ * \param p EC_POINT object
713
+ * \param x BIGNUM with the x-coordinate
714
+ * \param y BIGNUM with the y-coordinate
715
+ * \param ctx BN_CTX object (optional)
716
+ * \return 1 on success and 0 if an error occurred
717
+ */
718
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GF2m
719
+ (const EC_GROUP *group, EC_POINT *p,
720
+ const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
721
+
722
+ /** Gets the affine coordinates of an EC_POINT. A synonym of
723
+ * EC_POINT_get_affine_coordinates
724
+ * \param group underlying EC_GROUP object
725
+ * \param p EC_POINT object
726
+ * \param x BIGNUM for the x-coordinate
727
+ * \param y BIGNUM for the y-coordinate
728
+ * \param ctx BN_CTX object (optional)
729
+ * \return 1 on success and 0 if an error occurred
730
+ */
731
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GF2m
732
+ (const EC_GROUP *group, const EC_POINT *p,
733
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
734
+
735
+ /** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of
736
+ * EC_POINT_set_compressed_coordinates
737
+ * \param group underlying EC_GROUP object
738
+ * \param p EC_POINT object
739
+ * \param x BIGNUM with x-coordinate
740
+ * \param y_bit integer with the y-Bit (either 0 or 1)
741
+ * \param ctx BN_CTX object (optional)
742
+ * \return 1 on success and 0 if an error occurred
743
+ */
744
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GF2m
745
+ (const EC_GROUP *group, EC_POINT *p,
746
+ const BIGNUM *x, int y_bit, BN_CTX *ctx);
747
+ # endif
748
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
749
+
750
+ /** Encodes a EC_POINT object to a octet string
751
+ * \param group underlying EC_GROUP object
752
+ * \param p EC_POINT object
753
+ * \param form point conversion form
754
+ * \param buf memory buffer for the result. If NULL the function returns
755
+ * required buffer size.
756
+ * \param len length of the memory buffer
757
+ * \param ctx BN_CTX object (optional)
758
+ * \return the length of the encoded octet string or 0 if an error occurred
759
+ */
760
+ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
761
+ point_conversion_form_t form,
762
+ unsigned char *buf, size_t len, BN_CTX *ctx);
763
+
764
+ /** Decodes a EC_POINT from a octet string
765
+ * \param group underlying EC_GROUP object
766
+ * \param p EC_POINT object
767
+ * \param buf memory buffer with the encoded ec point
768
+ * \param len length of the encoded ec point
769
+ * \param ctx BN_CTX object (optional)
770
+ * \return 1 on success and 0 if an error occurred
771
+ */
772
+ int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
773
+ const unsigned char *buf, size_t len, BN_CTX *ctx);
774
+
775
+ /** Encodes an EC_POINT object to an allocated octet string
776
+ * \param group underlying EC_GROUP object
777
+ * \param point EC_POINT object
778
+ * \param form point conversion form
779
+ * \param pbuf returns pointer to allocated buffer
780
+ * \param ctx BN_CTX object (optional)
781
+ * \return the length of the encoded octet string or 0 if an error occurred
782
+ */
783
+ size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point,
784
+ point_conversion_form_t form,
785
+ unsigned char **pbuf, BN_CTX *ctx);
786
+
787
+ /* other interfaces to point2oct/oct2point: */
788
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
789
+ OSSL_DEPRECATEDIN_3_0 BIGNUM *EC_POINT_point2bn(const EC_GROUP *,
790
+ const EC_POINT *,
791
+ point_conversion_form_t form,
792
+ BIGNUM *, BN_CTX *);
793
+ OSSL_DEPRECATEDIN_3_0 EC_POINT *EC_POINT_bn2point(const EC_GROUP *,
794
+ const BIGNUM *,
795
+ EC_POINT *, BN_CTX *);
796
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
797
+
798
+ char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
799
+ point_conversion_form_t form, BN_CTX *);
800
+ EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
801
+ EC_POINT *, BN_CTX *);
802
+
803
+ /********************************************************************/
804
+ /* functions for doing EC_POINT arithmetic */
805
+ /********************************************************************/
806
+
807
+ /** Computes the sum of two EC_POINT
808
+ * \param group underlying EC_GROUP object
809
+ * \param r EC_POINT object for the result (r = a + b)
810
+ * \param a EC_POINT object with the first summand
811
+ * \param b EC_POINT object with the second summand
812
+ * \param ctx BN_CTX object (optional)
813
+ * \return 1 on success and 0 if an error occurred
814
+ */
815
+ int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
816
+ const EC_POINT *b, BN_CTX *ctx);
817
+
818
+ /** Computes the double of a EC_POINT
819
+ * \param group underlying EC_GROUP object
820
+ * \param r EC_POINT object for the result (r = 2 * a)
821
+ * \param a EC_POINT object
822
+ * \param ctx BN_CTX object (optional)
823
+ * \return 1 on success and 0 if an error occurred
824
+ */
825
+ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
826
+ BN_CTX *ctx);
827
+
828
+ /** Computes the inverse of a EC_POINT
829
+ * \param group underlying EC_GROUP object
830
+ * \param a EC_POINT object to be inverted (it's used for the result as well)
831
+ * \param ctx BN_CTX object (optional)
832
+ * \return 1 on success and 0 if an error occurred
833
+ */
834
+ int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
835
+
836
+ /** Checks whether the point is the neutral element of the group
837
+ * \param group the underlying EC_GROUP object
838
+ * \param p EC_POINT object
839
+ * \return 1 if the point is the neutral element and 0 otherwise
840
+ */
841
+ int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
842
+
843
+ /** Checks whether the point is on the curve
844
+ * \param group underlying EC_GROUP object
845
+ * \param point EC_POINT object to check
846
+ * \param ctx BN_CTX object (optional)
847
+ * \return 1 if the point is on the curve, 0 if not, or -1 on error
848
+ */
849
+ int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
850
+ BN_CTX *ctx);
851
+
852
+ /** Compares two EC_POINTs
853
+ * \param group underlying EC_GROUP object
854
+ * \param a first EC_POINT object
855
+ * \param b second EC_POINT object
856
+ * \param ctx BN_CTX object (optional)
857
+ * \return 1 if the points are not equal, 0 if they are, or -1 on error
858
+ */
859
+ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
860
+ BN_CTX *ctx);
861
+
862
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
863
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_make_affine(const EC_GROUP *group,
864
+ EC_POINT *point, BN_CTX *ctx);
865
+ OSSL_DEPRECATEDIN_3_0 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
866
+ EC_POINT *points[], BN_CTX *ctx);
867
+
868
+ /** Computes r = generator * n + sum_{i=0}^{num-1} p[i] * m[i]
869
+ * \param group underlying EC_GROUP object
870
+ * \param r EC_POINT object for the result
871
+ * \param n BIGNUM with the multiplier for the group generator (optional)
872
+ * \param num number further summands
873
+ * \param p array of size num of EC_POINT objects
874
+ * \param m array of size num of BIGNUM objects
875
+ * \param ctx BN_CTX object (optional)
876
+ * \return 1 on success and 0 if an error occurred
877
+ */
878
+ OSSL_DEPRECATEDIN_3_0 int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r,
879
+ const BIGNUM *n, size_t num,
880
+ const EC_POINT *p[], const BIGNUM *m[],
881
+ BN_CTX *ctx);
882
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
883
+
884
+ /** Computes r = generator * n + q * m
885
+ * \param group underlying EC_GROUP object
886
+ * \param r EC_POINT object for the result
887
+ * \param n BIGNUM with the multiplier for the group generator (optional)
888
+ * \param q EC_POINT object with the first factor of the second summand
889
+ * \param m BIGNUM with the second factor of the second summand
890
+ * \param ctx BN_CTX object (optional)
891
+ * \return 1 on success and 0 if an error occurred
892
+ */
893
+ int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
894
+ const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
895
+
896
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
897
+ /** Stores multiples of generator for faster point multiplication
898
+ * \param group EC_GROUP object
899
+ * \param ctx BN_CTX object (optional)
900
+ * \return 1 on success and 0 if an error occurred
901
+ */
902
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
903
+
904
+ /** Reports whether a precomputation has been done
905
+ * \param group EC_GROUP object
906
+ * \return 1 if a pre-computation has been done and 0 otherwise
907
+ */
908
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
909
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
910
+
911
+ /********************************************************************/
912
+ /* ASN1 stuff */
913
+ /********************************************************************/
914
+
915
+ DECLARE_ASN1_ITEM(ECPKPARAMETERS)
916
+ DECLARE_ASN1_ALLOC_FUNCTIONS(ECPKPARAMETERS)
917
+ DECLARE_ASN1_ITEM(ECPARAMETERS)
918
+ DECLARE_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS)
919
+
920
+ /*
921
+ * EC_GROUP_get_basis_type() returns the NID of the basis type used to
922
+ * represent the field elements
923
+ */
924
+ int EC_GROUP_get_basis_type(const EC_GROUP *);
925
+ # ifndef OPENSSL_NO_EC2M
926
+ int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
927
+ int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
928
+ unsigned int *k2, unsigned int *k3);
929
+ # endif
930
+
931
+ EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
932
+ int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
933
+
934
+ # define d2i_ECPKParameters_bio(bp,x) \
935
+ ASN1_d2i_bio_of(EC_GROUP, NULL, d2i_ECPKParameters, bp, x)
936
+ # define i2d_ECPKParameters_bio(bp,x) \
937
+ ASN1_i2d_bio_of(EC_GROUP, i2d_ECPKParameters, bp, x)
938
+ # define d2i_ECPKParameters_fp(fp,x) \
939
+ (EC_GROUP *)ASN1_d2i_fp(NULL, (d2i_of_void *)d2i_ECPKParameters, (fp), \
940
+ (void **)(x))
941
+ # define i2d_ECPKParameters_fp(fp,x) \
942
+ ASN1_i2d_fp((i2d_of_void *)i2d_ECPKParameters, (fp), (void *)(x))
943
+
944
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
945
+ OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print(BIO *bp, const EC_GROUP *x,
946
+ int off);
947
+ # ifndef OPENSSL_NO_STDIO
948
+ OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x,
949
+ int off);
950
+ # endif
951
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
952
+
953
+ /********************************************************************/
954
+ /* EC_KEY functions */
955
+ /********************************************************************/
956
+
957
+ /* some values for the encoding_flag */
958
+ # define EC_PKEY_NO_PARAMETERS 0x001
959
+ # define EC_PKEY_NO_PUBKEY 0x002
960
+
961
+ /* some values for the flags field */
962
+ # define EC_FLAG_SM2_RANGE 0x0004
963
+ # define EC_FLAG_COFACTOR_ECDH 0x1000
964
+ # define EC_FLAG_CHECK_NAMED_GROUP 0x2000
965
+ # define EC_FLAG_CHECK_NAMED_GROUP_NIST 0x4000
966
+ # define EC_FLAG_CHECK_NAMED_GROUP_MASK \
967
+ (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
968
+
969
+ /* Deprecated flags - it was using 0x01..0x02 */
970
+ # define EC_FLAG_NON_FIPS_ALLOW 0x0000
971
+ # define EC_FLAG_FIPS_CHECKED 0x0000
972
+
973
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
974
+ /**
975
+ * Creates a new EC_KEY object.
976
+ * \param ctx The library context for to use for this EC_KEY. May be NULL in
977
+ * which case the default library context is used.
978
+ * \return EC_KEY object or NULL if an error occurred.
979
+ */
980
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq);
981
+
982
+ /**
983
+ * Creates a new EC_KEY object. Same as calling EC_KEY_new_ex with a
984
+ * NULL library context
985
+ * \return EC_KEY object or NULL if an error occurred.
986
+ */
987
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new(void);
988
+
989
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_get_flags(const EC_KEY *key);
990
+
991
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_flags(EC_KEY *key, int flags);
992
+
993
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_clear_flags(EC_KEY *key, int flags);
994
+
995
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_decoded_from_explicit_params(const EC_KEY *key);
996
+
997
+ /**
998
+ * Creates a new EC_KEY object using a named curve as underlying
999
+ * EC_GROUP object.
1000
+ * \param ctx The library context for to use for this EC_KEY. May be NULL in
1001
+ * which case the default library context is used.
1002
+ * \param propq Any property query string
1003
+ * \param nid NID of the named curve.
1004
+ * \return EC_KEY object or NULL if an error occurred.
1005
+ */
1006
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx,
1007
+ const char *propq,
1008
+ int nid);
1009
+
1010
+ /**
1011
+ * Creates a new EC_KEY object using a named curve as underlying
1012
+ * EC_GROUP object. Same as calling EC_KEY_new_by_curve_name_ex with a NULL
1013
+ * library context and property query string.
1014
+ * \param nid NID of the named curve.
1015
+ * \return EC_KEY object or NULL if an error occurred.
1016
+ */
1017
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
1018
+
1019
+ /** Frees a EC_KEY object.
1020
+ * \param key EC_KEY object to be freed.
1021
+ */
1022
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
1023
+
1024
+ /** Copies a EC_KEY object.
1025
+ * \param dst destination EC_KEY object
1026
+ * \param src src EC_KEY object
1027
+ * \return dst or NULL if an error occurred.
1028
+ */
1029
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
1030
+
1031
+ /** Creates a new EC_KEY object and copies the content from src to it.
1032
+ * \param src the source EC_KEY object
1033
+ * \return newly created EC_KEY object or NULL if an error occurred.
1034
+ */
1035
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_dup(const EC_KEY *src);
1036
+
1037
+ /** Increases the internal reference count of a EC_KEY object.
1038
+ * \param key EC_KEY object
1039
+ * \return 1 on success and 0 if an error occurred.
1040
+ */
1041
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_up_ref(EC_KEY *key);
1042
+
1043
+ /** Returns the ENGINE object of a EC_KEY object
1044
+ * \param eckey EC_KEY object
1045
+ * \return the ENGINE object (possibly NULL).
1046
+ */
1047
+ OSSL_DEPRECATEDIN_3_0 ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey);
1048
+
1049
+ /** Returns the EC_GROUP object of a EC_KEY object
1050
+ * \param key EC_KEY object
1051
+ * \return the EC_GROUP object (possibly NULL).
1052
+ */
1053
+ OSSL_DEPRECATEDIN_3_0 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
1054
+
1055
+ /** Sets the EC_GROUP of a EC_KEY object.
1056
+ * \param key EC_KEY object
1057
+ * \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY
1058
+ * object will use an own copy of the EC_GROUP).
1059
+ * \return 1 on success and 0 if an error occurred.
1060
+ */
1061
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
1062
+
1063
+ /** Returns the private key of a EC_KEY object.
1064
+ * \param key EC_KEY object
1065
+ * \return a BIGNUM with the private key (possibly NULL).
1066
+ */
1067
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
1068
+
1069
+ /** Sets the private key of a EC_KEY object.
1070
+ * \param key EC_KEY object
1071
+ * \param prv BIGNUM with the private key (note: the EC_KEY object
1072
+ * will use an own copy of the BIGNUM).
1073
+ * \return 1 on success and 0 if an error occurred.
1074
+ */
1075
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
1076
+
1077
+ /** Returns the public key of a EC_KEY object.
1078
+ * \param key the EC_KEY object
1079
+ * \return a EC_POINT object with the public key (possibly NULL)
1080
+ */
1081
+ OSSL_DEPRECATEDIN_3_0 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
1082
+
1083
+ /** Sets the public key of a EC_KEY object.
1084
+ * \param key EC_KEY object
1085
+ * \param pub EC_POINT object with the public key (note: the EC_KEY object
1086
+ * will use an own copy of the EC_POINT object).
1087
+ * \return 1 on success and 0 if an error occurred.
1088
+ */
1089
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
1090
+
1091
+ OSSL_DEPRECATEDIN_3_0 unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
1092
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
1093
+ OSSL_DEPRECATEDIN_3_0 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
1094
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_conv_form(EC_KEY *eckey,
1095
+ point_conversion_form_t cform);
1096
+ # endif /*OPENSSL_NO_DEPRECATED_3_0 */
1097
+
1098
+ # define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \
1099
+ CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef)
1100
+
1101
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
1102
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg);
1103
+ OSSL_DEPRECATEDIN_3_0 void *EC_KEY_get_ex_data(const EC_KEY *key, int idx);
1104
+
1105
+ /* wrapper functions for the underlying EC_GROUP object */
1106
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
1107
+
1108
+ /** Creates a table of pre-computed multiples of the generator to
1109
+ * accelerate further EC_KEY operations.
1110
+ * \param key EC_KEY object
1111
+ * \param ctx BN_CTX object (optional)
1112
+ * \return 1 on success and 0 if an error occurred.
1113
+ */
1114
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
1115
+
1116
+ /** Creates a new ec private (and optional a new public) key.
1117
+ * \param key EC_KEY object
1118
+ * \return 1 on success and 0 if an error occurred.
1119
+ */
1120
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_generate_key(EC_KEY *key);
1121
+
1122
+ /** Verifies that a private and/or public key is valid.
1123
+ * \param key the EC_KEY object
1124
+ * \return 1 on success and 0 otherwise.
1125
+ */
1126
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_check_key(const EC_KEY *key);
1127
+
1128
+ /** Indicates if an EC_KEY can be used for signing.
1129
+ * \param eckey the EC_KEY object
1130
+ * \return 1 if can sign and 0 otherwise.
1131
+ */
1132
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_can_sign(const EC_KEY *eckey);
1133
+
1134
+ /** Sets a public key from affine coordinates performing
1135
+ * necessary NIST PKV tests.
1136
+ * \param key the EC_KEY object
1137
+ * \param x public key x coordinate
1138
+ * \param y public key y coordinate
1139
+ * \return 1 on success and 0 otherwise.
1140
+ */
1141
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key,
1142
+ BIGNUM *x,
1143
+ BIGNUM *y);
1144
+
1145
+ /** Encodes an EC_KEY public key to an allocated octet string
1146
+ * \param key key to encode
1147
+ * \param form point conversion form
1148
+ * \param pbuf returns pointer to allocated buffer
1149
+ * \param ctx BN_CTX object (optional)
1150
+ * \return the length of the encoded octet string or 0 if an error occurred
1151
+ */
1152
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_key2buf(const EC_KEY *key,
1153
+ point_conversion_form_t form,
1154
+ unsigned char **pbuf, BN_CTX *ctx);
1155
+
1156
+ /** Decodes a EC_KEY public key from a octet string
1157
+ * \param key key to decode
1158
+ * \param buf memory buffer with the encoded ec point
1159
+ * \param len length of the encoded ec point
1160
+ * \param ctx BN_CTX object (optional)
1161
+ * \return 1 on success and 0 if an error occurred
1162
+ */
1163
+
1164
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf,
1165
+ size_t len, BN_CTX *ctx);
1166
+
1167
+ /** Decodes an EC_KEY private key from an octet string
1168
+ * \param key key to decode
1169
+ * \param buf memory buffer with the encoded private key
1170
+ * \param len length of the encoded key
1171
+ * \return 1 on success and 0 if an error occurred
1172
+ */
1173
+
1174
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf,
1175
+ size_t len);
1176
+
1177
+ /** Encodes a EC_KEY private key to an octet string
1178
+ * \param key key to encode
1179
+ * \param buf memory buffer for the result. If NULL the function returns
1180
+ * required buffer size.
1181
+ * \param len length of the memory buffer
1182
+ * \return the length of the encoded octet string or 0 if an error occurred
1183
+ */
1184
+
1185
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2oct(const EC_KEY *key,
1186
+ unsigned char *buf, size_t len);
1187
+
1188
+ /** Encodes an EC_KEY private key to an allocated octet string
1189
+ * \param eckey key to encode
1190
+ * \param pbuf returns pointer to allocated buffer
1191
+ * \return the length of the encoded octet string or 0 if an error occurred
1192
+ */
1193
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2buf(const EC_KEY *eckey,
1194
+ unsigned char **pbuf);
1195
+
1196
+ /********************************************************************/
1197
+ /* de- and encoding functions for SEC1 ECPrivateKey */
1198
+ /********************************************************************/
1199
+
1200
+ /** Decodes a private key from a memory buffer.
1201
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
1202
+ * \param in pointer to memory with the DER encoded private key
1203
+ * \param len length of the DER encoded private key
1204
+ * \return the decoded private key or NULL if an error occurred.
1205
+ */
1206
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey(EC_KEY **key,
1207
+ const unsigned char **in,
1208
+ long len);
1209
+
1210
+ /** Encodes a private key object and stores the result in a buffer.
1211
+ * \param key the EC_KEY object to encode
1212
+ * \param out the buffer for the result (if NULL the function returns number
1213
+ * of bytes needed).
1214
+ * \return 1 on success and 0 if an error occurred.
1215
+ */
1216
+ OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey(const EC_KEY *key,
1217
+ unsigned char **out);
1218
+
1219
+ /********************************************************************/
1220
+ /* de- and encoding functions for EC parameters */
1221
+ /********************************************************************/
1222
+
1223
+ /** Decodes ec parameter from a memory buffer.
1224
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
1225
+ * \param in pointer to memory with the DER encoded ec parameters
1226
+ * \param len length of the DER encoded ec parameters
1227
+ * \return a EC_KEY object with the decoded parameters or NULL if an error
1228
+ * occurred.
1229
+ */
1230
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECParameters(EC_KEY **key,
1231
+ const unsigned char **in,
1232
+ long len);
1233
+
1234
+ /** Encodes ec parameter and stores the result in a buffer.
1235
+ * \param key the EC_KEY object with ec parameters to encode
1236
+ * \param out the buffer for the result (if NULL the function returns number
1237
+ * of bytes needed).
1238
+ * \return 1 on success and 0 if an error occurred.
1239
+ */
1240
+ OSSL_DEPRECATEDIN_3_0 int i2d_ECParameters(const EC_KEY *key,
1241
+ unsigned char **out);
1242
+
1243
+ /********************************************************************/
1244
+ /* de- and encoding functions for EC public key */
1245
+ /* (octet string, not DER -- hence 'o2i' and 'i2o') */
1246
+ /********************************************************************/
1247
+
1248
+ /** Decodes an ec public key from a octet string.
1249
+ * \param key a pointer to a EC_KEY object which should be used
1250
+ * \param in memory buffer with the encoded public key
1251
+ * \param len length of the encoded public key
1252
+ * \return EC_KEY object with decoded public key or NULL if an error
1253
+ * occurred.
1254
+ */
1255
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *o2i_ECPublicKey(EC_KEY **key,
1256
+ const unsigned char **in, long len);
1257
+
1258
+ /** Encodes an ec public key in an octet string.
1259
+ * \param key the EC_KEY object with the public key
1260
+ * \param out the buffer for the result (if NULL the function returns number
1261
+ * of bytes needed).
1262
+ * \return 1 on success and 0 if an error occurred
1263
+ */
1264
+ OSSL_DEPRECATEDIN_3_0 int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out);
1265
+
1266
+ /** Prints out the ec parameters on human readable form.
1267
+ * \param bp BIO object to which the information is printed
1268
+ * \param key EC_KEY object
1269
+ * \return 1 on success and 0 if an error occurred
1270
+ */
1271
+ OSSL_DEPRECATEDIN_3_0 int ECParameters_print(BIO *bp, const EC_KEY *key);
1272
+
1273
+ /** Prints out the contents of a EC_KEY object
1274
+ * \param bp BIO object to which the information is printed
1275
+ * \param key EC_KEY object
1276
+ * \param off line offset
1277
+ * \return 1 on success and 0 if an error occurred
1278
+ */
1279
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
1280
+
1281
+ # ifndef OPENSSL_NO_STDIO
1282
+ /** Prints out the ec parameters on human readable form.
1283
+ * \param fp file descriptor to which the information is printed
1284
+ * \param key EC_KEY object
1285
+ * \return 1 on success and 0 if an error occurred
1286
+ */
1287
+ OSSL_DEPRECATEDIN_3_0 int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
1288
+
1289
+ /** Prints out the contents of a EC_KEY object
1290
+ * \param fp file descriptor to which the information is printed
1291
+ * \param key EC_KEY object
1292
+ * \param off line offset
1293
+ * \return 1 on success and 0 if an error occurred
1294
+ */
1295
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
1296
+ # endif /* OPENSSL_NO_STDIO */
1297
+
1298
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_OpenSSL(void);
1299
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_default_method(void);
1300
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_default_method(const EC_KEY_METHOD *meth);
1301
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key);
1302
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth);
1303
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_method(ENGINE *engine);
1304
+
1305
+ /** The old name for ecdh_KDF_X9_63
1306
+ * The ECDH KDF specification has been mistakenly attributed to ANSI X9.62,
1307
+ * it is actually specified in ANSI X9.63.
1308
+ * This identifier is retained for backwards compatibility
1309
+ */
1310
+ OSSL_DEPRECATEDIN_3_0 int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
1311
+ const unsigned char *Z, size_t Zlen,
1312
+ const unsigned char *sinfo,
1313
+ size_t sinfolen, const EVP_MD *md);
1314
+
1315
+ OSSL_DEPRECATEDIN_3_0 int ECDH_compute_key(void *out, size_t outlen,
1316
+ const EC_POINT *pub_key,
1317
+ const EC_KEY *ecdh,
1318
+ void *(*KDF)(const void *in,
1319
+ size_t inlen, void *out,
1320
+ size_t *outlen));
1321
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
1322
+
1323
+ typedef struct ECDSA_SIG_st ECDSA_SIG;
1324
+
1325
+ /** Allocates and initialize a ECDSA_SIG structure
1326
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1327
+ */
1328
+ ECDSA_SIG *ECDSA_SIG_new(void);
1329
+
1330
+ /** frees a ECDSA_SIG structure
1331
+ * \param sig pointer to the ECDSA_SIG structure
1332
+ */
1333
+ void ECDSA_SIG_free(ECDSA_SIG *sig);
1334
+
1335
+ /** i2d_ECDSA_SIG encodes content of ECDSA_SIG (note: this function modifies *pp
1336
+ * (*pp += length of the DER encoded signature)).
1337
+ * \param sig pointer to the ECDSA_SIG object
1338
+ * \param pp pointer to a unsigned char pointer for the output or NULL
1339
+ * \return the length of the DER encoded ECDSA_SIG object or a negative value
1340
+ * on error
1341
+ */
1342
+ DECLARE_ASN1_ENCODE_FUNCTIONS_only(ECDSA_SIG, ECDSA_SIG)
1343
+
1344
+ /** d2i_ECDSA_SIG decodes an ECDSA signature (note: this function modifies *pp
1345
+ * (*pp += len)).
1346
+ * \param sig pointer to ECDSA_SIG pointer (may be NULL)
1347
+ * \param pp memory buffer with the DER encoded signature
1348
+ * \param len length of the buffer
1349
+ * \return pointer to the decoded ECDSA_SIG structure (or NULL)
1350
+ */
1351
+
1352
+ /** Accessor for r and s fields of ECDSA_SIG
1353
+ * \param sig pointer to ECDSA_SIG structure
1354
+ * \param pr pointer to BIGNUM pointer for r (may be NULL)
1355
+ * \param ps pointer to BIGNUM pointer for s (may be NULL)
1356
+ */
1357
+ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
1358
+
1359
+ /** Accessor for r field of ECDSA_SIG
1360
+ * \param sig pointer to ECDSA_SIG structure
1361
+ */
1362
+ const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
1363
+
1364
+ /** Accessor for s field of ECDSA_SIG
1365
+ * \param sig pointer to ECDSA_SIG structure
1366
+ */
1367
+ const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
1368
+
1369
+ /** Setter for r and s fields of ECDSA_SIG
1370
+ * \param sig pointer to ECDSA_SIG structure
1371
+ * \param r pointer to BIGNUM for r
1372
+ * \param s pointer to BIGNUM for s
1373
+ */
1374
+ int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
1375
+
1376
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
1377
+ /** Computes the ECDSA signature of the given hash value using
1378
+ * the supplied private key and returns the created signature.
1379
+ * \param dgst pointer to the hash value
1380
+ * \param dgst_len length of the hash value
1381
+ * \param eckey EC_KEY object containing a private EC key
1382
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1383
+ */
1384
+ OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst,
1385
+ int dgst_len, EC_KEY *eckey);
1386
+
1387
+ /** Computes ECDSA signature of a given hash value using the supplied
1388
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1389
+ * \param dgst pointer to the hash value to sign
1390
+ * \param dgstlen length of the hash value
1391
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
1392
+ * \param rp BIGNUM with a pre-computed rp value (optional),
1393
+ * see ECDSA_sign_setup
1394
+ * \param eckey EC_KEY object containing a private EC key
1395
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1396
+ */
1397
+ OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst,
1398
+ int dgstlen, const BIGNUM *kinv,
1399
+ const BIGNUM *rp, EC_KEY *eckey);
1400
+
1401
+ /** Verifies that the supplied signature is a valid ECDSA
1402
+ * signature of the supplied hash value using the supplied public key.
1403
+ * \param dgst pointer to the hash value
1404
+ * \param dgst_len length of the hash value
1405
+ * \param sig ECDSA_SIG structure
1406
+ * \param eckey EC_KEY object containing a public EC key
1407
+ * \return 1 if the signature is valid, 0 if the signature is invalid
1408
+ * and -1 on error
1409
+ */
1410
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
1411
+ const ECDSA_SIG *sig, EC_KEY *eckey);
1412
+
1413
+ /** Precompute parts of the signing operation
1414
+ * \param eckey EC_KEY object containing a private EC key
1415
+ * \param ctx BN_CTX object (optional)
1416
+ * \param kinv BIGNUM pointer for the inverse of k
1417
+ * \param rp BIGNUM pointer for x coordinate of k * generator
1418
+ * \return 1 on success and 0 otherwise
1419
+ */
1420
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx,
1421
+ BIGNUM **kinv, BIGNUM **rp);
1422
+
1423
+ /** Computes ECDSA signature of a given hash value using the supplied
1424
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1425
+ * \param type this parameter is ignored
1426
+ * \param dgst pointer to the hash value to sign
1427
+ * \param dgstlen length of the hash value
1428
+ * \param sig memory for the DER encoded created signature
1429
+ * \param siglen pointer to the length of the returned signature
1430
+ * \param eckey EC_KEY object containing a private EC key
1431
+ * \return 1 on success and 0 otherwise
1432
+ */
1433
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign(int type, const unsigned char *dgst,
1434
+ int dgstlen, unsigned char *sig,
1435
+ unsigned int *siglen, EC_KEY *eckey);
1436
+
1437
+ /** Computes ECDSA signature of a given hash value using the supplied
1438
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1439
+ * \param type this parameter is ignored
1440
+ * \param dgst pointer to the hash value to sign
1441
+ * \param dgstlen length of the hash value
1442
+ * \param sig buffer to hold the DER encoded signature
1443
+ * \param siglen pointer to the length of the returned signature
1444
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
1445
+ * \param rp BIGNUM with a pre-computed rp value (optional),
1446
+ * see ECDSA_sign_setup
1447
+ * \param eckey EC_KEY object containing a private EC key
1448
+ * \return 1 on success and 0 otherwise
1449
+ */
1450
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_ex(int type, const unsigned char *dgst,
1451
+ int dgstlen, unsigned char *sig,
1452
+ unsigned int *siglen, const BIGNUM *kinv,
1453
+ const BIGNUM *rp, EC_KEY *eckey);
1454
+
1455
+ /** Verifies that the given signature is valid ECDSA signature
1456
+ * of the supplied hash value using the specified public key.
1457
+ * \param type this parameter is ignored
1458
+ * \param dgst pointer to the hash value
1459
+ * \param dgstlen length of the hash value
1460
+ * \param sig pointer to the DER encoded signature
1461
+ * \param siglen length of the DER encoded signature
1462
+ * \param eckey EC_KEY object containing a public EC key
1463
+ * \return 1 if the signature is valid, 0 if the signature is invalid
1464
+ * and -1 on error
1465
+ */
1466
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst,
1467
+ int dgstlen, const unsigned char *sig,
1468
+ int siglen, EC_KEY *eckey);
1469
+
1470
+ /** Returns the maximum length of the DER encoded signature
1471
+ * \param eckey EC_KEY object
1472
+ * \return numbers of bytes required for the DER encoded signature
1473
+ */
1474
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_size(const EC_KEY *eckey);
1475
+
1476
+ /********************************************************************/
1477
+ /* EC_KEY_METHOD constructors, destructors, writers and accessors */
1478
+ /********************************************************************/
1479
+
1480
+ OSSL_DEPRECATEDIN_3_0 EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth);
1481
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_free(EC_KEY_METHOD *meth);
1482
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_init
1483
+ (EC_KEY_METHOD *meth,
1484
+ int (*init)(EC_KEY *key),
1485
+ void (*finish)(EC_KEY *key),
1486
+ int (*copy)(EC_KEY *dest, const EC_KEY *src),
1487
+ int (*set_group)(EC_KEY *key, const EC_GROUP *grp),
1488
+ int (*set_private)(EC_KEY *key, const BIGNUM *priv_key),
1489
+ int (*set_public)(EC_KEY *key, const EC_POINT *pub_key));
1490
+
1491
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth,
1492
+ int (*keygen)(EC_KEY *key));
1493
+
1494
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_compute_key
1495
+ (EC_KEY_METHOD *meth,
1496
+ int (*ckey)(unsigned char **psec, size_t *pseclen,
1497
+ const EC_POINT *pub_key, const EC_KEY *ecdh));
1498
+
1499
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_sign
1500
+ (EC_KEY_METHOD *meth,
1501
+ int (*sign)(int type, const unsigned char *dgst,
1502
+ int dlen, unsigned char *sig,
1503
+ unsigned int *siglen,
1504
+ const BIGNUM *kinv, const BIGNUM *r,
1505
+ EC_KEY *eckey),
1506
+ int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
1507
+ BIGNUM **kinvp, BIGNUM **rp),
1508
+ ECDSA_SIG *(*sign_sig)(const unsigned char *dgst,
1509
+ int dgst_len,
1510
+ const BIGNUM *in_kinv,
1511
+ const BIGNUM *in_r,
1512
+ EC_KEY *eckey));
1513
+
1514
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_verify
1515
+ (EC_KEY_METHOD *meth,
1516
+ int (*verify)(int type, const unsigned
1517
+ char *dgst, int dgst_len,
1518
+ const unsigned char *sigbuf,
1519
+ int sig_len, EC_KEY *eckey),
1520
+ int (*verify_sig)(const unsigned char *dgst,
1521
+ int dgst_len, const ECDSA_SIG *sig,
1522
+ EC_KEY *eckey));
1523
+
1524
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_init
1525
+ (const EC_KEY_METHOD *meth,
1526
+ int (**pinit)(EC_KEY *key),
1527
+ void (**pfinish)(EC_KEY *key),
1528
+ int (**pcopy)(EC_KEY *dest, const EC_KEY *src),
1529
+ int (**pset_group)(EC_KEY *key, const EC_GROUP *grp),
1530
+ int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key),
1531
+ int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key));
1532
+
1533
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_keygen
1534
+ (const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key));
1535
+
1536
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_compute_key
1537
+ (const EC_KEY_METHOD *meth,
1538
+ int (**pck)(unsigned char **psec,
1539
+ size_t *pseclen,
1540
+ const EC_POINT *pub_key,
1541
+ const EC_KEY *ecdh));
1542
+
1543
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_sign
1544
+ (const EC_KEY_METHOD *meth,
1545
+ int (**psign)(int type, const unsigned char *dgst,
1546
+ int dlen, unsigned char *sig,
1547
+ unsigned int *siglen,
1548
+ const BIGNUM *kinv, const BIGNUM *r,
1549
+ EC_KEY *eckey),
1550
+ int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
1551
+ BIGNUM **kinvp, BIGNUM **rp),
1552
+ ECDSA_SIG *(**psign_sig)(const unsigned char *dgst,
1553
+ int dgst_len,
1554
+ const BIGNUM *in_kinv,
1555
+ const BIGNUM *in_r,
1556
+ EC_KEY *eckey));
1557
+
1558
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_verify
1559
+ (const EC_KEY_METHOD *meth,
1560
+ int (**pverify)(int type, const unsigned
1561
+ char *dgst, int dgst_len,
1562
+ const unsigned char *sigbuf,
1563
+ int sig_len, EC_KEY *eckey),
1564
+ int (**pverify_sig)(const unsigned char *dgst,
1565
+ int dgst_len,
1566
+ const ECDSA_SIG *sig,
1567
+ EC_KEY *eckey));
1568
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
1569
+
1570
+ # define EVP_EC_gen(curve) \
1571
+ EVP_PKEY_Q_keygen(NULL, NULL, "EC", (char *)(strstr(curve, "")))
1572
+ /* strstr is used to enable type checking for the variadic string arg */
1573
+ # define ECParameters_dup(x) ASN1_dup_of(EC_KEY, i2d_ECParameters, \
1574
+ d2i_ECParameters, x)
1575
+
1576
+ # ifndef __cplusplus
1577
+ # if defined(__SUNPRO_C)
1578
+ # if __SUNPRO_C >= 0x520
1579
+ # pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
1580
+ # endif
1581
+ # endif
1582
+ # endif
1583
+
1584
+ # endif
1585
+ # ifdef __cplusplus
1586
+ }
1587
+ # endif
1588
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/encoder.h ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2019-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_ENCODER_H
11
+ # define OPENSSL_ENCODER_H
12
+ # pragma once
13
+
14
+ # include <openssl/opensslconf.h>
15
+
16
+ # ifndef OPENSSL_NO_STDIO
17
+ # include <stdio.h>
18
+ # endif
19
+ # include <stdarg.h>
20
+ # include <stddef.h>
21
+ # include <openssl/encodererr.h>
22
+ # include <openssl/types.h>
23
+ # include <openssl/core.h>
24
+
25
+ # ifdef __cplusplus
26
+ extern "C" {
27
+ # endif
28
+
29
+ OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *libctx, const char *name,
30
+ const char *properties);
31
+ int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder);
32
+ void OSSL_ENCODER_free(OSSL_ENCODER *encoder);
33
+
34
+ const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder);
35
+ const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder);
36
+ const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *kdf);
37
+ const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *kdf);
38
+ int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name);
39
+
40
+ void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx,
41
+ void (*fn)(OSSL_ENCODER *encoder, void *arg),
42
+ void *arg);
43
+ int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder,
44
+ void (*fn)(const char *name, void *data),
45
+ void *data);
46
+ const OSSL_PARAM *OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder);
47
+ int OSSL_ENCODER_get_params(OSSL_ENCODER *encoder, OSSL_PARAM params[]);
48
+
49
+ const OSSL_PARAM *OSSL_ENCODER_settable_ctx_params(OSSL_ENCODER *encoder);
50
+ OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new(void);
51
+ int OSSL_ENCODER_CTX_set_params(OSSL_ENCODER_CTX *ctx,
52
+ const OSSL_PARAM params[]);
53
+ void OSSL_ENCODER_CTX_free(OSSL_ENCODER_CTX *ctx);
54
+
55
+ /* Utilities that help set specific parameters */
56
+ int OSSL_ENCODER_CTX_set_passphrase(OSSL_ENCODER_CTX *ctx,
57
+ const unsigned char *kstr, size_t klen);
58
+ int OSSL_ENCODER_CTX_set_pem_password_cb(OSSL_ENCODER_CTX *ctx,
59
+ pem_password_cb *cb, void *cbarg);
60
+ int OSSL_ENCODER_CTX_set_passphrase_cb(OSSL_ENCODER_CTX *ctx,
61
+ OSSL_PASSPHRASE_CALLBACK *cb,
62
+ void *cbarg);
63
+ int OSSL_ENCODER_CTX_set_passphrase_ui(OSSL_ENCODER_CTX *ctx,
64
+ const UI_METHOD *ui_method,
65
+ void *ui_data);
66
+ int OSSL_ENCODER_CTX_set_cipher(OSSL_ENCODER_CTX *ctx,
67
+ const char *cipher_name,
68
+ const char *propquery);
69
+ int OSSL_ENCODER_CTX_set_selection(OSSL_ENCODER_CTX *ctx, int selection);
70
+ int OSSL_ENCODER_CTX_set_output_type(OSSL_ENCODER_CTX *ctx,
71
+ const char *output_type);
72
+ int OSSL_ENCODER_CTX_set_output_structure(OSSL_ENCODER_CTX *ctx,
73
+ const char *output_structure);
74
+
75
+ /* Utilities to add encoders */
76
+ int OSSL_ENCODER_CTX_add_encoder(OSSL_ENCODER_CTX *ctx, OSSL_ENCODER *encoder);
77
+ int OSSL_ENCODER_CTX_add_extra(OSSL_ENCODER_CTX *ctx,
78
+ OSSL_LIB_CTX *libctx, const char *propq);
79
+ int OSSL_ENCODER_CTX_get_num_encoders(OSSL_ENCODER_CTX *ctx);
80
+
81
+ typedef struct ossl_encoder_instance_st OSSL_ENCODER_INSTANCE;
82
+ OSSL_ENCODER *
83
+ OSSL_ENCODER_INSTANCE_get_encoder(OSSL_ENCODER_INSTANCE *encoder_inst);
84
+ void *
85
+ OSSL_ENCODER_INSTANCE_get_encoder_ctx(OSSL_ENCODER_INSTANCE *encoder_inst);
86
+ const char *
87
+ OSSL_ENCODER_INSTANCE_get_output_type(OSSL_ENCODER_INSTANCE *encoder_inst);
88
+ const char *
89
+ OSSL_ENCODER_INSTANCE_get_output_structure(OSSL_ENCODER_INSTANCE *encoder_inst);
90
+
91
+ typedef const void *OSSL_ENCODER_CONSTRUCT(OSSL_ENCODER_INSTANCE *encoder_inst,
92
+ void *construct_data);
93
+ typedef void OSSL_ENCODER_CLEANUP(void *construct_data);
94
+
95
+ int OSSL_ENCODER_CTX_set_construct(OSSL_ENCODER_CTX *ctx,
96
+ OSSL_ENCODER_CONSTRUCT *construct);
97
+ int OSSL_ENCODER_CTX_set_construct_data(OSSL_ENCODER_CTX *ctx,
98
+ void *construct_data);
99
+ int OSSL_ENCODER_CTX_set_cleanup(OSSL_ENCODER_CTX *ctx,
100
+ OSSL_ENCODER_CLEANUP *cleanup);
101
+
102
+ /* Utilities to output the object to encode */
103
+ int OSSL_ENCODER_to_bio(OSSL_ENCODER_CTX *ctx, BIO *out);
104
+ #ifndef OPENSSL_NO_STDIO
105
+ int OSSL_ENCODER_to_fp(OSSL_ENCODER_CTX *ctx, FILE *fp);
106
+ #endif
107
+ int OSSL_ENCODER_to_data(OSSL_ENCODER_CTX *ctx, unsigned char **pdata,
108
+ size_t *pdata_len);
109
+
110
+ /*
111
+ * Create the OSSL_ENCODER_CTX with an associated type. This will perform
112
+ * an implicit OSSL_ENCODER_fetch(), suitable for the object of that type.
113
+ * This is more useful than calling OSSL_ENCODER_CTX_new().
114
+ */
115
+ OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_for_pkey(const EVP_PKEY *pkey,
116
+ int selection,
117
+ const char *output_type,
118
+ const char *output_struct,
119
+ const char *propquery);
120
+
121
+ # ifdef __cplusplus
122
+ }
123
+ # endif
124
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/engine.h ADDED
@@ -0,0 +1,833 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
3
+ * Copyright (c) 2002, 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_ENGINE_H
12
+ # define OPENSSL_ENGINE_H
13
+ # pragma once
14
+
15
+ # include <openssl/macros.h>
16
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
17
+ # define HEADER_ENGINE_H
18
+ # endif
19
+
20
+ # include <openssl/opensslconf.h>
21
+
22
+ # ifndef OPENSSL_NO_ENGINE
23
+ # ifndef OPENSSL_NO_DEPRECATED_1_1_0
24
+ # include <openssl/bn.h>
25
+ # include <openssl/rsa.h>
26
+ # include <openssl/dsa.h>
27
+ # include <openssl/dh.h>
28
+ # include <openssl/ec.h>
29
+ # include <openssl/rand.h>
30
+ # include <openssl/ui.h>
31
+ # include <openssl/err.h>
32
+ # endif
33
+ # include <openssl/types.h>
34
+ # include <openssl/symhacks.h>
35
+ # include <openssl/x509.h>
36
+ # include <openssl/engineerr.h>
37
+ # ifdef __cplusplus
38
+ extern "C" {
39
+ # endif
40
+
41
+ /*
42
+ * These flags are used to control combinations of algorithm (methods) by
43
+ * bitwise "OR"ing.
44
+ */
45
+ # define ENGINE_METHOD_RSA (unsigned int)0x0001
46
+ # define ENGINE_METHOD_DSA (unsigned int)0x0002
47
+ # define ENGINE_METHOD_DH (unsigned int)0x0004
48
+ # define ENGINE_METHOD_RAND (unsigned int)0x0008
49
+ # define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
50
+ # define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
51
+ # define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200
52
+ # define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400
53
+ # define ENGINE_METHOD_EC (unsigned int)0x0800
54
+ /* Obvious all-or-nothing cases. */
55
+ # define ENGINE_METHOD_ALL (unsigned int)0xFFFF
56
+ # define ENGINE_METHOD_NONE (unsigned int)0x0000
57
+
58
+ /*
59
+ * This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used
60
+ * internally to control registration of ENGINE implementations, and can be
61
+ * set by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to
62
+ * initialise registered ENGINEs if they are not already initialised.
63
+ */
64
+ # define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
65
+
66
+ /* ENGINE flags that can be set by ENGINE_set_flags(). */
67
+ /* Not used */
68
+ /* #define ENGINE_FLAGS_MALLOCED 0x0001 */
69
+
70
+ /*
71
+ * This flag is for ENGINEs that wish to handle the various 'CMD'-related
72
+ * control commands on their own. Without this flag, ENGINE_ctrl() handles
73
+ * these control commands on behalf of the ENGINE using their "cmd_defns"
74
+ * data.
75
+ */
76
+ # define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002
77
+
78
+ /*
79
+ * This flag is for ENGINEs who return new duplicate structures when found
80
+ * via "ENGINE_by_id()". When an ENGINE must store state (eg. if
81
+ * ENGINE_ctrl() commands are called in sequence as part of some stateful
82
+ * process like key-generation setup and execution), it can set this flag -
83
+ * then each attempt to obtain the ENGINE will result in it being copied into
84
+ * a new structure. Normally, ENGINEs don't declare this flag so
85
+ * ENGINE_by_id() just increments the existing ENGINE's structural reference
86
+ * count.
87
+ */
88
+ # define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
89
+
90
+ /*
91
+ * This flag is for an ENGINE that does not want its methods registered as
92
+ * part of ENGINE_register_all_complete() for example if the methods are not
93
+ * usable as default methods.
94
+ */
95
+
96
+ # define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008
97
+
98
+ /*
99
+ * ENGINEs can support their own command types, and these flags are used in
100
+ * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input
101
+ * each command expects. Currently only numeric and string input is
102
+ * supported. If a control command supports none of the _NUMERIC, _STRING, or
103
+ * _NO_INPUT options, then it is regarded as an "internal" control command -
104
+ * and not for use in config setting situations. As such, they're not
105
+ * available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl()
106
+ * access. Changes to this list of 'command types' should be reflected
107
+ * carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string().
108
+ */
109
+
110
+ /* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */
111
+ # define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
112
+ /*
113
+ * accepts string input (cast from 'void*' to 'const char *', 4th parameter
114
+ * to ENGINE_ctrl)
115
+ */
116
+ # define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
117
+ /*
118
+ * Indicates that the control command takes *no* input. Ie. the control
119
+ * command is unparameterised.
120
+ */
121
+ # define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
122
+ /*
123
+ * Indicates that the control command is internal. This control command won't
124
+ * be shown in any output, and is only usable through the ENGINE_ctrl_cmd()
125
+ * function.
126
+ */
127
+ # define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008
128
+
129
+ /*
130
+ * NB: These 3 control commands are deprecated and should not be used.
131
+ * ENGINEs relying on these commands should compile conditional support for
132
+ * compatibility (eg. if these symbols are defined) but should also migrate
133
+ * the same functionality to their own ENGINE-specific control functions that
134
+ * can be "discovered" by calling applications. The fact these control
135
+ * commands wouldn't be "executable" (ie. usable by text-based config)
136
+ * doesn't change the fact that application code can find and use them
137
+ * without requiring per-ENGINE hacking.
138
+ */
139
+
140
+ /*
141
+ * These flags are used to tell the ctrl function what should be done. All
142
+ * command numbers are shared between all engines, even if some don't make
143
+ * sense to some engines. In such a case, they do nothing but return the
144
+ * error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED.
145
+ */
146
+ # define ENGINE_CTRL_SET_LOGSTREAM 1
147
+ # define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
148
+ # define ENGINE_CTRL_HUP 3/* Close and reinitialise
149
+ * any handles/connections
150
+ * etc. */
151
+ # define ENGINE_CTRL_SET_USER_INTERFACE 4/* Alternative to callback */
152
+ # define ENGINE_CTRL_SET_CALLBACK_DATA 5/* User-specific data, used
153
+ * when calling the password
154
+ * callback and the user
155
+ * interface */
156
+ # define ENGINE_CTRL_LOAD_CONFIGURATION 6/* Load a configuration,
157
+ * given a string that
158
+ * represents a file name
159
+ * or so */
160
+ # define ENGINE_CTRL_LOAD_SECTION 7/* Load data from a given
161
+ * section in the already
162
+ * loaded configuration */
163
+
164
+ /*
165
+ * These control commands allow an application to deal with an arbitrary
166
+ * engine in a dynamic way. Warn: Negative return values indicate errors FOR
167
+ * THESE COMMANDS because zero is used to indicate 'end-of-list'. Other
168
+ * commands, including ENGINE-specific command types, return zero for an
169
+ * error. An ENGINE can choose to implement these ctrl functions, and can
170
+ * internally manage things however it chooses - it does so by setting the
171
+ * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise
172
+ * the ENGINE_ctrl() code handles this on the ENGINE's behalf using the
173
+ * cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's
174
+ * ctrl() handler need only implement its own commands - the above "meta"
175
+ * commands will be taken care of.
176
+ */
177
+
178
+ /*
179
+ * Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not",
180
+ * then all the remaining control commands will return failure, so it is
181
+ * worth checking this first if the caller is trying to "discover" the
182
+ * engine's capabilities and doesn't want errors generated unnecessarily.
183
+ */
184
+ # define ENGINE_CTRL_HAS_CTRL_FUNCTION 10
185
+ /*
186
+ * Returns a positive command number for the first command supported by the
187
+ * engine. Returns zero if no ctrl commands are supported.
188
+ */
189
+ # define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
190
+ /*
191
+ * The 'long' argument specifies a command implemented by the engine, and the
192
+ * return value is the next command supported, or zero if there are no more.
193
+ */
194
+ # define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
195
+ /*
196
+ * The 'void*' argument is a command name (cast from 'const char *'), and the
197
+ * return value is the command that corresponds to it.
198
+ */
199
+ # define ENGINE_CTRL_GET_CMD_FROM_NAME 13
200
+ /*
201
+ * The next two allow a command to be converted into its corresponding string
202
+ * form. In each case, the 'long' argument supplies the command. In the
203
+ * NAME_LEN case, the return value is the length of the command name (not
204
+ * counting a trailing EOL). In the NAME case, the 'void*' argument must be a
205
+ * string buffer large enough, and it will be populated with the name of the
206
+ * command (WITH a trailing EOL).
207
+ */
208
+ # define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
209
+ # define ENGINE_CTRL_GET_NAME_FROM_CMD 15
210
+ /* The next two are similar but give a "short description" of a command. */
211
+ # define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
212
+ # define ENGINE_CTRL_GET_DESC_FROM_CMD 17
213
+ /*
214
+ * With this command, the return value is the OR'd combination of
215
+ * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given
216
+ * engine-specific ctrl command expects.
217
+ */
218
+ # define ENGINE_CTRL_GET_CMD_FLAGS 18
219
+
220
+ /*
221
+ * ENGINE implementations should start the numbering of their own control
222
+ * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc).
223
+ */
224
+ # define ENGINE_CMD_BASE 200
225
+
226
+ /*
227
+ * NB: These 2 nCipher "chil" control commands are deprecated, and their
228
+ * functionality is now available through ENGINE-specific control commands
229
+ * (exposed through the above-mentioned 'CMD'-handling). Code using these 2
230
+ * commands should be migrated to the more general command handling before
231
+ * these are removed.
232
+ */
233
+
234
+ /* Flags specific to the nCipher "chil" engine */
235
+ # define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
236
+ /*
237
+ * Depending on the value of the (long)i argument, this sets or
238
+ * unsets the SimpleForkCheck flag in the CHIL API to enable or
239
+ * disable checking and workarounds for applications that fork().
240
+ */
241
+ # define ENGINE_CTRL_CHIL_NO_LOCKING 101
242
+ /*
243
+ * This prevents the initialisation function from providing mutex
244
+ * callbacks to the nCipher library.
245
+ */
246
+
247
+ /*
248
+ * If an ENGINE supports its own specific control commands and wishes the
249
+ * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on
250
+ * its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN
251
+ * entries to ENGINE_set_cmd_defns(). It should also implement a ctrl()
252
+ * handler that supports the stated commands (ie. the "cmd_num" entries as
253
+ * described by the array). NB: The array must be ordered in increasing order
254
+ * of cmd_num. "null-terminated" means that the last ENGINE_CMD_DEFN element
255
+ * has cmd_num set to zero and/or cmd_name set to NULL.
256
+ */
257
+ typedef struct ENGINE_CMD_DEFN_st {
258
+ unsigned int cmd_num; /* The command number */
259
+ const char *cmd_name; /* The command name itself */
260
+ const char *cmd_desc; /* A short description of the command */
261
+ unsigned int cmd_flags; /* The input the command expects */
262
+ } ENGINE_CMD_DEFN;
263
+
264
+ /* Generic function pointer */
265
+ typedef int (*ENGINE_GEN_FUNC_PTR) (void);
266
+ /* Generic function pointer taking no arguments */
267
+ typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);
268
+ /* Specific control function pointer */
269
+ typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
270
+ void (*f) (void));
271
+ /* Generic load_key function pointer */
272
+ typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
273
+ UI_METHOD *ui_method,
274
+ void *callback_data);
275
+ typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
276
+ STACK_OF(X509_NAME) *ca_dn,
277
+ X509 **pcert, EVP_PKEY **pkey,
278
+ STACK_OF(X509) **pother,
279
+ UI_METHOD *ui_method,
280
+ void *callback_data);
281
+ /*-
282
+ * These callback types are for an ENGINE's handler for cipher and digest logic.
283
+ * These handlers have these prototypes;
284
+ * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
285
+ * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid);
286
+ * Looking at how to implement these handlers in the case of cipher support, if
287
+ * the framework wants the EVP_CIPHER for 'nid', it will call;
288
+ * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure)
289
+ * If the framework wants a list of supported 'nid's, it will call;
290
+ * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error)
291
+ */
292
+ /*
293
+ * Returns to a pointer to the array of supported cipher 'nid's. If the
294
+ * second parameter is non-NULL it is set to the size of the returned array.
295
+ */
296
+ typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,
297
+ const int **, int);
298
+ typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
299
+ int);
300
+ typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
301
+ const int **, int);
302
+ typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
303
+ const int **, int);
304
+ /*
305
+ * STRUCTURE functions ... all of these functions deal with pointers to
306
+ * ENGINE structures where the pointers have a "structural reference". This
307
+ * means that their reference is to allowed access to the structure but it
308
+ * does not imply that the structure is functional. To simply increment or
309
+ * decrement the structural reference count, use ENGINE_by_id and
310
+ * ENGINE_free. NB: This is not required when iterating using ENGINE_get_next
311
+ * as it will automatically decrement the structural reference count of the
312
+ * "current" ENGINE and increment the structural reference count of the
313
+ * ENGINE it returns (unless it is NULL).
314
+ */
315
+
316
+ /* Get the first/last "ENGINE" type available. */
317
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
318
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_first(void);
319
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_last(void);
320
+ # endif
321
+ /* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
322
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
323
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_next(ENGINE *e);
324
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_prev(ENGINE *e);
325
+ # endif
326
+ /* Add another "ENGINE" type into the array. */
327
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
328
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_add(ENGINE *e);
329
+ # endif
330
+ /* Remove an existing "ENGINE" type from the array. */
331
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
332
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_remove(ENGINE *e);
333
+ # endif
334
+ /* Retrieve an engine from the list by its unique "id" value. */
335
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
336
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id);
337
+ # endif
338
+
339
+ # ifndef OPENSSL_NO_DEPRECATED_1_1_0
340
+ # define ENGINE_load_openssl() \
341
+ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_OPENSSL, NULL)
342
+ # define ENGINE_load_dynamic() \
343
+ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DYNAMIC, NULL)
344
+ # ifndef OPENSSL_NO_STATIC_ENGINE
345
+ # define ENGINE_load_padlock() \
346
+ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL)
347
+ # define ENGINE_load_capi() \
348
+ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL)
349
+ # define ENGINE_load_afalg() \
350
+ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL)
351
+ # endif
352
+ # define ENGINE_load_cryptodev() \
353
+ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CRYPTODEV, NULL)
354
+ # define ENGINE_load_rdrand() \
355
+ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND, NULL)
356
+ # endif
357
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
358
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void);
359
+ # endif
360
+
361
+ /*
362
+ * Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
363
+ * "registry" handling.
364
+ */
365
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
366
+ OSSL_DEPRECATEDIN_3_0 unsigned int ENGINE_get_table_flags(void);
367
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_set_table_flags(unsigned int flags);
368
+ # endif
369
+
370
+ /*- Manage registration of ENGINEs per "table". For each type, there are 3
371
+ * functions;
372
+ * ENGINE_register_***(e) - registers the implementation from 'e' (if it has one)
373
+ * ENGINE_unregister_***(e) - unregister the implementation from 'e'
374
+ * ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list
375
+ * Cleanup is automatically registered from each table when required.
376
+ */
377
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
378
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RSA(ENGINE *e);
379
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RSA(ENGINE *e);
380
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RSA(void);
381
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DSA(ENGINE *e);
382
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DSA(ENGINE *e);
383
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DSA(void);
384
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_EC(ENGINE *e);
385
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_EC(ENGINE *e);
386
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_EC(void);
387
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DH(ENGINE *e);
388
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DH(ENGINE *e);
389
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DH(void);
390
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RAND(ENGINE *e);
391
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RAND(ENGINE *e);
392
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RAND(void);
393
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_ciphers(ENGINE *e);
394
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_ciphers(ENGINE *e);
395
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_ciphers(void);
396
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_digests(ENGINE *e);
397
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_digests(ENGINE *e);
398
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_digests(void);
399
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_meths(ENGINE *e);
400
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_meths(ENGINE *e);
401
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_meths(void);
402
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_asn1_meths(ENGINE *e);
403
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
404
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_asn1_meths(void);
405
+ # endif
406
+
407
+ /*
408
+ * These functions register all support from the above categories. Note, use
409
+ * of these functions can result in static linkage of code your application
410
+ * may not need. If you only need a subset of functionality, consider using
411
+ * more selective initialisation.
412
+ */
413
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
414
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_complete(ENGINE *e);
415
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_register_all_complete(void);
416
+ # endif
417
+
418
+ /*
419
+ * Send parameterised control commands to the engine. The possibilities to
420
+ * send down an integer, a pointer to data or a function pointer are
421
+ * provided. Any of the parameters may or may not be NULL, depending on the
422
+ * command number. In actuality, this function only requires a structural
423
+ * (rather than functional) reference to an engine, but many control commands
424
+ * may require the engine be functional. The caller should be aware of trying
425
+ * commands that require an operational ENGINE, and only use functional
426
+ * references in such situations.
427
+ */
428
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
429
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
430
+ void (*f) (void));
431
+ # endif
432
+
433
+ /*
434
+ * This function tests if an ENGINE-specific command is usable as a
435
+ * "setting". Eg. in an application's config file that gets processed through
436
+ * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to
437
+ * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl().
438
+ */
439
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
440
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
441
+ # endif
442
+
443
+ /*
444
+ * This function works like ENGINE_ctrl() with the exception of taking a
445
+ * command name instead of a command number, and can handle optional
446
+ * commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation
447
+ * on how to use the cmd_name and cmd_optional.
448
+ */
449
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
450
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
451
+ long i, void *p, void (*f) (void),
452
+ int cmd_optional);
453
+ # endif
454
+
455
+ /*
456
+ * This function passes a command-name and argument to an ENGINE. The
457
+ * cmd_name is converted to a command number and the control command is
458
+ * called using 'arg' as an argument (unless the ENGINE doesn't support such
459
+ * a command, in which case no control command is called). The command is
460
+ * checked for input flags, and if necessary the argument will be converted
461
+ * to a numeric value. If cmd_optional is non-zero, then if the ENGINE
462
+ * doesn't support the given cmd_name the return value will be success
463
+ * anyway. This function is intended for applications to use so that users
464
+ * (or config files) can supply engine-specific config data to the ENGINE at
465
+ * run-time to control behaviour of specific engines. As such, it shouldn't
466
+ * be used for calling ENGINE_ctrl() functions that return data, deal with
467
+ * binary data, or that are otherwise supposed to be used directly through
468
+ * ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl()
469
+ * operation in this function will be lost - the return value is interpreted
470
+ * as failure if the return value is zero, success otherwise, and this
471
+ * function returns a boolean value as a result. In other words, vendors of
472
+ * 'ENGINE'-enabled devices should write ENGINE implementations with
473
+ * parameterisations that work in this scheme, so that compliant ENGINE-based
474
+ * applications can work consistently with the same configuration for the
475
+ * same ENGINE-enabled devices, across applications.
476
+ */
477
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
478
+ OSSL_DEPRECATEDIN_3_0
479
+ int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
480
+ int cmd_optional);
481
+ # endif
482
+
483
+ /*
484
+ * These functions are useful for manufacturing new ENGINE structures. They
485
+ * don't address reference counting at all - one uses them to populate an
486
+ * ENGINE structure with personalised implementations of things prior to
487
+ * using it directly or adding it to the builtin ENGINE list in OpenSSL.
488
+ * These are also here so that the ENGINE structure doesn't have to be
489
+ * exposed and break binary compatibility!
490
+ */
491
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
492
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_new(void);
493
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
494
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_up_ref(ENGINE *e);
495
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_id(ENGINE *e, const char *id);
496
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_name(ENGINE *e, const char *name);
497
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
498
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
499
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
500
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
501
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
502
+ OSSL_DEPRECATEDIN_3_0
503
+ int ENGINE_set_destroy_function(ENGINE *e,ENGINE_GEN_INT_FUNC_PTR destroy_f);
504
+ OSSL_DEPRECATEDIN_3_0
505
+ int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
506
+ OSSL_DEPRECATEDIN_3_0
507
+ int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
508
+ OSSL_DEPRECATEDIN_3_0
509
+ int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
510
+ OSSL_DEPRECATEDIN_3_0
511
+ int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
512
+ OSSL_DEPRECATEDIN_3_0
513
+ int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
514
+ OSSL_DEPRECATEDIN_3_0
515
+ int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
516
+ ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
517
+ OSSL_DEPRECATEDIN_3_0
518
+ int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
519
+ OSSL_DEPRECATEDIN_3_0
520
+ int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
521
+ OSSL_DEPRECATEDIN_3_0
522
+ int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
523
+ OSSL_DEPRECATEDIN_3_0
524
+ int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
525
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_flags(ENGINE *e, int flags);
526
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_cmd_defns(ENGINE *e,
527
+ const ENGINE_CMD_DEFN *defns);
528
+ # endif
529
+ /* These functions allow control over any per-structure ENGINE data. */
530
+ # define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) \
531
+ CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef)
532
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
533
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
534
+ OSSL_DEPRECATEDIN_3_0 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
535
+ # endif
536
+
537
+ # ifndef OPENSSL_NO_DEPRECATED_1_1_0
538
+ /*
539
+ * This function previously cleaned up anything that needs it. Auto-deinit will
540
+ * now take care of it so it is no longer required to call this function.
541
+ */
542
+ # define ENGINE_cleanup() while(0) continue
543
+ # endif
544
+
545
+ /*
546
+ * These return values from within the ENGINE structure. These can be useful
547
+ * with functional references as well as structural references - it depends
548
+ * which you obtained. Using the result for functional purposes if you only
549
+ * obtained a structural reference may be problematic!
550
+ */
551
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
552
+ OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_id(const ENGINE *e);
553
+ OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_name(const ENGINE *e);
554
+ OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
555
+ OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
556
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e);
557
+ OSSL_DEPRECATEDIN_3_0 const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
558
+ OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
559
+ OSSL_DEPRECATEDIN_3_0
560
+ ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
561
+ OSSL_DEPRECATEDIN_3_0
562
+ ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
563
+ OSSL_DEPRECATEDIN_3_0
564
+ ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
565
+ OSSL_DEPRECATEDIN_3_0
566
+ ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
567
+ OSSL_DEPRECATEDIN_3_0
568
+ ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
569
+ OSSL_DEPRECATEDIN_3_0
570
+ ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
571
+ OSSL_DEPRECATEDIN_3_0
572
+ ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
573
+ OSSL_DEPRECATEDIN_3_0
574
+ ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
575
+ OSSL_DEPRECATEDIN_3_0
576
+ ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
577
+ OSSL_DEPRECATEDIN_3_0
578
+ ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
579
+ OSSL_DEPRECATEDIN_3_0
580
+ ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
581
+ OSSL_DEPRECATEDIN_3_0
582
+ const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
583
+ OSSL_DEPRECATEDIN_3_0
584
+ const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
585
+ OSSL_DEPRECATEDIN_3_0
586
+ const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
587
+ OSSL_DEPRECATEDIN_3_0
588
+ const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
589
+ OSSL_DEPRECATEDIN_3_0
590
+ const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
591
+ const char *str,
592
+ int len);
593
+ OSSL_DEPRECATEDIN_3_0
594
+ const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
595
+ const char *str, int len);
596
+ OSSL_DEPRECATEDIN_3_0
597
+ const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
598
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_get_flags(const ENGINE *e);
599
+ # endif
600
+
601
+ /*
602
+ * FUNCTIONAL functions. These functions deal with ENGINE structures that
603
+ * have (or will) be initialised for use. Broadly speaking, the structural
604
+ * functions are useful for iterating the list of available engine types,
605
+ * creating new engine types, and other "list" operations. These functions
606
+ * actually deal with ENGINEs that are to be used. As such these functions
607
+ * can fail (if applicable) when particular engines are unavailable - eg. if
608
+ * a hardware accelerator is not attached or not functioning correctly. Each
609
+ * ENGINE has 2 reference counts; structural and functional. Every time a
610
+ * functional reference is obtained or released, a corresponding structural
611
+ * reference is automatically obtained or released too.
612
+ */
613
+
614
+ /*
615
+ * Initialise an engine type for use (or up its reference count if it's
616
+ * already in use). This will fail if the engine is not currently operational
617
+ * and cannot initialise.
618
+ */
619
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
620
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e);
621
+ # endif
622
+ /*
623
+ * Free a functional reference to an engine type. This does not require a
624
+ * corresponding call to ENGINE_free as it also releases a structural
625
+ * reference.
626
+ */
627
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
628
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_finish(ENGINE *e);
629
+ # endif
630
+
631
+ /*
632
+ * The following functions handle keys that are stored in some secondary
633
+ * location, handled by the engine. The storage may be on a card or
634
+ * whatever.
635
+ */
636
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
637
+ OSSL_DEPRECATEDIN_3_0
638
+ EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
639
+ UI_METHOD *ui_method, void *callback_data);
640
+ OSSL_DEPRECATEDIN_3_0
641
+ EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
642
+ UI_METHOD *ui_method, void *callback_data);
643
+ OSSL_DEPRECATEDIN_3_0
644
+ int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn,
645
+ X509 **pcert, EVP_PKEY **ppkey,
646
+ STACK_OF(X509) **pother,
647
+ UI_METHOD *ui_method, void *callback_data);
648
+ # endif
649
+
650
+ /*
651
+ * This returns a pointer for the current ENGINE structure that is (by
652
+ * default) performing any RSA operations. The value returned is an
653
+ * incremented reference, so it should be free'd (ENGINE_finish) before it is
654
+ * discarded.
655
+ */
656
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
657
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RSA(void);
658
+ # endif
659
+ /* Same for the other "methods" */
660
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
661
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DSA(void);
662
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_EC(void);
663
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DH(void);
664
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RAND(void);
665
+ # endif
666
+ /*
667
+ * These functions can be used to get a functional reference to perform
668
+ * ciphering or digesting corresponding to "nid".
669
+ */
670
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
671
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_cipher_engine(int nid);
672
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_digest_engine(int nid);
673
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_meth_engine(int nid);
674
+ OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
675
+ # endif
676
+
677
+ /*
678
+ * This sets a new default ENGINE structure for performing RSA operations. If
679
+ * the result is non-zero (success) then the ENGINE structure will have had
680
+ * its reference count up'd so the caller should still free their own
681
+ * reference 'e'.
682
+ */
683
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
684
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RSA(ENGINE *e);
685
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_string(ENGINE *e,
686
+ const char *def_list);
687
+ # endif
688
+ /* Same for the other "methods" */
689
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
690
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DSA(ENGINE *e);
691
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_EC(ENGINE *e);
692
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DH(ENGINE *e);
693
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RAND(ENGINE *e);
694
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_ciphers(ENGINE *e);
695
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_digests(ENGINE *e);
696
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_meths(ENGINE *e);
697
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
698
+ # endif
699
+
700
+ /*
701
+ * The combination "set" - the flags are bitwise "OR"d from the
702
+ * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()"
703
+ * function, this function can result in unnecessary static linkage. If your
704
+ * application requires only specific functionality, consider using more
705
+ * selective functions.
706
+ */
707
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
708
+ OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default(ENGINE *e, unsigned int flags);
709
+ OSSL_DEPRECATEDIN_3_0 void ENGINE_add_conf_module(void);
710
+ # endif
711
+
712
+ /* Deprecated functions ... */
713
+ /* int ENGINE_clear_defaults(void); */
714
+
715
+ /**************************/
716
+ /* DYNAMIC ENGINE SUPPORT */
717
+ /**************************/
718
+
719
+ /* Binary/behaviour compatibility levels */
720
+ # define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000
721
+ /*
722
+ * Binary versions older than this are too old for us (whether we're a loader
723
+ * or a loadee)
724
+ */
725
+ # define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000
726
+
727
+ /*
728
+ * When compiling an ENGINE entirely as an external shared library, loadable
729
+ * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns'
730
+ * structure type provides the calling application's (or library's) error
731
+ * functionality and memory management function pointers to the loaded
732
+ * library. These should be used/set in the loaded library code so that the
733
+ * loading application's 'state' will be used/changed in all operations. The
734
+ * 'static_state' pointer allows the loaded library to know if it shares the
735
+ * same static data as the calling application (or library), and thus whether
736
+ * these callbacks need to be set or not.
737
+ */
738
+ typedef void *(*dyn_MEM_malloc_fn) (size_t, const char *, int);
739
+ typedef void *(*dyn_MEM_realloc_fn) (void *, size_t, const char *, int);
740
+ typedef void (*dyn_MEM_free_fn) (void *, const char *, int);
741
+ typedef struct st_dynamic_MEM_fns {
742
+ dyn_MEM_malloc_fn malloc_fn;
743
+ dyn_MEM_realloc_fn realloc_fn;
744
+ dyn_MEM_free_fn free_fn;
745
+ } dynamic_MEM_fns;
746
+ /*
747
+ * FIXME: Perhaps the memory and locking code (crypto.h) should declare and
748
+ * use these types so we (and any other dependent code) can simplify a bit??
749
+ */
750
+ /* The top-level structure */
751
+ typedef struct st_dynamic_fns {
752
+ void *static_state;
753
+ dynamic_MEM_fns mem_fns;
754
+ } dynamic_fns;
755
+
756
+ /*
757
+ * The version checking function should be of this prototype. NB: The
758
+ * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading
759
+ * code. If this function returns zero, it indicates a (potential) version
760
+ * incompatibility and the loaded library doesn't believe it can proceed.
761
+ * Otherwise, the returned value is the (latest) version supported by the
762
+ * loading library. The loader may still decide that the loaded code's
763
+ * version is unsatisfactory and could veto the load. The function is
764
+ * expected to be implemented with the symbol name "v_check", and a default
765
+ * implementation can be fully instantiated with
766
+ * IMPLEMENT_DYNAMIC_CHECK_FN().
767
+ */
768
+ typedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version);
769
+ # define IMPLEMENT_DYNAMIC_CHECK_FN() \
770
+ OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
771
+ OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
772
+ if (v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
773
+ return 0; }
774
+
775
+ /*
776
+ * This function is passed the ENGINE structure to initialise with its own
777
+ * function and command settings. It should not adjust the structural or
778
+ * functional reference counts. If this function returns zero, (a) the load
779
+ * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto
780
+ * the structure, and (c) the shared library will be unloaded. So
781
+ * implementations should do their own internal cleanup in failure
782
+ * circumstances otherwise they could leak. The 'id' parameter, if non-NULL,
783
+ * represents the ENGINE id that the loader is looking for. If this is NULL,
784
+ * the shared library can choose to return failure or to initialise a
785
+ * 'default' ENGINE. If non-NULL, the shared library must initialise only an
786
+ * ENGINE matching the passed 'id'. The function is expected to be
787
+ * implemented with the symbol name "bind_engine". A standard implementation
788
+ * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter
789
+ * 'fn' is a callback function that populates the ENGINE structure and
790
+ * returns an int value (zero for failure). 'fn' should have prototype;
791
+ * [static] int fn(ENGINE *e, const char *id);
792
+ */
793
+ typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
794
+ const dynamic_fns *fns);
795
+ # define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
796
+ OPENSSL_EXPORT \
797
+ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
798
+ OPENSSL_EXPORT \
799
+ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
800
+ if (ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \
801
+ CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \
802
+ fns->mem_fns.realloc_fn, \
803
+ fns->mem_fns.free_fn); \
804
+ OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL); \
805
+ skip_cbs: \
806
+ if (!fn(e, id)) return 0; \
807
+ return 1; }
808
+
809
+ /*
810
+ * If the loading application (or library) and the loaded ENGINE library
811
+ * share the same static data (eg. they're both dynamically linked to the
812
+ * same libcrypto.so) we need a way to avoid trying to set system callbacks -
813
+ * this would fail, and for the same reason that it's unnecessary to try. If
814
+ * the loaded ENGINE has (or gets from through the loader) its own copy of
815
+ * the libcrypto static data, we will need to set the callbacks. The easiest
816
+ * way to detect this is to have a function that returns a pointer to some
817
+ * static data and let the loading application and loaded ENGINE compare
818
+ * their respective values.
819
+ */
820
+ void *ENGINE_get_static_state(void);
821
+
822
+ # if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
823
+ # ifndef OPENSSL_NO_DEPRECATED_1_1_0
824
+ OSSL_DEPRECATEDIN_1_1_0 void ENGINE_setup_bsd_cryptodev(void);
825
+ # endif
826
+ # endif
827
+
828
+
829
+ # ifdef __cplusplus
830
+ }
831
+ # endif
832
+ # endif /* OPENSSL_NO_ENGINE */
833
+ #endif /* OPENSSL_ENGINE_H */
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/err_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/err.h"
8
+ #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
9
+ # include "./archs/linux-x32/asm/include/openssl/err.h"
10
+ #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
11
+ # include "./archs/linux-x86_64/asm/include/openssl/err.h"
12
+ #elif defined(OPENSSL_LINUX) && defined(__arm__)
13
+ # include "./archs/linux-armv4/asm/include/openssl/err.h"
14
+ #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
15
+ # include "./archs/linux-aarch64/asm/include/openssl/err.h"
16
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
17
+ # include "./archs/darwin-i386-cc/asm/include/openssl/err.h"
18
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
19
+ # include "./archs/darwin64-x86_64-cc/asm/include/openssl/err.h"
20
+ #elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__)
21
+ # include "./archs/darwin64-arm64-cc/asm/include/openssl/err.h"
22
+ #elif defined(_WIN32) && defined(_M_IX86)
23
+ # include "./archs/VC-WIN32/asm/include/openssl/err.h"
24
+ #elif defined(_WIN32) && defined(_M_X64)
25
+ # include "./archs/VC-WIN64A/asm/include/openssl/err.h"
26
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
27
+ # include "./archs/BSD-x86/asm/include/openssl/err.h"
28
+ #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
29
+ # include "./archs/BSD-x86_64/asm/include/openssl/err.h"
30
+ #elif defined(__sun) && defined(__i386__)
31
+ # include "./archs/solaris-x86-gcc/asm/include/openssl/err.h"
32
+ #elif defined(__sun) && defined(__x86_64__)
33
+ # include "./archs/solaris64-x86_64-gcc/asm/include/openssl/err.h"
34
+ #elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN)
35
+ # include "./archs/linux-ppc64le/asm/include/openssl/err.h"
36
+ #elif defined(_AIX) && defined(_ARCH_PPC64)
37
+ # include "./archs/aix64-gcc-as/asm/include/openssl/err.h"
38
+ #elif defined(OPENSSL_LINUX) && defined(__s390x__)
39
+ # include "./archs/linux64-s390x/asm/include/openssl/err.h"
40
+ #elif defined(OPENSSL_LINUX) && defined(__s390__)
41
+ # include "./archs/linux32-s390x/asm/include/openssl/err.h"
42
+ #else
43
+ # include "./archs/linux-elf/asm/include/openssl/err.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/evp.h ADDED
The diff for this file is too large to render. See raw diff
 
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/hpke.h ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2022-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
+ /* APIs and data structures for HPKE (RFC9180) */
11
+ #ifndef OSSL_HPKE_H
12
+ # define OSSL_HPKE_H
13
+ # pragma once
14
+
15
+ # include <openssl/types.h>
16
+
17
+ /* HPKE modes */
18
+ # define OSSL_HPKE_MODE_BASE 0 /* Base mode */
19
+ # define OSSL_HPKE_MODE_PSK 1 /* Pre-shared key mode */
20
+ # define OSSL_HPKE_MODE_AUTH 2 /* Authenticated mode */
21
+ # define OSSL_HPKE_MODE_PSKAUTH 3 /* PSK+authenticated mode */
22
+
23
+ /*
24
+ * Max for ikm, psk, pskid, info and exporter contexts.
25
+ * RFC9180, section 7.2.1 RECOMMENDS 64 octets but we have test vectors from
26
+ * Appendix A.6.1 with a 66 octet IKM so we'll allow that.
27
+ */
28
+ # define OSSL_HPKE_MAX_PARMLEN 66
29
+ # define OSSL_HPKE_MIN_PSKLEN 32
30
+ # define OSSL_HPKE_MAX_INFOLEN 1024
31
+
32
+ /*
33
+ * The (16bit) HPKE algorithm ID IANA codepoints
34
+ * If/when new IANA codepoints are added there are tables in
35
+ * crypto/hpke/hpke_util.c that must also be updated.
36
+ */
37
+ # define OSSL_HPKE_KEM_ID_RESERVED 0x0000 /* not used */
38
+ # define OSSL_HPKE_KEM_ID_P256 0x0010 /* NIST P-256 */
39
+ # define OSSL_HPKE_KEM_ID_P384 0x0011 /* NIST P-384 */
40
+ # define OSSL_HPKE_KEM_ID_P521 0x0012 /* NIST P-521 */
41
+ # define OSSL_HPKE_KEM_ID_X25519 0x0020 /* Curve25519 */
42
+ # define OSSL_HPKE_KEM_ID_X448 0x0021 /* Curve448 */
43
+
44
+ # define OSSL_HPKE_KDF_ID_RESERVED 0x0000 /* not used */
45
+ # define OSSL_HPKE_KDF_ID_HKDF_SHA256 0x0001 /* HKDF-SHA256 */
46
+ # define OSSL_HPKE_KDF_ID_HKDF_SHA384 0x0002 /* HKDF-SHA384 */
47
+ # define OSSL_HPKE_KDF_ID_HKDF_SHA512 0x0003 /* HKDF-SHA512 */
48
+
49
+ # define OSSL_HPKE_AEAD_ID_RESERVED 0x0000 /* not used */
50
+ # define OSSL_HPKE_AEAD_ID_AES_GCM_128 0x0001 /* AES-GCM-128 */
51
+ # define OSSL_HPKE_AEAD_ID_AES_GCM_256 0x0002 /* AES-GCM-256 */
52
+ # define OSSL_HPKE_AEAD_ID_CHACHA_POLY1305 0x0003 /* Chacha20-Poly1305 */
53
+ # define OSSL_HPKE_AEAD_ID_EXPORTONLY 0xFFFF /* export-only fake ID */
54
+
55
+ /* strings for suite components */
56
+ # define OSSL_HPKE_KEMSTR_P256 "P-256" /* KEM id 0x10 */
57
+ # define OSSL_HPKE_KEMSTR_P384 "P-384" /* KEM id 0x11 */
58
+ # define OSSL_HPKE_KEMSTR_P521 "P-521" /* KEM id 0x12 */
59
+ # define OSSL_HPKE_KEMSTR_X25519 "X25519" /* KEM id 0x20 */
60
+ # define OSSL_HPKE_KEMSTR_X448 "X448" /* KEM id 0x21 */
61
+ # define OSSL_HPKE_KDFSTR_256 "hkdf-sha256" /* KDF id 1 */
62
+ # define OSSL_HPKE_KDFSTR_384 "hkdf-sha384" /* KDF id 2 */
63
+ # define OSSL_HPKE_KDFSTR_512 "hkdf-sha512" /* KDF id 3 */
64
+ # define OSSL_HPKE_AEADSTR_AES128GCM "aes-128-gcm" /* AEAD id 1 */
65
+ # define OSSL_HPKE_AEADSTR_AES256GCM "aes-256-gcm" /* AEAD id 2 */
66
+ # define OSSL_HPKE_AEADSTR_CP "chacha20-poly1305" /* AEAD id 3 */
67
+ # define OSSL_HPKE_AEADSTR_EXP "exporter" /* AEAD id 0xff */
68
+
69
+ /*
70
+ * Roles for use in creating an OSSL_HPKE_CTX, most
71
+ * important use of this is to control nonce reuse.
72
+ */
73
+ # define OSSL_HPKE_ROLE_SENDER 0
74
+ # define OSSL_HPKE_ROLE_RECEIVER 1
75
+
76
+ # ifdef __cplusplus
77
+ extern "C" {
78
+ # endif
79
+
80
+ typedef struct {
81
+ uint16_t kem_id; /* Key Encapsulation Method id */
82
+ uint16_t kdf_id; /* Key Derivation Function id */
83
+ uint16_t aead_id; /* AEAD alg id */
84
+ } OSSL_HPKE_SUITE;
85
+
86
+ /**
87
+ * Suite constants, use this like:
88
+ * OSSL_HPKE_SUITE myvar = OSSL_HPKE_SUITE_DEFAULT;
89
+ */
90
+ # ifndef OPENSSL_NO_ECX
91
+ # define OSSL_HPKE_SUITE_DEFAULT \
92
+ {\
93
+ OSSL_HPKE_KEM_ID_X25519, \
94
+ OSSL_HPKE_KDF_ID_HKDF_SHA256, \
95
+ OSSL_HPKE_AEAD_ID_AES_GCM_128 \
96
+ }
97
+ # else
98
+ # define OSSL_HPKE_SUITE_DEFAULT \
99
+ {\
100
+ OSSL_HPKE_KEM_ID_P256, \
101
+ OSSL_HPKE_KDF_ID_HKDF_SHA256, \
102
+ OSSL_HPKE_AEAD_ID_AES_GCM_128 \
103
+ }
104
+ #endif
105
+
106
+ typedef struct ossl_hpke_ctx_st OSSL_HPKE_CTX;
107
+
108
+ OSSL_HPKE_CTX *OSSL_HPKE_CTX_new(int mode, OSSL_HPKE_SUITE suite, int role,
109
+ OSSL_LIB_CTX *libctx, const char *propq);
110
+ void OSSL_HPKE_CTX_free(OSSL_HPKE_CTX *ctx);
111
+
112
+ int OSSL_HPKE_encap(OSSL_HPKE_CTX *ctx,
113
+ unsigned char *enc, size_t *enclen,
114
+ const unsigned char *pub, size_t publen,
115
+ const unsigned char *info, size_t infolen);
116
+ int OSSL_HPKE_seal(OSSL_HPKE_CTX *ctx,
117
+ unsigned char *ct, size_t *ctlen,
118
+ const unsigned char *aad, size_t aadlen,
119
+ const unsigned char *pt, size_t ptlen);
120
+
121
+ int OSSL_HPKE_keygen(OSSL_HPKE_SUITE suite,
122
+ unsigned char *pub, size_t *publen, EVP_PKEY **priv,
123
+ const unsigned char *ikm, size_t ikmlen,
124
+ OSSL_LIB_CTX *libctx, const char *propq);
125
+ int OSSL_HPKE_decap(OSSL_HPKE_CTX *ctx,
126
+ const unsigned char *enc, size_t enclen,
127
+ EVP_PKEY *recippriv,
128
+ const unsigned char *info, size_t infolen);
129
+ int OSSL_HPKE_open(OSSL_HPKE_CTX *ctx,
130
+ unsigned char *pt, size_t *ptlen,
131
+ const unsigned char *aad, size_t aadlen,
132
+ const unsigned char *ct, size_t ctlen);
133
+
134
+ int OSSL_HPKE_export(OSSL_HPKE_CTX *ctx,
135
+ unsigned char *secret,
136
+ size_t secretlen,
137
+ const unsigned char *label,
138
+ size_t labellen);
139
+
140
+ int OSSL_HPKE_CTX_set1_authpriv(OSSL_HPKE_CTX *ctx, EVP_PKEY *priv);
141
+ int OSSL_HPKE_CTX_set1_authpub(OSSL_HPKE_CTX *ctx,
142
+ const unsigned char *pub,
143
+ size_t publen);
144
+ int OSSL_HPKE_CTX_set1_psk(OSSL_HPKE_CTX *ctx,
145
+ const char *pskid,
146
+ const unsigned char *psk, size_t psklen);
147
+
148
+ int OSSL_HPKE_CTX_set1_ikme(OSSL_HPKE_CTX *ctx,
149
+ const unsigned char *ikme, size_t ikmelen);
150
+
151
+ int OSSL_HPKE_CTX_set_seq(OSSL_HPKE_CTX *ctx, uint64_t seq);
152
+ int OSSL_HPKE_CTX_get_seq(OSSL_HPKE_CTX *ctx, uint64_t *seq);
153
+
154
+ int OSSL_HPKE_suite_check(OSSL_HPKE_SUITE suite);
155
+ int OSSL_HPKE_get_grease_value(const OSSL_HPKE_SUITE *suite_in,
156
+ OSSL_HPKE_SUITE *suite,
157
+ unsigned char *enc, size_t *enclen,
158
+ unsigned char *ct, size_t ctlen,
159
+ OSSL_LIB_CTX *libctx, const char *propq);
160
+ int OSSL_HPKE_str2suite(const char *str, OSSL_HPKE_SUITE *suite);
161
+ size_t OSSL_HPKE_get_ciphertext_size(OSSL_HPKE_SUITE suite, size_t clearlen);
162
+ size_t OSSL_HPKE_get_public_encap_size(OSSL_HPKE_SUITE suite);
163
+ size_t OSSL_HPKE_get_recommended_ikmelen(OSSL_HPKE_SUITE suite);
164
+
165
+ # ifdef __cplusplus
166
+ }
167
+ # endif
168
+
169
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/http.h ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.
3
+ * Copyright Siemens AG 2018-2020
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_HTTP_H
12
+ # define OPENSSL_HTTP_H
13
+ # pragma once
14
+
15
+ # include <openssl/opensslconf.h>
16
+
17
+ # include <openssl/bio.h>
18
+ # include <openssl/asn1.h>
19
+ # include <openssl/conf.h>
20
+
21
+
22
+ # ifdef __cplusplus
23
+ extern "C" {
24
+ # endif
25
+
26
+ # define OSSL_HTTP_NAME "http"
27
+ # define OSSL_HTTPS_NAME "https"
28
+ # define OSSL_HTTP_PREFIX OSSL_HTTP_NAME"://"
29
+ # define OSSL_HTTPS_PREFIX OSSL_HTTPS_NAME"://"
30
+ # define OSSL_HTTP_PORT "80"
31
+ # define OSSL_HTTPS_PORT "443"
32
+ # define OPENSSL_NO_PROXY "NO_PROXY"
33
+ # define OPENSSL_HTTP_PROXY "HTTP_PROXY"
34
+ # define OPENSSL_HTTPS_PROXY "HTTPS_PROXY"
35
+
36
+ /* We want to have this even in case of OPENSSL_NO_HTTP */
37
+ int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost,
38
+ char **pport, int *pport_num,
39
+ char **ppath, char **pquery, char **pfrag);
40
+
41
+ # ifndef OPENSSL_NO_HTTP
42
+
43
+ # define OSSL_HTTP_DEFAULT_MAX_LINE_LEN (4 * 1024)
44
+ # define OSSL_HTTP_DEFAULT_MAX_RESP_LEN (100 * 1024)
45
+ # define OSSL_HTTP_DEFAULT_MAX_CRL_LEN (32 * 1024 * 1024)
46
+ # define OSSL_HTTP_DEFAULT_MAX_RESP_HDR_LINES 256
47
+
48
+
49
+ /* Low-level HTTP API */
50
+ OSSL_HTTP_REQ_CTX *OSSL_HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int buf_size);
51
+ void OSSL_HTTP_REQ_CTX_free(OSSL_HTTP_REQ_CTX *rctx);
52
+ int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx, int method_POST,
53
+ const char *server, const char *port,
54
+ const char *path);
55
+ int OSSL_HTTP_REQ_CTX_add1_header(OSSL_HTTP_REQ_CTX *rctx,
56
+ const char *name, const char *value);
57
+ int OSSL_HTTP_REQ_CTX_set_expected(OSSL_HTTP_REQ_CTX *rctx,
58
+ const char *content_type, int asn1,
59
+ int timeout, int keep_alive);
60
+ int OSSL_HTTP_REQ_CTX_set1_req(OSSL_HTTP_REQ_CTX *rctx, const char *content_type,
61
+ const ASN1_ITEM *it, const ASN1_VALUE *req);
62
+ int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx);
63
+ int OSSL_HTTP_REQ_CTX_nbio_d2i(OSSL_HTTP_REQ_CTX *rctx,
64
+ ASN1_VALUE **pval, const ASN1_ITEM *it);
65
+ BIO *OSSL_HTTP_REQ_CTX_exchange(OSSL_HTTP_REQ_CTX *rctx);
66
+ BIO *OSSL_HTTP_REQ_CTX_get0_mem_bio(const OSSL_HTTP_REQ_CTX *rctx);
67
+ size_t OSSL_HTTP_REQ_CTX_get_resp_len(const OSSL_HTTP_REQ_CTX *rctx);
68
+ void OSSL_HTTP_REQ_CTX_set_max_response_length(OSSL_HTTP_REQ_CTX *rctx,
69
+ unsigned long len);
70
+ void OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines(OSSL_HTTP_REQ_CTX *rctx,
71
+ size_t count);
72
+ int OSSL_HTTP_is_alive(const OSSL_HTTP_REQ_CTX *rctx);
73
+
74
+ /* High-level HTTP API */
75
+ typedef BIO *(*OSSL_HTTP_bio_cb_t)(BIO *bio, void *arg, int connect, int detail);
76
+ OSSL_HTTP_REQ_CTX *OSSL_HTTP_open(const char *server, const char *port,
77
+ const char *proxy, const char *no_proxy,
78
+ int use_ssl, BIO *bio, BIO *rbio,
79
+ OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
80
+ int buf_size, int overall_timeout);
81
+ int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port,
82
+ const char *proxyuser, const char *proxypass,
83
+ int timeout, BIO *bio_err, const char *prog);
84
+ int OSSL_HTTP_set1_request(OSSL_HTTP_REQ_CTX *rctx, const char *path,
85
+ const STACK_OF(CONF_VALUE) *headers,
86
+ const char *content_type, BIO *req,
87
+ const char *expected_content_type, int expect_asn1,
88
+ size_t max_resp_len, int timeout, int keep_alive);
89
+ BIO *OSSL_HTTP_exchange(OSSL_HTTP_REQ_CTX *rctx, char **redirection_url);
90
+ BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
91
+ BIO *bio, BIO *rbio,
92
+ OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
93
+ int buf_size, const STACK_OF(CONF_VALUE) *headers,
94
+ const char *expected_content_type, int expect_asn1,
95
+ size_t max_resp_len, int timeout);
96
+ BIO *OSSL_HTTP_transfer(OSSL_HTTP_REQ_CTX **prctx,
97
+ const char *server, const char *port,
98
+ const char *path, int use_ssl,
99
+ const char *proxy, const char *no_proxy,
100
+ BIO *bio, BIO *rbio,
101
+ OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
102
+ int buf_size, const STACK_OF(CONF_VALUE) *headers,
103
+ const char *content_type, BIO *req,
104
+ const char *expected_content_type, int expect_asn1,
105
+ size_t max_resp_len, int timeout, int keep_alive);
106
+ int OSSL_HTTP_close(OSSL_HTTP_REQ_CTX *rctx, int ok);
107
+
108
+ /* Auxiliary functions */
109
+ int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost,
110
+ char **pport, int *pport_num,
111
+ char **ppath, char **pquery, char **pfrag);
112
+ const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy,
113
+ const char *server, int use_ssl);
114
+
115
+ # endif /* !defined(OPENSSL_NO_HTTP) */
116
+ # ifdef __cplusplus
117
+ }
118
+ # endif
119
+ #endif /* !defined(OPENSSL_HTTP_H) */
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/indicator.h ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 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_INDICATOR_H
11
+ # define OPENSSL_INDICATOR_H
12
+ # pragma once
13
+
14
+ # ifdef __cplusplus
15
+ extern "C" {
16
+ # endif
17
+
18
+ #include <openssl/params.h>
19
+
20
+ typedef int (OSSL_INDICATOR_CALLBACK)(const char *type, const char *desc,
21
+ const OSSL_PARAM params[]);
22
+
23
+ void OSSL_INDICATOR_set_callback(OSSL_LIB_CTX *libctx,
24
+ OSSL_INDICATOR_CALLBACK *cb);
25
+ void OSSL_INDICATOR_get_callback(OSSL_LIB_CTX *libctx,
26
+ OSSL_INDICATOR_CALLBACK **cb);
27
+
28
+ # ifdef __cplusplus
29
+ }
30
+ # endif
31
+ #endif /* OPENSSL_INDICATOR_H */
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/md4.h ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_MD4_H
11
+ # define OPENSSL_MD4_H
12
+ # pragma once
13
+
14
+ # include <openssl/macros.h>
15
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
16
+ # define HEADER_MD4_H
17
+ # endif
18
+
19
+ # include <openssl/opensslconf.h>
20
+
21
+ # ifndef OPENSSL_NO_MD4
22
+ # include <openssl/e_os2.h>
23
+ # include <stddef.h>
24
+ # ifdef __cplusplus
25
+ extern "C" {
26
+ # endif
27
+
28
+ # define MD4_DIGEST_LENGTH 16
29
+
30
+ # if !defined(OPENSSL_NO_DEPRECATED_3_0)
31
+
32
+ /*-
33
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34
+ * ! MD4_LONG has to be at least 32 bits wide. !
35
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
36
+ */
37
+ # define MD4_LONG unsigned int
38
+
39
+ # define MD4_CBLOCK 64
40
+ # define MD4_LBLOCK (MD4_CBLOCK/4)
41
+
42
+ typedef struct MD4state_st {
43
+ MD4_LONG A, B, C, D;
44
+ MD4_LONG Nl, Nh;
45
+ MD4_LONG data[MD4_LBLOCK];
46
+ unsigned int num;
47
+ } MD4_CTX;
48
+ # endif
49
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
50
+ OSSL_DEPRECATEDIN_3_0 int MD4_Init(MD4_CTX *c);
51
+ OSSL_DEPRECATEDIN_3_0 int MD4_Update(MD4_CTX *c, const void *data, size_t len);
52
+ OSSL_DEPRECATEDIN_3_0 int MD4_Final(unsigned char *md, MD4_CTX *c);
53
+ OSSL_DEPRECATEDIN_3_0 unsigned char *MD4(const unsigned char *d, size_t n,
54
+ unsigned char *md);
55
+ OSSL_DEPRECATEDIN_3_0 void MD4_Transform(MD4_CTX *c, const unsigned char *b);
56
+ # endif
57
+
58
+ # ifdef __cplusplus
59
+ }
60
+ # endif
61
+ # endif
62
+
63
+ #endif
data_prepare/node-v24.12.0-linux-x64/include/node/openssl/ocsp.h ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #if defined(OPENSSL_NO_ASM)
2
+ # include "./ocsp_no-asm.h"
3
+ #else
4
+ # include "./ocsp_asm.h"
5
+ #endif