Commit Graph

11 Commits

Author SHA1 Message Date
É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
Érico Rolim 06eb9d4222 Split mmap_file implementation.
Also add some useful definitions.
2020-09-14 00:32:16 -03:00
Érico Rolim 52f7829b48 Fix some compiler warnings. 2020-09-14 00:09:09 -03:00
Érico Rolim f13c0c2e3e Add decryption for recv.
A few fixes and hacks all around, but can now do:

  ./purr -e recv (./purr -e send makefile)

And output the original page.
2020-09-13 20:17:58 -03:00
Érico Rolim 94f8f4f61d Enable encrypted pastes properly.
Add base64 encoding per the pattern expected by the web interface.

Fix some pointers and file size things in purr/files.

TODO: files are cut off at random points, despite the efforts to remove
verification of null characters in libbaseencode.
2020-09-13 18:05:43 -03:00
Érico Rolim 1b4c19665c Fix some issues with the mmap impl.
Main one was using file->data instead of file->cursor in
write_into_mmap.

Switching to ftruncate in place of posix_fallocate was done for compat
reasons (posix_fallocate isn't available everywhere _and_ it can fail on
some file systems).
2020-09-13 16:08:40 -03:00
Érico Rolim baa013afae Move to mmap implementation.
Using FILE* is error prone and limited.
2020-09-13 13:32:28 -03:00
Érico Rolim 32f9910ece Fix encryption function.
Fix pointer parameters as function returns.
Add file clean-up as an atexit functionality.
2020-09-13 01:06:39 -03:00
Érico Rolim dd30aa72a8 Split encrypt.c and fix use-after-free.
UAF from genalloc and stralloc frees.

Also remove randomization of IV, not used in bsd.ac.
2020-09-12 23:28:49 -03:00
Érico Rolim f3069bb932 Split functionality into different files. 2020-09-10 23:33:52 -03:00
Érico Rolim e1ffd24466 Initial commit. 2020-09-10 23:11:38 -03:00