Merge "Refactor GoogleKeymaster's operation table to a new class."
diff --git a/aes_operation.cpp b/aes_operation.cpp
index 90f3cfe..804d9b3 100644
--- a/aes_operation.cpp
+++ b/aes_operation.cpp
@@ -369,6 +369,8 @@
return KM_ERROR_INVALID_ARGUMENT;
}
iv_.reset(dup_array(iv_blob.data, iv_blob.data_length));
+ if (!iv_.get())
+ return KM_ERROR_MEMORY_ALLOCATION_FAILED;
return KM_ERROR_OK;
}
diff --git a/aes_operation.h b/aes_operation.h
index 1c2dd8f..de2b065 100644
--- a/aes_operation.h
+++ b/aes_operation.h
@@ -83,7 +83,7 @@
const keymaster_block_mode_t block_mode_;
const keymaster_padding_t padding_;
const bool caller_iv_;
- UniquePtr<uint8_t> iv_;
+ UniquePtr<uint8_t[]> iv_;
uint8_t key_[SymmetricKey::MAX_KEY_SIZE];
};
diff --git a/include/keymaster/keymaster_tags.h b/include/keymaster/keymaster_tags.h
index 3d6e637..0596397 100644
--- a/include/keymaster/keymaster_tags.h
+++ b/include/keymaster/keymaster_tags.h
@@ -178,6 +178,7 @@
DEFINE_KEYMASTER_TAG(KM_BYTES, TAG_ROOT_OF_TRUST);
DEFINE_KEYMASTER_TAG(KM_BYTES, TAG_ASSOCIATED_DATA);
DEFINE_KEYMASTER_TAG(KM_BYTES, TAG_NONCE);
+DEFINE_KEYMASTER_TAG(KM_BYTES, TAG_AUTH_TOKEN);
#ifdef KEYMASTER_NAME_TAGS
#define DEFINE_KEYMASTER_ENUM_TAG(type, name, enumtype) \
diff --git a/keymaster_enforcement.cpp b/keymaster_enforcement.cpp
index 68dade7..0b3bb03 100644
--- a/keymaster_enforcement.cpp
+++ b/keymaster_enforcement.cpp
@@ -83,6 +83,9 @@
tag_user_id_present = true;
return_error = UserAuthenticated(param, uid);
break;
+ case KM_TAG_AUTH_TOKEN:
+ // TODO(swillden): Handle this.
+ break;
case KM_TAG_NO_AUTH_REQUIRED:
return_error = KM_ERROR_OK;
tag_no_auth_required_present = true;