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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Jul 16 2018, 12:47
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 16 2018, 12:47
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.

deadalnix updated this revision to Diff 4360.Jul 20 2018, 00:45

Make comments a bit clearer

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