# # # patch "netsync.cc" # from [284b400d09495be2e34ff8016ff8316fe34dfc6c] # to [262cc4625382699a2ae9c44f8a139ea43ad3d008] # # patch "options_list.hh" # from [dea0f08761112a3113a14a9f903b66faad4f02eb] # to [7c3f910f46f7ca2d2a416ac9fe2d23cbc5b8e8ee] # # patch "project.cc" # from [e19d0acb6159386ba911284a33ad4403ea6f5566] # to [a85f18807cbc13ff145d382dce8e1ab7b09fbdbe] # # patch "project.hh" # from [c6dfcadfe0eb30b3d13b69102833fc8a1a620921] # to [4738c610b3c8115d55913a130f8f2f7672cff6c7] # # patch "vocab_terms.hh" # from [bedb85f7daae7ba8565203769aba9e3db3ba25fd] # to [3614f3fb3d23347011580247e8593a3b157a0347] # # patch "work.cc" # from [9053a57ad3260c1c6f54e3b8aa038006b71e0119] # to [75a70fb7735951970a73bb6d44cbfad8b4fe9e1e] # ============================================================ --- netsync.cc 284b400d09495be2e34ff8016ff8316fe34dfc6c +++ netsync.cc 262cc4625382699a2ae9c44f8a139ea43ad3d008 @@ -885,7 +885,7 @@ session::session(options & opts, rev_enumerator(project, *this), initiated_by_server(initiated_by_server) { - for (vector::const_iterator i = opts.keys_to_push.begin(); + for (vector::const_iterator i = opts.keys_to_push.begin(); i != opts.keys_to_push.end(); ++i) { key_identity_info ident; ============================================================ --- options_list.hh dea0f08761112a3113a14a9f903b66faad4f02eb +++ options_list.hh 7c3f910f46f7ca2d2a416ac9fe2d23cbc5b8e8ee @@ -395,11 +395,11 @@ GOPT(ignore_suspend_certs, "ignore-suspe #endif -OPTVAR(key, arg_type, signing_key, ) +OPTVAR(key, external_key_name, signing_key, ) OPTION(globals, key, true, "key,k", gettext_noop("set key for signatures")) #ifdef option_bodies { - signing_key = arg_type(arg, origin::user); + signing_key = external_key_name(arg, origin::user); } #endif @@ -414,12 +414,12 @@ OPTION(globals, key_dir, true, "keydir", } #endif -OPTVAR(key_to_push, std::vector, keys_to_push, ) +OPTVAR(key_to_push, std::vector, keys_to_push, ) OPTION(key_to_push, key_to_push, true, "key-to-push", gettext_noop("push the specified key even if it hasn't signed anything")) #ifdef option_bodies { - keys_to_push.push_back(arg_type(arg, origin::user)); + keys_to_push.push_back(external_key_name(arg, origin::user)); } #endif ============================================================ --- project.cc e19d0acb6159386ba911284a33ad4403ea6f5566 +++ project.cc a85f18807cbc13ff145d382dce8e1ab7b09fbdbe @@ -11,6 +11,7 @@ #include "vector.hh" #include "cert.hh" +#include "charset.hh" // internalize_key_name #include "database.hh" #include "project.hh" #include "revision.hh" @@ -607,7 +608,7 @@ project_t::get_key_identity(key_store * void project_t::get_key_identity(key_store * const keys, lua_hooks & lua, - arg_type const & input, + external_key_name const & input, key_identity_info & output) { try @@ -621,7 +622,8 @@ project_t::get_key_identity(key_store * } catch (recoverable_failure &) { - output.official_name = typecast_vocab(input); + internalize_key_name(typecast_vocab(input), + output.official_name); } complete_key_identity(keys, lua, output); } @@ -629,10 +631,27 @@ project_t::get_key_identity(key_store & void project_t::get_key_identity(key_store & keys, lua_hooks & lua, + external_key_name const & input, + key_identity_info & output) +{ + get_key_identity(&keys, lua, input, output); +} + +void +project_t::get_key_identity(lua_hooks & lua, + external_key_name const & input, + key_identity_info & output) +{ + get_key_identity(0, lua, input, output); +} + +void +project_t::get_key_identity(key_store & keys, + lua_hooks & lua, arg_type const & input, key_identity_info & output) { - get_key_identity(&keys, lua, input, output); + get_key_identity(&keys, lua, typecast_vocab(input), output); } void @@ -640,9 +659,10 @@ project_t::get_key_identity(lua_hooks & arg_type const & input, key_identity_info & output) { - get_key_identity(0, lua, input, output); + get_key_identity(0, lua, typecast_vocab(input), output); } + // These should maybe be converted to member functions. string ============================================================ --- project.hh c6dfcadfe0eb30b3d13b69102833fc8a1a620921 +++ project.hh 4738c610b3c8115d55913a130f8f2f7672cff6c7 @@ -163,7 +163,7 @@ private: key_identity_info & info); void get_key_identity(key_store * const keys, lua_hooks & lua, - arg_type const & input, + external_key_name const & input, key_identity_info & output); public: void complete_key_identity(key_store & keys, @@ -173,6 +173,13 @@ public: key_identity_info & info); void get_key_identity(key_store & keys, lua_hooks & lua, + external_key_name const & input, + key_identity_info & output); + void get_key_identity(lua_hooks & lua, + external_key_name const & input, + key_identity_info & output); + void get_key_identity(key_store & keys, + lua_hooks & lua, arg_type const & input, key_identity_info & output); void get_key_identity(lua_hooks & lua, ============================================================ --- vocab_terms.hh bedb85f7daae7ba8565203769aba9e3db3ba25fd +++ vocab_terms.hh 3614f3fb3d23347011580247e8593a3b157a0347 @@ -34,6 +34,7 @@ ATOMIC(key_name); // keynam ATOMIC_NOVERIFY(var_value); // symbol-of-your-choosing ATOMIC(key_name); // address@hidden +ATOMIC_NOVERIFY(external_key_name); // maybe a key_name, maybe a key_id ATOMIC_NOVERIFY(rsa_pub_key); // some nice numbers ATOMIC_NOVERIFY(rsa_priv_key); // some nice numbers ATOMIC_NOVERIFY(old_arc4_rsa_priv_key); // ... in the old storage format ============================================================ --- work.cc 9053a57ad3260c1c6f54e3b8aa038006b71e0119 +++ work.cc 75a70fb7735951970a73bb6d44cbfad8b4fe9e1e @@ -400,7 +400,7 @@ read_options_file(any_path const & optsp read_options_file(any_path const & optspath, system_path & workspace_database, branch_name & workspace_branch, - arg_type & workspace_key, + external_key_name & workspace_key, system_path & workspace_keydir) { data dat; @@ -429,7 +429,7 @@ read_options_file(any_path const & optsp else if (opt == "branch") workspace_branch = branch_name(val, origin::workspace); else if (opt == "key") - workspace_key = arg_type(val, origin::workspace); + workspace_key = external_key_name(val, origin::workspace); else if (opt == "keydir") workspace_keydir = system_path(val, origin::workspace); else @@ -444,7 +444,7 @@ write_options_file(bookkeeping_path cons write_options_file(bookkeeping_path const & optspath, system_path const & workspace_database, branch_name const & workspace_branch, - arg_type const & workspace_key, + external_key_name const & workspace_key, system_path const & workspace_keydir) { basic_io::stanza st; @@ -479,7 +479,7 @@ workspace::get_options(options & opts) system_path workspace_database; branch_name workspace_branch; - arg_type workspace_key; + external_key_name workspace_key; system_path workspace_keydir; bookkeeping_path o_path; @@ -517,7 +517,7 @@ workspace::get_database_option(system_pa system_path & workspace_database) { branch_name workspace_branch; - arg_type workspace_key; + external_key_name workspace_key; system_path workspace_keydir; system_path o_path = (workspace @@ -540,7 +540,7 @@ workspace::set_options(options const & o // as is in _MTN/options, not write out an empty option. system_path workspace_database; branch_name workspace_branch; - arg_type workspace_key; + external_key_name workspace_key; system_path workspace_keydir; if (file_exists(o_path)) @@ -579,7 +579,7 @@ workspace::print_option(utf8 const & opt system_path workspace_database; branch_name workspace_branch; - arg_type workspace_key; + external_key_name workspace_key; system_path workspace_keydir; read_options_file(o_path, workspace_database, workspace_branch,