don't tie message verification with P2PKH addresses

pull/25/head
Pavol Rusnak 8 years ago
parent 3a42032c63
commit e70900d49e
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -172,8 +172,12 @@ int cryptoMessageVerify(const CoinType *coin, const uint8_t *message, size_t mes
pubkey[0] = 0x02 | (pubkey[64] & 1);
}
// check if the address is correct
ecdsa_get_address_raw(pubkey, coin->address_type, addr_raw);
if (memcmp(addr_raw, address_raw, prefixBytesByAddressType(coin->address_type) + 20) != 0) {
uint32_t address_type;
if (!getAddressType(coin, address_raw, &address_type)) {
return 2;
}
ecdsa_get_address_raw(pubkey, address_type, addr_raw);
if (memcmp(addr_raw, address_raw, prefixBytesByAddressType(address_type) + 20) != 0) {
return 2;
}
return 0;

Loading…
Cancel
Save