| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
| |
We allow gaps in IVs, but ensure that an IV is never used more than once.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This allows us to work with deterministic values for testing purposes.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This was implicitly done by the seed length check before 58dda5d6, but we
now require an explicit check to avoid that unsupported use.
|
|
|
|
|
| |
While that use is uncommon in real-world use, nonetheless should HMAC set a
correct key and reset any underlying hasher.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
While such a change is not unproblematic, keeping status_t makes the API
inconsistent once we introduce return values for the public value operations.
|
| |
|
| |
|
| |
|
|
|
|
| |
Other algorithms are defined in private use range.
|
|
|
|
|
| |
The default is SHA512 since this hash function is also
used for the c_indices random oracle.
|
| |
|
|
|
|
|
|
|
|
|
| |
Before this fix it was possible to crash charon with an IKE_SA_INIT
message containing a KE payload with DH group MODP_CUSTOM(1025).
Defining MODP_CUSTOM outside of the two byte IKE DH identifier range
prevents it from getting negotiated.
Fixes CVE-2014-9221.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This allows using e.g. AES for PKCS#8 and PKCS#12 files.
Some legacy schemes defined in RFC 2898 are not supported (like RC2).
Fixes #740.
|
|
|
|
|
|
|
|
| |
The OID (1.3.6.1.4.1.3029.1.2) is technically not correct, the correct
one is (1.3.6.1.4.1.3029.1.1.2). Every other library or tool (like OpenSSL)
uses the incorrect one so we do the same.
References #740.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While it was always documented as boolean setting, the option is currently
handled as integer value, for which yes/no values do not work. Instead the
default of TRUE is used for a no value.
The option has been moved a lot during the last years, and in some locations
was handled as bool, in some as integer. In the latest codebase it
congruently used integer, which is actually not what is documented and used
in testing.
Fixes #781.
|
|
|
|
|
|
| |
The new get_byte() method returns a pseudo-random byte at a time.
Changed the get_bits() interface to the same interface as get_byte().
Updated the mgf1 unit-tests accordingly.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
To avoid any race conditions when multiple threads call and initialize
diffie_hellman_get_params(), explicitly examine the optimum DH exponent size
during library initialization.
Fixes #655.
|
|
|
|
|
| |
Others remain in the order in which they were added, grouped by
algorithm identifier and sorted by benchmarking speed, if provided.
|
|
|
|
|
| |
CLOCK_THREAD_CPUTIME_ID seems to be defined sometimes even if clock_gettime() is
missing.
|
|
|
|
|
| |
Include some more basic system headers in utils.h, so we can use that common
header on the different platforms.
|
|
|
|
|
| |
To allow enum.h to depend on utils.h definitions, avoid its direct inclusion.
Instead include utils.h, which includes enum.h as well.
|
|
|
|
|
|
|
|
|
| |
The salt, or often called implicit nonce, varies between AEAD algorithms and
their use in protocols. For IKE and ESP, GCM uses 4 bytes, while CCM uses
3 bytes. With TLS, however, AEAD mode uses 4 bytes for both GCM and CCM.
Our GCM backends currently support 4 bytes and CCM 3 bytes only. This is fine
until we go for CCM mode support in TLS, which requires 4 byte nonces.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
If a proposal string cannot be matched to a token using strcmp (e.g. if
you want to register a whole class of algorithms containing their ID,
like my_alg_2342), you can use the provided function to register a
parser that transforms the given string into a proposal token.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This makes it harder to attack a HA setup, even if the sequence numbers were
not fully in sync.
|