proposal: Add method to check if two proposals match

Similar to select() but does not return a proposal and does not log
anything.
This commit is contained in:
Tobias Brunner
2018-06-28 18:46:41 +02:00
parent 90f5fe1ca9
commit f72aa13a29
3 changed files with 124 additions and 35 deletions
+11 -1
View File
@@ -34,7 +34,6 @@ typedef struct proposal_t proposal_t;
#include <crypto/crypters/crypter.h>
#include <crypto/signers/signer.h>
#include <crypto/diffie_hellman.h>
#include <selectors/traffic_selector.h>
/**
* Protocol ID of a proposal.
@@ -143,6 +142,17 @@ struct proposal_t {
proposal_t *(*select)(proposal_t *this, proposal_t *other,
bool other_remote, bool private);
/**
* Check if the given proposal matches this proposal.
*
* This is similar to select, but no resulting proposal is selected.
*
* @param other proposal to compare against
* @param private accepts algorithms allocated in a private range
* @return TRUE if the proposals match
*/
bool (*matches)(proposal_t *this, proposal_t *other, bool private);
/**
* Get the protocol ID of the proposal.
*