History log of /system/keymaster/km_openssl/attestation_utils.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
59c6af81b6b510dd991ab04b8d65f1bab966d0c8 01-Jun-2017 Janis Danisevskis <jdanis@google.com> Key class takes ownership of AuthorizationSets

The key object is constantly passed around together with the two
authorization sets, while the Key class has a field for the
combined authorizations sets. This is doubly awkward.

1. In the combined authorization list the information
about the level of enforcement is lost.
2. The combined authorization list takes up memory that is up to
the same size as the two separate authorization list which
have roughly the same life cycle. Also the allocation
of the additional memory can cause the constructor of Key
to fail (i.e., in the TEE environment) which gave rise to the
error [out] parameter to communicate the failure to the caller.

With this patch, the constructor of Key takes ownership of the
individual authorization lists. This preserves the information
about the enforcement levels (1). The AuthorizationSets can now
be passed around conveniently with the key it belongs to.
The memory for authorizations is no longer duplicated (2). And
the move semantic of the constructor guarantees that it can no
longer fail obviating the need for the error [out] parameter.

Additionally the Key class now keeps the original key blob around.
It also got a key_factory_ field allowing a key to be associated
with its factory. This is particularly useful for hybrid keymaster
implementation where keys can have different factories, depending
on their authorizations.

Test: VtsHalKeymasterV3_0TargetTest
Bug: 67358942
Change-Id: I1d235e16f9120b3d29ef4c71ff7a19d98700559f
/system/keymaster/km_openssl/attestation_utils.cpp
3bfda165bb8a2b91dfe039c92f96cd50aa3d8c2e 12-May-2017 Janis Danisevskis <jdanis@google.com> Move attestation related code to seperate compilation unit

Attestation related functions from KeymasterContext are never called by
AndroidKeymaster but rather by the code that imiplmenets attestation.
Therefore, this patch moves this interface from KeymasterContext to
AttestationRecordContext in attestation_record.h.

Also
- Move attestation key material to contexts/soft_attestation_certs for
reuse by other contexts.
- Moved attestation related code from asymmetric_key to
attestation_utils.

Test: VtsHalKeymasterV3_0TargetTest
Bug: 67358942
Change-Id: I38ed66f69629893783dc639166855963ae7b43f6
/system/keymaster/km_openssl/attestation_utils.cpp