Files
TransPyC/ViperOpenSSLProject/README.md
T

49 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ViperOpenSSLProject
基于 [ViperTemplateProject](../ViperTemplateProject) 模板创建的 **OpenSSL 3.x FFI 测试工程**,
用来验证 `includes/openssl` FFI 层(摘要/哈希、EVP、证书 PKI、SSL/TLS)的链接与调用。
## 说明
- FFI 层源码在 `../includes/openssl/`(`import openssl` 使用)。
- 当前 App/main.vp 为「版本 + SHA256/MD5 摘要」演示。
- 尚未决定链接目标(msys2 预装 3.6.2 动态库 或 openssl_358_C 自编译静态库),
本工程 `project.vpj` **暂未配置 openssl 链接参数**,需要时再补。
## 目录结构
```
ViperOpenSSLProject/
├── .gitignore
├── LICENSE
├── README.md
├── project.vpj # 编译/链接配置(openssl 链接目标待定)
└── App/
└── main.vp # 版本 + 摘要演示
```
## 链接参考(后续选择其一填入 project.vpj)
### 方式 A:msys2 预装 3.6.2 动态库(推荐先试)
在 `project.vpj` 的 `linker.flags` 中加入:
```
"-L D:/msys64/mingw64/lib",
"-lcrypto",
"-lssl"
```
运行 app.exe 前需把 `D:/msys64/mingw64/bin` 加入 PATH(`libcrypto-3-x64.dll` / `libssl-3-x64.dll`)。
### 方式 B:openssl_358_C 源码自编译静态库
先用 perl Configure + mingw 编译 `../includes/openssl/openssl_358_C`,再把
生成的 `libcrypto.a` / `libssl.a` 填入 `linker.static_libs`。
## 编译运行
```powershell
cd D:\Users\TermiNexus\Desktop\TransPyC\ViperOpenSSLProject
python ..\Projectrans.py --project .\project.vpj --clean-cache=false
.\output\app.exe # 注意:openssl 链接参数配好前编译/链接会失败
```