Fixed broken check for active client certificate

This commit is contained in:
Corewala 2022-05-17 13:49:18 -04:00
parent fe957eb581
commit 36952de39f
2 changed files with 2 additions and 3 deletions

View File

@ -20,9 +20,8 @@ class BuranKeyManager(val context: Context, val onKeyError: (error: String) -> U
//If the user has a key loaded load it here - or else return null
fun getFactory(clientCertPassword: String?): KeyManagerFactory? {
val isClientCertActive = prefs.getBoolean(Buran.PREF_KEY_CLIENT_CERT_ACTIVE, false)
return when {
isClientCertActive and (clientCertPassword != null) -> {
clientCertPassword != null -> {
lastCallUsedKey = true
val keyStore: KeyStore = KeyStore.getInstance("pkcs12")

View File

@ -415,7 +415,7 @@ class GemActivity : AppCompatActivity() {
.setTitle(getString(R.string.client_certificate_required))
.setMessage(state.header.meta)
if(prefs.getString(Buran.PREF_KEY_CLIENT_CERT_HUMAN_READABLE, null) != null){
if(prefs.getBoolean(Buran.PREF_KEY_CLIENT_CERT_ACTIVE, false)){
builder
.setPositiveButton(getString(R.string.use_client_certificate).toUpperCase()) { _, _ ->
if(prefs.getBoolean("use_biometrics", false)){