Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | unit-tests: Actually verify registered algorithms against test vectors | Tobias Brunner | 2014-03-20 | 2 | -5/+47 | |
| | | | | | | | | Previously, the {ns}.crypto_test.on_add option had to be enabled to actually test the algorithms, which we can't enforce for the tests in the test_runner as the option is already read when the crypto factory is initialized. Even so, we wouldn't want to do this for every unit test, which would be the result of enabling that option. | |||||
* | unit-tests: Use TEST_FUNCTION macro in ntru tests | Tobias Brunner | 2014-03-20 | 1 | -34/+44 | |
| | ||||||
* | unit-tests: Implement registered functions without __builtin_apply() | Tobias Brunner | 2014-03-20 | 1 | -17/+17 | |
| | | | | | This makes the tests work with clang, which does not implement said builtin. | |||||
* | unit-tests: Call functions with TEST_ prefix in ntru test | Tobias Brunner | 2014-03-20 | 1 | -36/+38 | |
| | ||||||
* | unit-tests: Prefix imported testable functions with TEST_ | Tobias Brunner | 2014-03-20 | 1 | -3/+3 | |
| | | | | This avoids any clashes with existing functions in the monolithic build. | |||||
* | unit-tests: Change how hashtable for testable functions is created | Tobias Brunner | 2014-03-20 | 3 | -28/+49 | |
| | | | | | | | | Because GCC does not adhere to the priorities defined for constructors when building with --enable-monolithic (not sure if it was just luck that it worked in non-monolithic mode - anyway, it's not very portable) function registration would fail because the hashtable would not be created yet. | |||||
* | unit-tests: Generate weak keys with gcrypt plugin (but quickly) | Tobias Brunner | 2014-03-20 | 1 | -0/+3 | |
| | ||||||
* | plugin-feature: Hash only the actually used feature argument | Tobias Brunner | 2014-03-20 | 1 | -1/+31 | |
| | | | | | | | | Clang does not initialize padding in union members so hashing the complete "arg" union could lead to different hashes if the hashed plugin_feature_t does not have static storage duration. Fixes #549. | |||||
* | array: Fix removal of elements in the second half of an array | Tobias Brunner | 2014-03-18 | 1 | -1/+1 | |
| | | | | | | | Memory beyond the end of the array was moved when array elements in the second half of an array were removed. Fixes #548. | |||||
* | plugin-loader: Properly initialize modular plugin list if no plugins are enabled | Tobias Brunner | 2014-03-18 | 1 | -0/+1 | |
| | ||||||
* | Implemented ntru_private_key class | Andreas Steffen | 2014-03-18 | 15 | -1381/+1429 | |
| | ||||||
* | 11 bits are needed to encode a maximum index of 1086 | Andreas Steffen | 2014-03-15 | 1 | -1/+1 | |
| | ||||||
* | Refactored NTRU parameter set selection | Andreas Steffen | 2014-03-07 | 3 | -40/+47 | |
| | ||||||
* | Refactored ntru_param_sets | Andreas Steffen | 2014-03-07 | 9 | -246/+175 | |
| | ||||||
* | thread: Properly clean up meta data of main thread | Tobias Brunner | 2014-03-07 | 1 | -0/+2 | |
| | ||||||
* | settings: Log all errors on level 1 | Tobias Brunner | 2014-03-04 | 1 | -4/+3 | |
| | | | | Closes #539. | |||||
* | settings: Avoid conf file parsing beyond allocated buffer | Thomas Egerer | 2014-03-03 | 1 | -2/+2 | |
| | | | | | | | | | | | | | | | A valgrind analysis of libstrongswan revealed an invalid read of 1 in the function starts_with(). A more thorough analysis proved this to be true and showed that with a specially crafted config file (e.g. a single '#'-character not followed by a newline), the parser might even interpret the random memory contents following the allocated buffer as part of the configuration file. The way the parser is designed, it must be able to skip an inserted '\0' and continue parsing. Since it is not able to skip two '\0' characters, the 'fix' of allocating two more bytes than the size of the parsed file and setting them to '\0' seems to be a safe bet. Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com> | |||||
* | Optimize ntru_poly constructors some more5.1.2 | Andreas Steffen | 2014-02-27 | 1 | -26/+24 | |
| | ||||||
* | Optimized initialisation of indices | Andreas Steffen | 2014-02-27 | 1 | -50/+39 | |
| | ||||||
* | Added get_array() method to ntru_poly_t class | Andreas Steffen | 2014-02-27 | 6 | -157/+90 | |
| | ||||||
* | Defined ntru_poly_create_from_seed() and ntru_poly_create_from_data() ↵ | Andreas Steffen | 2014-02-27 | 6 | -138/+220 | |
| | | | | constructors and built some unit tests for the latter) | |||||
* | Optimized use of temporary arrays in polynomial multiplication | Andreas Steffen | 2014-02-27 | 2 | -24/+24 | |
| | ||||||
* | Implement ring multiplication method | Andreas Steffen | 2014-02-27 | 4 | -113/+245 | |
| | ||||||
* | utils: Add memrchr(3) replacement for platforms that don't support it | Tobias Brunner | 2014-02-26 | 3 | -1/+81 | |
| | | | | For instance, on Mac OS X memrchr(3) is not provided by the C library. | |||||
* | settings: Use thread-safe dirname(3) | Tobias Brunner | 2014-02-24 | 1 | -5/+3 | |
| | ||||||
* | utils: Add thread-safe variants of dirname(3) and basename(3) | Tobias Brunner | 2014-02-24 | 3 | -4/+144 | |
| | ||||||
* | utils: Move thread-safe strerror replacement to a separate file | Tobias Brunner | 2014-02-24 | 7 | -99/+145 | |
| | | | | | For some utils _GNU_SOURCE might be needed but that conflicts with the signature of strerror_r(3). | |||||
* | settings: Use dirname(3) correctly | Tobias Brunner | 2014-02-24 | 1 | -4/+4 | |
| | | | | | | | | dirname(3) may return a pointer to a statically allocated buffer. So freeing the returned value can result to undefined behavior. This was noticed on FreeBSD where it caused very strange crashes. It is also not thread-safe, which will be addressed later. | |||||
* | index limit can be easily computed | Andreas Steffen | 2014-02-19 | 6 | -54/+28 | |
| | ||||||
* | uclibc only defines strndup(3) if _GNU_SOURCE is defined | Tobias Brunner | 2014-02-19 | 1 | -2/+2 | |
| | | | | References #516. | |||||
* | sshkey: uclibc only defines fmemopen(3) if _GNU_SOURCE is defined | Tobias Brunner | 2014-02-19 | 1 | -0/+1 | |
| | | | | Fixes #516. | |||||
* | Created ntru_poly class for sparse trinary polynomials | Andreas Steffen | 2014-02-18 | 9 | -440/+575 | |
| | ||||||
* | Fixed some typos | Tobias Brunner | 2014-02-18 | 3 | -6/+6 | |
| | ||||||
* | plugin-loader: Escape <ns> in comment as Doxygen sees this as XML tag | Tobias Brunner | 2014-02-18 | 1 | -2/+2 | |
| | ||||||
* | unit-tests: Ignore tests not test_runner | Tobias Brunner | 2014-02-18 | 1 | -1/+1 | |
| | ||||||
* | lookip: Disconnect asynchronously to avoid dead-locking watcher unregistration | Martin Willi | 2014-02-17 | 1 | -3/+2 | |
| | | | | | | | | | While it really would be desirable to allow stream destruction during on_read() callbacks, this does not work anymore since e49b2998. Until we have a proper solution for this issue, use asynchronous disconnects for the only user doing so. Fixes #518. | |||||
* | Fixed a minor vulnerability in which a malformed ASN.1 length field could ↵5.1.2rc1 | Andreas Steffen | 2014-02-14 | 1 | -0/+1 | |
| | | | | cause a crash of the charon daemon if the verbose debug level 3 (raw hex dump) for the asn subsystem is enabled. | |||||
* | printf-hook-glibc: printf.h on FreeBSD 10 does not include stdargs.h | Tobias Brunner | 2014-02-13 | 1 | -1/+1 | |
| | ||||||
* | array: Fix compilation on FreeBSD | Tobias Brunner | 2014-02-13 | 1 | -2/+2 | |
| | ||||||
* | settings: Add support to enumerate sections and key/value pairs with fallbacks | Tobias Brunner | 2014-02-12 | 3 | -45/+187 | |
| | ||||||
* | settings: Implement subsections and key/value pairs with sorted arrays | Tobias Brunner | 2014-02-12 | 1 | -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. | |||||
* | array: Add fallback for qsort_r using thread-local value | Tobias Brunner | 2014-02-12 | 3 | -2/+49 | |
| | | | | Cygwin for example does not support qsort_r. | |||||
* | plugin-loader: Optionally use load option in each plugin section to load plugins | Tobias Brunner | 2014-02-12 | 2 | -4/+144 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This now works because all plugins use the same config namespace. If <ns>.load_modular is true, the list of plugins to load is determined via the value of the <ns>.plugins.<name>.load options. Using includes the following is possible: charon { load_modular = yes plugins { include strongswan.d/charon/*.conf } } charon-cmd { load_modular = yes plugins { include strongswan.d/charon-cmd/*.conf } } Where each .conf file would contain something like: <name> { load = yes <option> = <value> } To increase the priority of individual plugins load = <priority> can be used (the default is 1). For instance, to use openssl instead of the built-in crypto plugins set in strongswan.d/charon/openssl.conf: openssl { load = 10 } If two plugins have the same priority their order in the default plugin list is preserved. Plugins not found in that list are ordered alphabetically before other plugins with the same priority. | |||||
* | array: Add array_bsearch function | Tobias Brunner | 2014-02-12 | 3 | -0/+141 | |
| | ||||||
* | array: Add array_sort function | Tobias Brunner | 2014-02-12 | 3 | -1/+167 | |
| | ||||||
* | lib: All settings use configured namespace | Tobias Brunner | 2014-02-12 | 23 | -54/+54 | |
| | ||||||
* | lib: Add default config fallback for configured namespace | Tobias Brunner | 2014-02-12 | 1 | -0/+3 | |
| | | | | All settings in the configured global namespace fall back to libstrongswan. | |||||
* | unit-tests: Test how settings_t handles some invalid data | Tobias Brunner | 2014-02-12 | 1 | -0/+72 | |
| | ||||||
* | settings: Add method that allows to define fallback sections for other sections | Tobias Brunner | 2014-02-12 | 3 | -13/+276 | |
| | | | | | 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 buffer | Tobias Brunner | 2014-02-12 | 1 | -10/+5 | |
| | | | | | The key to print (e.g. until the next .) still has to be null-terminated. |