From 505d7e44be362ab5076d2be8a9aebf9ab5ec7775 Mon Sep 17 00:00:00 2001 From: Marcos Ramos Date: Sat, 17 Oct 2020 19:33:06 +0000 Subject: [PATCH 1/2] fixed nullable usage on authenticode --- src/System.Management.Automation/security/Authenticode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/security/Authenticode.cs b/src/System.Management.Automation/security/Authenticode.cs index 0abdafa956c..ebd4eca2b6d 100644 --- a/src/System.Management.Automation/security/Authenticode.cs +++ b/src/System.Management.Automation/security/Authenticode.cs @@ -292,7 +292,7 @@ internal static Signature GetSignature(string fileName, string fileContent) [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods")] private static Signature GetSignatureFromCatalog(string filename) { - if (Signature.CatalogApiAvailable.HasValue && !Signature.CatalogApiAvailable.Value) + if (!Signature.CatalogApiAvailable.GetValueOrDefault()) { // Signature.CatalogApiAvailable would be set to false the first time it is detected that // WTGetSignatureInfo API does not exist on the platform, or if the API is not functional on the target platform. From c80ec93c34c47279c1b15d6d699944078aa6080b Mon Sep 17 00:00:00 2001 From: Marcos Ramos Date: Wed, 21 Oct 2020 22:10:30 +0200 Subject: [PATCH 2/2] Update src/System.Management.Automation/security/Authenticode.cs Co-authored-by: Ilya --- src/System.Management.Automation/security/Authenticode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/security/Authenticode.cs b/src/System.Management.Automation/security/Authenticode.cs index ebd4eca2b6d..584087a6e69 100644 --- a/src/System.Management.Automation/security/Authenticode.cs +++ b/src/System.Management.Automation/security/Authenticode.cs @@ -292,7 +292,7 @@ internal static Signature GetSignature(string fileName, string fileContent) [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods")] private static Signature GetSignatureFromCatalog(string filename) { - if (!Signature.CatalogApiAvailable.GetValueOrDefault()) + if (Signature.CatalogApiAvailable.HasValue && !Signature.CatalogApiAvailable.GetValueOrDefault()) { // Signature.CatalogApiAvailable would be set to false the first time it is detected that // WTGetSignatureInfo API does not exist on the platform, or if the API is not functional on the target platform.