Monthly Status Report
It has been just over one month since this project received funding from the Haskell Foundation, and that means it is time for a status report on how things are going!
Where we were then
This project has already been underway for some time, so it necessary to some numbers to where we were at the start of the month, in order to compare to where we are now.
Here are some stats - at the start of the month, this project had:
- 154 commits
- 119 days
- 1 repo
- 1 language
- 3 libraries
- 99 modules
- 11191 significant lines of code
There was some manual counting plus
find . -name \*.hs -exec cat {} +| grep -Evc '^\s*(--|$)'
andgit rev-list --count COMMIT
, so the numbers are slightly subjective.
At the time, I had just finished wrapping up the existing, read-only X509 support, with bindings, low-level implementations, and unit tests of the base Botan FFI. This was the last currently-existing module, and completing it left botan-bindings
and botan-low
functionally- / alpha- complete, though there is still a need for refactoring various things for safety, consistency, and final nomenclature, as well as some potential code migration updwards / downwards as things settle.
All things considered, things were in a very good place. We had accomplished 3 of our goals already:
- Bindings library
- Low-level library
- Unit tests
<- we were here
Remaining major targets / goals remaining were:
- Development of
botan
high-level library - CI
- Tutorials
- Documentation
Plus several high-value optional goals, which would require extending the C++ botan FFI interface:
- Extended X509 support
- TLS
- Stream ciphers
Where we are now
With the library in a stable place, I thought it would be appropriate to tackle one of the larger unknowns, which would be the need to extend the Botan C++ library in order to supply missing FFI features and functions. At this point, I knew it was certainly possible, quite doable, but I had no idea how long it would take, or how much effort. Thus began this last month of work.
At first, I thought it would be possible to extend the FFI by writing an additional C++ layer, but I quickly ended up forking the Botan C++ library, as there was a limit to what I could do without updating the source code itself. This meant building Botan C++ from source, which in turn meant that I had to be able to point Botan-Haskell at the custom Botan-C++.
There are plans to submit these improvements back to the original Botan C++ library once they are appropriately complete
Once that was complete, it was off to the races!
The rest of the month was spent working on extending the X509 interface in both C++ and Haskell, while building a bridge between the two. Now it is one month later, and I have gotten quite comfy with C and C++ again.The extended X509 is now moderately functional, in Haskell and C++, and although its still in-progress, it too is in a very good place.
As a result of this work, we have several new features and modules:
- Botan.*.X509.CA (Certificate Authority)
- Botan.*.X509.CRL (Certificate Revocation List)
- Botan.*.X509.CSR (Certificate Signing Request)
- Botan.*.X509.Options
- Botan.*.X509.Path (Path validation)
- Botan.*.X509.Store
I would estimate that the X509 FFI to be at 60-70% completion, with a high degree of certainty that it will be completed according to schedule.
Working hands-on with the Botan C++ source for a month has started to give me some opinions on it. I’ve effectively doubled the amount of code in the Botan C FFI, but as a result, the existing FFI patterns have become unwieldy / laborious at this scale. I keep having to resist the urge to refactor the entire FFI for consistency, now that I’ve worked with it for a while, and know its idiosyncracies (cough one giant giga-header). I could do some rework to rely more on defines and templates in order to reduce the C++ code footprint, but since we already have most of it working, that seems better left off til later as a refinement.
Our stats for the end of the month are:
- 234 commits
- 149 days
- 2 repos
- 3 languages (Haskell, C, C++)
- 4 libraries
- 115 modules
- 15326 significant lines of code (12917 Haskell + 2409 C/C++)
It is gratifying to see that I have kept a consistent pace.
Where we are going next
After from taking a pause to see where we are (and thus write this report), now it is time to plan a little of the next month. We’re definitely going to be finishing up the extended X509 support, and after that we’re going to do a consistency pass to tackle some cleanup-and-polish in the bindings and low-level libraries, as well as focusing on the build pipeline providing better README / installation instructions / CI.
As such, our timeline is roughly as follows:
- Bindings library
botan-bindings
- Low-level library
botan-low
- Unit tests
- Extended X509 support
<- we are here
- CI
- High-level library
botan
- Tutorials
- Documentation
<- we need to get at least here
- Test vectors
- Stream Cipher support
- TLS support
It is clear at this time that optional deliverables (extended FFI for TLS, stream ciphers) may not make it by the end of this proposal’s funding. We knew this going in that not all optional objectives would be achieved, but I am pleased to know that at least X509 will. Stream ciphers are small enough that they may be able to sneak in, but I suspect that implementing an FFI interface for Botan’s TLS functionality will require a specific effort comparable to that of implementing the X509 FFI.
That’s it for now!
You can follow the devlog for more frequent updates.