Add warning against using weak SHA-1 File Catalog - #27805
Open
Anam Navied (anamnavi) wants to merge 4 commits into
Open
Add warning against using weak SHA-1 File Catalog#27805Anam Navied (anamnavi) wants to merge 4 commits into
Anam Navied (anamnavi) wants to merge 4 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an advisory warning when New-FileCatalog/Test-FileCatalog operate on legacy catalog version 1 (SHA-1), encouraging use of catalog version 2 (SHA-256) without breaking compatibility.
Changes:
- Added a helper to emit a warning when the catalog version indicates SHA-1 (legacy v1).
- Invoked the warning during both catalog generation and validation flows.
- Added a new localized resource string for the warning text.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/System.Management.Automation/security/CatalogHelper.cs | Adds and invokes a warning helper for legacy (v1/SHA-1) catalogs during generate/validate operations. |
| src/System.Management.Automation/resources/CatalogStrings.resx | Introduces the user-facing warning string used by the cmdlet warning stream. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Patrick Meinecke (SeeminglyScience)
approved these changes
Aug 10, 2026
Patrick Meinecke (SeeminglyScience)
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
Patrick Meinecke (SeeminglyScience)
approved these changes
Aug 10, 2026
Patrick Meinecke (SeeminglyScience)
approved these changes
Aug 10, 2026
| <value>Catalog version is not valid. We only support catalog version {0} and version {1}.</value> | ||
| </data> | ||
| <data name="WeakCatalogHashAlgorithm" xml:space="preserve"> | ||
| <value>'{0}' is a version 1 catalog that uses SHA1. Consider regenerating this catalog with -CatalogVersion 2.</value> |
There was a problem hiding this comment.
Suggested change
| <value>'{0}' is a version 1 catalog that uses SHA1. Consider regenerating this catalog with -CatalogVersion 2.</value> | |
| <value>'{0}' is a version 1 catalog that uses SHA1. Consider regenerating this catalog with '-CatalogVersion 2'.</value> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Summary
Add warning against using weak SHA-1 File Catalog
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header