2021-07-01 09:16:41 +00:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
== Sensitive Code Example
|
2021-07-01 09:16:41 +00:00
|
|
|
|
|
|
|
A ``++CryptoObject++`` is not used during authentication:
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,java]
|
2021-07-01 09:16:41 +00:00
|
|
|
----
|
|
|
|
// ...
|
|
|
|
BiometricPrompt biometricPrompt = new BiometricPrompt(activity, executor, callback);
|
|
|
|
// ...
|
|
|
|
biometricPrompt.authenticate(promptInfo); // Noncompliant
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
A ``++CryptoObject++`` is used during authentication:
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,java]
|
2021-07-01 09:16:41 +00:00
|
|
|
----
|
|
|
|
// ...
|
|
|
|
BiometricPrompt biometricPrompt = new BiometricPrompt(activity, executor, callback);
|
|
|
|
// ...
|
|
|
|
biometricPrompt.authenticate(promptInfo, new BiometricPrompt.CryptoObject(cipher)); // Compliant
|
|
|
|
|
|
|
|
----
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
include::../see.adoc[]
|