# # patch "ChangeLog" # from [8b4d852dead6e549d0a3574cc8db1b00f2a61adb] # to [765659294791cef398c6a0f72bf2f1ce8baeb8a8] # # patch "commands.cc" # from [b1cc2399c0aacbd57290a3d39e3066d7f6bba22c] # to [818f7619b1575c088d33bc2c100362021bdbc04e] # # patch "tests/t_dropkey_2.at" # from [6f7f564465372a8b2bc4f01f726379dd79052682] # to [273fd69925b633a137a326975a2ba6a1d1f45293] # # patch "tests/t_lua_privkey.at" # from [236a2638e071e7107a7ac761a0bd3b21eebe3f48] # to [e85cec14dbef01453f2307c787d8144502bfba77] # =============================================== --- ChangeLog 8b4d852dead6e549d0a3574cc8db1b00f2a61adb +++ ChangeLog 765659294791cef398c6a0f72bf2f1ce8baeb8a8 @@ -1,3 +1,11 @@ +2005-07-26 Richard Levitte + + * commands.cc (CMD(privkey)): Change so both the public and + private key are printed. + + * tests/t_dropkey_2.at, tests/t_lua_privkey.at: Adapt to the new + private key format. + 2005-07-24 Nathaniel Smith * sanity.cc (MusingI, ~MusingI): No-op when already in the middle =============================================== --- commands.cc b1cc2399c0aacbd57290a3d39e3066d7f6bba22c +++ commands.cc 818f7619b1575c088d33bc2c100362021bdbc04e @@ -1933,13 +1933,16 @@ throw usage(name); rsa_keypair_id ident(idx(args, 0)()); - N(app.db.private_key_exists(ident), - F("private key '%s' does not exist in database") % idx(args, 0)()); + N(app.db.private_key_exists(ident) && app.db.private_key_exists(ident), + F("public and private key '%s' do not exist in database") % idx(args, 0)()); packet_writer pw(cout); - base64< arc4 > key; - app.db.get_key(ident, key); - pw.consume_private_key(ident, key); + base64< arc4 > privkey; + base64< rsa_pub_key > pubkey; + app.db.get_key(ident, privkey); + app.db.get_key(ident, pubkey); + pw.consume_public_key(ident, pubkey); + pw.consume_private_key(ident, privkey); } =============================================== --- tests/t_dropkey_2.at 6f7f564465372a8b2bc4f01f726379dd79052682 +++ tests/t_dropkey_2.at 273fd69925b633a137a326975a2ba6a1d1f45293 @@ -35,7 +35,7 @@ AT_CHECK(MONOTONE privkey address@hidden, [1], [ignore], [stderr]) -AT_CHECK(grep -q 'does not exist' stderr, []) +AT_CHECK(grep -q 'do not exist' stderr, []) AT_CHECK(MONOTONE pubkey address@hidden, [1], [ignore], [stderr]) =============================================== --- tests/t_lua_privkey.at 236a2638e071e7107a7ac761a0bd3b21eebe3f48 +++ tests/t_lua_privkey.at e85cec14dbef01453f2307c787d8144502bfba77 @@ -19,10 +19,11 @@ AT_CHECK(cp $_ROOT_DIR/test_hooks.lua test_key_hooks.lua, [], [ignore], [ignore]) AT_CHECK(echo "function get_priv_key(keyid)" >> test_key_hooks.lua, [], [ignore], [ignore]) AT_CHECK(echo 'return @<:@@<:@ ' >> test_key_hooks.lua, [], [ignore], [ignore]) -AT_CHECK(grep -v '\@<:@' privkey >> test_key_hooks.lua, [], [ignore], [ignore]) +AT_CHECK([sed -e '/^\@<:@pubkey/,/^\@<:@end\@:>@$/d' -e '/^\@<:@/d' privkey >> test_key_hooks.lua], [], [ignore], [ignore]) AT_CHECK(echo ' @:>@@:>@ end' >> test_key_hooks.lua, [], [ignore], [ignore]) AT_CHECK(RCMONOTONE db execute "delete from private_keys", [], [ignore], [ignore]) +AT_CHECK(RCMONOTONE db execute "delete from public_keys", [], [ignore], [ignore]) AT_CHECK(RCMONOTONE comment $SOMEREV boing)