summaryrefslogtreecommitdiffstats
path: root/keystore/keystore.h
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2012-03-23 16:34:39 -0700
committerKenny Root <kroot@google.com>2012-03-27 14:58:04 -0700
commit822c3a99d930e9299e2fad2fb3e0ff91b119b95a (patch)
tree30d12cd0df6c5921863451542a70749c2206d17b /keystore/keystore.h
parent298e7b1b0f9116e2054d594d7538379d86585035 (diff)
downloadsystem_security-822c3a99d930e9299e2fad2fb3e0ff91b119b95a.zip
system_security-822c3a99d930e9299e2fad2fb3e0ff91b119b95a.tar.gz
system_security-822c3a99d930e9299e2fad2fb3e0ff91b119b95a.tar.bz2
Add support for upgrading key types
Old key types were not distinguished by the keystore itself. This change takes some of the reserved fields in the old format and changes it to a version number and key type. Change-Id: I45bd4cdce042617641fe7bd742bbe26da6024996
Diffstat (limited to 'keystore/keystore.h')
-rw-r--r--keystore/keystore.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/keystore/keystore.h b/keystore/keystore.h
index 0c2dac5..fe2ce56 100644
--- a/keystore/keystore.h
+++ b/keystore/keystore.h
@@ -91,4 +91,23 @@ command_code_t CommandCodes[] = {
'y', // UNGRANT
};
+/**
+ * Returns the size of the softkey magic header value for measuring
+ * and allocating purposes.
+ */
+size_t get_softkey_header_size();
+
+/**
+ * Adds the magic softkey header to a key blob.
+ *
+ * Returns NULL if the destination array is too small. Otherwise it
+ * returns the offset directly after the magic value.
+ */
+uint8_t* add_softkey_header(uint8_t* key_blob, size_t key_blob_length);
+
+/**
+ * Returns true if the key blob has a magic softkey header at the beginning.
+ */
+bool is_softkey(const uint8_t* key_blob, const size_t key_blob_length);
+
#endif