-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PIA-620: Update iOS
KeychainSettings
constructor to pass the `kSecA…
…ttrAccessible` attribute (#1) Update iOS KeychainSettings constructor to pass the accessible attribute
- Loading branch information
1 parent
c0d41b1
commit 4882791
Showing
1 changed file
with
11 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 11 additions & 1 deletion
12
...vateinternetaccess/account/internals/persistency/secureSettings/SecureSettingsProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
package com.privateinternetaccess.account.internals.persistency.secureSettings | ||
|
||
import com.russhwolf.settings.ExperimentalSettingsImplementation | ||
import com.russhwolf.settings.KeychainSettings | ||
import com.russhwolf.settings.Settings | ||
import kotlinx.cinterop.ExperimentalForeignApi | ||
import platform.Foundation.CFBridgingRetain | ||
import platform.Security.kSecAttrAccessible | ||
import platform.Security.kSecAttrAccessibleAlways | ||
import platform.Security.kSecAttrService | ||
|
||
internal actual object SecureSettingsProvider { | ||
|
||
private const val KEYCHAIN_NAME = "account_keychain" | ||
|
||
@OptIn(ExperimentalSettingsImplementation::class, ExperimentalForeignApi::class) | ||
actual val settings: Settings? | ||
get() = KeychainSettings(KEYCHAIN_NAME) | ||
get() = KeychainSettings( | ||
kSecAttrService to CFBridgingRetain(KEYCHAIN_NAME), | ||
kSecAttrAccessible to kSecAttrAccessibleAlways | ||
) | ||
} |