Tobias Brunner
94e10f15e5
test-asn1: Fix skipping of >2038 tests on i386
...
The two constants overflow time_t on i386 (they also produced a compiler
warning without type suffix) so the comparison with TIME_32_BIT_SIGNED_MAX
did not work as intended.
Fixes #477 .
2014-01-06 18:23:40 +01:00
Tobias Brunner
d62a6ec3f9
chunk: Fix chunk_mac/hash tests on big-endian systems
...
Our SipHash-2-4 implementation returns the result in host order, while
the test vectors are little-endian. Use a custom comparison function to
account for this.
Fixes #478 .
2014-01-06 17:31:07 +01:00
Tobias Brunner
13f2d3a2f6
utils: Fix %T printf hook on big-endian systems
...
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 .
2014-01-06 15:30:02 +01:00
Tobias Brunner
bfa2201537
tun-device: Include system headers before our own
...
On CentOS 6.5 the sys/capability.h header file defines _LINUX_TYPES_H
without actually including that header, preventing its later inclusion
here.
As library.h (via which the capabilities headers are included) is not
actually required in tun_device.[ch], moving the inclusion of tun_device.h
would not strictly be necessary. But it's probably a good idea to
include our own headers after system headers anyway, for if one of the
recursively included files at a later point includes library.h we'd have
the same problem again.
2013-12-20 11:33:16 +01:00
Andreas Steffen
953a922e9b
unit-tests: NTRU test to check a special branch
2013-12-08 10:18:33 +01:00
Andreas Steffen
84814a6b7c
min_MGF_hash_calls parameter is not needed anymore
2013-12-07 23:54:53 +01:00
Andreas Steffen
5da659523e
Optimized MGF1 implementation
2013-12-07 23:29:04 +01:00
Andreas Steffen
abd4797dc1
Implemented ntru_trits class
2013-12-07 23:27:59 +01:00
Andreas Steffen
a978a8194d
Streamlined DRBG and MGF1 debug output
2013-12-07 00:21:28 +01:00
Andreas Steffen
933f3c6e8f
unit-tests: Added crypter tests
2013-12-06 10:09:36 +01:00
Andreas Steffen
fdc6c682b2
Added own MGF1 mask generating function
2013-12-05 22:55:47 +01:00
Andreas Steffen
78affed0a0
unit-tests: Added hasher tests
2013-12-04 23:09:32 +01:00
Andreas Steffen
2006709ec5
Moved test_rng to a test suite of its own
2013-12-04 21:23:30 +01:00
Tobias Brunner
f1e12da7ef
unit-tests: Don't use priority for destructor that unregisters testable 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.
2013-12-04 20:33:00 +01:00
Tobias Brunner
d5a0abfa92
unit-tests: Export ntru_drbg_create as testable function so no linking is required
...
This way the plugin does not have to be linked explicitly to the test
runner, which otherwise would require that the plugin is either always
enabled to build the tests or that ifdefs are added to the Makefile.
2013-12-04 20:32:59 +01:00
Tobias Brunner
4cea186b64
unit-tests: Add facility to register testable functions
...
These can be defined in plugins, or other parts of the tested libraries.
They can even be static.
2013-12-04 20:32:59 +01:00
Tobias Brunner
a24eec4649
unit-tests: Move ntru_test_rng_t to a utility class in libtest
2013-12-04 20:32:59 +01:00
Tobias Brunner
6354466a5b
unit-tests: Fix apidoc for libtest
2013-12-04 20:32:59 +01:00
Tobias Brunner
3e8a44c2aa
ntru: Fix compiler warning caused by ++/-- on righthand side of an assignment
...
The behavior of stuff like x = --x; (or x++) is not defined.
2013-12-04 20:32:59 +01:00
Andreas Steffen
7d5b9e81a4
Added DRBG automatic reseeding tests
2013-11-27 20:21:41 +01:00
Andreas Steffen
5443762491
Use strongSwan hash plugins for SHA-1 and SHA-256
2013-11-27 20:21:41 +01:00
Andreas Steffen
d993a567b7
Extended NIST SP 800-90A HMAC_DRBG test cases
2013-11-27 20:21:41 +01:00
Andreas Steffen
a7047cda59
Cleaned up ntru-crypto library
2013-11-27 20:21:41 +01:00
Andreas Steffen
98c6421674
Implemented NIST SP 800-90A DRBG_HMAC with SHA-256
2013-11-27 20:21:41 +01:00
Andreas Steffen
9013973cc8
unit-tests: Added ntru wrong ciphertext test
2013-11-27 20:21:41 +01:00
Andreas Steffen
885e699b58
unit-tests: Added ntru entropy, retransmission and ciphertext tests
2013-11-27 20:21:41 +01:00
Andreas Steffen
802eaf3789
Any of the four NTRU parameter sets can be selected
2013-11-27 20:21:41 +01:00
Andreas Steffen
1f73969eb5
Make the NTRU parameter set configurable
2013-11-27 20:21:41 +01:00
Andreas Steffen
2c620cb089
unit-tests: first NTRU test case
2013-11-27 20:21:40 +01:00
Andreas Steffen
146ad86be5
Prototype implementation of IKE key exchange via NTRU encryption
2013-11-27 20:21:40 +01:00
Tobias Brunner
20a48e4be3
chunk: Fix signedness warnings caused by chunk_from_* macros
...
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.
2013-11-27 18:28:44 +01:00
Martin Willi
1cbe4e6ce4
tun-device: Include <linux/types.h> before <linux/if_tun.h>
...
Fixes a build error on CentOS 6.4.
2013-11-22 09:09:06 +01:00
Martin Willi
07ca25909b
printf-hook-builtin: Don't use %P to print uppercase hex pointers
...
We use %P as custom printf specifier for proposals.
2013-11-20 16:57:28 +01:00
Tobias Brunner
3bff80aee3
openssl: Verify that a peer's ECDH public value is a point on the elliptic curve
...
This check is mandated by RFC 6989. Since we don't reuse DH secrets,
it is mostly a sanity check.
2013-11-19 15:00:28 +01:00
Andreas Steffen
b63246c5db
Implemented libstrongswan.plugins.random.strong_equals_true option
2013-11-16 00:11:40 +01:00
Tobias Brunner
20c99edab9
android: Remove dependency on libvstr
2013-11-13 11:40:47 +01:00
Tobias Brunner
334f44cd29
unit-tests: Initialize tests with a callback
2013-11-06 10:31:07 +01:00
Tobias Brunner
8d2450d8b8
plugin-loader: Convenience function added to add plugin dirs in build tree
2013-11-06 10:31:07 +01:00
Martin Willi
09d0c9030a
unit-tests: Separate test runner to a library, reusable by other tests
...
Other users may make use of the noinst libtest.la helper library to implement
unit tests. For libstrongswan, tests.[ch] provide the configuration for test
runner to perform unit tests in a simple manner.
2013-11-06 10:31:07 +01:00
Martin Willi
5a3230a250
unit-tests: Use some include magic to define test suite constructors
...
Avoid editing of several files when creating test suites by using a single
header file to define test suite constructor functions.
2013-11-06 10:31:07 +01:00
Martin Willi
d9d0eef92b
unit-tests: Check printing of strings having zero length
2013-11-06 10:31:07 +01:00
Martin Willi
61934203e2
unit-tests: Add some basic tests if PRI* printf specifiers work as expected
2013-11-06 10:31:06 +01:00
Martin Willi
a4cbda35ce
unit-tests: Add a semaphore wait cancel test
2013-11-06 10:31:06 +01:00
Martin Willi
fae1b85223
unit-tests: Add a semaphore absolute timed wait test
2013-11-06 10:31:06 +01:00
Martin Willi
a14935ea4b
unit-tests: Add a semaphore timed wait test case
2013-11-06 10:31:06 +01:00
Martin Willi
ffab2e0c95
unit-tests: Add a simple semaphore test
2013-11-06 10:31:06 +01:00
Martin Willi
b1bfe59560
unit-tests: Add a spinlock test case
2013-11-06 10:31:06 +01:00
Martin Willi
478dc0257c
unit-tests: Add a rwlock condvar thread cancel test
2013-11-06 10:31:05 +01:00
Martin Willi
b92c173b28
unit-tests: Add a rwlock condvar absolute timed wait test
2013-11-06 10:31:05 +01:00
Martin Willi
af19213c54
unit-tests: Add a rwlock condvar wait test
2013-11-06 10:31:05 +01:00