Skip to content

Commit 90b7ce4

Browse files
committed
Add input validation to EncryptPassword method
Added a null or empty input check in the `EncryptPassword` method to validate the `plainText` parameter before proceeding with encryption logic. This ensures robustness and prevents errors or unintended behavior when invalid input is provided.
1 parent 998ee19 commit 90b7ce4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/SignToolGUI/Class/SecurePasswordManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ private static string GenerateMachineSpecificKey()
7979
/// <returns>Base64 encoded encrypted password with metadata</returns>
8080
public static string EncryptPassword(string plainText)
8181
{
82+
// Check for null or empty input
8283
if (string.IsNullOrEmpty(plainText))
8384
return string.Empty;
8485

0 commit comments

Comments
 (0)