Fix GCM IV length
Earlier versions of Keystore generated and stored a 16 byte IV, but used
only the first 12 bytes. Simply generate and store a 12 byte IV, while
processing the longer IVs as before.
Bug: 163866361
Test: keystore2_test
Change-Id: I6b30ad3f41515ce224f282fe555a03580ee7c214
diff --git a/keystore2/src/legacy_blob.rs b/keystore2/src/legacy_blob.rs
index e631356..29d46ad 100644
--- a/keystore2/src/legacy_blob.rs
+++ b/keystore2/src/legacy_blob.rs
@@ -206,7 +206,7 @@
}
impl LegacyBlobLoader {
- const IV_SIZE: usize = keystore2_crypto::IV_LENGTH;
+ const IV_SIZE: usize = keystore2_crypto::LEGACY_IV_LENGTH;
const GCM_TAG_LENGTH: usize = keystore2_crypto::TAG_LENGTH;
const SALT_SIZE: usize = keystore2_crypto::SALT_LENGTH;