Skip to content

Commit 8bbdadd

Browse files
committed
feat(iOS): unify missingSecureEnclave with hwBackedKeystore
1 parent 5e3eada commit 8bbdadd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ios/FreeraspReactNative.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ class FreeraspReactNative: RCTEventEmitter {
4141
}
4242

4343
override func supportedEvents() -> [String]! {
44-
return ["initializationError", "started", "privilegedAccess", "debug", "simulator", "appIntegrity", "unofficialStore", "hooks", "device binding", "deviceID", "missingSecureEnclave", "passcodeChange", "passcode"]
44+
return ["initializationError", "started", "privilegedAccess", "debug", "simulator", "appIntegrity", "unofficialStore", "hooks", "device binding", "deviceID", "hardwareBackedKeystoreNotAvailable", "passcodeChange", "passcode"]
4545
}
4646
}
4747

4848
extension SecurityThreatCenter: SecurityThreatHandler {
4949
public func threatDetected(_ securityThreat: TalsecRuntime.SecurityThreat) {
5050
// It is better to implement security reactions (e.g. killing the app) here.
51-
FreeraspReactNative.shared!.sendEvent(withName: securityThreat.rawValue, body: securityThreat.rawValue)
51+
if (securityThreat.rawValue == "missingSecureEnclave") {
52+
FreeraspReactNative.shared!.sendEvent(withName: "hardwareBackedKeystoreNotAvailable", body: "hardwareBackedKeystoreNotAvailable")
53+
} else {
54+
FreeraspReactNative.shared!.sendEvent(withName: securityThreat.rawValue, body: securityThreat.rawValue)
55+
}
5256
}
5357
}

0 commit comments

Comments
 (0)