aboutsummaryrefslogtreecommitdiff
path: root/crypto.c
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-06-24 13:19:54 -0400
committerFranklin Wei <me@fwei.tk>2018-06-24 13:19:54 -0400
commit68932344b45fb8938e86513220eb39b3b7306c5b (patch)
tree82e7dd1be81469232e2aac00f98a0263b58debb9 /crypto.c
parent54cffee43a62dcb176bbd0fb7525598d275cfde4 (diff)
downloadcsaa-68932344b45fb8938e86513220eb39b3b7306c5b.zip
csaa-68932344b45fb8938e86513220eb39b3b7306c5b.tar.gz
csaa-68932344b45fb8938e86513220eb39b3b7306c5b.tar.bz2
csaa-68932344b45fb8938e86513220eb39b3b7306c5b.tar.xz
Implement file info and content retrieval in client
Encryption hasn't been implemented yet.
Diffstat (limited to 'crypto.c')
-rw-r--r--crypto.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto.c b/crypto.c
index a7bf68c..4eb1cfa 100644
--- a/crypto.c
+++ b/crypto.c
@@ -555,6 +555,9 @@ hash_t crypt_secret(hash_t encrypted_secret,
* forgo any HMAC. */
hash_t calc_lambda(hash_t gamma, const struct iomt *buildcode, const struct iomt *composefile, hash_t kf)
{
+ printf("calc_lambda: gamma = %s, buildcode = %s, compose = %s, kf = %s\n",
+ hash_format(gamma, 4).str, hash_format(buildcode->mt_nodes[0], 4).str,
+ hash_format(composefile->mt_nodes[0], 4).str, hash_format(kf, 4).str);
hash_t buildcode_root = hash_null, composefile_root = hash_null;
if(buildcode)
buildcode_root = buildcode->mt_nodes[0];
@@ -625,6 +628,14 @@ int read_from_fd(void *userdata, void *buf, size_t len)
return rc;
}
+void dump_versioninfo(const struct version_info *verinfo)
+{
+ printf("idx = %lu, ctr = %lu, ver = %lu, max_ver = %lu, acl = %s, lambda = %s\n",
+ verinfo->idx, verinfo->counter, verinfo->version, verinfo->max_version,
+ hash_format(verinfo->current_acl, 4).str,
+ hash_format(verinfo->lambda, 4).str);
+}
+
void crypto_test(void)
{
#if 1