Seitched mmap-based file reader against getline which also works with pipes.

This commit is contained in:
Heiko Reese
2021-09-11 14:40:43 +02:00
parent b6a350ef3a
commit a6c6169122
4 changed files with 26 additions and 54 deletions

View File

@ -125,7 +125,10 @@ int main(int argc, char *argv[]) {
// base64-decode input
unsigned char *ciphertext;
size_t ciphertext_len;
base64_decode_string(cipherstring, &ciphertext, &ciphertext_len);
if (base64_decode_string(cipherstring, &ciphertext, &ciphertext_len) != 0) {
fprintf(stderr, "[ERROR] Unable to base64-decode ciphertext.\n\n");
exit(EXIT_FAILURE);
};
// extract nonce
unsigned char nonce[crypto_secretbox_NONCEBYTES];