(#3765) Don't try to decrypt cert password#3786
Open
corbob wants to merge 1 commit intochocolatey:developfrom
Open
(#3765) Don't try to decrypt cert password#3786corbob wants to merge 1 commit intochocolatey:developfrom
corbob wants to merge 1 commit intochocolatey:developfrom
Conversation
Member
Author
|
I've opened this PR as a draft as I would really like to get some tests around certificate authentication, but need to think a bit on this. |
Member
Author
|
I'm not sure yet, but I think this might be related to #2736 (as in, this fix fixes that issue too). Will need to do more investigating. |
8e3fbc0 to
195fb6e
Compare
Member
Author
|
@gep13 I've marked this PR ready for review, and requested the review from you due to the linked testing PR also being assigned to you. |
The DefaultEncryptionUtility attempts to decrypt a string without checking if the string is null or empty. This commit adds a check the same as in EncryptString whereby we return null if the input string is null or empty.
195fb6e to
dd61ec5
Compare
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.
Description Of Changes
When attempting to decrypt a string that is null or empty, instead of attempting to decrypt, return null.
Motivation and Context
It is not possible to decrypt a string that doesn't exist. This also brings the decrypt logic in line with the encrypt logic that already included this check.
Testing
Internal Chocolatey Software testing:
userNoPassword.pfxas well asuserWithPassword.pfxin your testing.Operating Systems Testing
Windows 11
Change Types Made
Change Checklist
Related Issue