aboutsummaryrefslogtreecommitdiff
path: root/service_provider.c
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-07-12 18:08:19 -0400
committerFranklin Wei <me@fwei.tk>2018-07-12 18:08:48 -0400
commit2ff7ce101d02c1ca7a03f088205f302aa31d5549 (patch)
treee8512cdba8ef63aaee9ce138090eb996d3899964 /service_provider.c
parent883824b8710d52ffbc0bc28bacfbac72f7443064 (diff)
downloadcsaa-2ff7ce101d02c1ca7a03f088205f302aa31d5549.zip
csaa-2ff7ce101d02c1ca7a03f088205f302aa31d5549.tar.gz
csaa-2ff7ce101d02c1ca7a03f088205f302aa31d5549.tar.bz2
csaa-2ff7ce101d02c1ca7a03f088205f302aa31d5549.tar.xz
Add some comments
Diffstat (limited to 'service_provider.c')
-rw-r--r--service_provider.c6
1 files changed, 6 insertions, 0 deletions
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));