Fix AES encryption for SP

Synthetic password is double encrypted by both a random auth-bound
keymaster key and a secret derived from user password.

The value 256 (AES_KEY_LENGTH) is declared as default key size for
secret derived from user password.

Auth-bound keymaster key is not a KeyStore-backed secret key
but is one that is PRNG created by JCA classes and stored
into KeyStore through import key material routine,
constraining particular purpose (only PURPOSE_DECRYPT).

Size for random auth-bound keymaster key is not set.

The default size of the AES key generated by KeyGenerator
(if keysize is not set) is 128.

Following fix is aiming to:

* Ensures that both wrapping keys are using the same key size (=256).

* Ensures that GCM encryption parameters generated by the provider are
the same (tag size equals 128).

How to verify:
Check the synthetic_password_X keystore blob size diff (479 -> 495) at
/data/misc/keystore/user_XX

Bug: 124030743
Test: Manual - see issue
Change-Id: I44346b8c1d98773ef1c168d63b03bc5d2bf0f746
1 file changed