Commit Graph

8 Commits

Author SHA1 Message Date
Érico Rolim 4b3f41d0f9 Extend localization support.
Localize purr.c so both main executables are localized, plus some
library code. Refactor some message printing so localization is easier.
2020-11-11 01:36:40 -03:00
Érico Rolim a78061e6db Simplify reallocation loops in read_certs.
realloc(NULL, size) works the same as malloc(size), so there's no need
to have one path for each.
2020-10-19 03:28:30 -03:00
Érico Rolim 367fbc823f Fix read_certs to receive FILE instead of a path.
This change lead to completely overhauling the bearssl_read_certs()
function, which now deals directly with FILES, instead of depending on
mmap_file. There is some slight added complexity for dealing with the
file reads.

The idea for this came from the idea of implementing path resolution
using openat() instead of path concatenation, so there was a need to
pass either fds or file streams to functions instead of specific paths.
2020-10-16 01:13:09 -03:00
Érico Rolim 4dab3ebdc3 Make it possible to read certs from multiple files
The previous impl clobbered most of the ta array if it was reutilized.
Add proper bookkeeping to solve this and enable reading from multiple
files.

The necessary changes in gemi.c are in the next commit, due to being
more involved and adding unrelated features.
2020-10-15 22:31:38 -03:00
Érico Rolim f7270d1640 Add parameter to bearssl_read_certs for certs file
Still has the option of looking at the env var, but can also be
controlled directly. Will be useful when certificates are stored in
custom locations.
2020-10-15 20:45:05 -03:00
Érico Rolim 3566ed2690 Add help output for cert env var to all utilities.
Also redirect help output to stderr when it's supposed to fail and to
stdout otherwise.
2020-10-15 20:44:46 -03:00
Érico Rolim 334cf419e5 Add and use bearssl_free_certs. 2020-09-17 16:21:13 -03:00
Érico Rolim bffda75074 Create read_certs.
Used in place of s6-networking's sbearssl. Still needs some deeper
checking, it can segfault sometimes.
2020-09-14 04:15:44 -03:00