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
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 @@
* 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 @@
* 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 @@
* 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);
};