Slimelite BBS

libbearssl.lha

Back to lib

TLS/SSL link library

Size
840K (860,670 bytes)
Added
2026-11-20 02:43
Downloads
2
Long Description
ABOUT BearSSL is for now considered alpha-level software. This means that it probably still has some bugs, possibly very serious ones (e.g. buffer overflows -- one of the perks of using C as programming language). It still lacks some functionalities. The API will probably change and may break both source and binary compatibility. In other words, you would be quite mad to use it for any production purpose. Right now, this is for learning, testing and possibly contributing. You might want to run the tests: - `testcrypto all` runs the cryptographic tests (test vectors on all implemented cryptogaphic functions). It can be slow. - `testspeed all` runs a number of performance benchmarks, there again on cryptographic functions. It gives a taste of how things go on the current platform. - `testx509` runs X.509 validation tests. The test certificates are all in `test/x509/`. The brssl command-line tool is a stand-alone binary. It is not included in this package. USAGE Using the library means writing some application code that invokes it, and linking with the static library. The header files are all in the `inc` directory; copy them wherever makes sense. The library itself (`libbearssl.a`) Alternatively, you may want to copy the source files directly into your own application code. This will make integrating ulterior versions of BearSSL more difficult. If you still want to go down that road, then simply copy all the `*.h` and `*.c` files from the `src` and `inc` directories into your application source code. In the BearSSL source archive, the source files are segregated into various sub-directories, but this is for my convenience only. There is no technical requirement for that, and all files can be dumped together in a simple directory. Dependencies are simple and systematic: - Each `*.c` file includes `inner.h` - `inner.h` includes `config.h` and `bearssl.h` - `bearssl.h` includes the other `bearssl_*.h` Backward compatibility is maintained, at both source and binary levels, for each major version: this means that if some application code was designed for version `x.y`, then it should compile, link and run properly with any version `x.y'` for any `y'` greater than `y`. Right now there is little documentation. The following principles are maintained: - All public symbols (global functions and data elements, macros) have a name that starts with `br_` or `BR_`. - The header files (the `bearssl_*.h` in the `inc` directory) contain for now the most complete documentation (as comments). - Context structures are allocated by the caller. BearSSL does not contain any single `malloc()` call; this means that there is no "freeing up" call to be done. When you don't need some BearSSL functionality, just cease to call it, and that's it. - BearSSL contains no modifiable static data. It is thus thread-safe and reentrant, _for distinct contexts_. Accessing the same context structure from distinct threads, though, is a recipe for disaster. - The main SSL I/O API is organised as a state machine. A running SSL engine (client or server) has four I/O ports: - It can receive bytes from the transport medium ("record data"). - It can send bytes to the transport medium. - It can receive application data, to be sent to the peer through the SSL tunnel. - It can produce application data, built from the records sent by the peer. BearSSL never performs I/O by itself; it expects the caller to provide or retrieve the data. Each port consists in a pair of functions: one yields the pointer to the buffer from which data can be read or to which data can be written, and the maximum size for such an operation; the other function is used to inform the engine about how many bytes were actually read or written. For instance, if the `br_ssl_engine_sendrec_buf()` function returns a n