|
|
@@ -164,3 +164,45 @@ Index: work.cc
|
|
|
|
|
|
renames.insert(make_pair(src, dpath));
|
|
|
|
|
|
+-----------------------------------------------------------------------------
|
|
|
+
|
|
|
+Upstream fix:
|
|
|
+
|
|
|
+If a key clash occurs on a netsync operation, i.e. two different
|
|
|
+keys with the same key id are encountered, mtn now fails cleanly
|
|
|
+and provides further guidance how to proceed.
|
|
|
+
|
|
|
+Index: netsync.cc
|
|
|
+--- netsync.cc 255ab2fc2c3ca94f0686014fea03035ba7649bdf
|
|
|
++++ netsync.cc 0be25c91e1a814bcb2070386e43d05297f51a1e6
|
|
|
+@@ -1335,9 +1335,28 @@ session::process_hello_cmd(rsa_keypair_i
|
|
|
+ % printable_key_hash);
|
|
|
+ project.db.set_var(their_key_key, printable_key_hash);
|
|
|
+ }
|
|
|
+- if (project.db.put_key(their_keyname, their_key))
|
|
|
+- W(F("saving public key for %s to database") % their_keyname);
|
|
|
+
|
|
|
++ if (project.db.public_key_exists(their_keyname))
|
|
|
++ {
|
|
|
++ rsa_pub_key tmp;
|
|
|
++ project.db.get_key(their_keyname, tmp);
|
|
|
++
|
|
|
++ E(keys_match(their_keyname, tmp, their_keyname, their_key),
|
|
|
++ F("the server sent a key with the key id '%s'\n"
|
|
|
++ "which is already in use in your database. you may want to execute\n"
|
|
|
++ " %s dropkey %s\n"
|
|
|
++ "on your local database before you run this command again,\n"
|
|
|
++ "assumed that your local key has NOT a private counterpart.")
|
|
|
++ % their_keyname % ui.prog_name % their_keyname);
|
|
|
++ }
|
|
|
++ else
|
|
|
++ {
|
|
|
++ // this should now always return true since we just checked
|
|
|
++ // for the existance of this particular key
|
|
|
++ I(project.db.put_key(their_keyname, their_key));
|
|
|
++ W(F("saving public key for %s to database") % their_keyname);
|
|
|
++ }
|
|
|
++
|
|
|
+ {
|
|
|
+ hexenc<id> hnonce;
|
|
|
+ encode_hexenc(nonce, hnonce);
|