aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Begin implementing symmetric encryptionGravatar Benjamin Barenblat2018-09-28
| | | | Support RC4. Future commits will add support for more modern algorithms.
* Make NID-to-string routine saferGravatar Benjamin Barenblat2018-09-28
| | | | | Eliminate the possibility of a null pointer dereference by converting short names to `Maybe String`.
* Stop using newtypes for labeled argumentsGravatar Benjamin Barenblat2018-09-28
| | | | It’s getting messy, so switch to a parameters datatype pattern.
* Give `Algorithm` a `Show` instanceGravatar Benjamin Barenblat2018-09-25
|
* Rewrite tests for readabilityGravatar Benjamin Barenblat2018-09-21
| | | | | | Replace tables of tuples with simple function calls, and normalize argument order to have outputs to the right of inputs. Also factor out some common patterns.
* Start using base16-bytestring in btlsGravatar Benjamin Barenblat2018-09-21
| | | | | We’re already using it in tests, so eliminate some hand-rolled hexification code.
* Marshal `ForeignPtr` to `Ptr` within c2hs codeGravatar Benjamin Barenblat2018-09-04
|
* Enable error checking for HKDF computationsGravatar Benjamin Barenblat2018-09-04
|
* Remove `Eq Error` instanceGravatar Benjamin Barenblat2018-09-04
| | | | | It’s not clear what equality between errors should mean, so don’t support it.
* Documentation improvementsGravatar Benjamin Barenblat2018-09-04
|
* Consolidate buffer-handling functionsGravatar Benjamin Barenblat2018-09-04
|
* Enable error checking for HMAC computationsGravatar Benjamin Barenblat2018-09-04
|
* Begin wrapping BoringSSL’s error typeGravatar Benjamin Barenblat2018-08-31
|
* Remove some unnecessary `fromIntegral`sGravatar Benjamin Barenblat2018-08-31
|
* Replace `unsafeCoerce' with `castPtr'Gravatar Benjamin Barenblat2018-08-31
|
* Marshal `ByteString` input arguments to `fun`sGravatar Benjamin Barenblat2018-08-31
|
* Begin switching to `fun` in c2hsGravatar Benjamin Barenblat2018-08-31
| | | | | Replace most invocations of `call` with `fun`. There’s a lot of explicit `id`-marshalling going on; future commits will remove it.
* Clean up castsGravatar Benjamin Barenblat2018-08-23
| | | | | | | Use unsigned char buffers more pervasively throughout the code. This removes most calls to `asCUCharBuf`, isolating `unsafeCoerce` further. By making some type signatures slightly more flexible, also eliminate most explicit integer conversions.
* Wrap random number generatorGravatar Benjamin Barenblat2018-08-23
|
* Codec.Crypto.HKDF: Implement `hkdf` convenience functionGravatar Benjamin Barenblat2018-08-23
|
* Factor out common allocate-modify-read patternGravatar Benjamin Barenblat2018-08-23
| | | | | | | Many functions in BoringSSL accept a buffer and a pointer to size, write data into the buffer, and mutate the size. Create a function representing this pattern that also loads the result into a ByteString for convenience.
* Eliminate Data.Digest.InternalGravatar Benjamin Barenblat2018-08-02
| | | | | | Move Data.Digest.Internal’s functions and types into more appropriate modules. There’s now a single BTLS hierarchy that contains all internal modules for the project.
* Move BTLS.ConstantTimeEquals into the BTLS.BoringSSL hierarchyGravatar Benjamin Barenblat2018-08-02
| | | | | It’s a direct wrapper around a BoringSSL function, so it really belongs there.
* Factor out common char* ↔ unsigned char* castGravatar Benjamin Barenblat2018-08-02
|
* Begin cleaning up internal modulesGravatar Benjamin Barenblat2018-08-02
| | | | | | Clarify the division between internal and external modules in the source by consolidating all internal modules except Data.Digest.Internal into a flatter BTLS directory.
* Codec.Crypto.HKDF: Implement `expand`Gravatar Benjamin Barenblat2018-08-02
|
* Codec.Crypto.HKDF: Add test 7 from RFC 5869Gravatar Benjamin Barenblat2018-08-02
|
* Begin implementing HKDFGravatar Benjamin Barenblat2018-07-31
| | | | Implement the `extract` phase of HKDF.
* Enable `-Werror` and a reasonable set of warningsGravatar Benjamin Barenblat2018-07-30
| | | | | | | | | | Instead of using `-Weverything` and turning warnings off as they become problematic, enable `-Werror` and turn on a specific set of warnings judged to have high signal-to-noise ratio. Fix up all instances of those warnings in the code. These warnings are all available in GHC 8.0.1, which is the default in the current Debian (Debian 9).
* Factor out common resource create/initialize/set-finalizer cycleGravatar Benjamin Barenblat2018-04-28
|
* Abstract out common body between hashing and HMACingGravatar Benjamin Barenblat2018-04-28
|
* Switch initialism style to follow the rest of the Haskell worldGravatar Benjamin Barenblat2018-04-28
|
* Formatting passGravatar Benjamin Barenblat2018-04-28
| | | | | | I don’t always like the output hindent gives, so reformat the project to be a bit closer to what you see in published Haskell books and the like.
* Split low-level HMAC bindings into their own moduleGravatar Benjamin Barenblat2018-04-28
|
* Split low-level digest bindings into their own moduleGravatar Benjamin Barenblat2018-04-28
|
* Begin refactoring low-level foreign imports into their own hierarchyGravatar Benjamin Barenblat2018-04-28
| | | | | | | It’s clear at this point that this system is going to get large enough that a two-layer implementation is warranted. `Internal` will contain low-level bindings to BoringSSL; other modules will export an idiomatic interface on top of them.
* Move result-handling functions into their own moduleGravatar Benjamin Barenblat2018-04-28
|
* Switch to c2hsGravatar Benjamin Barenblat2018-04-28
| | | | | | | | | | Let the computer figure out its own types for most foreign imports. Continue using the vanilla FFI for finalizers, though, as that’s the easiest way to deal with function pointers. Reuse the build hook from gtk2hs-buildtools to work around Cabal’s inability to topologically sort .chs dependencies (https://github.com/haskell/cabal/issues/1906).
* Apply Apache LicenseGravatar Benjamin Barenblat2018-03-28
|
* Implement HMACGravatar Benjamin Barenblat2018-03-24
|
* Data.Digest: Reify hash algorithmsGravatar Benjamin Barenblat2018-03-23
| | | | | | | Eliminate the functional interface for hashing. Hashing now occurs exclusively through the `hash` function, which accepts a `Data.Digest.Algorithm`. This makes btls somewhat less extensible, but it’s the most elegant way to support HMACs.
* Data.Digest: Switch back to EVPGravatar Benjamin Barenblat2018-01-27
| | | | | | | Use the finalizer techniques demonstrated in 4e56c79b907da4a4654e5278bdcf94b08480a426 to safely allocate `EVP_MD_CTX` on the Haskell heap. This allows us to return to the high-level EVP API, eliminating much boilerplate code.
* Implement MD5Gravatar Benjamin Barenblat2018-01-26
|
* Implement SHA-1Gravatar Benjamin Barenblat2018-01-26
|
* Data.Digest.Sha2: Accept lazy ByteStringsGravatar Benjamin Barenblat2018-01-26
| | | | | | | Switch SHA-2 API to use lazy ByteStrings rather than strict. Lazy ByteStrings make the hash function compatible with streaming I/O patterns; users no longer need to preload all the data they wish to hash into RAM.
* Data.Digest.Sha2: Cleanse hash buffers after useGravatar Benjamin Barenblat2018-01-25
| | | | | | Implement a wrapper for `OPENSSL_cleanse` and use it to securely erase hash buffers. This matches the behavior of BoringSSL’s all-in-one hash functions (`SHA256`, `SHA512`, etc.) and memory allocation subsystem.
* Data.Digest.Sha2: Improve memory managementGravatar Benjamin Barenblat2018-01-24
| | | | | | | | | Rework the SHA-2 implementation to use the low-level sha.h interface rather than the higher-level evp.h. This allows us to preallocate all the data structures, eliminating BoringSSL cleanup functions. As a result, we can implement hashing under `unsafeLocalState` (a.k.a. `unsafeDupablePerformIO`) instead of `unsafePerformIO`, which should improve performance in multithreaded programs.
* Begin writing btls, a Haskell crypto and TLS library using BoringSSLGravatar Benjamin Barenblat2017-12-30
So far, btls provides SHA-224, SHA-256, SHA-384, and SHA-512 algorithms. To do that, I - vendor BoringSSL and create a custom `Setup.hs` to build it, - wrap a number of functions and values from BoringSSL's EVP subsystem, and - implement the four SHA-2 algorithms using the wrapped routines. I provide conformance tests incorporating the official NIST example vectors and the vectors used in the Go SHA-2 test suite. The tests also use SmallCheck to compare btls’s SHA-2 implementations with those provided by the system’s Coreutils and openssl(1) installations.