Skip to content

Commit 124fe21

Browse files
authored
Merge pull request #4283 from owncloud/technical/improve_biometrical_auth_security
[TECHNICAL] Improve biometrical authentication security
2 parents 8a58791 + fb90354 commit 124fe21

3 files changed

Lines changed: 29 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ownCloud admins and users.
2727

2828
## Summary
2929

30+
* Security - Improve biometric authentication security: [#4180](https://github.com/owncloud/android/issues/4180)
3031
* Bugfix - Some Null Pointer Exceptions in MainFileListViewModel: [#4065](https://github.com/owncloud/android/issues/4065)
3132
* Bugfix - Some Null Pointer Exceptions fixed from Google Play: [#4207](https://github.com/owncloud/android/issues/4207)
3233
* Bugfix - Add "scope" parameter to /token endpoint HTTP requests: [#4260](https://github.com/owncloud/android/pull/4260)
@@ -51,6 +52,14 @@ ownCloud admins and users.
5152

5253
## Details
5354

55+
* Security - Improve biometric authentication security: [#4180](https://github.com/owncloud/android/issues/4180)
56+
57+
Biometric authentication has been improved by checking the result received when
58+
performing a successful authentication.
59+
60+
https://github.com/owncloud/android/issues/4180
61+
https://github.com/owncloud/android/pull/4283
62+
5463
* Bugfix - Some Null Pointer Exceptions in MainFileListViewModel: [#4065](https://github.com/owncloud/android/issues/4065)
5564

5665
The MainFileListViewModel has prevented the fileById variable from crashing when

changelog/unreleased/4283

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Security: Improve biometric authentication security
2+
3+
Biometric authentication has been improved by checking the result received when performing a successful
4+
authentication.
5+
6+
https://github.com/owncloud/android/issues/4180
7+
https://github.com/owncloud/android/pull/4283

owncloudApp/src/main/java/com/owncloud/android/presentation/security/biometric/BiometricActivity.kt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,20 @@ class BiometricActivity : AppCompatActivity() {
8787

8888
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
8989
super.onAuthenticationSucceeded(result)
90-
if (biometricViewModel.shouldAskForNewPassCode()) {
91-
biometricViewModel.removePassCode()
92-
val intent = Intent(baseContext, PassCodeActivity::class.java)
93-
intent.action = PassCodeActivity.ACTION_CREATE
94-
intent.putExtra(PassCodeActivity.EXTRAS_MIGRATION, true)
95-
startActivity(intent)
90+
if (result.cryptoObject?.cipher != cryptoObject.cipher) {
91+
authError()
92+
} else {
93+
if (biometricViewModel.shouldAskForNewPassCode()) {
94+
biometricViewModel.removePassCode()
95+
val intent = Intent(baseContext, PassCodeActivity::class.java)
96+
intent.action = PassCodeActivity.ACTION_CREATE
97+
intent.putExtra(PassCodeActivity.EXTRAS_MIGRATION, true)
98+
startActivity(intent)
99+
}
100+
biometricViewModel.setLastUnlockTimestamp()
101+
OwnCloudBiometricManager.onActivityStopped(this@BiometricActivity)
102+
finish()
96103
}
97-
biometricViewModel.setLastUnlockTimestamp()
98-
OwnCloudBiometricManager.onActivityStopped(this@BiometricActivity)
99-
finish()
100104
}
101105

102106
override fun onAuthenticationFailed() {

0 commit comments

Comments
 (0)