From 5c2823405e5d050fe681fa753c0e9137306a5ff8 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Mon, 22 Jun 2020 11:53:09 +0200 Subject: Add org.gnu.icecat as a trusted multi-origin browser (#871) I verified the following: * Store: F-Droid * Package hash: wi2iuVvK/WYZUzd2g0Qzn9ef3kAisQURZ8U1WSMTkcM= * Based on: Firefox * Actively maintained: https://git.savannah.gnu.org/cgit/gnuzilla.git/log/?h=68 * Multi-origin method: WebView * Save support: no (cherry picked from commit 8a90ba46c63501b57e95da7ef016dcbb749b7928) Signed-off-by: Harsh Shandilya --- .../java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt index be6263de..8864f877 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt @@ -65,6 +65,7 @@ private val TRUSTED_BROWSER_CERTIFICATE_HASH = mapOf( "com.opera.mini.native" to "V6y8Ul8bLr0ZGWzW8BQ5fMkQ/RiEHgroUP68Ph5ZP/I=", "com.opera.mini.native.beta" to "V6y8Ul8bLr0ZGWzW8BQ5fMkQ/RiEHgroUP68Ph5ZP/I=", "com.opera.touch" to "qtjiBNJNF3k0yc0MY8xqo4779CxKaVcJfiIQ9X+qZ6o=", + "org.gnu.icecat" to "wi2iuVvK/WYZUzd2g0Qzn9ef3kAisQURZ8U1WSMTkcM=", "org.mozilla.fenix" to "UAR3kIjn+YjVvFzF+HmP6/T4zQhKGypG79TI7krq8hE=", "org.mozilla.fenix.nightly" to "d+rEzu02r++6dheZMd1MwZWrDNVLrzVdIV57vdKOQCo=", "org.mozilla.fennec_aurora" to "vASIg40G9Mpr8yOG2qsN2OvPPncweHRZ9i+zzRShuqo=", @@ -102,6 +103,7 @@ private val BROWSER_MULTI_ORIGIN_METHOD = mapOf( "com.opera.mini.native" to BrowserMultiOriginMethod.WebView, "com.opera.mini.native.beta" to BrowserMultiOriginMethod.WebView, "com.opera.touch" to BrowserMultiOriginMethod.WebView, + "org.gnu.icecat" to BrowserMultiOriginMethod.WebView, "org.mozilla.fenix" to BrowserMultiOriginMethod.Field, "org.mozilla.fenix.nightly" to BrowserMultiOriginMethod.Field, "org.mozilla.fennec_aurora" to BrowserMultiOriginMethod.Field, -- cgit v1.2.3 From b5cff71b939bc13bdfbb031fb7ab6aba33598955 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Fri, 26 Jun 2020 09:00:19 +0200 Subject: Reset SSH passphrase after SSH key import (#885) (cherry picked from commit 6b5984dfe65a538a9b96878dff66aea4743a5f79) Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/UserPreference.kt | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt index 0ed1a66a..fb27ba6a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt @@ -655,6 +655,7 @@ class UserPreference : AppCompatActivity() { val prefs = PreferenceManager.getDefaultSharedPreferences(applicationContext) prefs.edit { putBoolean("use_generated_key", false) } + getEncryptedPrefs("git_operation").edit { remove("ssh_key_local_passphrase") } // Delete the public key from generation File("""$filesDir/.ssh_key.pub""").delete() -- cgit v1.2.3 From 8f7d3052ea0814ee701b3aefb13b7be386a21c39 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Fri, 26 Jun 2020 09:12:39 +0200 Subject: Use remembered credential even if it is empty (#880) * Use remembered credential even if it is empty Should fix #875. * .isNull() --> == null * Update relnotes Signed-off-by: Harsh Shandilya * Reword relnotes Signed-off-by: Harsh Shandilya * 2019 it is Signed-off-by: Harsh Shandilya Co-authored-by: Harsh Shandilya (cherry picked from commit b60c5fb605893be51840b742bf3e3c89c5b446a5) Signed-off-by: Harsh Shandilya --- CHANGELOG.md | 4 ++++ app/src/main/java/com/zeapo/pwdstore/git/GitOperation.kt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2247f45e..77b7def1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Fixed + +- Remember passphrase option did not work with keys that had empty passphrases and were generated before 2019 + ### Added - Add GNU IceCatMobile to the list of supported browsers for Autofill diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.kt b/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.kt index 6df5f65d..8cf09b39 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.kt @@ -67,7 +67,7 @@ private class GitOperationCredentialFinder(val callingActivity: Activity, val co val storedCredential = gitOperationPrefs.getString(credentialPref, null) if (isRetry) gitOperationPrefs.edit { remove(credentialPref) } - if (storedCredential.isNullOrEmpty()) { + if (storedCredential == null) { val layoutInflater = LayoutInflater.from(callingActivity) @SuppressLint("InflateParams") -- cgit v1.2.3 From cc2bb763980a15cf32fa068adcccbb6e3b8f2b1b Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Fri, 26 Jun 2020 08:47:47 +0200 Subject: Prevent cached passwords from being wiped (#884) (cherry picked from commit 889208b2644fd5676de8e05b81b4712dd11fa58b) Signed-off-by: Harsh Shandilya --- .../zeapo/pwdstore/git/config/SshjSessionFactory.kt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/config/SshjSessionFactory.kt b/app/src/main/java/com/zeapo/pwdstore/git/config/SshjSessionFactory.kt index f643c714..f900e959 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/config/SshjSessionFactory.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/config/SshjSessionFactory.kt @@ -38,13 +38,13 @@ import kotlin.coroutines.suspendCoroutine sealed class SshAuthData { class Password(val passwordFinder: InteractivePasswordFinder) : SshAuthData() { override fun clearCredentials() { - passwordFinder.clearPassword() + passwordFinder.clearPasswords() } } class PublicKeyFile(val keyFile: File, val passphraseFinder: InteractivePasswordFinder) : SshAuthData() { override fun clearCredentials() { - passphraseFinder.clearPassword() + passphraseFinder.clearPasswords() } } @@ -57,13 +57,14 @@ abstract class InteractivePasswordFinder : PasswordFinder { private var isRetry = false private var lastPassword: CharArray? = null + private val rememberToWipe: MutableList = mutableListOf() fun resetForReuse() { isRetry = false } - fun clearPassword() { - lastPassword?.clear() + fun clearPasswords() { + rememberToWipe.forEach { it.clear() } lastPassword = null } @@ -73,17 +74,20 @@ abstract class InteractivePasswordFinder : PasswordFinder { // now being reused for a new one. We try the previous password so that the user // does not have to type it again. isRetry = true - return lastPassword!! + return lastPassword!!.clone().also { rememberToWipe.add(it) } } - clearPassword() + clearPasswords() val password = runBlocking(Dispatchers.Main) { suspendCoroutine { cont -> askForPassword(cont, isRetry) } } isRetry = true - return password?.toCharArray()?.also { lastPassword = it } - ?: throw SSHException(DisconnectReason.AUTH_CANCELLED_BY_USER) + if (password == null) + throw SSHException(DisconnectReason.AUTH_CANCELLED_BY_USER) + val passwordChars = password.toCharArray().also { rememberToWipe.add(it) } + lastPassword = passwordChars + return passwordChars.clone().also { rememberToWipe.add(it) } } final override fun shouldRetry(resource: Resource<*>?) = true -- cgit v1.2.3 From 52808fb1266d3a1763ba1fba0c79e5ef5367b5de Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 28 Jun 2020 21:34:26 +0530 Subject: build: bump version Signed-off-by: Harsh Shandilya --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index cd2b0bc8..8b12e0d9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,8 +25,8 @@ android { defaultConfig { applicationId 'dev.msfjarvis.aps' - versionCode 10900 - versionName '1.9.0' + versionCode 10910 + versionName '1.9.1' } lintOptions { -- cgit v1.2.3 From b663fbe64f41f34ed66842835876779d1f923e22 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 30 Jun 2020 14:37:59 +0530 Subject: Workaround to prevent crash on first run (#898) Signed-off-by: Harsh Shandilya (cherry picked from commit 57f125a4da9f8bad69c2b2e2e6540d245bdd44c4) Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt b/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt index 69205241..05ccf28f 100644 --- a/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt +++ b/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt @@ -291,6 +291,7 @@ class SearchableRepositoryViewModel(application: Application) : AndroidViewModel recyclerViewState: Parcelable? = null, pushPreviousLocation: Boolean = true ) { + if (!newDirectory.exists()) return require(newDirectory.isDirectory) { "Can only navigate to a directory" } if (pushPreviousLocation) { navigationStack.push(NavigationStackEntry(_currentDir.value!!, recyclerViewState)) -- cgit v1.2.3 From 1a8e9ec1e4d215845fc5d2d808475e779ba44fe8 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 30 Jun 2020 15:14:39 +0530 Subject: Bump version Signed-off-by: Harsh Shandilya --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index 8b12e0d9..25040ca4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,8 +25,8 @@ android { defaultConfig { applicationId 'dev.msfjarvis.aps' - versionCode 10910 - versionName '1.9.1' + versionCode 10920 + versionName '1.9.2' } lintOptions { -- cgit v1.2.3