aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed some typosTobias Brunner2014-02-181-3/+3
|
* printf-hook-glibc: printf.h on FreeBSD 10 does not include stdargs.hTobias Brunner2014-02-131-1/+1
|
* settings: Add support to enumerate sections and key/value pairs with fallbacksTobias Brunner2014-02-122-35/+163
|
* settings: Implement subsections and key/value pairs with sorted arraysTobias Brunner2014-02-121-68/+74
| | | | | | Is a bit more memory efficient (also due to lazy instantiation) and lookups for sections with lots of subsections/keys (e.g. charon.plugins) are faster.
* lib: All settings use configured namespaceTobias Brunner2014-02-121-3/+3
|
* settings: Add method that allows to define fallback sections for other sectionsTobias Brunner2014-02-122-13/+167
| | | | | The fallbacks are currently only used for single value lookups. Enumerators are not affected by them.
* settings: Make print_key() not rely on null-terminated beginning of key bufferTobias Brunner2014-02-121-10/+5
| | | | | The key to print (e.g. until the next .) still has to be null-terminated.
* settings: Allow empty strings in section keyTobias Brunner2014-02-121-23/+31
|
* identification: Fix printing of empty RDNs on FreeBSDTobias Brunner2014-02-121-1/+6
| | | | On FreeBSD (null) is printed for NULL even if the precision is 0.
* leak_detective: Assign return value of realloc to bufThomas Egerer2014-02-101-1/+1
| | | | | | | If realloc return a pointer value different from the value to be reallocated, a double free can occur in this context. Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
* integrity-checker: Use chunk_map() instead of non-portable mmap()Martin Willi2014-01-231-31/+6
|
* chunk: Externalize error reporting in chunk_write()Martin Willi2014-01-232-11/+9
| | | | | 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 availableMartin Willi2014-01-231-1/+46
|
* chunk: Use dynamically allocated buffer in chunk_from_fd()Martin Willi2014-01-232-14/+46
| | | | | | | | 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 chunkMartin Willi2014-01-232-0/+106
|
* utils: Add strreplace functionTobias Brunner2014-01-232-2/+68
|
* agent: Keep CAP_DAC_OVERRIDE to connect to ssh-agent socketTobias Brunner2014-01-231-0/+3
| | | | This is also required if charon-cmd is used with capability dropping.
* printf-hook-builtin: Correctly calculate written bytes in print_in_hook()Martin Willi2014-01-151-3/+7
| | | | | | | | | | The hook data counts remaining buffer bytes, not used ones. Counting them correctly fixes a crash for long hexdumps. Further, print_in_hook() must return the number of bytes that would have been written, not the actually written bytes. This is important, as we allocate a dynamic buffer in bus that relies on the exact byte count. Fixes long hexdumps that got truncated.
* utils: Fix %T printf hook on big-endian systemsTobias Brunner2014-01-061-1/+1
| | | | | | | | The cast to a bool* cut of the actual value on big-endian systems if bool was shorter than int because the bool argument to printf gets promoted to an int. Fixes #479.
* unit-tests: Don't use priority for destructor that unregisters testable ↵Tobias Brunner2013-12-041-1/+6
| | | | | | | | | functions This fixes coverage reports, at least if leak detective is disabled. If it is enabled the plugins are not unloaded so the destructor is not executed until the process is destroyed, which seems not to be covered by gcov.
* unit-tests: Add facility to register testable functionsTobias Brunner2013-12-042-0/+141
| | | | | These can be defined in plugins, or other parts of the tested libraries. They can even be static.
* chunk: Fix signedness warnings caused by chunk_from_* macrosTobias Brunner2013-11-271-3/+3
| | | | | | There are countless other such warnings because e.g. chunk_create() is called with char*, but at least we prevent users from causing such warnings inadvertently when using these macros.
* printf-hook-builtin: Don't use %P to print uppercase hex pointersMartin Willi2013-11-201-6/+0
| | | | We use %P as custom printf specifier for proposals.
* backtrace: Support backtracing even if library is not initializedMartin Willi2013-11-061-2/+2
| | | | But of course backtracing must be initialized anyway using backtrace_init().
* leak-detective: Call {gm,local}time_r() to allocate static bufferMartin Willi2013-11-061-0/+5
| | | | | On OS X Mavericks, these functions use a static allocation and are hard to whitelist using other means.
* leak-detective: Register OS X specific hooks just onceMartin Willi2013-11-061-0/+7
| | | | | If we initialize libstrongswan more than once in the same process, we may not register the hooks twice.
* leak-detective: Reset leak list during cleanupMartin Willi2013-11-061-0/+1
| | | | This resets leak detective state should it get created/destroyed more than once.
* leak-detective: Use callback functions to report leaks and usage informationMartin Willi2013-11-063-45/+100
| | | | This is more flexible than printing reports to a FILE.
* identification: Properly check length before comparing for binary DN equalityMartin Willi2013-10-311-1/+1
| | | | Fixes CVE-2013-6075.
* utils: Include stdio.h for fmemopen() replacementTobias Brunner2013-10-291-0/+1
| | | | | This might now be required because Vstr is not necessarily required anymore, which means stdio.h might not be pulled in by prinf_hook.h.
* utils: Fix check for fmemopen() fallback implementationMartin Willi2013-10-242-2/+3
|
* printf-hook-builtin: Don't rely on isinf() return value signednessMartin Willi2013-10-241-8/+9
| | | | | Many systems don't return a negative value for negative infinities; so do a separate check.
* utils: Provide a fmemopen(3) fallback using BSD funopen()Martin Willi2013-10-242-0/+61
|
* chunk: Add helper function to create a chunk from data read from a file ↵Tobias Brunner2013-10-232-0/+40
| | | | descriptor
* utils: Add utility function to calculate padding lengthTobias Brunner2013-10-171-12/+16
|
* vstr: Forward actual field widthTobias Brunner2013-10-111-1/+1
| | | | | fmt_field_width is a flag that indicates if a field width is defined in obj_field_width.
* printf-hook-builtin: Print NaN/Infinity floating point values as suchMartin Willi2013-10-111-2/+22
|
* printf-hook-builtin: Correctly round up floating point valuesMartin Willi2013-10-111-1/+15
|
* printf-hook-builtin: Add some preliminary floating point supportMartin Willi2013-10-111-2/+194
| | | | | This minimalistic implementation has no aspiration for completeness or accuracy, and just provides what we need.
* printf-hook-builtin: Support GNU %m specifierMartin Willi2013-10-111-0/+8
|
* printf-hook-builtin: Add a new "builtin" backend using its own printf() routinesMartin Willi2013-10-113-0/+1017
| | | | | | Overloads printf C library functions by a self-contained implementation, based on klibc. Does not yet feature all the required default formatters, including those for floating point values.
* printf-hook: Move glibc/vstr printf hook backends to separate filesMartin Willi2013-10-116-379/+575
|
* printf-hook: Write to output stream instead of the FD directly when using VstrTobias Brunner2013-09-241-12/+12
| | | | | This avoids problems when other stdio functions are used (fputs, fwrite) as writes via Vstr/FD were always unbuffered.
* Added tzset memory leak to whitelistAndreas Steffen2013-08-281-0/+1
|
* chunk: Print chunks without separator if + modifier is usedTobias Brunner2013-08-242-2/+3
|
* utils: Add case-insensitive version of strpfx()Tobias Brunner2013-08-241-0/+8
|
* backtrace: rename clone() method clashing with system callMartin Willi2013-08-091-2/+2
| | | | Fixes #376.
* utils: add round_up/down() helper functionsMartin Willi2013-07-291-0/+23
|
* capabilities: Proper error handling when reading groupsTobias Brunner2013-07-241-1/+8
|
* Fix various API doc issues and typosTobias Brunner2013-07-181-1/+0
| | | | Partially based on an old patch by Adrian-Ken Rueegsegger.