Add SHA256 fallback validation for ESDs and update catalogs with SHA256 fields #343
+5,954
−3,198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds SHA256 support for validating downloaded ESD files in OSD.
When a catalog entry does not provide a SHA1 hash, the script now falls back to SHA256 verification to prevent corrupted images from being used.
Details of Changes
Public/OSDCloud.ps1
Catalog updates (add
Sha256fields)cache/archive-cloudoperatingsystems/CloudOperatingSystems.jsoncache/archive-cloudoperatingsystems/CloudOperatingSystems.xmlcache/archive-cloudoperatingsystems/CloudOperatingSystemsARM64.jsoncache/archive-cloudoperatingsystems/CloudOperatingSystemsARM64.xmlcache/os-catalogs/build-operatingusystem.xml.Motivation
Starting with Windows 11 25H2, Microsoft provides SHA256 (not SHA1) for ESD integrity.
Classic OSD, however, only validated SHA1 and its catalogs did not expose a
Sha256field.As discussed in OSDeploy/OSD#317, I needed a working implementation on my side.
This PR adds a SHA256 fallback in
OSDCloud.ps1and introducesSha256fields to the catalogs so ESDs can be verified reliably when SHA1 is unavailable.The SHA256 values were populated from
cache/os-catalogs/build-operatingusystem.xmlfor build 26200.7462.Compatibility
This change is backward‑compatible:
Sha256field continue to work normally.