[Top][All Lists]

[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


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

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

Monotone version: 0.45
OS:  win32/linux

Best regards!
Zbigniew Zagórski
/ software developer / geek / /

reply via email to

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