Skip to content

Commit

Permalink
getCipherFIPSStatus() returns a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
wmathurin committed Jan 22, 2025
1 parent 40d0d7b commit 3b5c236
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions libs/SmartStore/SmartStore/Classes/SFSmartStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ NS_SWIFT_NAME(SmartStore)

/**
* Return SQLCipher FIPS status
* @return 0 when using the community edition or the commercial edition and 1 when using the FIPS enabled enterprise edition
* @return true if using a FIPS enabled SQLCipher edition
*/
- (NSString *)getCipherFIPSStatus NS_SWIFT_NAME(cipherFIPSStatus());
- (BOOL)getCipherFIPSStatus NS_SWIFT_NAME(cipherFIPSStatus());

#pragma mark - Long operations recovery methods

Expand Down
5 changes: 3 additions & 2 deletions libs/SmartStore/SmartStore/Classes/SFSmartStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -2041,9 +2041,10 @@ - (NSString*) getCipherProviderVersion
return [[self queryPragma:@"cipher_provider_version"] componentsJoinedByString:@""];
}

- (NSString*) getCipherFipsStatus
- (BOOL) getCipherFipsStatus
{
return [[self queryPragma:@"cipher_fips_status"] componentsJoinedByString:@""];
NSString *cipherFIPSStatus = [[self queryPragma:@"cipher_fips_status"] componentsJoinedByString:@""];
return [cipherFIPSStatus isEqualToString:@"1"];
}

- (NSArray*) queryPragma:(NSString*) pragma
Expand Down
4 changes: 2 additions & 2 deletions libs/SmartStore/SmartStoreTests/SFSmartStoreTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ - (void) testCipherProviderVersion

- (void) testCipherFIPSStatus
{
NSString* cipherFIPSStatus = [self.store getCipherFIPSStatus];
XCTAssertEqualObjects(cipherFIPSStatus, @"0");
BOOL cipherFIPSStatus = [self.store getCipherFIPSStatus];
XCTAssertFalse(cipherFIPSStatus);
}

/**
Expand Down

0 comments on commit 3b5c236

Please sign in to comment.