Skip to content

fix(deps): declare zeroize's alloc feature explicitly - #175

Merged
gonzafg2 merged 1 commit into
mainfrom
fix/zeroize-alloc-explicit
Oct 11, 2026
Merged

gonzafg2 merged 1 commit into
mainfrom
fix/zeroize-alloc-explicit

Conversation

@gonzafg2

Copy link
Copy Markdown
Owner

Summary

The workspace uses Zeroizing<Vec<u8>> (kex.rs:766, auth.rs:309, transport.rs:1402) and Zeroizing<String>. Both need zeroize's alloc feature, but the workspace never declared it. Today it arrives only through feature unification from ed25519-dalek's std feature:

$ cargo tree -e features -i zeroize --workspace
├── zeroize feature "alloc"
│   ├── ed25519-dalek feature "alloc" (*)
│   └── curve25519-dalek feature "alloc" (*)
└── zeroize feature "zeroize_derive"

ed25519-dalek 3.x removes the std feature. Without this line, the build breaks in 35 lib places and 51 lib-test places, all with the same cause (E0277: Zeroizing<Vec<u8>> does not implement Zeroize), with no first-party code change. So this PR declares the feature where it is used. It is one line in the workspace Cargo.toml.

This is a prerequisite for the coordinated dalek 3.x bump tracked on #109 (ADR-0036 and its implementation come in follow-up PRs). It is also correct on its own: a feature the code relies on should not depend on another crate's feature set.

Verification

  • cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test --workspace: 34 + 103 + 35 passed.
  • cargo build --workspace --release: ok.
  • No dependency or lockfile change; alloc was already active through unification.

Refs #109

https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW

Zeroizing<Vec<u8>> (kex.rs, auth.rs, transport.rs) and Zeroizing<String>
need zeroize's alloc feature. The workspace never declared it: it
arrives only through feature unification from ed25519-dalek's std
feature (ed25519-dalek/std -> alloc -> zeroize?/alloc and
curve25519-dalek/alloc). Dropping std from ed25519-dalek, as its 3.x
line requires, would break the build in 35 places with no code change
of ours. Declare it where it is used.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

Copy link
Copy Markdown

PR Review: fix(deps): declare zeroize's alloc feature explicitly (#175)

Decision: 🟢 Approved
Iteration: First review
Lenses applied: Rust / dependency manifest (Cargo.toml); CI and ADR/RFC lenses not applicable (no workflow or docs/ changes)

Executive summary

The PR adds alloc to the workspace zeroize feature list in Cargo.toml:54, one line, so that Zeroizing<Vec<u8>> (used at kex.rs:766, auth.rs:309, transport.rs:1402) no longer depends on another crate's feature unification to compile. zeroize was already a direct dependency of both crates, so no dependency is introduced, no lockfile changes, and cargo check --workspace --all-targets passes. The change is well-scoped, correctly justified, and touches no crypto, protocol, or CI surface.

Analysis

