use the Diffie-Hellman functionality of libstrongswan

This commit is contained in:
Andreas Steffen
2009-05-24 11:26:00 +02:00
parent 770b408902
commit 52ccea657b
12 changed files with 210 additions and 253 deletions
+7 -10
View File
@@ -31,9 +31,10 @@
#include <utils.h>
#include <utils/lexparser.h>
#include <crypto/diffie_hellman.h>
#include <crypto/transform.h>
#include <crypto/proposal/proposal_keywords.h>
#include <crypto/proposal/proposal_keywords.h>
#include "alg_info.h"
#include "constants.h"
@@ -215,8 +216,8 @@ static void __alg_info_ike_add (struct alg_info_ike *alg_info, int ealg_id,
*/
static int default_ike_groups[] = {
OAKLEY_GROUP_MODP1536,
OAKLEY_GROUP_MODP1024
MODP_1536_BIT,
MODP_1024_BIT
};
/*
@@ -316,10 +317,6 @@ static status_t alg_info_add(chunk_t alg, unsigned protoid,
{
return FAILED;
}
if (token->algorithm > OAKLEY_GROUP_MODP8192)
{
return FAILED;
}
*dh_group = token->algorithm;
}
break;
@@ -636,11 +633,11 @@ int alg_info_snprint_ike(char *buf, int buflen, struct alg_info_ike *alg_info)
while (cnt--)
{
struct encrypt_desc *enc_desc = ike_alg_get_encrypter(ike_info->ike_ealg);
struct encrypt_desc *enc_desc = ike_alg_get_crypter(ike_info->ike_ealg);
struct hash_desc *hash_desc = ike_alg_get_hasher(ike_info->ike_halg);
struct dh_desc *dh_desc = ike_alg_get_dh_group(ike_info->ike_modp);
if (enc_desc != NULL && hash_desc != NULL
&& lookup_group(ike_info->ike_modp))
if (enc_desc && hash_desc && dh_desc)
{
u_int eklen = (ike_info->ike_eklen)