diff options
author | Franklin Wei <me@fwei.tk> | 2018-05-30 22:45:20 -0400 |
---|---|---|
committer | Franklin Wei <me@fwei.tk> | 2018-05-30 22:45:20 -0400 |
commit | fbd47093d2e71e4d6a58b4c23ac57e357a26ab2a (patch) | |
tree | 31c6b84dd6d0d8931cb093c7a2b2c86c4ab7e760 /service_provider.h | |
parent | 8ff48e0c8e4f4012527083bf072db385b57fc222 (diff) | |
download | csaa-fbd47093d2e71e4d6a58b4c23ac57e357a26ab2a.zip csaa-fbd47093d2e71e4d6a58b4c23ac57e357a26ab2a.tar.gz csaa-fbd47093d2e71e4d6a58b4c23ac57e357a26ab2a.tar.bz2 csaa-fbd47093d2e71e4d6a58b4c23ac57e357a26ab2a.tar.xz |
work on various things
Diffstat (limited to 'service_provider.h')
-rw-r--r-- | service_provider.h | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/service_provider.h b/service_provider.h index b1910a0..2ba3682 100644 --- a/service_provider.h +++ b/service_provider.h @@ -6,11 +6,41 @@ #include "crypto.h" -struct iomt_node { - int idx, next_idx; /* idx cannot be zero */ - hash_t val; /* all zero indicates placeholder */ +struct service_provider; + +struct user_request { + int idx; + int id; /* user id */ + enum { ACL_UPDATE, FILE_UPDATE } type; + int counter; + hash_t val; /* for ACL update, val=[root of ACL IOMT], for file + * update, val is a commitment to the contents, key, + * and index of the file */ + union { + /* if counter = 0 and type = ACL, create a new file with given ACL */ + struct { + struct tm_cert ru_cert; + hash_t ru_hmac; + } create; + + /* otherwise the request is to modify either the file or + * ACL */ + struct { + /* FR certificate verifying file ACL and counter */ + struct tm_cert fr_cert; + hash_t fr_hmac; + + /* RV certificate verifying that user is in the ACL */ + struct tm_cert rv_cert; + hash_t rv_hmac; + + struct tm_cert ru_cert; + hash_t ru_hmac; + } modify; + }; }; -struct service_provider; +struct service_provider *sp_new(const void *key, size_t keylen); +void sp_request(struct service_provider *sp, const struct user_request *req, hmac_t hmac); #endif |