# # # patch "key_store.cc" # from [e11141e0fa1143dece96d218a45417c92da2b84e] # to [758a28d366a98ffbe390206896bf4cc1af1fec05] # # patch "key_store.hh" # from [33a62cd00bd4d89c37a0cb35bbd5944b550e6960] # to [e7a24afec02df8a6548d93c797438e3116a05811] # ============================================================ --- key_store.cc e11141e0fa1143dece96d218a45417c92da2b84e +++ key_store.cc 758a28d366a98ffbe390206896bf4cc1af1fec05 @@ -462,30 +462,30 @@ key_store::create_key_pair(database & db void key_store::create_key_pair(database & db, - rsa_keypair_id const & id, + rsa_keypair_id const & ident, utf8 const * maybe_passphrase, id * maybe_pubhash, id * maybe_privhash) { conditional_transaction_guard guard(db); - bool exists = key_pair_exists(id); + bool exists = key_pair_exists(ident); if (db.database_specified()) { guard.acquire(); - exists = exists || db.public_key_exists(id); + exists = exists || db.public_key_exists(ident); } - E(!exists, origin::user, F("key '%s' already exists") % id); + E(!exists, origin::user, F("key '%s' already exists") % ident); utf8 prompted_passphrase; if (!maybe_passphrase) { - get_passphrase(prompted_passphrase, id, true, true); + get_passphrase(prompted_passphrase, ident, true, true); maybe_passphrase = &prompted_passphrase; } // okay, now we can create the key - P(F("generating key-pair '%s'") % id); + P(F("generating key-pair '%s'") % ident); RSA_PrivateKey priv(*s->rng, static_cast(constants::keylen)); // serialize and maybe encrypt the private key @@ -518,20 +518,20 @@ key_store::create_key_pair(database & db % kp.priv().size()); // and save it. - P(F("storing key-pair '%s' in %s/") % id % get_key_dir()); - put_key_pair(id, kp); + P(F("storing key-pair '%s' in %s/") % ident % get_key_dir()); + put_key_pair(ident, kp); if (db.database_specified()) { - P(F("storing public key '%s' in %s") % id % db.get_filename()); - db.put_key(id, kp.pub); + P(F("storing public key '%s' in %s") % ident % db.get_filename()); + db.put_key(ident, kp.pub); guard.commit(); } if (maybe_pubhash) - key_hash_code(id, kp.pub, *maybe_pubhash); + key_hash_code(ident, kp.pub, *maybe_pubhash); if (maybe_privhash) - key_hash_code(id, kp.priv, *maybe_privhash); + key_hash_code(ident, kp.priv, *maybe_privhash); } void ============================================================ --- key_store.hh 33a62cd00bd4d89c37a0cb35bbd5944b550e6960 +++ key_store.hh e7a24afec02df8a6548d93c797438e3116a05811 @@ -64,7 +64,7 @@ public: void cache_decrypted_key(rsa_keypair_id const & id); - void create_key_pair(database & db, rsa_keypair_id const & id, + void create_key_pair(database & db, rsa_keypair_id const & ident, utf8 const * maybe_passphrase = NULL, id * maybe_pubhash = NULL, id * maybe_privhash = NULL);