Pure C client for PurritoBin and other networking projects
Go to file
Érico Rolim d5ce01c91f Add install target and symlinks.
purr can be symlinked to meow and meowd, in which cases it has special
behavior.
2020-09-14 01:16:14 -03:00
extern/libbaseencode Add decryption for recv. 2020-09-13 20:17:58 -03:00
.gitignore Add install target and symlinks. 2020-09-14 01:16:14 -03:00
LICENSE Add README and LICENSE. 2020-09-13 21:40:15 -03:00
README.md Add README and LICENSE. 2020-09-13 21:40:15 -03:00
comm.c Move to mmap implementation. 2020-09-13 13:32:28 -03:00
encrypt.c Split mmap_file implementation. 2020-09-14 00:32:16 -03:00
files.c Split mmap_file implementation. 2020-09-14 00:32:16 -03:00
formats.c Add get_encryption_params. 2020-09-13 20:17:03 -03:00
makefile Add install target and symlinks. 2020-09-14 01:16:14 -03:00
mmap_file.c Split mmap_file implementation. 2020-09-14 00:32:16 -03:00
mmap_file.h Add test for mmap_file and simplify makefile. 2020-09-14 00:43:59 -03:00
purr.c Add install target and symlinks. 2020-09-14 01:16:14 -03:00
purr.h Split mmap_file implementation. 2020-09-14 00:32:16 -03:00
socket.c Split functionality into different files. 2020-09-10 23:33:52 -03:00
tests.c Add test for mmap_file and simplify makefile. 2020-09-14 00:43:59 -03:00
urls.c Add get_encryption_params. 2020-09-13 20:17:03 -03:00

README.md

purr-c

This is a pure C client for the PurritoBin pastebin server, and uses PurritoBin's author's instance in https://bsd.ac by default.

It was written as an exercise in learning network and crypto libraries, and uses BearSSL for symmetric encryption (supported by PurritoBin's online interface as well as its suggested clients) and SSL interaction with the server. For now, it also depends on s6-networking's sbearssl library for certificate parsing. libbaseencode has been vendored in (can be found in external/libbaseencode), but has also gone through some changes, namely removing null-byte checking from the base64 encoding function and adding an output length parameter to the base64 decoding function.

The code has a few instances of // TODO: remove hack comments and the like, which I hope to get to someday.

Usage

Usage information can be viewed with purr -h.

Build dependencies

The build dependencies are the ones listed above: BearSSL and s6-networking, as well as GNU Make and a C compiler. This currently depends on Linux's getrandom(2) function, but I plan on adding at least an arc4random_buf(3) implementation.

Acknowledgements

  • Thomas Pornin for BearSSL
  • Laurent Bercot for s6-networking
  • epsilon-0 for PurritoBin (and the valuable help while I was testing this program)
  • paolostivanin for libbaseencode