diff --git a/src/TrustedSigning/TrustedSigning/ChangeLog.md b/src/TrustedSigning/TrustedSigning/ChangeLog.md index 2fd44ec14754..b7c02f34b7dc 100644 --- a/src/TrustedSigning/TrustedSigning/ChangeLog.md +++ b/src/TrustedSigning/TrustedSigning/ChangeLog.md @@ -18,9 +18,10 @@ - Additional information about change #1 --> ## Upcoming Release +* Updated InvokeCIPolicySigning to support signing files with the .cip extension ## Version 0.1.1 -* Modified InvokeCiPolicySigning to include ShouldProcess command confirmation +* Modified InvokeCIPolicySigning to include ShouldProcess command confirmation ## Version 0.1.0 * Renamed from Az.CodeSigning diff --git a/src/TrustedSigning/TrustedSigning/Commands/InvokeCIPolicySigning.cs b/src/TrustedSigning/TrustedSigning/Commands/InvokeCIPolicySigning.cs index 6ee29c471d07..238fb7bd69b6 100644 --- a/src/TrustedSigning/TrustedSigning/Commands/InvokeCIPolicySigning.cs +++ b/src/TrustedSigning/TrustedSigning/Commands/InvokeCIPolicySigning.cs @@ -65,7 +65,6 @@ public class InvokeCIPolicySigning : CodeSigningCmdletBase HelpMessage = "The endpoint url used to submit request to Azure TrustedSigning.")] public string EndpointUrl { get; set; } - /// /// Metadata File Path /// @@ -143,7 +142,9 @@ private void WriteMessage(string message) private void ValidateFileType(string fullInPath) { - if (string.Equals(System.IO.Path.GetExtension(fullInPath), ".bin", StringComparison.OrdinalIgnoreCase)) + string fileExtension = System.IO.Path.GetExtension(fullInPath); + if (string.Equals(fileExtension, ".bin", StringComparison.OrdinalIgnoreCase) || + string.Equals(fileExtension, ".cip", StringComparison.OrdinalIgnoreCase)) { WriteMessage(Environment.NewLine); WriteMessage("CI Policy file submitted"); @@ -166,7 +167,7 @@ private void ValidateFileType(string fullInPath) if (doc?.Root.Name == SiPolicyRootElementName) { WriteWarning("Input file is an XML-based policy file."); - WriteWarning("Please run 'ConvertFrom-CiPolicy' to create a .bin file before running this command."); + WriteWarning("Please run 'ConvertFrom-CiPolicy' to create a .bin or .cip file before running this command."); } try diff --git a/src/TrustedSigning/TrustedSigning/Models/CodeSigningServiceClient.cs b/src/TrustedSigning/TrustedSigning/Models/CodeSigningServiceClient.cs index ea4a79783945..bbd788c84875 100644 --- a/src/TrustedSigning/TrustedSigning/Models/CodeSigningServiceClient.cs +++ b/src/TrustedSigning/TrustedSigning/Models/CodeSigningServiceClient.cs @@ -43,17 +43,13 @@ public CodeSigningServiceClient(IAuthenticationFactory authFactory, IAzureContex if (context == null) throw new ArgumentNullException(nameof(context)); if (context.Environment == null) - //throw new ArgumentException(KeyVaultProperties.Resources.InvalidAzureEnvironment); + { throw new ArgumentException("Invalid Environment"); + } Initialize(authFactory, context); } - private Exception GetInnerException(Exception exception) - { - while (exception.InnerException != null) exception = exception.InnerException; - return exception; - } private void Initialize(IAuthenticationFactory authFactory, IAzureContext context) {