Add configure option to disable testing key exchange methods

If this is used, the functionality to set a private key/value/seed for
key exchange methods is removed (including from the interface to avoid
accidentally forgetting to wrap implementations and uses of set_seed()).

The set_seed() method is assigned outside the INIT() macro to avoid
potentially undefined behavior (preprocessing directives in macro
arguments).

The test done by the crypto tester is a simple functionality test.
This commit is contained in:
Tobias Brunner
2025-04-10 08:31:09 +02:00
parent a7c285bc50
commit 6cbd93838b
19 changed files with 250 additions and 50 deletions
+4
View File
@@ -153,6 +153,8 @@ struct key_exchange_t {
bool (*get_public_key)(key_exchange_t *this, chunk_t *value)
__attribute__((warn_unused_result));
#ifdef TESTABLE_KE
/**
* Set a seed used for the derivation of private key material.
*
@@ -167,6 +169,8 @@ struct key_exchange_t {
bool (*set_seed)(key_exchange_t *this, chunk_t value, drbg_t *drbg)
__attribute__((warn_unused_result));
#endif /* TESTABLE_KE */
/**
* Get the key exchange method used.
*