mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-25 22:34:27 +00:00
Merge pull request #3176 from Diapolo/key
fix wrong memcmp() usage in CKey::operator==
This commit is contained in:
commit
42a12f22d6
@ -205,7 +205,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
friend bool operator==(const CKey &a, const CKey &b) {
|
friend bool operator==(const CKey &a, const CKey &b) {
|
||||||
return a.fCompressed == b.fCompressed && memcmp(&a.vch[0], &b.vch[0], 32);
|
return a.fCompressed == b.fCompressed && a.size() == b.size() &&
|
||||||
|
memcmp(&a.vch[0], &b.vch[0], a.size()) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize using begin and end iterators to byte data.
|
// Initialize using begin and end iterators to byte data.
|
||||||
@ -261,9 +262,9 @@ public:
|
|||||||
|
|
||||||
// Derive BIP32 child key.
|
// Derive BIP32 child key.
|
||||||
bool Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const;
|
bool Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const;
|
||||||
|
|
||||||
// Load private key and check that public key matches.
|
// Load private key and check that public key matches.
|
||||||
bool Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck);
|
bool Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CExtPubKey {
|
struct CExtPubKey {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user