monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] adding existing pubkey - incorrect invariant


From: Zbigniew Zagórski
Subject: [Monotone-devel] adding existing pubkey - incorrect invariant
Date: Tue, 29 Dec 2009 10:27:06 +0100

Hello,

Looks like we've got some small issue. You can't add pubkey to db/keystore when
it is already known.

It's minor but shall not be internal invariant as it is now. IMHO, mtn
read shall ignore
packets that contain already known information and here we have exception (and
it ignores in all other cases)

(BTW, when importing privkey everything works perfectly)

Offending code:
database::put_key(key_name const & pub_id,
                  rsa_pub_key const & pub)
{
  //(...)
  I(!public_key_exists(thash)); // BAD! to be removed

  if (public_key_exists(thash)) // never executed
    {
      L(FL("skipping existing public key %s") % pub_id); // maybe
shall be removed also
      return false;
    }


Test case using my pub key:

$ mtn ls keys | grep zbigg
3c5bcd300193a6b8e9a39a2fbf8185e2fa6942e1 address@hidden

$ cat address@hidden
[pubkey address@hidden
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7ixlgafREiQMbrpF8EUqm0BwmVycQhFlt
YVx6YFByXUkGI8mdvghKxxatr2xuD+KQdfZzuNKN2AWDBBu8qMj1scEbeqttGx05VDU6kw/r
STb6U8PA2difOMxq1aoi/V4lUBBouav0gZG8IKefIgCblLs2lNQvH9+rWZ/hZiQEawIDAQAB
[end]

$ mtn read < address@hidden
mtn: fatal: error: database.cc:3078: I(!public_key_exists(thash))
...

Monotone version: 0.45
OS:  win32/linux

Best regards!
-- 
Zbigniew Zagórski
/ software developer / geek / http://zbigg.blogspot.com /




reply via email to

[Prev in Thread] Current Thread [Next in Thread]