Skip to content

Commit ae1e29a

Browse files
authored
trusted signing: add filter to sign files with .cip extension (#28207)
1 parent 767907a commit ae1e29a

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/TrustedSigning/TrustedSigning/ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Updated InvokeCIPolicySigning to support signing files with the .cip extension
2122

2223
## Version 0.1.1
23-
* Modified InvokeCiPolicySigning to include ShouldProcess command confirmation
24+
* Modified InvokeCIPolicySigning to include ShouldProcess command confirmation
2425

2526
## Version 0.1.0
2627
* Renamed from Az.CodeSigning

src/TrustedSigning/TrustedSigning/Commands/InvokeCIPolicySigning.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public class InvokeCIPolicySigning : CodeSigningCmdletBase
6565
HelpMessage = "The endpoint url used to submit request to Azure TrustedSigning.")]
6666
public string EndpointUrl { get; set; }
6767

68-
6968
/// <summary>
7069
/// Metadata File Path
7170
/// </summary>
@@ -143,7 +142,9 @@ private void WriteMessage(string message)
143142

144143
private void ValidateFileType(string fullInPath)
145144
{
146-
if (string.Equals(System.IO.Path.GetExtension(fullInPath), ".bin", StringComparison.OrdinalIgnoreCase))
145+
string fileExtension = System.IO.Path.GetExtension(fullInPath);
146+
if (string.Equals(fileExtension, ".bin", StringComparison.OrdinalIgnoreCase) ||
147+
string.Equals(fileExtension, ".cip", StringComparison.OrdinalIgnoreCase))
147148
{
148149
WriteMessage(Environment.NewLine);
149150
WriteMessage("CI Policy file submitted");
@@ -166,7 +167,7 @@ private void ValidateFileType(string fullInPath)
166167
if (doc?.Root.Name == SiPolicyRootElementName)
167168
{
168169
WriteWarning("Input file is an XML-based policy file.");
169-
WriteWarning("Please run 'ConvertFrom-CiPolicy' to create a .bin file before running this command.");
170+
WriteWarning("Please run 'ConvertFrom-CiPolicy' to create a .bin or .cip file before running this command.");
170171
}
171172

172173
try

src/TrustedSigning/TrustedSigning/Models/CodeSigningServiceClient.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,13 @@ public CodeSigningServiceClient(IAuthenticationFactory authFactory, IAzureContex
4343
if (context == null)
4444
throw new ArgumentNullException(nameof(context));
4545
if (context.Environment == null)
46-
//throw new ArgumentException(KeyVaultProperties.Resources.InvalidAzureEnvironment);
46+
{
4747
throw new ArgumentException("Invalid Environment");
48+
}
4849

4950
Initialize(authFactory, context);
5051
}
5152

52-
private Exception GetInnerException(Exception exception)
53-
{
54-
while (exception.InnerException != null) exception = exception.InnerException;
55-
return exception;
56-
}
5753

5854
private void Initialize(IAuthenticationFactory authFactory, IAzureContext context)
5955
{

0 commit comments

Comments
 (0)