Skip to content

Commit

Permalink
santactl/fileinfo: Include teamID/platform prefix in signing ID (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellhancox committed May 21, 2024
1 parent cf4dab5 commit 7502bc2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Source/santactl/Commands/SNTCommandFileInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,8 @@ - (SNTAttributeBlock)rule {
if (identifier) {
if (teamID) {
signingID = [NSString stringWithFormat:@"%@:%@", teamID, identifier];
} else {
if (csc.platformBinary) {
signingID = [NSString stringWithFormat:@"platform:%@", identifier];
}
} else if (csc.platformBinary) {
signingID = [NSString stringWithFormat:@"platform:%@", identifier];
}
}

Expand Down Expand Up @@ -524,7 +522,16 @@ - (SNTAttributeBlock)teamID {
- (SNTAttributeBlock)signingID {
return ^id(SNTCommandFileInfo *cmd, SNTFileInfo *fileInfo) {
MOLCodesignChecker *csc = [fileInfo codesignCheckerWithError:NULL];
return csc.signingID;

NSString *identifier = csc.signingID;
NSString *teamID = csc.teamID;
if (!identifier) return nil;
if (teamID) {
return [NSString stringWithFormat:@"%@:%@", teamID, identifier];
} else if (csc.platformBinary) {
return [NSString stringWithFormat:@"platform:%@", identifier];
}
return nil;
};
}

Expand Down

0 comments on commit 7502bc2

Please sign in to comment.