Martin Willi
61b2d815b9
x509: Replace fixed acert group string getter by a more dynamic group enumerator
2014-03-31 11:14:58 +02:00
Martin Willi
a9bfd4b055
x509: Skip parsing of acert chargingIdentity, as we don't use it anyway
2014-03-31 11:14:58 +02:00
Martin Willi
3134379ac7
x509: Fix some whitespaces and do some minor style cleanups in acert
2014-03-31 11:14:57 +02:00
Martin Willi
883a63adc1
ac: Remove unimplemented equals_holder() method from ac_t
2014-03-31 11:14:57 +02:00
Tobias Brunner
0462304dbb
unit-tests: Fix filtered enumerator tests on 64-bit big-endian platforms
...
In case of sizeof(void*) == 8 and sizeof(int) == 4 on big-endian hosts
the tests failed as the actual integer value got cut off.
2014-03-27 15:35:32 +01:00
Tobias Brunner
58d8c52190
unit-tests: Fix memory leak in ntru tests
2014-03-27 10:52:45 +01:00
Andreas Steffen
f0388684cd
unit-test: added missing TEST_FUNCTION macros
2014-03-22 10:26:02 +01:00
Tobias Brunner
01632eccf3
openssl: Add default fallback when calculating fingerprints of RSA keys
...
We still try to calculate these directly as it can avoid a dependency on
the pkcs1 or other plugins. But for e.g. PGPv3 keys we need to delegate the
actual fingerprint calculation to the pgp plugin.
2014-03-22 09:55:03 +01:00
Andreas Steffen
22e1aa51f9
Completed integration of ntru_crypto library into ntru plugin
2014-03-22 09:51:00 +01:00
Tobias Brunner
510c900479
crypto-tester: Don't fail if key size is not supported
...
The Blowfish and Twofish implementations provided by the gcrypt plugin
only support specific key lengths, which we don't know when testing
against vectors (either during unit tests or during algorithm
registration). The on_create test with a specific key length will be
skipped anyway, so there is no point in treating this failure differently.
2014-03-20 15:49:05 +01:00
Tobias Brunner
5dd638f45c
unit-tests: Add an option to increase the verbosity when running tests
...
The TESTS_VERBOSITY option takes an integer from -1 to 4 that sets the
default debug level.
2014-03-20 15:49:05 +01:00
Tobias Brunner
77603e98a3
unit-tests: Add an option to run only a subset of all test suites
...
The TESTS_SUITES environment variable can contain a comma separated list
of names of test suites to run.
2014-03-20 15:49:05 +01:00
Tobias Brunner
636076d45d
unit-tests: Actually verify registered algorithms against test vectors
...
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.
2014-03-20 15:49:05 +01:00
Tobias Brunner
6ce5aee0b2
unit-tests: Use TEST_FUNCTION macro in ntru tests
2014-03-20 15:49:05 +01:00
Tobias Brunner
b751f6f25a
unit-tests: Implement registered functions without __builtin_apply()
...
This makes the tests work with clang, which does not implement said
builtin.
2014-03-20 15:37:44 +01:00
Tobias Brunner
31b3bb2211
unit-tests: Call functions with TEST_ prefix in ntru test
2014-03-20 15:37:44 +01:00
Tobias Brunner
2c687b3cb3
unit-tests: Prefix imported testable functions with TEST_
...
This avoids any clashes with existing functions in the monolithic build.
2014-03-20 15:29:27 +01:00
Tobias Brunner
f51169eb09
unit-tests: Change how hashtable for testable functions is created
...
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.
2014-03-20 15:29:27 +01:00
Tobias Brunner
48ac56e2aa
unit-tests: Generate weak keys with gcrypt plugin (but quickly)
2014-03-20 15:29:27 +01:00
Tobias Brunner
fc4f8fc30e
tnc-pdp: Fix monolithic build
2014-03-20 15:29:27 +01:00
Tobias Brunner
27b3358fed
plugin-feature: Hash only the actually used feature argument
...
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 .
2014-03-20 13:42:57 +01:00
Andreas Steffen
0b408faef1
Added TPMRA workitem support for [dummy] Trusted Boot measurements
2014-03-19 20:26:31 +01:00
Martin Willi
0a8c399a21
pki: When dispatching commands, don't look beyond non-null-terminated array
2014-03-19 09:37:46 +01:00
Martin Willi
87e53819a6
pki: Check length of commands array before accessing command in --help
...
As --help is counted as command as well, the array is not null-terminated
and we have to check for MAX_COMMANDS.
Fixes #550 .
2014-03-19 09:25:29 +01:00
Tobias Brunner
c489c5881a
charon-nm: No additional secrets are required once a password has been entered
...
Recent versions of NM will call need_secrets() as long as it returns TRUE,
but then fail as the number of calls is limited by an assert.
Fixes #547 .
2014-03-18 14:53:40 +01:00
Tobias Brunner
11f31ceb6a
array: Fix removal of elements in the second half of an array
...
Memory beyond the end of the array was moved when array elements in the
second half of an array were removed.
Fixes #548 .
2014-03-18 14:46:16 +01:00
Tobias Brunner
0ab7d5f1f9
plugin-loader: Properly initialize modular plugin list if no plugins are enabled
2014-03-18 10:56:39 +01:00
Andreas Steffen
337f0c8a2f
Implemented ntru_private_key class
2014-03-18 10:03:16 +01:00
Andreas Steffen
3933798cb1
11 bits are needed to encode a maximum index of 1086
2014-03-15 19:22:16 +01:00
Tobias Brunner
67dc5d393c
tnc-ifmap: Get a reference to the client cert as it is also used in an auth config
2014-03-10 14:31:42 +01:00
Andreas Steffen
342bc6e545
Disable mandatory ECP support for attestion
2014-03-07 21:56:34 +01:00
Andreas Steffen
ac17ca1ad7
Refactored NTRU parameter set selection
2014-03-07 21:56:34 +01:00
Andreas Steffen
7befce8c3f
Refactored ntru_param_sets
2014-03-07 21:56:33 +01:00
Tobias Brunner
0d30d73eb9
thread: Properly clean up meta data of main thread
2014-03-07 18:28:38 +01:00
Tobias Brunner
d517a9893e
settings: Log all errors on level 1
...
Closes #539 .
2014-03-04 13:30:09 +01:00
Thomas Egerer
7acdebf6c0
settings: Avoid conf file parsing beyond allocated buffer
...
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 <[email protected] >
2014-03-03 17:27:58 +01:00
Andreas Steffen
d6ce8da6c0
Optimize ntru_poly constructors some more
2014-02-27 23:06:51 +01:00
Andreas Steffen
2bb793f131
Optimized initialisation of indices
2014-02-27 22:39:47 +01:00
Andreas Steffen
222b88a302
Added get_array() method to ntru_poly_t class
2014-02-27 22:08:22 +01:00
Andreas Steffen
d12a4a67bf
Defined ntru_poly_create_from_seed() and ntru_poly_create_from_data() constructors and built some unit tests for the latter)
2014-02-27 20:36:17 +01:00
Andreas Steffen
f87f28ec68
Optimized use of temporary arrays in polynomial multiplication
2014-02-27 15:22:59 +01:00
Andreas Steffen
bf24960cbe
Implement ring multiplication method
2014-02-27 15:22:58 +01:00
Tobias Brunner
2ed241aeb3
utils: Add memrchr(3) replacement for platforms that don't support it
...
For instance, on Mac OS X memrchr(3) is not provided by the C library.
2014-02-26 11:05:07 +01:00
Tobias Brunner
6b895d7b25
libpts: Use path_base|dirname()
2014-02-24 12:04:11 +01:00
Tobias Brunner
9222d58634
conftest: Use path_dirname()
2014-02-24 12:04:11 +01:00
Tobias Brunner
849e401b37
stroke: Use thread-safe dirname(3)
2014-02-24 12:04:11 +01:00
Tobias Brunner
18019a3b89
settings: Use thread-safe dirname(3)
2014-02-24 12:04:11 +01:00
Tobias Brunner
766141bc77
utils: Add thread-safe variants of dirname(3) and basename(3)
2014-02-24 12:04:11 +01:00
Tobias Brunner
ba10cd3c7f
utils: Move thread-safe strerror replacement to a separate file
...
For some utils _GNU_SOURCE might be needed but that conflicts with the
signature of strerror_r(3).
2014-02-24 12:04:10 +01:00
Tobias Brunner
aa693d763a
stroke: Use dirname(3) correctly
2014-02-24 12:04:10 +01:00