chore(deps): upgrade security-crypto to 1.1.0-alpha04

This commit is contained in:
Harsh Shandilya 2023-01-26 13:00:13 +05:30
parent e17a17a8e8
commit 5e0e0a8be2
No known key found for this signature in database
3 changed files with 8 additions and 16 deletions

View file

@ -24,8 +24,6 @@
"^com.android.tools:desugar_jdk_libs",
// Later versions require newer JDKs
"^commons-codec:commons-codec",
// https://github.com/android-password-store/Android-Password-Store/issues/2247
"^androidx.security:security-crypto",
],
"enabled": false
},

View file

@ -232,18 +232,15 @@ object SshKey {
type = if (isGenerated) Type.LegacyGenerated else Type.Imported
}
@Suppress("BlockingMethodInNonBlockingContext")
private suspend fun getOrCreateWrappingMasterKey(requireAuthentication: Boolean) =
withContext(Dispatchers.IO) {
MasterKey.Builder(context, KEYSTORE_ALIAS).run {
setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
setRequestStrongBoxBacked(true)
setUserAuthenticationRequired(requireAuthentication, 15)
build()
}
MasterKey.Builder(context, KEYSTORE_ALIAS)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.setRequestStrongBoxBacked(true)
.setUserAuthenticationRequired(requireAuthentication, 15)
.build()
}
@Suppress("BlockingMethodInNonBlockingContext")
private suspend fun getOrCreateWrappedPrivateKeyFile(requireAuthentication: Boolean) =
withContext(Dispatchers.IO) {
EncryptedFile.Builder(
@ -252,13 +249,10 @@ object SshKey {
getOrCreateWrappingMasterKey(requireAuthentication),
EncryptedFile.FileEncryptionScheme.AES256_GCM_HKDF_4KB
)
.run {
setKeysetPrefName(ANDROIDX_SECURITY_KEYSET_PREF_NAME)
build()
}
.setKeysetPrefName(ANDROIDX_SECURITY_KEYSET_PREF_NAME)
.build()
}
@Suppress("BlockingMethodInNonBlockingContext")
suspend fun generateKeystoreWrappedEd25519Key(requireAuthentication: Boolean) =
withContext(Dispatchers.IO) {
delete()

View file

@ -31,7 +31,7 @@ androidx-material = "com.google.android.material:material:1.9.0-alpha01"
androidx-preference = "androidx.preference:preference:1.2.0"
androidx-recyclerview = "androidx.recyclerview:recyclerview:1.3.0-rc01"
androidx-recyclerviewSelection = "androidx.recyclerview:recyclerview-selection:1.2.0-alpha01"
androidx-security = "androidx.security:security-crypto:1.1.0-alpha03"
androidx-security = "androidx.security:security-crypto-ktx:1.1.0-alpha04"
androidx-swiperefreshlayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01"
aps-sublimeFuzzy = "com.github.android-password-store:sublime-fuzzy:2.3.0"
aps-zxingAndroidEmbedded = "com.github.android-password-store:zxing-android-embedded:4.2.1"