aboutsummaryrefslogtreecommitdiff
path: root/helper.c
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-06-25 15:32:23 -0400
committerFranklin Wei <me@fwei.tk>2018-06-25 15:32:23 -0400
commit42aa4d804e7e8f42745e32d23080f0b895dddb32 (patch)
tree426e74b942244cb487f58f00ab6c1e5a1990c21f /helper.c
parent51674fc424435b49e7538448276e1af509669e04 (diff)
downloadcsaa-42aa4d804e7e8f42745e32d23080f0b895dddb32.zip
csaa-42aa4d804e7e8f42745e32d23080f0b895dddb32.tar.gz
csaa-42aa4d804e7e8f42745e32d23080f0b895dddb32.tar.bz2
csaa-42aa4d804e7e8f42745e32d23080f0b895dddb32.tar.xz
Limit direct access to IOMT structure
Preparation for moving to database backend instead of storing everything in memory.
Diffstat (limited to 'helper.c')
-rw-r--r--helper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/helper.c b/helper.c
index e34e515..15ae695 100644
--- a/helper.c
+++ b/helper.c
@@ -53,14 +53,15 @@ struct tm_cert cert_rv_by_idx(const struct trusted_module *tm,
uint64_t idx,
hash_t *hmac_out)
{
- struct iomt_node *node = iomt_find_leaf_or_encloser(tree, idx);
+ uint64_t leafidx;
+ struct iomt_node *node = iomt_find_leaf_or_encloser(tree, idx, &leafidx);
if(!node)
return cert_null;
/* find the complement */
int *orders;
- hash_t *comp = merkle_complement(tree, node - tree->mt_leaves, &orders);
+ hash_t *comp = merkle_complement(tree, leafidx, &orders);
struct tm_cert cert;