Martin Willi
d7811415ff
aesni: Implement 192-bit key schedule
2015-04-15 11:35:26 +02:00
Martin Willi
6d7671eb1c
aesni: Implement 128-bit key schedule
2015-04-15 11:35:26 +02:00
Martin Willi
431f452ed4
aesni: Add a common key schedule class for AES
2015-04-15 11:35:26 +02:00
Martin Willi
78c04b5d4d
aesni: Provide a plugin stub for AES-NI instruction based crypto primitives
2015-04-15 11:35:26 +02:00
Martin Willi
1ef6c0ef06
utils: Provide an INIT_EXTRA() macro, that allocates extra data to INIT()
2015-04-15 11:35:26 +02:00
Martin Willi
ed6295944b
test-vectors: Add some self-made additional AES-GCM test vectors
...
We missed test vectors for 192/256-bit key vectors for ICV8/12, and should
also have some for larger associated data chunk.
2015-04-15 11:35:26 +02:00
Martin Willi
5c419b2974
test-vectors: Define some additional CCM test vectors
...
We don't have any where plain or associated data is not a multiple of the block
size, but it is likely to find bugs here. Also, we miss some ICV12 test vectors
using 128- and 192-bit key sizes.
2015-04-15 11:35:26 +02:00
Martin Willi
3a5106caea
crypto-tester: Use the plugin feature key size to benchmark crypters/aeads
...
We previously didn't pass the key size during algorithm registration, but this
resulted in benchmarking with the "default" key size the crypter uses when
passing 0 as key size.
2015-04-15 11:35:26 +02:00
Martin Willi
3ba3be97d6
utils: Define MAX_(U)INT_TYPE to the maximum size integer type available
2015-04-14 12:03:57 +02:00
Martin Willi
051064ac60
utils: Typedef int128_t and u_int128_t types if supported
2015-04-14 12:03:46 +02:00
Martin Willi
161a015782
utils: Use chunk_equals_const() for all cryptographic purposes
2015-04-14 12:02:51 +02:00
Martin Willi
9d6e952201
utils: Add a constant time chunk_equals() variant for cryptographic purposes
2015-04-14 12:02:48 +02:00
Martin Willi
71afe0a556
utils: Use memeq_const() for all cryptographic purposes
2015-04-14 11:53:31 +02:00
Martin Willi
b833963270
utils: Add a constant time memeq() variant for cryptographic purposes
2015-04-14 11:51:54 +02:00
Martin Willi
63d1e5b930
rdrand: Reuse CPU feature detection to check for RDRAND instructions
2015-04-13 15:31:58 +02:00
Martin Willi
137079b56f
padlock: Reuse common CPU feature detection to check for Padlock features
2015-04-13 15:31:58 +02:00
Martin Willi
793851856b
cpu-feature: Support Via Padlock security features
2015-04-13 15:31:58 +02:00
Martin Willi
f155880eda
cpu-feature: Add a common class to query available CPU features
...
Currently supported is x86/x64 via cpuid() for some common features.
2015-04-13 15:31:58 +02:00
Martin Willi
6a84a4049d
sqlite: Use our locking mechanism also when sqlite3_threadsafe() returns 0
...
We previously checked for older library versions without locking support at
all. But newer libraries can be built in single-threading mode as well, where
we have to care about the locking.
2015-04-13 15:31:58 +02:00
Martin Willi
4e621ada96
sqlite: Show SQLite library version and thread safety flag during startup
2015-04-13 15:31:58 +02:00
Martin Willi
3c81cb6fc3
aead: Create AEAD using traditional transforms with an explicit IV generator
...
Real AEADs directly provide a suitable IV generator, but traditional crypters
do not. For some (stream) ciphers, we should use sequential IVs, for which
we pass an appropriate generator to the AEAD wrapper.
2015-04-13 15:06:15 +02:00
Martin Willi
a4549e5525
iv-gen: Add a generic constructor to create an IV gen from an algorithm
2015-04-13 15:06:15 +02:00
Martin Willi
c2906c8f21
openssl: Don't pre-initialize OpenSSL HMAC with an empty key
...
With OpenSSL commit 929b0d70c19f60227f89fac63f22a21f21950823 setting an empty
key fails if no previous key has been set on that HMAC.
In 9138f49e we explicitly added the check we remove now, as HMAC_Update()
might crash if HMAC_Init_ex() has not been called yet. To avoid that, we
set and check a flag locally to let any get_mac() call fail if set_key() has
not yet been called.
2015-04-13 14:52:30 +02:00
Martin Willi
7394ad92ae
thread: Remove unneeded thread startup synchronization
...
sem_init() is deprecated on OS X, and it actually fails with ENOSYS. Using our
wrapped semaphore object is not an option, as it relies on the thread cleanup
that we can't rely on at this stage.
It is unclear why startup synchronization is required, as we can allocate the
thread ID just before creating the pthread. There is a chance that we allocate
a thread ID for a thread that fails to create, but the risk and consequences
are negligible.
2015-04-13 14:50:45 +02:00
Martin Willi
280f752c56
fips-prf: Remove superfluous <arpa/inet.h> include
...
As we make no use of htonl() and friends, this is unneeded, but actually
prevents a Windows build.
2015-04-13 09:31:28 +02:00
Martin Willi
12def59617
asn1: Undefine TIME_UTC, which is used by C11
...
When building with C11 support, TIME_UTC is used for timespec_get() and
defined in <time.h>. Undefine TIME_UTC for our own internal use in asn1.c.
2015-04-08 08:47:31 +02:00
Andreas Steffen
ff96400d13
Wipe auxiliary key store
2015-03-28 10:44:23 +01:00
Martin Willi
9310d4250a
crypto-tester: Explicitly exclude FIPS-PRF from append mode tests
...
This was implicitly done by the seed length check before 58dda5d6 , but we
now require an explicit check to avoid that unsupported use.
2015-03-28 08:38:52 +01:00
Martin Willi
b234fdfce8
fips-prf: Fail when trying to use append mode on FIPS-PRF
...
Append mode hardly makes sense for the special stateful FIPS-PRF, which is
different to other PRFs.
2015-03-28 08:36:35 +01:00
Martin Willi
bc1876bc9a
cmac: Reset state before doing set_key()
2015-03-27 16:07:53 +01:00
Martin Willi
4075e9d7a4
af-alg: Reset hmac/xcbc state before doing set_key()
2015-03-27 16:06:21 +01:00
Martin Willi
eedd92b53b
xcbc: Reset XCBC state in set_key()
...
If some partial data has been appended, a truncated key gets invalid if it
is calculated from the pending state.
2015-03-27 15:53:52 +01:00
Martin Willi
bfb029c82a
hmac: Reset the underlying hasher before doing set_key() with longer keys
...
The user might have done a non-complete append, having some state in the
hasher.
Fixes #909 .
2015-03-27 15:53:50 +01:00
Martin Willi
58dda5d6ab
crypto-tester: Test set_key() after a doing a partial append on prf/signers
...
While that use is uncommon in real-world use, nonetheless should HMAC set a
correct key and reset any underlying hasher.
2015-03-27 15:53:47 +01:00
Tobias Brunner
48bae7b2ba
android: Sync libstrongswan Makefile.am and Android.mk
2015-03-25 12:00:20 +01:00
Martin Willi
0356089d0f
diffie-hellman: Verify public DH values in backends
2015-03-23 17:54:03 +01:00
Martin Willi
a777155ffe
diffie-hellman: Add a bool return value to set_other_public_value()
2015-03-23 17:54:03 +01:00
Martin Willi
42431690e0
diffie-hellman: Add a bool return value to get_my_public_value()
2015-03-23 17:54:03 +01:00
Martin Willi
bace1d6479
diffie-hellman: Use bool instead of status_t as get_shared_secret() return value
...
While such a change is not unproblematic, keeping status_t makes the API
inconsistent once we introduce return values for the public value operations.
2015-03-23 17:54:02 +01:00
Tobias Brunner
cb461de2a2
unit-tests: Fix settings test after merging multi-line strings
2015-03-23 10:46:32 +01:00
Martin Willi
e284a861b8
unit-tests: Depend on SHA1/SHA256 features for mgf1 test cases
2015-03-23 09:53:34 +01:00
Tobias Brunner
d148c7ab6c
settings: Merge quoted strings that span multiple lines
2015-03-20 18:37:22 +01:00
Martin Willi
b546a98e0a
utils: Fix enum_flags_to_string parameter name to match Doxygen description
2015-03-19 12:14:30 +01:00
Andreas Steffen
d35143bb8d
Fixed two BLISS key type identifier strings
2015-03-16 17:08:14 +01:00
Tobias Brunner
1735d80f38
files: Add simple plugin to load files from file:// URIs
2015-03-09 16:08:52 +01:00
Tobias Brunner
11ac1dff9c
scheduler: Add method to remove all scheduled jobs
...
References #840 .
2015-03-09 15:57:57 +01:00
Tobias Brunner
1bfa5e0cac
plugin-loader: Increase log level for warning about plugin features that failed to load
...
Since we can't get rid of all unmet dependencies (at least not in every
possible plugin configuration) the message is more confusing than
helpful. In particular because a detailed warning about plugin features
that failed to load due to unmet dependencies is only logged on level 2.
2015-03-09 15:45:29 +01:00
Tobias Brunner
e5009fbb66
pkcs11: Convert RFC 3279 ECDSA signatures when verifying
...
References #873 .
2015-03-09 15:37:07 +01:00
Tobias Brunner
b258ed0192
pkcs11: Properly encode RFC 3279 ECDSA signatures
...
Fixes #873 .
2015-03-09 15:37:07 +01:00
Tobias Brunner
8c9a0b5fb5
pkcs11: Properly encode EC_POINTs created on a token
...
Some tokens might not fail when creating EC public keys in the incorrect
format, but they will later not be able to use them to verify signatures.
References #872 .
2015-03-09 15:37:01 +01:00