1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# encryption-rust CI:stable 全量测试、MSRV 守护、依赖安全审计
name: CI
on:
push:
branches:
pull_request:
branches:
schedule:
# 每周一 05:17 UTC 触发(只影响 audit job)
- cron: "17 5 * * 1"
jobs:
# stable 工具链:格式 → clippy(全 feature,警告即错误)→ 测试(全 feature)
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
# 该 action 默认只装 minimal profile,fmt/clippy 需显式声明
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-features --all-targets -- -D warnings
- run: cargo test --all-features
# 守 Cargo.toml 声明的 rust-version = 1.88;
# 不带 --all-features:8 个框架依赖自身的 MSRV 可能高于 1.88
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88.0
- run: cargo check
# RustSec 安全审计:仅 push 与每周 cron 运行,PR 上跳过
audit:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
# audit-check 需要 checks: write 落检查结果、issues: write 在发现漏洞时建 issue
permissions:
contents: read
checks: write
issues: write
steps:
- uses: actions/checkout@v4
- uses: rustsec/audit-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
# RUSTSEC-2026-0258(h2 0.3.27 无界空 DATA 帧,低危):由 actix-http 3.18
# 与 rocket_http 0.5 传递引入(均为可选框架依赖);h2 0.3 线已停止维护、
# 该公告只修 >=0.4.16,锁内另一份 h2 0.4.19 已是修补版。
# 待 actix-web / rocket 迁到 hyper 1.x 后删除本条。
#
# RUSTSEC-2023-0071(rsa 0.9.10「Marvin」时序侧信道,CVSS AV:N/AC:H):
# 上游至今无补丁(patched = [],0.9.10 与 0.10.0-rc 均受影响;RSA#626/#680/#702
# 跟踪中)。本库的 rsa-oaep-sha256 解密固定走 decrypt_blinded(公告承认的缓解
# 方向),且已在模块文档、SECURITY.md 与 README 标注「网络暴露场景优先
# ECDH / X25519 / Ed25519 / ML-KEM」。待 rsa crate 落地常量时间填充、
# 或本库移除该算法后删除本条。
ignore: RUSTSEC-2026-0258,RUSTSEC-2023-0071