Commit Graph

20 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 e01615adff Add test for mmap_file and simplify makefile.
Also fix typo in mmap_file.h.
2020-09-14 00:43:59 -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 fc9fc8dbf9 Add README and LICENSE. 2020-09-13 21:40:15 -03:00
Érico Rolim a80f082b48 Remove padding bytes (uglily) from encrypted recv. 2020-09-13 20:32:37 -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 e20d8ae124 Add get_encryption_params.
This function is used to split the links to encrypted content into
useful parts.
2020-09-13 20:17:03 -03:00
Érico Rolim 71d813af3e Switch to single makefile. 2020-09-13 18:20:15 -03:00
Érico Rolim b70d741b03 Enable IV randomization. 2020-09-13 18:08:52 -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 593aaabfec Add external libbaseencode. 2020-09-13 01:06:29 -03:00
Érico Rolim 95f4c0192b Add tests for clean_up_links.
Clean up makefile.
2020-09-12 23:49:38 -03:00
Érico Rolim 5b7ec3ead5 Implement print_hex to print byte buffers.
Also add tests for it.
2020-09-12 23:30:13 -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