KE payload of ECP groups has X and Y coordinates

This commit is contained in:
Andreas Steffen
2009-05-24 18:06:49 +02:00
parent 7bb47ea4f3
commit 8585af7acb
3 changed files with 55 additions and 55 deletions
+52 -52
View File
@@ -19,106 +19,106 @@
#include "ike_alg.h"
struct dh_desc unset_group = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_NONE,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_NONE,
algo_next: NULL,
modulus_size: 0
ke_size: 0
};
struct dh_desc dh_desc_modp_1024 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_1024_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_1024_BIT,
algo_next: NULL,
modulus_size: 1024 / BITS_PER_BYTE
ke_size: 1024 / BITS_PER_BYTE
};
struct dh_desc dh_desc_modp_1536 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_1536_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_1536_BIT,
algo_next: NULL,
modulus_size: 1536 / BITS_PER_BYTE
ke_size: 1536 / BITS_PER_BYTE
};
struct dh_desc dh_desc_modp_2048 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_2048_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_2048_BIT,
algo_next: NULL,
modulus_size: 2048 / BITS_PER_BYTE
ke_size: 2048 / BITS_PER_BYTE
};
struct dh_desc dh_desc_modp_3072 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_3072_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_3072_BIT,
algo_next: NULL,
modulus_size: 3072 / BITS_PER_BYTE
ke_size: 3072 / BITS_PER_BYTE
};
struct dh_desc dh_desc_modp_4096 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_4096_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_4096_BIT,
algo_next: NULL,
modulus_size: 4096 / BITS_PER_BYTE
ke_size: 4096 / BITS_PER_BYTE
};
struct dh_desc dh_desc_modp_6144 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_6144_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_6144_BIT,
algo_next: NULL,
modulus_size: 6144 / BITS_PER_BYTE
ke_size: 6144 / BITS_PER_BYTE
};
struct dh_desc dh_desc_modp_8192 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_8192_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: MODP_8192_BIT,
algo_next: NULL,
modulus_size: 8192 / BITS_PER_BYTE
ke_size: 8192 / BITS_PER_BYTE
};
struct dh_desc dh_desc_ecp_256 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_256_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_256_BIT,
algo_next: NULL,
modulus_size: 256 / BITS_PER_BYTE
ke_size: 2*256 / BITS_PER_BYTE
};
struct dh_desc dh_desc_ecp_384 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_384_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_384_BIT,
algo_next: NULL,
modulus_size: 384 / BITS_PER_BYTE
ke_size: 2*384 / BITS_PER_BYTE
};
struct dh_desc dh_desc_ecp_521 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_521_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_521_BIT,
algo_next: NULL,
modulus_size: 528 / BITS_PER_BYTE
ke_size: 2*528 / BITS_PER_BYTE
};
struct dh_desc dh_desc_ecp_192 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_192_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_192_BIT,
algo_next: NULL,
modulus_size: 192 / BITS_PER_BYTE
ke_size: 2*192 / BITS_PER_BYTE
};
struct dh_desc dh_desc_ecp_224 = {
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_224_BIT,
algo_next: NULL,
algo_type: IKE_ALG_DH_GROUP,
algo_id: ECP_224_BIT,
algo_next: NULL,
modulus_size: 224 / BITS_PER_BYTE
ke_size: 2*224 / BITS_PER_BYTE
};
+1 -1
View File
@@ -80,7 +80,7 @@ struct dh_desc {
u_int16_t algo_id;
struct ike_alg *algo_next;
size_t modulus_size;
size_t ke_size;
};
#define IKE_ALG_ENCRYPT 0
+2 -2
View File
@@ -167,10 +167,10 @@ static notification_t accept_KE(chunk_t *dest, const char *val_name,
const struct dh_desc *gr,
pb_stream *pbs)
{
if (pbs_left(pbs) != gr->modulus_size)
if (pbs_left(pbs) != gr->ke_size)
{
loglog(RC_LOG_SERIOUS, "KE has %u byte DH public value; %u required"
, (unsigned) pbs_left(pbs), gr->modulus_size);
, (unsigned) pbs_left(pbs), gr->ke_size);
/* XXX Could send notification back */
return INVALID_KEY_INFORMATION;
}