Page MenuHomePhabricator

Merge #12460: Assert CPubKey::ValidLength to the pubkey's header-relevant size
ClosedPublic

Authored by markblundeberg on Aug 6 2019, 18:49.

Details

Summary

PR12460 backport https://github.com/bitcoin/bitcoin/pull/12460/files
f8c249ab91 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.

Backporter note: the changes to IsCompressedOrUncompressedPubKey and
IsCompressedPubKey needed to be massaged somewhat (due to D1569)

Test Plan

make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
validsize
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7055
Build 12157: Bitcoin ABC Buildbot (legacy)
Build 12156: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Aug 6 2019, 19:08