diff options
author | David Zeuthen <zeuthen@google.com> | 2020-10-16 11:27:24 -0400 |
---|---|---|
committer | David Zeuthen <zeuthen@google.com> | 2021-01-23 13:35:57 -0500 |
commit | 49f2d2558ac417d090dfae9c78ab372d71e5140c (patch) | |
tree | be240ccdfb0fa1e45aa03648cb385ff7ce82d84f /identity/aidl/default/libeic/EicCbor.c | |
parent | eafa06164d1e1bafbe20562d540ab5420bb0f825 (diff) |
Identity Credential changes for Android 12
- Add IIdentityCredential.deleteCredentialWithChallenge()
- Deprecate IIdentityCredential.deleteCredential()
- Add IIdentityCredential.proveOwership()
- Add IIdentityCredential.updateCredential()
- Add ProofOfBinding CBOR to AuthenticationKey X.509 certificate
- Document which API versions new methods/features appeared in.
- Mention need to declare android.hardware.identity_credential system
feature (w/ feature version number) and do this for the default
implementation.
Bug: 170146643
Test: atest VtsHalIdentityTargetTest
Change-Id: Ib47c7caa5f3d6fff6919f019eee44a735dba9cf8
Diffstat (limited to 'identity/aidl/default/libeic/EicCbor.c')
-rw-r--r-- | identity/aidl/default/libeic/EicCbor.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/identity/aidl/default/libeic/EicCbor.c b/identity/aidl/default/libeic/EicCbor.c index ec049b1c0d..fe131eb8b7 100644 --- a/identity/aidl/default/libeic/EicCbor.c +++ b/identity/aidl/default/libeic/EicCbor.c @@ -17,6 +17,7 @@ #include "EicCbor.h" void eicCborInit(EicCbor* cbor, uint8_t* buffer, size_t bufferSize) { + eicMemSet(cbor, '\0', sizeof(EicCbor)); cbor->size = 0; cbor->bufferSize = bufferSize; cbor->buffer = buffer; @@ -26,6 +27,7 @@ void eicCborInit(EicCbor* cbor, uint8_t* buffer, size_t bufferSize) { void eicCborInitHmacSha256(EicCbor* cbor, uint8_t* buffer, size_t bufferSize, const uint8_t* hmacKey, size_t hmacKeySize) { + eicMemSet(cbor, '\0', sizeof(EicCbor)); cbor->size = 0; cbor->bufferSize = bufferSize; cbor->buffer = buffer; @@ -33,6 +35,10 @@ void eicCborInitHmacSha256(EicCbor* cbor, uint8_t* buffer, size_t bufferSize, eicOpsHmacSha256Init(&cbor->digester.hmacSha256, hmacKey, hmacKeySize); } +void eicCborEnableSecondaryDigesterSha256(EicCbor* cbor, EicSha256Ctx* sha256) { + cbor->secondaryDigesterSha256 = sha256; +} + void eicCborFinal(EicCbor* cbor, uint8_t digest[EIC_SHA256_DIGEST_SIZE]) { switch (cbor->digestType) { case EIC_CBOR_DIGEST_TYPE_SHA256: @@ -53,6 +59,9 @@ void eicCborAppend(EicCbor* cbor, const uint8_t* data, size_t size) { eicOpsHmacSha256Update(&cbor->digester.hmacSha256, data, size); break; } + if (cbor->secondaryDigesterSha256 != NULL) { + eicOpsSha256Update(cbor->secondaryDigesterSha256, data, size); + } if (cbor->size >= cbor->bufferSize) { cbor->size += size; |