Skip to content

chore(deps): use sev from the branch of virtee/sev#418 (rsa 0.10, p384 0.14) - #12377

Open
basvandijk wants to merge 4 commits into
masterfrom
bas/sev-from-virtee-sev-418
Open

basvandijk wants to merge 4 commits into
masterfrom
bas/sev-from-virtee-sev-418

Conversation

@basvandijk

@basvandijk basvandijk commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Points sev at the head of virtee/sev#418 (commit 2539202729) until a sev release includes that PR. It moves sev to rsa 0.10, p384 0.14 and x509-cert 0.3. Stacked on #12374.

Changes

  • Cargo.toml and bazel/rust.MODULE.bazel: sev comes from https://github.com/DGonzalezVillal/virtee-sev at rev = "2539202729be739909c80ff807245e2030302557".

    • Both have a TODO to switch back to crates.io once a sev release includes Update Rust to 1.93.1 and it's dependencies virtee/sev#418.
    • The features stay crypto_nossl and snp without defaults.
    • The pin is a commit rather than the branch, so a later cargo update or ./bin/bazel-pin.sh --full can't pick up new commits from it unnoticed.
    • deny.toml denies git sources outside the dfinity orgs, so cargo deny check sources would flag this pin. CI runs only the advisories check.
  • Lockfiles, identically in Cargo.lock and Cargo.Bazel.toml.lock:

    • removes rsa 0.9.10, p384 0.13.1, primeorder 0.13.6, x509-cert 0.2.5, pkcs1 0.7.5, num-bigint-dig 0.8.6 and der_derive 0.7.3;
    • moves bitfield (and bitfield-macros) 0.19.5 → 0.20.0 and dirs 6.0.0 → 7.0.0.

    This clears RUSTSEC-2023-0071 (rsa 0.9.10). RUSTSEC-2026-0387 (crypto-bigint 0.5.5) stays: its only remaining holder is k256 0.13, which alloy still needs.

  • .cargo/config.toml (new): builds getrandom 0.4 with its unsupported backend for wasm32-unknown-unknown, as bazel/rust.MODULE.bazel does for Bazel.

    • sev enables the default features of p384 (std, which turns on getrandom) and rsa (getrandom), which pull in getrandom 0.4.
    • Without a backend, Cargo builds for wasm32 of every canister that links attestation would fail. That includes the builds in rs/nns/dfx.json.
    • RUSTFLAGS and CARGO_ENCODED_RUSTFLAGS replace these flags.
  • rs/ic_os/sev/host: new tests check the real AMD VCEK fixture (mock_amd_key_server_response.crt, fetched from AMD's key server):

    • the chain the host provider builds from it passes sev's certificate checks, as in attestation verification: the ARK is self-signed, signs the ASK, and the ASK signs the VCEK;
    • a tampered copy, and the VCEK under the Genoa chain, are rejected.

Behaviour changes

  • SEV attestation verification now runs on rsa 0.10, p384 0.14, x509-cert 0.3 and sha2 0.11. That covers the registry canister's add_node and GuestOS's guest_upgrade and open_rootfs. In Bazel builds p384 0.14 uses the fiat backend (the existing p384 annotation).

    • The AMD ARK, ASK, ASVK, VCEK and VLEK certificates checked verify as before.
    • The error text of a failed RSA certificate signature changes from signature error: verification error to signature error. It appears in add_node errors.
  • sev enables the default features of p384 and rsa, so Bazel builds them with more features. This applies to all targets, canisters included:

    • p384 gains std, getrandom and precomputed-tables;
    • rsa gains std and getrandom (so pkcs1 gains std);
    • without num-bigint-dig 0.8, lazy_static loses spin_no_std, so every target uses std's Once in it.

    Compressed Wasm sizes:

    • registry-canister grows by 8,270 bytes to 1,705,912 (cap 1,800,000);
    • governance, root and CMC change by less than 2 KB.

    The canisters still import only ic0 functions.

@basvandijk
basvandijk added this pull request to stack #12378 December 1, 2026 22:03
@basvandijk basvandijk changed the title bas/sev from virtee sev 418 chore(deps): use sev from the branch of virtee/sev#418 (rsa 0.10, p384 0.14) Dec 1, 2026
@basvandijk basvandijk added the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Dec 1, 2026
@basvandijk
basvandijk requested a balanced review from Copilot December 1, 2026 22:03
@github-actions github-actions Bot added the chore label Dec 1, 2026
@basvandijk
basvandijk marked this pull request as ready for review December 1, 2026 22:07
@basvandijk
basvandijk requested a review from a team as a code owner December 1, 2026 22:07
@github-actions github-actions Bot added the @infra label Dec 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The dependency pin enables getrandom 0.4 without the required Cargo Wasm backend configuration, breaking registry and other attestation-dependent canister builds.

1 open issue
What changed in this PR

Temporarily pins sev to the commit from virtee/sev#418, updating the cryptographic dependencies used for SEV attestation. This builds on #12374’s dependency refresh and removes rsa 0.9.10 from the dependency graph.

Changes:

  • Pins the same sev revision in Cargo and Bazel, with TODOs to return to a crates.io release.
  • Migrates SEV verification to rsa 0.10, p384 0.14, and x509-cert 0.3.
  • Refreshes lockfiles, removing older cryptographic packages and recording updated dependencies and features.
File Description
Cargo.toml Pins the workspace sev dependency to the fork commit.
Cargo.lock Records the Cargo dependency migration and removes obsolete versions.
Cargo.Bazel.toml.lock Records matching dependency versions for Bazel.
Cargo.Bazel.json.lock Updates Bazel source metadata, dependencies, and resolved features.
bazel/​rust.MODULE.bazel Mirrors the sev Git pin in Bazel’s dependency declarations.

Review effort: Balanced

Comment thread Cargo.toml Resolved
@basvandijk
basvandijk requested review from a team as code owners December 1, 2026 22:24
Copilot AI balanced review requested due to automatic review settings December 1, 2026 22:24
@zeropath-ai

zeropath-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 0b6bf37.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► a/.cargo/config.toml
Indented: Add RUSTFLAGS cfg for wasm9 backend
Enhancement ► a/Cargo.Bazel.json.lock
Indented: Bump bitfield and bitfield-macros to 0.20.0 with updated checksums
Indented: Update several dependencies (dirs to 7.0.0, p384 to 0.14.0; rsa to 0.10.0; x509-cert to 0.3.1; sev to Git rev)
Enhancement ► a/Cargo.Bazel.toml.lock
Indented: Align bitfield and bitfield-macros to 0.20.0; update related dependencies and checksums
Indented: Remove der_derive 0.7.3 references; update dirs to 7.0.0; switch rsa/p384/x509-cert references to new versions/git source as part of Sev update
Enhancement ► a/Cargo.lock
Indented: Update multiple crates to new versions (bitfield, bitfield-macros, dirs, p384, rsa, x509-cert, sev to git rev) and adjust dependencies accordingly
Enhancement ► a/Cargo.toml
Indented: Change sev dependency to Git source with rev 25392027… and disable default-features; retain feature flags (crypto_nossl, snp)
Enhancement ► a/bazel/rust.MODULE.bazel
Indented: Update sev package spec to point to Git repo with rev 25392027… and add comment about PR head changes
Enhancement ► a/rs/ic_os/sev/host/src/lib.rs
Indented: Extend tests to use new mock and helpers, add chain parsing and verification tests for VCEK, ASK, ARK; include new MOCK_AMD_KEY_SERVER responses and related utilities

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The unreleased fork changes security-critical attestation cryptography, requiring human crypto/dependency review and native/Wasm runtime validation beyond the static and lockfile checks performed.

1 open issue

Review effort: Balanced

Base automatically changed from bas/refresh-cargo-bazel-lockfiles-2026-12 to master December 2, 2026 13:56
@basvandijk
basvandijk requested review from a team as code owners December 2, 2026 13:56
basvandijk and others added 3 commits December 2, 2026 14:56
Point sev at the head of virtee/sev#418, which moves
sev to rsa 0.10, p384 0.14 and x509-cert 0.3, until a sev release includes it.
This removes rsa 0.9.10 (RUSTSEC-2023-0071), p384 0.13.1 and x509-cert 0.2.5
from both lock sets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n chain

mock_amd_key_server_response.crt is a real VCEK from AMD's key server.
Check that the chain the host provider builds from it passes sev's
certificate checks (ARK self-signed, ARK signs ASK, ASK signs VCEK), and
that a tampered copy or the Genoa chain is rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…32 builds

sev from virtee/sev#418 enables the default features of p384 and rsa,
which turn on getrandom 0.4. Without a backend selected, Cargo builds of
canisters that link attestation (e.g. rs/nns/dfx.json's) fail for
wasm32-unknown-unknown. Select getrandom's `unsupported` backend there, as
bazel/rust.MODULE.bazel does for Bazel builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@basvandijk
basvandijk force-pushed the bas/sev-from-virtee-sev-418 branch from 6f1b53e to 317a083 Compare December 2, 2026 13:56

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@basvandijk
basvandijk dismissed github-actions[bot]’s stale review December 3, 2026 08:16

No significant canister changes.

@basvandijk basvandijk removed the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Dec 3, 2026
Copilot AI balanced review requested due to automatic review settings December 3, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The unmerged cryptographic fork affects registry admission and GuestOS attestation, requiring security-owner review and end-to-end compatibility validation beyond the available certificate fixture tests.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants