# # # patch "cmd_key_cert.cc" # from [a0d35d7700f872f63b4aece72118109e1e95adf4] # to [8dcd07a96d97128da87ec9ce83eb4af2fc821e70] # # patch "cmd_packet.cc" # from [08d5ce0630d5eb5035ca832d571c3a4fd80129ff] # to [98a32aaad46f8cf84693763f0e38a5bad1075018] # # patch "keys.cc" # from [5ac875db602c75633255a6be7f70e93ae8f72f22] # to [75f5f73ce24d06021d81dfcd7c9543fe20eaf45a] # # patch "lua_hooks.cc" # from [14053cbed410fbcc150fe280a85f5097cdb6d32a] # to [0662b9925c66ea83b054c66a235724549b84f984] # # patch "lua_hooks.hh" # from [37e9103e9a88710298ca7a580019e02c9d37062f] # to [56a7bcc44bd23784e58d85e10b00c0c0baee22c9] # # patch "network/netsync_session.cc" # from [91610bcaf3268f2b7ba6a4c39d9902ad0a0e9ace] # to [78db6255ceae5c7498ddc809ced510826d479a93] # # patch "project.cc" # from [1861ee1819e6c87f5a1b17fcefc53a238f799934] # to [05a19fbf28d1739f79ba4b6308e8f12da4865199] # # patch "project.hh" # from [76e965fecfd97bbae88e8b4a213bb9815ab58685] # to [92a156f9191c7078bbe9942fa9ad223e97f59898] # ============================================================ --- cmd_key_cert.cc a0d35d7700f872f63b4aece72118109e1e95adf4 +++ cmd_key_cert.cc 8dcd07a96d97128da87ec9ce83eb4af2fc821e70 @@ -72,7 +72,7 @@ CMD(dropkey, "dropkey", "", CMD_REF(key_ key_identity_info identity; project_t project(db, app.lua, app.opts); - project.get_key_identity(keys, app.lua, branch_name(), + project.get_key_identity(keys, app.lua, app.opts, typecast_vocab(idx(args, 0)), identity); @@ -119,7 +119,7 @@ CMD(passphrase, "passphrase", "", CMD_RE project_t project(db, app.lua, app.opts); key_identity_info identity; - project.get_key_identity(keys, app.lua, branch_name(), + project.get_key_identity(keys, app.lua, app.opts, typecast_vocab(idx(args, 0)), identity); @@ -237,7 +237,7 @@ CMD(trusted, "trusted", "", CMD_REF(key_ for (unsigned int i = 3; i != args.size(); ++i) { key_identity_info identity; - project.get_key_identity(keys, app.lua, app.opts.branch, + project.get_key_identity(keys, app.lua, app.opts, typecast_vocab(idx(args, i)), identity); signers.insert(identity); ============================================================ --- cmd_packet.cc 08d5ce0630d5eb5035ca832d571c3a4fd80129ff +++ cmd_packet.cc 98a32aaad46f8cf84693763f0e38a5bad1075018 @@ -37,7 +37,7 @@ CMD(pubkey, "pubkey", "", CMD_REF(packet project_t project(db, app.lua, app.opts); key_identity_info identity; - project.get_key_identity(keys, app.lua, app.opts.branch, + project.get_key_identity(keys, app.lua, app.opts, typecast_vocab(idx(args, 0)), identity); bool exists(false); @@ -75,7 +75,7 @@ CMD(privkey, "privkey", "", CMD_REF(pack key_name name = typecast_vocab(idx(args, 0)); key_identity_info identity; - project.get_key_identity(app.lua, branch_name(), + project.get_key_identity(app.lua, app.opts, typecast_vocab(idx(args, 0)), identity); E(keys.key_pair_exists(identity.id), origin::user, ============================================================ --- keys.cc 5ac875db602c75633255a6be7f70e93ae8f72f22 +++ keys.cc 75f5f73ce24d06021d81dfcd7c9543fe20eaf45a @@ -133,7 +133,7 @@ get_user_key(options const & opts, lua_h if (!opts.signing_key().empty()) { key_identity_info identity; - project.get_key_identity(keys, lua, opts.branch, + project.get_key_identity(keys, lua, opts, opts.signing_key, identity); key = identity.id; } @@ -144,7 +144,7 @@ get_user_key(options const & opts, lua_h "was given with an empty argument")); } } - else if (lua.hook_get_branch_key(opts.branch, keys, project, key)) + else if (lua.hook_get_branch_key(opts, keys, project, key)) ; // the lua hook sets the key else { @@ -181,13 +181,13 @@ cache_netsync_key(options const & opts, // maybe they specifically requested no key ("--key ''") if (!opts.signing_key().empty()) { - project.get_key_identity(keys, lua, opts.branch, + project.get_key_identity(keys, lua, opts, opts.signing_key, identity); key = identity.id; found_key = true; } } - else if (lua.hook_get_netsync_key(host, include, exclude, keys, project, key)) + else if (lua.hook_get_netsync_key(host, include, exclude, keys, project, opts, key)) { found_key = true; } ============================================================ --- lua_hooks.cc 14053cbed410fbcc150fe280a85f5097cdb6d32a +++ lua_hooks.cc 0662b9925c66ea83b054c66a235724549b84f984 @@ -359,7 +359,7 @@ bool } bool -lua_hooks::hook_get_branch_key(branch_name const & branchname, +lua_hooks::hook_get_branch_key(options const & opts, key_store & keys, project_t & project, key_id & k) @@ -367,7 +367,7 @@ lua_hooks::hook_get_branch_key(branch_na string key; bool ok = Lua(st) .func("get_branch_key") - .push_str(branchname()) + .push_str(opts.branch()) .call(1,1) .extract_str(key) .ok(); @@ -377,7 +377,7 @@ lua_hooks::hook_get_branch_key(branch_na else { key_identity_info identity; - project.get_key_identity(keys, *this, branch_name(), + project.get_key_identity(keys, *this, opts, external_key_name(key, origin::user), identity); k = identity.id; return true; @@ -805,6 +805,7 @@ lua_hooks::hook_get_netsync_key(utf8 con globish const & exclude, key_store & keys, project_t & project, + options const & opts, key_id & k) { string name; @@ -823,7 +824,7 @@ lua_hooks::hook_get_netsync_key(utf8 con else { key_identity_info identity; - project.get_key_identity(keys, *this, branch_name(), + project.get_key_identity(keys, *this, opts, external_key_name(name, origin::user), identity); k = identity.id; return true; ============================================================ --- lua_hooks.hh 37e9103e9a88710298ca7a580019e02c9d37062f +++ lua_hooks.hh 56a7bcc44bd23784e58d85e10b00c0c0baee22c9 @@ -57,7 +57,7 @@ public: // cert hooks bool hook_expand_selector(string const & sel, string & exp); bool hook_expand_date(string const & sel, string & exp); - bool hook_get_branch_key(branch_name const & branchname, + bool hook_get_branch_key(options const & opts, key_store & keys, project_t & project, key_id & k); bool hook_get_passphrase(key_identity_info const & info, @@ -91,6 +91,7 @@ public: globish const & exclude, key_store & keys, project_t & project, + options const & opts, key_id & k); bool hook_get_netsync_connect_command(uri_t const & uri, globish const & include_pattern, ============================================================ --- network/netsync_session.cc 91610bcaf3268f2b7ba6a4c39d9902ad0a0e9ace +++ network/netsync_session.cc 78db6255ceae5c7498ddc809ced510826d479a93 @@ -106,7 +106,7 @@ netsync_session::netsync_session(session i != opts.keys_to_push.end(); ++i) { key_identity_info ident; - project.get_key_identity(keys, lua, branch_name(), *i, ident); + project.get_key_identity(keys, lua, opts, *i, ident); keys_to_push.push_back(ident.id); } } ============================================================ --- project.cc 1861ee1819e6c87f5a1b17fcefc53a238f799934 +++ project.cc 05a19fbf28d1739f79ba4b6308e8f12da4865199 @@ -1580,7 +1580,7 @@ project_t::get_key_identity(key_store * void project_t::get_key_identity(key_store * const keys, lua_hooks & lua, - branch_name const & where, + options const & opts, external_key_name const & input, key_identity_info & output) const { @@ -1592,13 +1592,13 @@ project_t::get_key_identity(key_store * // above throw recoverable_failure instead of unrecoverable_failure ident.made_from = input.made_from; output.id = key_id(ident); - complete_key_identity_from_id(keys, lua, where, output); + complete_key_identity_from_id(keys, lua, opts.branch, output); return; } catch (recoverable_failure &) { output.official_name = typecast_vocab(input); - lookup_key_by_name(keys, lua, where, output.official_name, output.id); + lookup_key_by_name(keys, lua, opts.branch, output.official_name, output.id); get_given_name_of_key(keys, output.id, output.given_name); return; } @@ -1607,20 +1607,20 @@ project_t::get_key_identity(key_store & void project_t::get_key_identity(key_store & keys, lua_hooks & lua, - branch_name const & where, + options const & opts, external_key_name const & input, key_identity_info & output) const { - get_key_identity(&keys, lua, where, input, output); + get_key_identity(&keys, lua, opts, input, output); } void project_t::get_key_identity(lua_hooks & lua, - branch_name const & where, + options const & opts, external_key_name const & input, key_identity_info & output) const { - get_key_identity(0, lua, where, input, output); + get_key_identity(0, lua, opts, input, output); } ============================================================ --- project.hh 76e965fecfd97bbae88e8b4a213bb9815ab58685 +++ project.hh 92a156f9191c7078bbe9942fa9ad223e97f59898 @@ -248,7 +248,7 @@ private: key_identity_info & info) const; void get_key_identity(key_store * const keys, lua_hooks & lua, - branch_name const & where, + options const & opts, external_key_name const & input, key_identity_info & output) const; public: @@ -261,11 +261,11 @@ public: key_identity_info & info) const; void get_key_identity(key_store & keys, lua_hooks & lua, - branch_name const & where, + options const & opts, external_key_name const & input, key_identity_info & output) const; void get_key_identity(lua_hooks & lua, - branch_name const & where, + options const & opts, external_key_name const & input, key_identity_info & output) const; };