diff options
author | Franklin Wei <me@fwei.tk> | 2018-07-12 18:08:19 -0400 |
---|---|---|
committer | Franklin Wei <me@fwei.tk> | 2018-07-12 18:08:48 -0400 |
commit | 2ff7ce101d02c1ca7a03f088205f302aa31d5549 (patch) | |
tree | e8512cdba8ef63aaee9ce138090eb996d3899964 | |
parent | 883824b8710d52ffbc0bc28bacfbac72f7443064 (diff) | |
download | csaa-2ff7ce101d02c1ca7a03f088205f302aa31d5549.zip csaa-2ff7ce101d02c1ca7a03f088205f302aa31d5549.tar.gz csaa-2ff7ce101d02c1ca7a03f088205f302aa31d5549.tar.bz2 csaa-2ff7ce101d02c1ca7a03f088205f302aa31d5549.tar.xz |
Add some comments
-rw-r--r-- | iomt.h | 1 | ||||
-rw-r--r-- | service_provider.c | 6 |
2 files changed, 6 insertions, 1 deletions
@@ -121,7 +121,6 @@ void iomt_setnode(const struct iomt *tree, uint64_t idx, hash_t val); struct iomt_node iomt_getleaf(const struct iomt *tree, uint64_t leafidx); -/* All linear searches... slow! */ struct iomt_node iomt_find_leaf(const struct iomt *tree, uint64_t idx, uint64_t *leafidx); struct iomt_node iomt_find_encloser(const struct iomt *tree, uint64_t idx, uint64_t *leafidx); struct iomt_node iomt_find_leaf_or_encloser(const struct iomt *tree, uint64_t idx, uint64_t *leafidx); diff --git a/service_provider.c b/service_provider.c index 77edb2a..01235e0 100644 --- a/service_provider.c +++ b/service_provider.c @@ -738,6 +738,8 @@ struct tm_request sp_createfile(struct service_provider *sp, } else { + /* NOTE: this relies on files being created with a sequential + * numbering; this can be changed if needed. */ /* we must insert a placeholder node; first find the index of * the leaf that loops around to 1 */ i = sp->next_fileidx - 1; @@ -749,6 +751,8 @@ struct tm_request sp_createfile(struct service_provider *sp, } /* generate EQ certificate */ + /* if we assigned indices in a random order we'd have to use + * iomt_find_encloser for this. */ hash_t hmac; struct tm_cert eq = cert_eq(sp, iomt_getleaf(sp->iomt, i - 1), @@ -763,6 +767,8 @@ struct tm_request sp_createfile(struct service_provider *sp, /* next_idx is set to 1 to keep everything circularly linked; * in the next iteration it will be updated to point to the * next node, if any */ + /* for random indices, recall the encloser's old next index, + * and use that here */ iomt_update_leaf_full(sp->iomt, i, i + 1, 1, hash_null); assert(tm_set_equiv_root(sp->tm, &eq, hmac)); |