diff --git a/commandline.c b/commandline.c index 5b498437..0f95ef8a 100644 --- a/commandline.c +++ b/commandline.c @@ -1054,10 +1054,16 @@ int app_config_get(int argc, const char *const *argv, struct command_line_option int app_rhizome_add_file(int argc, const char *const *argv, struct command_line_option *o) { - const char *filepath, *manifestpath,*authorisingSid; + const char *filepath, *manifestpath,*authorisingSid,*pin; cli_arg(argc, argv, o, "filepath", &filepath, NULL, ""); cli_arg(argc, argv, o, "manifestpath", &manifestpath, NULL, ""); cli_arg(argc, argv, o, "sid", &authorisingSid,NULL,""); + cli_arg(argc, argv, o, "pin", &pin,NULL,""); + + keyring=keyring_open_with_pins(pin); + if (!keyring) { WHY("keyring add: Failed to create/open keyring file"); + return -1; } + /* Ensure the Rhizome database exists and is open */ if (create_serval_instance_dir() == -1) @@ -1067,7 +1073,7 @@ int app_rhizome_add_file(int argc, const char *const *argv, struct command_line_ * it, otherwise create a blank manifest. */ rhizome_manifest *m = NULL; int manifest_file_supplied = 0; - if (manifestpath[0] && access(manifestpath, R_OK) == 0) { + if (manifestpath[0] && access(manifestpath, R_OK) == 0) { m = rhizome_read_manifest_file(manifestpath, 0, 0); // no verify if (!m) return WHY("Manifest file could not be loaded -- not added to rhizome"); @@ -1520,7 +1526,7 @@ 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, + {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"}, diff --git a/overlay_route.c b/overlay_route.c index ed6144f0..9df0e20b 100644 --- a/overlay_route.c +++ b/overlay_route.c @@ -397,6 +397,7 @@ int overlay_get_nexthop(unsigned char *d,unsigned char *nexthop,int *nexthoplen, return 0; } else { /* Is not a direct neighbour */ + return WHY("Calculating next-hop destination for nodes that are not direct neighbours is not yet implemented"); } } diff --git a/rhizome_crypto.c b/rhizome_crypto.c index d43bdbd5..922ba721 100644 --- a/rhizome_crypto.c +++ b/rhizome_crypto.c @@ -135,7 +135,7 @@ int rhizome_bk_xor(const char *author, */ int rhizome_extract_privatekey(rhizome_manifest *m,const char *authorHex) { - char *bk = rhizome_manifest_get(m, "bk", NULL, 0); + char *bk = rhizome_manifest_get(m, "BK", NULL, 0); if (!bk) return WHY("Cannot obtain private key as manifest lacks BK field"); unsigned char bkBytes[crypto_sign_edwards25519sha512batch_SECRETKEYBYTES];