summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2016-01-27 12:59:13 -0700
committerShawn Willden <swillden@google.com>2016-01-28 16:24:17 -0700
commitcb647fec03f71929fd316d2b8f0750f7b24824f3 (patch)
tree54b208b5c2de82c6ed5b722fdeac91a22dc675b1 /include
parent4ed2d7ed2275735ddc4952f310badfa4dcbaf04e (diff)
downloadkeymaster-cb647fec03f71929fd316d2b8f0750f7b24824f3.tar.gz
Support input to "finish()" in AndroidKeymaster operations.
This CL does not yet take advantage of the simplifications that allowing input to finish() provides. That will require updating the Java layer first, to remove some assumptions and code that assume update() must eventually consume all input. Change-Id: Ie85896027a1d55ddec06750d19addbb1f5e462c8
Diffstat (limited to 'include')
-rw-r--r--include/keymaster/authorization_set.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/keymaster/authorization_set.h b/include/keymaster/authorization_set.h
index 5f0f8c3..74daa8d 100644
--- a/include/keymaster/authorization_set.h
+++ b/include/keymaster/authorization_set.h
@@ -118,6 +118,11 @@ class AuthorizationSet : public Serializable, public keymaster_key_param_set_t {
size_t size() const { return elems_size_; }
/**
+ * Returns true if the set is empty.
+ */
+ bool empty() const { return size() == 0; }
+
+ /**
* Returns the total size of all indirect data referenced by set elements.
*/
size_t indirect_size() const { return indirect_data_size_; }
@@ -152,6 +157,12 @@ class AuthorizationSet : public Serializable, public keymaster_key_param_set_t {
int find(keymaster_tag_t tag, int begin = -1) const;
/**
+ * Removes the entry at the specified index. Returns true if successful, false if the index was
+ * out of bounds.
+ */
+ bool erase(size_t index);
+
+ /**
* Returns iterator (pointer) to beginning of elems array, to enable STL-style iteration
*/
const keymaster_key_param_t* begin() const { return elems_; }