Skip to content

Support MSIX/AppX bundles and upload extensions equally across code paths - #32

Merged
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
masterfrom
copilot/msix-format-parity
Sep 5, 2026
Merged

Support MSIX/AppX bundles and upload extensions equally across code paths#32
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
masterfrom
copilot/msix-format-parity

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Summary

The MSIX-family audit found .msixbundle/.appxbundle were not treated equally: portable bundle final signing was explicitly rejected as "flat-only", --skip-signed ignored bundles, psign-tool code regenerated wrong (flat-style) block maps for bundles and silently ignored --publisher-name on them, and msix-manifest-info/msix-set-publisher failed on bundle manifests. This PR closes those gaps so all MSIX-family formats are handled uniformly.

  • Portable bundle final signing (psign-portable-core): .msixbundle/.appxbundle sign through native-shaped portable local PFX/cert-store, Azure Key Vault, and Artifact Signing REST routes with native AppxBundleSip semantics — manifest-only bundle block map (backslash names, per-block Size, LfhSize=65, byte-verified against MakeAppx fixtures), byte-identical child packages, and PKCX-wrapped AppxSignature.p7x embedding. Children must be signed before the bundle, matching native.
  • Latent ZIP64 bug fixed (psign-sip-digest): MakeAppx writes 0xFFFF sentinels in the classic EOCD disk fields; parse_zip_tail misread them as multi-disk and rejected valid MakeAppx output. Real disk fields are validated in the ZIP64 EOCD path.
  • --skip-signed now covers bundles (both target_should_skip_signed and the staging preflight via new msix_signature_part_present).
  • psign-tool code: bundle layouts regenerate manifest-only block maps and propagate --publisher-name into AppxBundleManifest.xml Identity@Publisher plus child Package@Publisher mirrors.
  • msix-manifest-info / msix-set-publisher: read/update AppxMetadata/AppxBundleManifest.xml for bundles, reporting package_publisher; flat path unchanged.
  • Uniform family classification: .appxupload/.msixuploadMsixFamily (Win32 detect()) and new PortableFileFormat::MsixUpload/MsixEncrypted variants with family-specific explicit errors everywhere (portable sign/inspect/trust, --mode portable verify routing, sealing constraints). Upload containers and encrypted packages remain deliberate, documented rejections (not cleartext SIP subjects).

Testing

  • cargo fmt --all --check clean; cargo clippy --workspace --all-targets --locked clean (incl. feature combos artifact-signing-rest, azure-kv-sign-portable, timestamp-http)
  • cargo test --workspace --locked green: 182 sip-digest unit tests, 224 cli_pe_digest tests with KV/Artifact-Signing/timestamp test servers, all code_command tests, CLI-matrix doc test
  • New round-trip tests: sign flat child → repack bundle → sign bundle → verify-msix passes with recursive child validation; --skip-signed bundle detection; bundle-manifest publisher propagation

Docs

Updated rust-sip-gaps.md, gap-analysis-signing-platforms.md, linux-signing-pipelines.md, migration-artifact-signing.md, migration-azuresigntool.md, and psign-cli-matrix.json/.md (top gap renamed to portable-msix-upload-final-signing; bundle gap closed).

…aths

- psign-portable-core: portable final signing for .msixbundle/.appxbundle with
  native AppxBundleSip semantics (manifest-only bundle block map with backslash
  names and per-block Size, byte-identical child packages, PKCX AppxSignature
  embedding); skip-signed preflight via AppxSignature.p7x presence; explicit
  MsixUpload/MsixEncrypted formats with family-specific diagnostics
- psign-sip-digest: fix ZIP64 classic-EOCD 0xFFFF disk-field sentinels being
  misread as multi-disk; expose msix_signature_part_present
- portable sign: route bundles through native-shaped local/KV/Artifact Signing
  paths; extend --skip-signed and target validation to the full MSIX family
- psign-tool code: bundle layouts regenerate manifest-only block maps and
  propagate --publisher-name into AppxBundleManifest.xml Identity@Publisher and
  child Package@Publisher
- digest CLI: msix-manifest-info / msix-set-publisher read and update bundle
  manifests (AppxMetadata/AppxBundleManifest.xml), reporting package_publisher
- win detect/sealing: classify .appxupload/.msixupload as MSIX family for
  uniform SIP diagnostics and sealing constraints
- docs: close the portable-msix-bundle-upload-final-signing gap; upload
  containers and encrypted packages remain explicit rejections
New clippy lint fires on all chunks_exact(2) call sites under
-D warnings; replace with as_chunks::<2>() across portable and
Windows-only crates so the floating-stable CI clippy gates pass.
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit a50e39c into master Sep 5, 2026
36 checks passed
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) deleted the copilot/msix-format-parity branch September 5, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant