fix(attestation): correct leaf CN casing and enforce keystore2 parameter policy
Leaf cert Subject CN used "KeyStore" (capital S) but AOSP KeyGenParameterSpec uses "Keystore" (lowercase s). Fixed in both the Rust native certgen and BouncyCastle paths. Replicate keystore2's security_level.rs parameter validation for software-generated keys: reject CREATION_DATETIME (output-only tag, ResponseCode 20) and device ID attestation tags (CANNOT_ATTEST_IDS -66) that real keystore2 blocks before they reach the HAL. Also fix createErrorReply parcel write order, AIDL protocol expects exception_code, message, error_code but we had message and error_code swapped, causing malformed replies for positive error codes.
This commit is contained in:
@@ -51,7 +51,7 @@ fn build_leaf_cert(
|
||||
let subject_dn_der = if let Some(ref subject) = params.cert_subject {
|
||||
subject.clone()
|
||||
} else {
|
||||
encode_simple_cn_dn("Android KeyStore Key")
|
||||
encode_simple_cn_dn("Android Keystore Key")
|
||||
};
|
||||
|
||||
// Validity
|
||||
|
||||
Reference in New Issue
Block a user