Skip to content

Commit

Permalink
Fixups for SNTExecutionController tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarkowsky committed Mar 10, 2024
1 parent 5372a7b commit d73d15f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Source/santad/SNTPolicyProcessor.mm
Expand Up @@ -76,9 +76,24 @@ - (nonnull SNTCachedDecision *)updateCachedDecision:(SNTCachedDecision *)cd
cd.silentBlock = YES;
} else if (rule.state == SNTRuleStateAllowCompiler) {
if (![self.configurator enableTransitiveRules]) {
cd.decision = SNTEventStateAllowBinary;
switch (rule.type) {
case SNTRuleTypeCDHash: cd.decision = SNTEventStateAllowCDHash; break;
case SNTRuleTypeBinary: cd.decision = SNTEventStateAllowBinary; break;
case SNTRuleTypeSigningID: cd.decision = SNTEventStateAllowSigningID; break;
default:
// Programming error. Something's marked as a compiler that shouldn't
// be.
LOGE(@"Invalid compiler rule type %ld", rule.type);
[NSException
raise:@"Invalid compiler rule type"
format:@"updateCachedDecision:ForRule: Unexpected compiler rule type: %ld", rule.type];
break;
}
}
} else if (rule.state == SNTRuleStateAllowTransitive) {
// If transitive rules are enabled, then SNTRuleStateAllowTransitive rules
// become SNTEventStateAllowTransitive decisions. Otherwise, we treat the
// rule as if it were SNTRuleStateUnknown.
if (![self.configurator enableTransitiveRules]) {
// check operating mode.
SNTClientMode mode = [self.configurator clientMode];
Expand Down

0 comments on commit d73d15f

Please sign in to comment.