# # # patch "ChangeLog" # from [e0881925676f7f4575cb262946456b4eac12b483] # to [994e5c7216b572e797fb67652eecc6c3cfde7d09] # # patch "cert.cc" # from [9165f65c27fb4d4dbec9ca11c0a09bb0a5281f9f] # to [c02a7b0abf62fa3d0485985df5317154041025cf] # # patch "keys.cc" # from [95e14385943c9849f15bf7324c856e25f29bedb1] # to [6a9950c8f9a3d70c82ee7f9519be3f1679afbcdb] # # patch "lua.cc" # from [7e34d30bfe4493bdc6bbc4d9169e1c6df3f303f0] # to [c8c228b16b396eaf8cbc1b41ca6363593e9abfee] # # patch "lua.hh" # from [92d0d719602e0529c4ff56d4d1744f34e81c24ac] # to [71e2943fa623254b4e3e1340e1f8c4b442271a6c] # ============================================================ --- ChangeLog e0881925676f7f4575cb262946456b4eac12b483 +++ ChangeLog 994e5c7216b572e797fb67652eecc6c3cfde7d09 @@ -1,3 +1,9 @@ +2006-01-14 Nathaniel Smith + + * lua.cc (hook_get_key_pair): Remove. + * keys.cc (require_password): Adjust accordingly. + * cert.cc (priv_key_exists, load_key_pair): Likewise. + 2006-01-14 Richard Levitte * configure.ac: Make sure there's an empty xgettext.opts ============================================================ --- cert.cc 9165f65c27fb4d4dbec9ca11c0a09bb0a5281f9f +++ cert.cc c02a7b0abf62fa3d0485985df5317154041025cf @@ -321,15 +321,7 @@ priv_key_exists(app_state & app, rsa_keypair_id const & id) { - if (app.keys.key_pair_exists(id)) - return true; - - keypair kp; - - if (app.lua.hook_get_key_pair(id, kp)) - return true; - - return false; + return app.keys.key_pair_exists(id); } // Loads a key pair for a given key id, from either a lua hook @@ -351,41 +343,11 @@ } else { - keypair kskeys, luakeys; - bool haveks = false, havelua = false; - - if (app.keys.key_pair_exists(id)) - { - app.keys.get_key_pair(id, kskeys); - haveks = true; - } - havelua = app.lua.hook_get_key_pair(id, luakeys); - - N(haveks || havelua, - F("no private key '%s' found in key store or get_priv_key hook") % id); - - if (havelua) - { - if (haveks) - { - // We really don't want the database key and the rcfile key - // to differ. - N(/*keys_match(id, kskeys.priv, id, luakeys.priv) - && */keys_match(id, kskeys.pub, id, luakeys.pub), - F("mismatch between key '%s' in key store" - " and get_key_pair hook") % id); - } - kp = luakeys; - } - else if (haveks) - { - kp = kskeys; - } - + N(app.keys.key_pair_exists(id), + F("no key pair '%s' found in key store '%s'") % id % app.keys.key_dir); + app.keys.get_key_pair(id, kp); if (persist_ok) - { - keys.insert(make_pair(id, kp)); - } + keys.insert(make_pair(id, kp)); } } ============================================================ --- keys.cc 95e14385943c9849f15bf7324c856e25f29bedb1 +++ keys.cc 6a9950c8f9a3d70c82ee7f9519be3f1679afbcdb @@ -528,9 +528,8 @@ app_state & app) { N(priv_key_exists(app, key), - F("no key pair '%s' found in key store or get_priv_key hook") % key); -// N(app.db.public_key_exists(key), -// F("no public key '%s' found in database") % key); + F("no key pair '%s' found in key store '%s'") + % key % app.keys.key_dir); keypair kp; load_key_pair(app, key, kp); if (app.lua.hook_persist_phrase_ok()) ============================================================ --- lua.cc 7e34d30bfe4493bdc6bbc4d9169e1c6df3f303f0 +++ lua.cc c8c228b16b396eaf8cbc1b41ca6363593e9abfee @@ -997,26 +997,6 @@ } bool -lua_hooks::hook_get_key_pair(rsa_keypair_id const & k, - keypair & kp) -{ - string key; - bool ok = Lua(st) - .func("get_priv_key") - .push_str(k()) - .call(1,1) - .extract_str(key) - .ok(); - - size_t pos = key.find("#"); - if (pos == std::string::npos) - return false; - kp.pub = key.substr(0, pos); - kp.priv = key.substr(pos+1); - return ok; -} - -bool lua_hooks::hook_get_author(cert_value const & branchname, string & author) { ============================================================ --- lua.hh 92d0d719602e0529c4ff56d4d1744f34e81c24ac +++ lua.hh 71e2943fa623254b4e3e1340e1f8c4b442271a6c @@ -43,8 +43,6 @@ bool hook_expand_selector(std::string const & sel, std::string & exp); bool hook_expand_date(std::string const & sel, std::string & exp); bool hook_get_branch_key(cert_value const & branchname, rsa_keypair_id & k); - bool hook_get_key_pair(rsa_keypair_id const & k, - keypair & kp); bool hook_get_passphrase(rsa_keypair_id const & k, std::string & phrase); bool hook_get_author(cert_value const & branchname, std::string & author); bool hook_edit_comment(std::string const & commentary,