Add Sapling decryption check to CCryptoKeyStore::Unlock()
This commit is contained in:
parent
e8a949c153
commit
0adba6789b
|
@ -232,6 +232,21 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
|
||||||
if (fDecryptionThoroughlyChecked)
|
if (fDecryptionThoroughlyChecked)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
CryptedSaplingSpendingKeyMap::const_iterator miSapling = mapCryptedSaplingSpendingKeys.begin();
|
||||||
|
for (; miSapling != mapCryptedSaplingSpendingKeys.end(); ++miSapling)
|
||||||
|
{
|
||||||
|
const libzcash::SaplingFullViewingKey &fvk = (*miSapling).first;
|
||||||
|
const std::vector<unsigned char> &vchCryptedSecret = (*miSapling).second;
|
||||||
|
libzcash::SaplingSpendingKey sk;
|
||||||
|
if (!DecryptSaplingSpendingKey(vMasterKeyIn, vchCryptedSecret, fvk, sk))
|
||||||
|
{
|
||||||
|
keyFail = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
keyPass = true;
|
||||||
|
if (fDecryptionThoroughlyChecked)
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (keyPass && keyFail)
|
if (keyPass && keyFail)
|
||||||
{
|
{
|
||||||
LogPrintf("The wallet is probably corrupted: Some keys decrypt but not all.\n");
|
LogPrintf("The wallet is probably corrupted: Some keys decrypt but not all.\n");
|
||||||
|
|
Loading…
Reference in New Issue