| 199 | } |
| 200 | |
| 201 | bool CCryptoKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey) |
| 202 | { |
| 203 | { |
| 204 | LOCK(cs_KeyStore); |
| 205 | if (!IsCrypted()) |
| 206 | return CBasicKeyStore::AddKeyPubKey(key, pubkey); |
| 207 | |
| 208 | if (IsLocked()) |
| 209 | return false; |
| 210 | |
| 211 | std::vector<unsigned char> vchCryptedSecret; |
| 212 | CKeyingMaterial vchSecret(key.begin(), key.end()); |
| 213 | if (!EncryptSecret(vMasterKey, vchSecret, pubkey.GetHash(), vchCryptedSecret)) |
| 214 | return false; |
| 215 | |
| 216 | if (!AddCryptedKey(pubkey, vchCryptedSecret)) |
| 217 | return false; |
| 218 | } |
| 219 | return true; |
| 220 | } |
| 221 | |
| 222 | |
| 223 | bool CCryptoKeyStore::AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) |
nothing calls this directly
no test coverage detected