Skip to content

Conversation

@jorisdral
Copy link
Collaborator

@jorisdral jorisdral commented Oct 7, 2025

Resolves #28

Previously, we were calling this documentation the "C++ Botan documentation".
Calling it "C++ API reference" is closer to what the handbook calls it at
https://botan.randombit.net/handbook/api_ref/contents.html
@jorisdral jorisdral self-assigned this Oct 7, 2025
@jorisdral jorisdral changed the title Review, refactor, and fix SRP6 modules Fix SRP6 tests, review and refactor SRP6 modules Oct 7, 2025
The test-suite was disabled because it fails to run successfully. The test-suite
is enabled again, even though the tests still fail. Fixes for these tests will
be included in coming commits.
Reduced levels of indentation means we have more horizontal real estate to work
with in Haskell files. Putting `::` on the same line as function definitions
improves syntax highlighting.
@jorisdral jorisdral force-pushed the jdral/srp6 branch 2 times, most recently from 5b92c14 to f8eb95d Compare October 13, 2025 10:08
This includes only the relevant modules from `botan-bindings` and `botan-low`.

In particular, we work around a bug in `srp6ServerSessionStep1` in `botan-low`
where an exception is thrown from C code by `botan_srp6_server_session_step1`
because it is called twice by `srp6ServerSessionStep1`. This is bug in the Botan
C++ library, see randombit/botan#5112.

The best we can do for now is to try to not trigger the exception. The
work-around we introduce is to make sure we call the erroring function
(`botan_srp6_server_session_step1`) only once. Previously, we were calling it
once to "query" the size of output buffers, and then again with the correct
sizes of output buffers. We can instead use
`botan_srp6_group_size`/`srp6GroupSize` to determine the correct sizes of output
buffers immediately. This is now done this way automatically where appropriate
in `botan-low`, but not in `botan-bindings`. Moreover, users can still call
`botan_srp6_server_session_step1`/`srp6ServerSessionStep1` twice if they want
to, meaning that the exception can still be triggered. To warn against this, we
make sure to include appropriate warnings in the Haddock documentation.

The other smaller changes do not affect the functionality of the code, only
documentation and such.
@jorisdral jorisdral marked this pull request as ready for review October 13, 2025 10:13
@jorisdral jorisdral enabled auto-merge October 13, 2025 10:14
@jorisdral jorisdral added this pull request to the merge queue Oct 13, 2025
Merged via the queue into main with commit da12253 Oct 13, 2025
34 checks passed
@jorisdral jorisdral deleted the jdral/srp6 branch October 13, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SRP6 functions get broken because allocBytesQuerying calls botan_srp6_server_session_step1 twice

2 participants