proposal: Add method to move a given DH group to the front

This way a responder (like strongSwan) selecting a proposal first and
then checking if the KE payload matches sees the peer's preferred group
first.
This commit is contained in:
Tobias Brunner
2018-02-09 10:20:05 +01:00
parent 97ad041e6e
commit d9c9b7b832
3 changed files with 101 additions and 12 deletions
+11 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2016 Tobias Brunner
* Copyright (C) 2009-2018 Tobias Brunner
* Copyright (C) 2006 Martin Willi
* HSR Hochschule fuer Technik Rapperswil
*
@@ -108,7 +108,16 @@ struct proposal_t {
* @param group group to check for
* @return TRUE if algorithm included
*/
bool (*has_dh_group) (proposal_t *this, diffie_hellman_group_t group);
bool (*has_dh_group)(proposal_t *this, diffie_hellman_group_t group);
/**
* Move the given DH group to the front of the list if it was contained in
* the proposal.
*
* @param group group to promote
* @return TRUE if algorithm included
*/
bool (*promote_dh_group)(proposal_t *this, diffie_hellman_group_t group);
/**
* Strip DH groups from proposal to use it without PFS.