Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | chunk: Correctly parse Base64 text where four = follow in a row | Tobias Brunner | 2017-05-23 | 1 | -1/+1 |
| | | | | | | | That's not correct Base64 but invalid data could trigger this. Since outlen would get reduced four times, but is only ever increased three times per iteration, this could result in an integer underflow and then a potential buffer overflow. | ||||
* | utils: chunk_from_hex() skips optional 0x prefix | Andreas Steffen | 2017-03-06 | 1 | -1/+7 |
| | |||||
* | Use standard unsigned integer types | Andreas Steffen | 2016-03-24 | 1 | -31/+31 |
| | |||||
* | chunk: Fix internet checksum calculation on big-endian systems | Tobias Brunner | 2014-10-23 | 1 | -1/+1 |
| | | | | | | | ntohs() might be defined as noop (#define ntohs(x) (x)) so we have to manually shorten the negated value (gets promoted to an int). Fixes #747. | ||||
* | chunk: Add function to calculate Internet Checksums according to RFC 1071 | Tobias Brunner | 2014-07-22 | 1 | -0/+31 |
| | |||||
* | unit-tests: Seed chunk_hash() only once, but before creating any hashtables | Martin Willi | 2014-06-04 | 1 | -0/+8 |
| | | | | | | | Due to the removal of pthread_once, we manually create the seed for chunk_hash(). With the new testable functions interface, this won't work for the hashtable initiated using __attribute__((constructor)). Enforce seeding before creating that hashtable. | ||||
* | chunk: On Windows, use binary mode in chunk_write() | Martin Willi | 2014-06-04 | 1 | -1/+8 |
| | |||||
* | chunk: On Windows, chunk_map() opens files in binary mode | Martin Willi | 2014-06-04 | 1 | -2/+7 |
| | |||||
* | chunk: Fallback to recv() on Windows chunk_from_fd() when operating on socket | Martin Willi | 2014-06-04 | 1 | -0/+6 |
| | |||||
* | chunk: Don't depend on pthread directly | Martin Willi | 2014-06-04 | 1 | -13/+5 |
| | |||||
* | chunk: Externalize error reporting in chunk_write() | Martin Willi | 2014-01-23 | 1 | -9/+6 |
| | | | | | This avoids passing that arbitrary label just for error messages, and gives greater flexibility in handling errors. | ||||
* | chunk: Provide a fallback chunk_map() if mmap is not available | Martin Willi | 2014-01-23 | 1 | -1/+46 |
| | |||||
* | chunk: Use dynamically allocated buffer in chunk_from_fd() | Martin Willi | 2014-01-23 | 1 | -12/+41 |
| | | | | | | | | When acting on files, we can use fstat() to estimate the buffer size. On non-file FDs, we dynamically increase an allocated buffer. Additionally we slightly change the function signature to properly handle zero-length files and add appropriate unit tests. | ||||
* | chunk: Add functions to map file contents to a chunk | Martin Willi | 2014-01-23 | 1 | -0/+80 |
| | |||||
* | chunk: Add helper function to create a chunk from data read from a file ↵ | Tobias Brunner | 2013-10-23 | 1 | -0/+32 |
| | | | | descriptor | ||||
* | chunk: Print chunks without separator if + modifier is used | Tobias Brunner | 2013-08-24 | 1 | -2/+2 |
| | |||||
* | chunk: Add predictable hash function | Tobias Brunner | 2013-06-28 | 1 | -0/+22 |
| | | | | | Since chunk_hash() is randomized its output is not predictable, that is, it is only within the same process. | ||||
* | Randomly allocate chunk_hash() key during first use | Tobias Brunner | 2013-06-11 | 1 | -1/+46 |
| | | | | This avoids hash flooding attacks. | ||||
* | Replace chunk_hash() with output from chunk_mac() | Tobias Brunner | 2013-06-11 | 1 | -75/+23 |
| | | | | | | | The quality is way better, the calculation is a bit slower though. The key is statically initialized to zero, which will be changed later to prevent hash flooding. | ||||
* | Adding chunk_mac() which calculates a 64-bit MAC using SipHash-2-4 | Tobias Brunner | 2013-06-11 | 1 | -1/+117 |
| | |||||
* | Moved chunk_t to utils folder | Tobias Brunner | 2012-10-24 | 1 | -0/+690 |