summaryrefslogtreecommitdiff
path: root/transport/base
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2017-03-27 17:10:42 -0700
committerYifan Hong <elsk@google.com>2017-03-30 17:50:22 -0700
commitdb93348cb674bb93a117c0f7a140e2b76cfca5c6 (patch)
tree4daa2e96281c89a9e778520da39f0d676ca5ab13 /transport/base
parenta62432bf9b64b8b3f5cc902218f33e1648027732 (diff)
downloadlibhidl-db93348cb674bb93a117c0f7a140e2b76cfca5c6.tar.gz
Add getHashChain() to IBase.
Each interface has a getHashChain() method that returns the hash of all .hal files from the rtti of the interface up to IBase. Test: pass (since no frozen hashes for interfaces yet) Bug: 36602587 Change-Id: I068cc7a09fea1fdab050b3b7e5b3d4360bd56cdc
Diffstat (limited to 'transport/base')
-rw-r--r--transport/base/1.0/IBase.hal23
1 files changed, 21 insertions, 2 deletions
diff --git a/transport/base/1.0/IBase.hal b/transport/base/1.0/IBase.hal
index 9301c65..e862ec8 100644
--- a/transport/base/1.0/IBase.hal
+++ b/transport/base/1.0/IBase.hal
@@ -41,7 +41,7 @@ interface IBase {
* package android.hardware.foo@1.0;
* interface IParent {};
* interface IChild extends IParent {};
- * Calling interfaceChain on an IChild object will yield the following:
+ * Calling interfaceChain on an IChild object must yield the following:
* ["android.hardware.foo@1.0::IChild",
* "android.hardware.foo@1.0::IParent"
* "android.hidl.base@1.0::IBase"]
@@ -57,7 +57,7 @@ interface IBase {
* package android.hardware.foo@1.0;
* interface IParent {};
* interface IChild extends IParent {};
- * Calling interfaceDescriptor on an IChild object will yield
+ * Calling interfaceDescriptor on an IChild object must yield
* "android.hardware.foo@1.0::IChild"
*
* @return descriptor a descriptor of the run-time type of the
@@ -116,4 +116,23 @@ interface IBase {
* Must support empty for default debug information.
*/
debug(handle fd, vec<string> options);
+
+ /*
+ * Returns hashes of the source HAL files that define the interfaces of the
+ * runtime type information on the object.
+ * For example, for the following interface definition:
+ * package android.hardware.foo@1.0;
+ * interface IParent {};
+ * interface IChild extends IParent {};
+ * Calling interfaceChain on an IChild object must yield the following:
+ * [(hash of IChild.hal),
+ * (hash of IParent.hal)
+ * (hash of IBase.hal)].
+ *
+ * SHA-256 is used as the hashing algorithm. Each hash has 32 bytes
+ * according to SHA-256 standard.
+ *
+ * @return hashchain a vector of SHA-1 digests
+ */
+ getHashChain() generates (vec<uint8_t[32]> hashchain);
};