aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan
Commit message (Collapse)AuthorAgeFilesLines
...
* Initialize variables that some compilers seem to warn aboutTobias Brunner2015-08-132-2/+2
|
* Fixed some typosTobias Brunner2015-08-132-2/+2
|
* identification: Use UTF8String instead of the legacy T61String to encode DNsTobias Brunner2015-08-061-1/+1
| | | | | | | When strings in RDNs contain characters outside the character set for PrintableString use UTF8String as the passed string is most likely in that encoding (RFC 5280 actually recommends to use only those two string types).
* identification: Add hash() methodTobias Brunner2015-08-063-3/+135
| | | | | | | Compared to hashing the encoding we can ignore string types of RDNs when hashing DNs, making hash() compatible to equals() that does the same. Fixes #991.
* pkcs11: Fix encoding of RSA keys if unnecessarily zero prefixedTobias Brunner2015-08-061-3/+8
| | | | | | | | | | | | | | Some tokens/libraries seem to prefix all numbers with zero bytes even if not necessary (e.g. the default exponent 0x010001). If we don't fix that, the fingerprints calculated based on the retrieved values will be incorrect. Even if the pkcs1 plugin can properly handle numbers that are not in two's complement since a81bd670b086 ("Added PUBKEY_RSA_MODULUS encoding type") we prefix them with zero if necessary as other encoders might expect them in two's complement. Fixes #1012.
* printf-hook-builtin: Fix invalid memory accessTobias Brunner2015-08-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When precision is given for a string, we must not run unbounded strlen() as it will read beyond the given length. It might even cause a crash if the given pointer is near end of heap or mapping. Fixes numerous valgrind errors such as: ==19215== Invalid read of size 1 ==19215== at 0x52D36C6: builtin_vsnprintf (printf_hook_builtin.c:853) ==19215== by 0x52D40A8: builtin_snprintf (printf_hook_builtin.c:1084) ==19215== by 0x52CE464: dntoa (identification.c:337) ==19215== by 0x52CE464: identification_printf_hook (identification.c:837) ==19215== by 0x52D3DAA: builtin_vsnprintf (printf_hook_builtin.c:1010) ==19215== by 0x57040EB: vlog (bus.c:388) ==19215== by 0x570427D: log_ (bus.c:430) ==19215== by 0xA8445D3: load_x509_ca (stroke_cred.c:416) ==19215== by 0xA8445D3: load_certdir (stroke_cred.c:537) ==19215== by 0xA846A95: load_certs (stroke_cred.c:1353) ==19215== by 0xA846A95: stroke_cred_create (stroke_cred.c:1475) ==19215== by 0xA84073E: stroke_socket_create (stroke_socket.c:782) ==19215== by 0xA83F27C: register_stroke (stroke_plugin.c:53) ==19215== by 0x52C3125: load_feature (plugin_loader.c:716) ==19215== by 0x52C3125: load_provided (plugin_loader.c:778) ==19215== by 0x52C3A20: load_features (plugin_loader.c:799) ==19215== by 0x52C3A20: load_plugins (plugin_loader.c:1159) ==19215== Address 0x50cdb42 is 0 bytes after a block of size 2 alloc'd ==19215== at 0x4C919FE: malloc (vg_replace_malloc.c:296) ==19215== by 0x52CD198: chunk_printable (chunk.c:759) ==19215== by 0x52CE442: dntoa (identification.c:334) ==19215== by 0x52CE442: identification_printf_hook (identification.c:837) ==19215== by 0x52D3DAA: builtin_vsnprintf (printf_hook_builtin.c:1010) ==19215== by 0x57040EB: vlog (bus.c:388) ==19215== by 0x570427D: log_ (bus.c:430) ==19215== by 0xA8445D3: load_x509_ca (stroke_cred.c:416) ==19215== by 0xA8445D3: load_certdir (stroke_cred.c:537) ==19215== by 0xA846A95: load_certs (stroke_cred.c:1353) ==19215== by 0xA846A95: stroke_cred_create (stroke_cred.c:1475) ==19215== by 0xA84073E: stroke_socket_create (stroke_socket.c:782) ==19215== by 0xA83F27C: register_stroke (stroke_plugin.c:53) ==19215== by 0x52C3125: load_feature (plugin_loader.c:716) ==19215== by 0x52C3125: load_provided (plugin_loader.c:778) ==19215== by 0x52C3A20: load_features (plugin_loader.c:799) ==19215== by 0x52C3A20: load_plugins (plugin_loader.c:1159)
* unit-tests: Add unit tests for settings_t.load_string[_section]Tobias Brunner2015-07-281-8/+113
|
* settings: Add methods and a constructor to parse settings from stringsTobias Brunner2015-07-282-11/+112
|
* settings: Extend parser so we can parse settings from a stringTobias Brunner2015-07-282-0/+45
|
* settings: Add support for multi-line stringsTobias Brunner2015-07-283-16/+20
| | | | Unterminated strings are now an error.
* settings: Don't replace rarely used special charactersTobias Brunner2015-07-281-2/+0
|
* Use MGF1 with SHA-512 as BLISS random oracleAndreas Steffen2015-07-274-72/+58
|
* Generalize c_indices generation using SHA-512 random oracle.Markku-Juhani Olavi Saarinen2015-07-271-18/+24
| | | | | | This generalization allows the ring dimension n to be different from the current n = 512 and allows kappa to be > 56. Also the hash octets are consumed in a more consistent manner.
* Fixed several bugs in the BLISS signature generation/verification step.Markku-Juhani Olavi Saarinen2015-07-271-4/+8
| | | | | | | | | | | | | | | | The c_indices derived from the SHA-512 random oracle consist of nine bits (0..511). The leftmost 8 bits of each index are taken on an octet-by-octet basis from the 56 leftmost octets of the SHA-512 hash. The 9th bit needed for the LSB is taken from the extra_bits 64 bit unsigned integer which consists of the 8 rightmost octets of the SHA-512 hash (in network order). If more than 56 indices must be derived then additional rounds of the random oracle are executed until all kappa c_indices have been determined. The bug fix shifts the extra_bits value by one bit in each loop iteration so that the LSB of each index is random. Also iterate through the hash array using the loop variable j not the c_indices variable i.
* host: Properly handle NULL in host_create_from_string[_and_family]Tobias Brunner2015-07-272-0/+10
|
* unit-tests: Increase failure message buffer to hold larger hex dumpsMartin Willi2015-07-122-2/+2
|
* unit-tests: Forward variable argument list in TEST_SUITE_DEPENDMartin Willi2015-07-121-2/+2
| | | | | For some plugin features, such as crypters or AEADs, we have some additional feature arguments, such as the key size.
* chapoly: Process two Poly1305 blocks in parallel in SSSE3 driverMartin Willi2015-07-121-85/+291
| | | | | | | | | | By using a derived key r^2 we can improve performance, as we can do loop unrolling and slightly better utilize SIMD instructions. Overall ChaCha20-Poly1305 performance increases by ~12%. Converting integers to/from our 5-word representation in SSE does not seem to pay off, so we work on individual words.
* chapoly: Process four ChaCha20 blocks in parallel in SSSE3 driverMartin Willi2015-07-121-16/+207
| | | | | As we don't have to shuffle the state in each ChaCha round, overall performance for ChaCha20-Poly1305 increases by ~40%.
* chapoly: Add an SSSE3 based driverMartin Willi2015-06-294-1/+514
| | | | | | | | | | | | | We always build the driver on x86/x64, but enable it only if SSSE3 support is detected during runtime. Poly1305 uses parallel 32-bit multiplication operands yielding a 64-bit result, for which two can be done in parallel in SSE. This is minimally faster than multiplication with 64-bit operands, and also works on 32-bit builds not having a __int128 result type. On a 32-bit architecture, this is more than twice as fast as the portable driver, and on 64-bit it is ~30% faster.
* chapoly: Add a ChaCha20/Poly1305 driver implemented in portable CMartin Willi2015-06-294-0/+488
|
* chapoly: Provide a generic ChaCha20/Poly1305 AEAD supporting driver backendsMartin Willi2015-06-298-0/+679
|
* test-vectors: Add some initial ChaCha20/Poly1305 AEAD test vectorMartin Willi2015-06-293-0/+112
|
* proposal: Add a chacha20poly1305 proposal keywordMartin Willi2015-06-291-0/+1
|
* crypter: Define a ChaCha20/Poly1305 AEAD algorithm identifierMartin Willi2015-06-293-3/+7
|
* capabilities: Handle ERANGE in user and group lookupsTobias Brunner2015-06-231-12/+48
| | | | | | | | | | | | | | As it turns out, getpwnam_r, getgrnam_r, and friends will return ERANGE if _any_ user or group on the system is larger than will fit into the scratch buffer you pass to them. This reworks the resolve_uid and resolve_gid methods plus init_supplementary_groups to use a variable-size buffer that is grown until the results fit. Based on a patch by Evan Broder. Closes strongswan/strongswan#12.
* Remove accidentally added stamp-h1Tobias Brunner2015-06-151-1/+0
| | | | Was added in bc4748832395 ("Add a return value to prf_t.get_bytes()").
* settings: Fix out-of-tree buildTobias Brunner2015-06-111-1/+1
| | | | | The header file was created in the source directory before, where it wasn't found by the generated C files in the build directory.
* unit-tests: Add tests for iv_gen_seq_tTobias Brunner2015-06-053-0/+75
|
* ivgen: Allow reusing the same message ID twice in sequential IV genMartin Willi2015-06-051-7/+25
| | | | | | | | | | | | We use the message ID and fragment number as IV generator. As IKEv2 uses distinct message ID counters for actively and passively initiated exchanges, each IV would be used twice. As we explicitly reject such message IDs since d0ed1079, original-responder initiated exchanges fail with counter mode ciphers. This commit separates IV space in two halves for sequential IVs, and automatically assigns once reused sequence numbers to the second half. Fixes #980.
* iv-gen: Fail getting shorter IV values than the used counter sizeMartin Willi2015-06-011-0/+4
| | | | | While no algorithm actually uses such short IVs, we add a check here to ensure we won't return just the lower bits of the counter.
* iv-gen: Ensure external sequential IVs are actually sequentialMartin Willi2015-06-012-0/+23
| | | | We allow gaps in IVs, but ensure that an IV is never used more than once.
* leak-detective: Use passed callback to report leaksTobias Brunner2015-04-201-2/+2
| | | | | | | | This prevented `stroke memusage` from reporting the leaks on the console. Instead, they were sent to the callbacks set up by libstrongswan. Fixes a426851f6362 ("leak-detective: Use callback functions to report leaks and usage information").
* openssl: Don't refer to EVP_des_ecb() if OpenSSL is built without DES supportTobias Brunner2015-04-171-0/+2
| | | | | | While DES-ECB is not registered by the plugin in this case (so the function will never actually be called), the compiler still warns about the implicitly declared function.
* strerror: Move to its own Doxygen subgroupMartin Willi2015-04-161-1/+2
|
* utils: Clean up includesMartin Willi2015-04-162-36/+31
|
* align: Move min/max/padding/alignment functions to separate filesMartin Willi2015-04-166-109/+154
|
* time: Move time related functions to separate filesMartin Willi2015-04-166-191/+238
|
* object: Move OO programming helper macros to a separate header fileMartin Willi2015-04-163-107/+128
|
* status: Move status_t type and functions to separate filesMartin Willi2015-04-166-116/+125
|
* path: Move path related utility functions to separate filesMartin Willi2015-04-166-201/+249
|
* tty: Move tty related functions to separate filesMartin Willi2015-04-166-110/+157
|
* memory: Move memory manipulation related functions to separate filesMartin Willi2015-04-166-380/+424
|
* string: Move string related utility functions to separate filesMartin Willi2015-04-166-155/+199
|
* byteorder: Move byte order related functions to separate header fileMartin Willi2015-04-163-137/+163
|
* types: Use generic type definitions to separate header fileMartin Willi2015-04-163-63/+89
|
* atomics: Move atomics/recounting support to separate filesMartin Willi2015-04-166-183/+251
|
* unit-tests: Further increase the test vector testing timeoutMartin Willi2015-04-161-1/+1
| | | | Some build bots running make check seem to have longer for the DH testing.
* test-vectors: Define test vector symbols as externMartin Willi2015-04-161-7/+7
| | | | | | We don't actually define a vector, but only prototype the test vector implemented in a different file. GCC uses the correct symbol during testing, but clang correctly complains about duplicated symbols during linking.
* aesni: Fix doxygen groupsMartin Willi2015-04-151-2/+2
|