Verified against the hard constraints:

  • Memory-safe (§4, ADR-0018) — only Cargo.toml changed; no first-party unsafe. zeroize's internal unsafe is the audited dependency layer.
  • Post-quantum / zero legacy — the change touches no KEX, cipher, or auth list. No legacy primitive is introduced.
  • Small surface (commitment chore(security): mark quantumssh.org aliases as live #4) — zeroize was already a direct dependency (crates/quantumssh/Cargo.toml:23, crates/quantumssh-core/Cargo.toml:30); only a feature is added to an existing entry. alloc is a dependency-free feature (zeroize-1.9.0/Cargo.toml: alloc = []) and does not enable std; cargo tree -e features -i zeroize shows no new transitive crate and no std node. Cargo.lock is not in the diff, consistent with the PR description.
  • Licensing (commitment docs: add operations and verification guide #5) — zeroize is Apache-2.0 OR MIT, within the deny.toml allow-list. No relicensing.
  • Commit provenance — fe69b5c reports .commit.verification.verified = true (reason valid) via the GitHub API, which is what branch protection enforces; commit-lint passes.

The claimed mechanism is accurate: impl<Z> Zeroize for Vec<Z> is gated behind #[cfg(feature = "alloc")], so the explicit declaration is the correct fix for the dalek 3.x migration window (RFC-0007/RFC-0009 apply to primitives, not build features; nothing here is deprecated-or-disallowed crypto).

No finding reached the ≥ 80 threshold. One non-blocking accuracy nit: the comment on Cargo.toml:54 and the commit body mention Zeroizing<String>, but no such type exists in crates/ — only Zeroizing<Vec<u8>>. Informational only; it does not affect the change's correctness or the build.

Decision: 🟢 Approved

github run

@claude

claude Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…nes, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…nes, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2
gonzafg2 merged commit f4b3966 into main Oct 11, 2026
12 of 13 checks passed
@gonzafg2
gonzafg2 deleted the fix/zeroize-alloc-explicit branch October 11, 2026 23:17
gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…ther (Proposed) (#177)

* docs(adr): ADR-0036 — move ed25519-dalek and x25519-dalek to 3.x together (Proposed)

The coordinated bump the #109 comment of 2026-07-18 deferred, subsidiary
to RFC-0003. Evaluates the four points that comment asked for: API
(ed25519-dalek 3 drops std; no first-party code change needed), zeroize
and static_secrets (kept; x25519 secrets now erase on drop only), MSRV
(1.85, below the workspace's 1.92), and maturity/audit (no advisory on
either line; Verus coverage applies to curve25519-dalek 4.1.3, not 5.0;
no known public audit of 5.0/3.0).

States the value plainly: no vulnerability fixed; Cargo.lock 102 -> 88,
no duplicated crates in quantumssh-core, signature 3 aligned with
ADR-0035's ml-dsa. Records that the dalek crates are BSD-3-Clause
(RFC-0003 says Apache-2.0 or MIT; deny.toml allows BSD-3-Clause).

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — review fixes (2.x release date, two manifest lines, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — ed25519-dalek 3's runtime vs optional/dev dependencies

opencode review #2 suggestion on #177: getrandom 0.4 is a dev-dependency
of ed25519-dalek 3.0.0, and rand_core 0.10 and signature 3 are optional
there (signature 3 still enters through ed25519 3, a normal dependency).
The API bullet now names the runtime moves only. Verified against the
crates.io dependency metadata of ed25519-dalek 3.0.0 and ed25519 3.0.0.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — yanked 4.2.0 and licence cell wording

opencode suggestions on #177 (review #3) and #179 (review #2):
- curve25519-dalek 4.2.0 was published 2025-07-09 and yanked; both
  maintenance statements now say 'no usable 4.x release since
  2024-06-18' and name it (verified on crates.io).
- The licence cell said 'all six' with no referent; it now says 'all
  three crates'.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — cite RFC-0003's Guide-level explanation for the primitive stack

opencode suggestion on #179 (review #3): RFC-0003 section 'Operational
dependencies of this decision' only lists four follow-up ADRs and never
mentions the dalek crates; the primitive stack (with x25519-dalek and
ed25519-dalek) is in its Guide-level explanation. Related and Links now
point there, consistent with the licence note.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

---------

Signed-off-by: Gonzalo Fleming <[email protected]>
gonzafg2 added a commit that referenced this pull request Oct 11, 2026
…-dalek 5) (#179)

* docs(adr): ADR-0036 — move ed25519-dalek and x25519-dalek to 3.x together (Proposed)

The coordinated bump the #109 comment of 2026-07-18 deferred, subsidiary
to RFC-0003. Evaluates the four points that comment asked for: API
(ed25519-dalek 3 drops std; no first-party code change needed), zeroize
and static_secrets (kept; x25519 secrets now erase on drop only), MSRV
(1.85, below the workspace's 1.92), and maturity/audit (no advisory on
either line; Verus coverage applies to curve25519-dalek 4.1.3, not 5.0;
no known public audit of 5.0/3.0).

States the value plainly: no vulnerability fixed; Cargo.lock 102 -> 88,
no duplicated crates in quantumssh-core, signature 3 aligned with
ADR-0035's ml-dsa. Records that the dalek crates are BSD-3-Clause
(RFC-0003 says Apache-2.0 or MIT; deny.toml allows BSD-3-Clause).

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* fix(deps): declare zeroize's alloc feature explicitly

Zeroizing<Vec<u8>> (kex.rs, auth.rs, transport.rs) and Zeroizing<String>
need zeroize's alloc feature. The workspace never declared it: it
arrives only through feature unification from ed25519-dalek's std
feature (ed25519-dalek/std -> alloc -> zeroize?/alloc and
curve25519-dalek/alloc). Dropping std from ed25519-dalek, as its 3.x
line requires, would break the build in 35 places with no code change
of ours. Declare it where it is used.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* chore(deps): move ed25519-dalek and x25519-dalek to 3.0.0 (curve25519-dalek 5)

Implements ADR-0036. ed25519-dalek drops the removed std feature and the
unused rand_core feature; x25519-dalek keeps static_secrets and zeroize.
No first-party code change.

Cargo.lock: 102 -> 88 packages; cargo tree -d -e normal -p
quantumssh-core prints nothing (was sha2, digest, rand_core,
block-buffer, crypto-common, cpufeatures in two versions each).
fmt, clippy -D warnings, test --workspace (34 + 103 + 35) and
build --release pass.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 Accepted with the implementing PR #179

Flips Status to Accepted inside the implementing PR (repo pattern since
#128), points Links/Decision at #179, and historicises the three
drafting-time phrasings (table header, advisory sentence, ADR-0035
availability).

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — review fixes (2.x release date, two manifest lines, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — review fixes (2.x release date, two manifest lines, present vs future controls)

claude-review on #177:
- 'The 4.x/2.x line has had no release since mid-2024' was false for
  ed25519-dalek 2.2.0 (2025-07-09); now scoped per crate.
- The diff is two manifest lines (zeroize/alloc belongs to #175).
- The Verus-loss paragraph listed Phase-3 fuzzing as a present control;
  present controls (RFC 7748 vectors, OpenSSH interop gate) are now
  separated from the future one, and the text says nothing currently
  replaces the formal guarantee.

opencode suggestions on #177 and #179:
- Refers to 'the ml-dsa ADR proposed in #174' instead of citing the
  not-yet-permanent number ADR-0035 as established.
- pkcs8/der/spki leave Cargo.lock (they are not compiled today).
- The RFC-0003 licence sentence lives in its Guide-level explanation.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — ed25519-dalek 3's runtime vs optional/dev dependencies

opencode review #2 suggestion on #177: getrandom 0.4 is a dev-dependency
of ed25519-dalek 3.0.0, and rand_core 0.10 and signature 3 are optional
there (signature 3 still enters through ed25519 3, a normal dependency).
The API bullet now names the runtime moves only. Verified against the
crates.io dependency metadata of ed25519-dalek 3.0.0 and ed25519 3.0.0.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — yanked 4.2.0 and licence cell wording

opencode suggestions on #177 (review #3) and #179 (review #2):
- curve25519-dalek 4.2.0 was published 2025-07-09 and yanked; both
  maintenance statements now say 'no usable 4.x release since
  2024-06-18' and name it (verified on crates.io).
- The licence cell said 'all six' with no referent; it now says 'all
  three crates'.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0036 — cite RFC-0003's Guide-level explanation for the primitive stack

opencode suggestion on #179 (review #3): RFC-0003 section 'Operational
dependencies of this decision' only lists four follow-up ADRs and never
mentions the dalek crates; the primitive stack (with x25519-dalek and
ed25519-dalek) is in its Guide-level explanation. Related and Links now
point there, consistent with the licence note.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

---------

Signed-off-by: Gonzalo Fleming <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant