From 39be8a0b7505fdf020b687e54d08ba4fa292ec5c Mon Sep 17 00:00:00 2001 From: gardners Date: Tue, 15 May 2012 22:15:13 +0930 Subject: [PATCH] added new command line option for adding rhizome bundle with authorship so that it includes a BK. All good, except the BK isn't being added. Yet to find out why. --- commandline.c | 3 +++ rhizome.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/commandline.c b/commandline.c index 4fcd07a0..fea39212 100644 --- a/commandline.c +++ b/commandline.c @@ -1082,6 +1082,7 @@ int app_rhizome_add_file(int argc, const char *const *argv, struct command_line_ /* Add the manifest and its associated file to the Rhizome database, generating an "id" in the * process */ rhizome_manifest *mout = NULL; + WHYF("calling rhizome_add_manifest, author='%s'",authorisingSid); int ret = rhizome_add_manifest(m, &mout, filepath, NULL, // no groups - XXX should allow them 255, // ttl - XXX should read from somewhere @@ -1501,6 +1502,8 @@ command_line_option command_line_options[]={ "Get specified configuration variable."}, {app_rhizome_add_file,{"rhizome","add","file","","[]",NULL},CLIFLAG_STANDALONE, "Add a file to Rhizome and optionally write its manifest to the given path"}, + {app_rhizome_add_file,{"rhizome","add","authored","file","","","[]",NULL},CLIFLAG_STANDALONE, + "Add a file to Rhizome and remember who authored it, so that they can modify the bundle later."}, {app_rhizome_list,{"rhizome","list","[]","[]",NULL},CLIFLAG_STANDALONE, "List all manifests and files in Rhizome"}, {app_rhizome_extract_manifest,{"rhizome","extract","manifest","","[]",NULL},CLIFLAG_STANDALONE, diff --git a/rhizome.c b/rhizome.c index e2e29c7a..2a7fc1cb 100644 --- a/rhizome.c +++ b/rhizome.c @@ -275,7 +275,10 @@ int rhizome_add_manifest(rhizome_manifest *m_in, if (!rhizome_bk_xor(author,m_in->cryptoSignPublic, m_in->cryptoSignPublic, bkbytes)) { + WHYF("set BK='%s'",rhizome_bytes_to_hex(bkbytes,len)); rhizome_manifest_set(m_in,"BK",rhizome_bytes_to_hex(bkbytes,len)); + } else { + WHY("Failed to set BK"); } } }