Page MenuHomePhabricator

Add test case for CheckSignatureEncoding for proper DER encoding
ClosedPublic

Authored by deadalnix on Jul 16 2018, 12:47.

Details

Summary

This ensures IsValidSignatureEncoding is properly checked.

The test time is atrocious because IsValidSignatureEncoding assumes the presence of the sighash type which causes a combinotary explosion, and also uncover a SRP violation. I would like to refactor these to detangle the two, but obviously doing so safely require a test so here we are.

Depends on D1570

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
sigcheckderencoding
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2910
Build 3924: Bitcoin ABC Buildbot (legacy)
Build 3923: arc lint + arc unit

Event Timeline

jasonbcox added inline comments.
src/test/sigencoding_tests.cpp
190 ↗(On Diff #4317)

Is this referring to the // Non canonical length for S. case? If not, I don't understand which case this is referring to. It might be worth making it explicit as it's own list to pass in here (as a local variable).

203 ↗(On Diff #4317)

Same as above.

Make comments a bit clearer

This revision is now accepted and ready to land.Jul 20 2018, 04:49
This revision was automatically updated to reflect the committed changes.