Improve MOTW error handling in download flow#6127
Improve MOTW error handling in download flow#6127JohnMcPMS merged 5 commits intomicrosoft:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
Sorry to ask here. 🙏🏼 Is there any unknown reason that blocks this PR? A new preview version of |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| @@ -536,21 +549,31 @@ namespace AppInstaller::Utility | |||
|
|
|||
| std::thread aesThread([&]() | |||
There was a problem hiding this comment.
I just realized that the failures being missing from the logs is probably due to this new thread. If you want this change to actually make the logs show up and not just fix the error handling, you would need to:
// outside lambda
ThreadGlobals* globals = ThreadGlobals::GetForCurrentThread();
// capture into lambda
... = [..., globals] (...)
{
if (globals)
{
auto globalsCleanup = globals->SetForCurrentThread();
}
...
}
There was a problem hiding this comment.
Given that the error handling is the main thing causing the issue, my preference is to get this error handling merged so that some portion of the local manifests start working again for users who are having issues, and I can raise a second PR for the logging globals
|
Hi @JohnMcPMS @hackean-msft, 👋🏼 I notice the latest prerelease Could you please tell when this PR can be bundled into the prerelease? It blocks us from validating local manifests before submitting to |
|
@Dragon1573 - Based on previous discussions I've had in the Gitter chat, the prereleases have to go through some level of internal testing before they are published to GitHub. I'm not sure how frequently they are built and tested, but given that 69a9e3d was 3 weeks ago, and it seems like the pre-releases are happening almost weekly, I'd think it would be another 2-3 weeks before this makes it into a pre-release, depending on the internal build/test cycle of course |
|
We generally make a weekly build based on the code at 00:00 Pacific time on Mondays. This was merged after that, so it didn't make the cut for this week, but it should be in next week's build. Each build is first distributed internally, and if everything goes well, it is published as a preview after a week. So, if things go smoothly, you would see a build with this in about 2 weeks. |
|
Okay ❤️ If I'm eager to having issue been resolved in the binary, I should build |
|
@Dragon1573 yes, but when you deploy that it will be available as |
Fix MOTW security check failures for downloaded installers
Problem
All installer downloads were failing the security check with 0x80070003 (ERROR_PATH_NOT_FOUND), causing every install to terminate with "Installer failed security check".
Two root causes were identified:
temporary pre-hash-validation file (a raw SHA256 hex string with no extension, e.g. aab2dc8e…) rather than the final installer (e.g. BadlionClient.exe).
Important
Shell32's AES relies on file extension for MIME-type detection, scan policy, and zone assignment, so scanning an extensionless file produced unreliable results
called and the whole check returning a failure code. Additionally, a missing THROW_IF_FAILED(hr) after IPersistFile::Load meant unexpected load errors were silently ignored, leading to Remove()/Save()
being called on a non-loaded object.
Changes
DownloadFlow.cpp
Downloader.cpp — RemoveMotwIfApplicable
Downloader.cpp — ApplyMotwUsingIAttachmentExecuteIfApplicable
security scan.
CoInitializeEx so failures are captured through WIL.
never updated
Microsoft Reviewers: Open in CodeFlow