Skip to content

Commit c428782

Browse files
committed
Minor changes on demo
1 parent d3364c4 commit c428782

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

demos/android/MASVS-RESILIENCE/MASTG-DEMO-0109/MASTG-DEMO-0109.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ test: MASTG-TEST-0342
88

99
## Sample
1010

11-
This sample generates an EC key pair in the Android KeyStore (hardware-backed via the TEE) and retrieves the resulting certificate chain to send to a server for verification. However, no attestation challenge is set via [`setAttestationChallenge`](https://developer.android.com/reference/kotlin/android/security/keystore/KeyGenParameterSpec.Builder#setattestationchallenge) during key generation, so the `attestationChallenge` field in the leaf certificate is null.
12-
13-
Without a server-issued nonce embedded in the attestation, the server cannot determine when the attestation was produced. An attacker could replay a certificate chain that was generated on a clean device long before that device was compromised. See @MASTG-KNOW-0044 for details on how the challenge provides freshness.
11+
This sample generates an EC key pair in the Android KeyStore (hardware-backed via the TEE) and retrieves the resulting certificate chain to send to a server for verification. However, no attestation challenge is set via [`setAttestationChallenge`](https://developer.android.com/reference/kotlin/android/security/keystore/KeyGenParameterSpec.Builder#setattestationchallenge) during key generation, so the server cannot determine when the attestation was produced.
1412

1513
{{ MastgTest.kt # MastgTest_reversed.java }}
1614

demos/android/MASVS-RESILIENCE/MASTG-DEMO-0109/output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
MastgTest_reversed.java
88
❯❱ rules.mastg-android-key-attestation-missing-challenge
9+
❰❰ Blocking ❱❱
910
[MASVS-RESILIENCE-2] KeyGenParameterSpec built without setAttestationChallenge. The server cannot
1011
verify when this attestation was produced.
1112

0 commit comments

Comments
 (0)