key-exchange: Add helper to concatenate shared secrets of several key exchanges

This commit is contained in:
Tobias Brunner
2024-08-07 16:20:18 +02:00
parent ec0ec55070
commit c36eaf42da
2 changed files with 55 additions and 2 deletions
+14 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2019 Tobias Brunner
* Copyright (C) 2010-2020 Tobias Brunner
* Copyright (C) 2005-2007 Martin Willi
* Copyright (C) 2005 Jan Hutter
*
@@ -29,6 +29,7 @@ typedef struct key_exchange_t key_exchange_t;
typedef struct diffie_hellman_params_t diffie_hellman_params_t;
#include <library.h>
#include <collections/array.h>
/**
* Key exchange method.
@@ -209,4 +210,16 @@ bool key_exchange_is_ecdh(key_exchange_method_t ke);
*/
bool key_exchange_verify_pubkey(key_exchange_method_t ke, chunk_t value);
/**
* Return the first shared secret plus the concatenated additional shared
* secrets of all the key exchange methods in the given array.
*
* @param kes array of key_exchange_t*
* @param secret first shared secret (allocated)
* @param add_secret concatenated additional shared secrets (allocated)
* @return TRUE on success
*/
bool key_exchange_concat_secrets(array_t *kes, chunk_t *secret,
chunk_t *add_secret);
#endif /** KEY_EXCHANGE_H_ @}*/