From: Tobias Brunner Date: Thu, 5 Sep 2019 16:02:47 +0000 (+0200) Subject: proposal: Remove unused strip_dh() method X-Git-Tag: 5.8.2dr2~19^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec93acff03bb72c5ad137797e902d65aecfbde55;p=thirdparty%2Fstrongswan.git proposal: Remove unused strip_dh() method --- diff --git a/src/libstrongswan/crypto/proposal/proposal.c b/src/libstrongswan/crypto/proposal/proposal.c index 3b05b3b530..560303f783 100644 --- a/src/libstrongswan/crypto/proposal/proposal.c +++ b/src/libstrongswan/crypto/proposal/proposal.c @@ -302,38 +302,6 @@ METHOD(proposal_t, promote_dh_group, bool, return found; } -METHOD(proposal_t, strip_dh, void, - private_proposal_t *this, diffie_hellman_group_t keep) -{ - enumerator_t *enumerator; - entry_t *entry; - bool found = FALSE; - - enumerator = array_create_enumerator(this->transforms); - while (enumerator->enumerate(enumerator, &entry)) - { - if (entry->type == DIFFIE_HELLMAN_GROUP) - { - if (entry->alg != keep) - { - array_remove_at(this->transforms, enumerator); - } - else - { - found = TRUE; - } - } - } - enumerator->destroy(enumerator); - array_compress(this->transforms); - - if (keep == MODP_NONE || !found) - { - remove_type(this, DIFFIE_HELLMAN_GROUP); - array_compress(this->types); - } -} - /** * Select a matching proposal from this and other. */ @@ -961,7 +929,6 @@ proposal_t *proposal_create(protocol_id_t protocol, u_int number) .get_algorithm = _get_algorithm, .has_dh_group = _has_dh_group, .promote_dh_group = _promote_dh_group, - .strip_dh = _strip_dh, .select = _select_proposal, .matches = _matches, .get_protocol = _get_protocol, diff --git a/src/libstrongswan/crypto/proposal/proposal.h b/src/libstrongswan/crypto/proposal/proposal.h index f05669e1c7..f2fc4cd6cb 100644 --- a/src/libstrongswan/crypto/proposal/proposal.h +++ b/src/libstrongswan/crypto/proposal/proposal.h @@ -131,13 +131,6 @@ struct proposal_t { */ bool (*promote_dh_group)(proposal_t *this, diffie_hellman_group_t group); - /** - * Strip DH groups from proposal to use it without PFS. - * - * @param keep group to keep (MODP_NONE to remove all) - */ - void (*strip_dh)(proposal_t *this, diffie_hellman_group_t keep); - /** * Compare two proposal, and select a matching subset. *