-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use digest verification APIs for MSIX when available #4564
Conversation
if (!options.ExpectedDigests.empty()) | ||
{ | ||
// Must use API that supports digests | ||
THROW_WIN32_IF(ERROR_NOT_SUPPORTED, !IsExpectedDigestsSupported()); | ||
|
||
AddPackageOptions addPackageOptions; | ||
|
||
for (const auto& digest : options.ExpectedDigests) | ||
{ | ||
addPackageOptions.ExpectedDigests().Insert(Uri{ Utility::ConvertToUTF16(digest.first) }, digest.second); | ||
} | ||
|
||
return packageManager.AddPackageByUriAsync(uri, addPackageOptions); | ||
} | ||
else if (options.SkipReputationCheck) | ||
{ | ||
return packageManager.AddPackageAsync( | ||
uri, | ||
nullptr, /*dependencyPackageUris*/ | ||
DeploymentOptions::None, | ||
nullptr, /*targetVolume*/ | ||
nullptr, /*optionalAndRelatedPackageFamilyNames*/ | ||
nullptr, /*optionalPackageUris*/ | ||
nullptr /*relatedPackageUris*/); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to have these two branches separate? I would find it easier to understand if we had as few different calls to *AddPackage*Async()
Only reason I can think of is if AddPackageByUriAsync()
wasn't available downlevel, but it goes back to 19041 which I think is the oldest supported version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to remove it until we change the minimum version for the shipping package:
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.22621.0"/>
Change
When available (10.0.23504.0 according to MSDN), use the MSIX digest APIs to verify the package during streaming installation. When not available, download instead.
Validation
Manual installation successful, with logs indicating usage of digest. Manual installation with debugger memory change to invalidate the digest results in an error (although not the best error experience, it should also be extremely rare).
Existing regression tests should get some coverage as well.
Microsoft Reviewers: Open in CodeFlow