Update: Unit Tests and Pubkey fixes
Once again, the repo has been updated, this time with a good number of things.
- RNG unit tests
- Improvements to SRP6
- Added synonyms for all the bytestring arguments
- Fixed srp6ClientAgree
- SRP6 unit tests
- Documented function srp6_group_identifier missing from Botan FFI
- TOTP unit tests
- Improvements to Utility
- Replaced size calculations with pointer querying to fix InsufficientBufferSpace exception
- Utility unit tests
- Improvements to PubKey
- Found authoritative source of algorithm names and parameters
- Fixed GOST-34.10
- Removed X25519 (redundant synonym for Curve25519)
- Renamed awkward flag data types
- PubKey unit tests
- PubKey.Encrypt unit tests
- PubKey.Decrypt unit tests
- PubKey.Sign unit tests
- PubKey.Verify unit tests
- Improvements to PubKey.Sign
Fixed signFinish to use allocBytesQuerying- Fixed signFinish to use upper bound and then trim
- Found Botan’s test vectors in the C++ source
Almost all of the basic unit tests are done now, and though there are algorithm combos that fail, things are more or less passing in general. There are still some PubKey functions that need testing:
- Key agreement
- Key encapsulation
- Algorithm-specific key loading functions
X509 certificates also don’t have unit tests yet, but I already know I’m going to need to take a deeper look at them so I’m holding off on that and considering it to be a larger, but important issue.
The big thing today, aside from all of the unit tests, is that pubkey encryption, decryption, signing, verification are now all working for all algorithms, though a bit fiddly because of parameters.
Signing was actually slightly broken, and was in some cases producing signatures that would fail verification. A closer look and some experimentation showed that sizes weren’t correct, which was slightly unexpected behavior given that many other functions allow you to query the size pointer by providing a null pointer for input.
In retrospect I realized that the size was non-deterministic due to the random generator. Querying once and running it again with the queried size would actually result in a different random number being generated internally, and thus the occasional InsufficientBufferSpace exception - which is why I couldn’t use querying for these functions (or any other function with non-deterministic buffers, really).
Armed with this knowledge, I figured out that I needed to both poke a size upper bound into a particular pointer, and read its actual size afterwards, and that pretty much got it working properly. Viola!
The Proposal Has been Approved for Recommendation
In some good news that actually happened last Friday, the TWG committee has voted to approve the proposal for recommendation to the Haskell Foundation.
This is a recommendation and not a commitment, and the Foundation still has to accept (or reject) it, but they are meeting Thursday, and this item is on the agenda! I obviously have high hopes, but I’ve made it this far with everyone’s help and feedback, and either way I’m happy to have had your support.
'Til next time!