keybase / saltpack

a modern crypto messaging format
https://saltpack.org/
BSD 3-Clause "New" or "Revised" License
992 stars 63 forks source link

get signcrypt_open.go coverage to max #17

Closed oconnor663 closed 7 years ago

oconnor663 commented 7 years ago

This covers every line except two impossible checks, one for the length of a slice that's statically known, and the other for overflowing a 64-bit int. I managed to get by without needing an extra encryptor with its own hooks; instead I just doctor sealed messages directly to trigger errors.

Also implement anonymous sender mode.

r? @maxtaco @mlsteele

coveralls commented 7 years ago

Coverage Status

Coverage increased (+2.04%) to 86.215% when pulling 13bf6fe0622f001b4fad6a7c832a4635bad7b08d on jack/CORE-4831/saltpack_coverage into e6eeb092a61670a1b43ee5f795653bf8ca500147 on master.

oconnor663 commented 7 years ago

Take that Coveralls!

maxtaco commented 7 years ago

Very nice! I remember this one. It's apparently hard to generate 2^64-1 test packets?

oconnor663 commented 7 years ago

Yes, and the other one would only panic if the 32 on the line above were changed, or if SHA512 somehow returned less than 32 bytes.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+2.04%) to 86.215% when pulling 1e3458dbc0152eed77c1ae825862ac08050ca4d9 on jack/CORE-4831/saltpack_coverage into e6eeb092a61670a1b43ee5f795653bf8ca500147 on master.