Skip to content

Commit

Permalink
Fix typos and tests for standalone mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarkowsky committed Nov 27, 2024
1 parent c4116c9 commit feaa11a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions Source/common/SNTConfigurator.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,12 @@
///
@property(nullable, readonly, nonatomic) NSString *modeNotificationLockdown;

///
/// The notification text to display when the client goes into STANDALONE mode.
/// Defaults to "Switching into Lockdown mode"
///
@property(nullable, readonly, nonatomic) NSString *modeNotificationStandalone;

///
/// If this is set to true, the UI will use different fonts on April 1st, May 4th and October 31st.
///
Expand Down
2 changes: 1 addition & 1 deletion Source/gui/SNTBinaryMessageWindowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ struct SNTBinaryMessageWindowView: View {

HStack(spacing: 15.0) {
if !(c.eventDetailURL?.isEmpty ?? false)
&& !(event?.needsBundleHash ?? false && !bundleProgress.isFinished) && !c.clientMode == .standalone
&& !(event?.needsBundleHash ?? false && !bundleProgress.isFinished) && c.clientMode != .standalone
{
OpenEventButton(customText: c.eventDetailText, action: openButton)
} else if addStandaloneButton() {
Expand Down
18 changes: 9 additions & 9 deletions Source/santad/SantadTest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ - (void)testBinaryWithSHA256BlockRuleIsBlockedInLockdownMode {
}];
}

- (void)testBinaryWithSHA256BlockRuleIsBlockedInStandaloneMode {
[self checkBinaryExecution:@"badbinary"
wantResult:ES_AUTH_RESULT_DENY
clientMode:SNTClientModeStandalone
cdValidator:^BOOL(SNTCachedDecision *cd) {
return cd.decision == SNTEventStateBlockBinary;
}];
}

- (void)testBinaryWithSHA256BlockRuleIsBlockedInMonitorMode {
[self checkBinaryExecution:@"badbinary"
wantResult:ES_AUTH_RESULT_DENY
Expand Down Expand Up @@ -263,15 +272,6 @@ - (void)testBinaryWithSHA256BlockRuleIsBlockedInStandaloneMode {
}];
}

- (void)testBinaryWithSHA256BlockRuleIsBlockedInMonitorMode {
[self checkBinaryExecution:@"badbinary"
wantResult:ES_AUTH_RESULT_DENY
clientMode:SNTClientModeMonitor
cdValidator:^BOOL(SNTCachedDecision *cd) {
return cd.decision == SNTEventStateBlockBinary;
}];
}

- (void)testBinaryWithSHA256AllowRuleIsNotBlockedInStandaloneMode {
[self checkBinaryExecution:@"goodbinary"
wantResult:ES_AUTH_RESULT_ALLOW
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"whitelist_regex": null, "client_mode": "STANDALONE", "blacklist_regex": null, "batch_size": 100}

0 comments on commit feaa11a

Please sign in to comment.