mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-29 12:22:52 +03:00
clear keys from memory after disconnecting usb yk
This commit is contained in:
parent
c17338ce98
commit
c70aa4ccf0
@ -46,7 +46,8 @@ class MainViewModel : ViewModel() {
|
|||||||
val yubiKeyDevice = MutableLiveData<YubiKeyDevice?>()
|
val yubiKeyDevice = MutableLiveData<YubiKeyDevice?>()
|
||||||
private var isUsbKeyConnected: Boolean = false
|
private var isUsbKeyConnected: Boolean = false
|
||||||
|
|
||||||
private val keyManager = KeyManager(KeyStoreProvider(), ClearingMemProvider())
|
private val memoryKeyProvider = ClearingMemProvider()
|
||||||
|
private val keyManager = KeyManager(KeyStoreProvider(), memoryKeyProvider)
|
||||||
|
|
||||||
private var _operationContext = OperationContext.Oath
|
private var _operationContext = OperationContext.Oath
|
||||||
|
|
||||||
@ -178,13 +179,11 @@ class MainViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun yubikeyDetached() {
|
fun yubikeyDetached() {
|
||||||
|
|
||||||
if (isUsbKeyConnected) {
|
if (isUsbKeyConnected) {
|
||||||
// forget the current password only for usb keys
|
// clear keys from memory
|
||||||
// TODO: clear from memory store
|
memoryKeyProvider.clearAll()
|
||||||
_fManagementApi.updateDeviceInfo("") {}
|
_fManagementApi.updateDeviceInfo("") {}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onDialogClosed(result: Pigeon.Result<Void>) {
|
fun onDialogClosed(result: Pigeon.Result<Void>) {
|
||||||
|
Loading…
Reference in New Issue
Block a user