diff options
author | Franklin Wei <me@fwei.tk> | 2018-06-23 20:41:45 -0400 |
---|---|---|
committer | Franklin Wei <me@fwei.tk> | 2018-06-23 20:41:45 -0400 |
commit | 54cffee43a62dcb176bbd0fb7525598d275cfde4 (patch) | |
tree | 8c60c53ef311fa94b6b0ccfc9c1c046b37b817c3 /service_provider.h | |
parent | 77094976e17f3c1151dc7210815f0d47029ea54b (diff) | |
download | csaa-54cffee43a62dcb176bbd0fb7525598d275cfde4.zip csaa-54cffee43a62dcb176bbd0fb7525598d275cfde4.tar.gz csaa-54cffee43a62dcb176bbd0fb7525598d275cfde4.tar.bz2 csaa-54cffee43a62dcb176bbd0fb7525598d275cfde4.tar.xz |
Add command-line interface for client
Mostly functional now; file info and content retrieval not fully done yet.
Diffstat (limited to 'service_provider.h')
-rw-r--r-- | service_provider.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/service_provider.h b/service_provider.h index be931a2..f5fd4bc 100644 --- a/service_provider.h +++ b/service_provider.h @@ -32,30 +32,33 @@ struct service_provider; /* request from the client to the service */ struct user_request { - enum { CREATE_FILE, MODIFY_FILE, MODIFY_ACL, RETRIEVE_INFO, RETRIEVE_FILE } type; + enum { USERREQ_NONE = 0, CREATE_FILE, MODIFY_FILE, MODIFY_ACL, RETRIEVE_INFO, RETRIEVE_FILE } type; + uint64_t user_id; union { struct { - uint64_t user_id; - } create; - struct { - uint64_t user_id, file_idx; + uint64_t file_idx; /* ACL IOMT will follow */ + + /* service will respond with tm_request structure, + * requiring a client signature; then the module's HMAC + * will follow */ } modify_acl; struct { - uint64_t user_id, file_idx; + uint64_t file_idx; hash_t encrypted_secret, kf; /* file contents, build code IOMT, and compose file IOMT * will follow */ - /* will respond with module's HMAC of tm_request struct - * plus a zero byte */ + /* service will respond with tm_request structure, + * requiring a client signature; then the module's HMAC + * will follow */ } modify_file; struct { /* same structure for retrieve file and retrieve info */ - uint64_t user_id, file_idx, version; - /* will respond with either version_info struct, plus - * HMAC, or file contents and key (which the client can - * verify themselves) */ + uint64_t file_idx, version; + /* service will respond with either version_info struct, + * plus HMAC, or file contents and key (which the client + * can verify themselves) */ } retrieve; }; } __attribute__((packed)); |