Skip to content

Commit f3723a6

Browse files
MarcoFalkegades
authored andcommitted
Merge bitcoin#12460: Assert CPubKey::ValidLength to the pubkey's header-relevant size
f8c249a Assert CPubKey::ValidLength to the pubkey's header-relevent size (Ben Woosley) Pull request description: A pubkey's length is specific to its type which is indicated by its header value. GetLen returns the header-indicated length, so this change ensures that a key matches its header-indicated length. And replace some magic values with their constant equivalents. Tree-SHA512: b727b39a631babe0932326396fc4d796ade8ec1e37454ff0c709ae9b78ecbd0cfdf59d84089ba8415e6efa7bc180e3cd39a14ddaf0871cbac54b96851e1b7b44
1 parent 9c7a894 commit f3723a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/script/interpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) {
8484
}
8585

8686
bool static IsCompressedPubKey(const valtype &vchPubKey) {
87-
if (vchPubKey.size() != 33) {
87+
if (vchPubKey.size() != CPubKey::COMPRESSED_PUBLIC_KEY_SIZE) {
8888
// Non-canonical public key: invalid length for compressed key
8989
return false;
9090
}

0 commit comments

Comments
 (0)