From 5e0e0a8be20cfe7641c7691fd8caf585f24aa95a Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 26 Jan 2023 13:00:13 +0530 Subject: chore(deps): upgrade security-crypto to 1.1.0-alpha04 --- .../java/app/passwordstore/util/git/sshj/SshKey.kt | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt b/app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt index bdced9af..e7f5dd96 100644 --- a/app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt +++ b/app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt @@ -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() -- cgit v1.2.3