GitHub - earlephilhower/bearssl-esp8266: Port of https://bearssl.org BearSSL to ESP8266 (original) (raw)

Documentation

The most up-to-date documentation is supposed to be available on the BearSSL Web site.

Disclaimer

BearSSL is considered beta-level software. Most planned functionalities are implemented; new evolution may still break both source and binary compatibility.

Using BearSSL for production purposes would be a relatively bold but not utterly crazy move. BearSSL is free, open-source software, provided without any guarantee of fitness or reliability. That being said, it appears to behave properly, and only minor issues have been found (and fixed) so far. You are encourage to inspect its API and code for learning, testing and possibly contributing.

The usage license is explicited in the LICENSE.txt file. This is the "MIT license". It can be summarised in the following way:

Installation

Right now, BearSSL is a simple library, along with a few test and debug command-line tools. There is no installer yet. The library can be compiled as a shared library on some systems, but since the binary API is not fully stabilised, this is not a very good idea to do that right now.

To compile the code, just type make. This will try to use sane "default" values. On a Windows system with Visual Studio, run a console with the environment initialised for a specific version of the C compiler, and type nmake.

To override the default settings, create a custom configuration file in the conf directory, and invoke make (or nmake) with an explicit CONF= parameter. For instance, to use the provided samd20.mk configuration file (that targets cross-compilation for an Atmel board that features a Cortex-M0+ CPU), type:

make CONF=samd20

The conf/samd20.mk file includes the Unix.mk file and then overrides some of the parameters, including the destination directory. Any custom configuration can be made the same way.

Some compile-time options can be set through macros, either on the compiler command-line, or in the src/config.h file. See the comments in that file. Some settings are autodetected but they can still be explicitly overridden.

When compilation is done, the library (static and DLL, when appropriate) and the command-line tools can be found in the designated build directory (by default named build). The public headers (to be used by applications linked against BearSSL) are in the inc/ directory.

To run the tests:

The brssl command-line tool produced in the build directory is a stand-alone binary. It can exercise some of the functionalities of BearSSL, in particular running a test SSL client or server. It is not meant for production purposes (e.g. the SSL client has a mode where it disregards the inability to validate the server's certificate, which is inherently unsafe, but convenient for debug).

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 (e.g. in the /usr/local/include directory). The library itself (libbearssl.a) is what you link against.

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:

Versioning

I follow this simple version numbering scheme: