android-key-attestation
android-key-attestation copied to clipboard
Handle a missing Attestation Application ID properly
Some certificates cause the library to exit with a NullPointerException, in our case when ASN1Sequence.fromByteArray(attestationApplicationId.getOctets());
returned null. We need to make sure that these cases don't break the parsing completely.
Stack trace:
20:11:35.636: Caused by: java.lang.NullPointerException
20:11:35.636: at com.google.android.attestation.AttestationApplicationId.<init>(AttestationApplicationId.java:50)
20:11:35.636: at com.google.android.attestation.AttestationApplicationId.createAttestationApplicationId(AttestationApplicationId.java:79)
20:11:35.636: at com.google.android.attestation.AuthorizationList.<init>(AuthorizationList.java:186)
20:11:35.636: at com.google.android.attestation.AuthorizationList.createAuthorizationList(AuthorizationList.java:221)
20:11:35.636: at com.google.android.attestation.ParsedAttestationRecord.<init>(ParsedAttestationRecord.java:66)
20:11:35.636: at com.google.android.attestation.ParsedAttestationRecord.createParsedAttestationRecord(ParsedAttestationRecord.java:78)