Use message instead of attributes in hook
This commit is contained in:
committed by
Martin Willi
parent
b3b74e479b
commit
ed5fc4cafe
@@ -256,16 +256,12 @@ static void add_attribute(private_simaka_message_t *this,
|
||||
{
|
||||
attr_t *attr;
|
||||
|
||||
if (!charon->sim->attribute_hook(charon->sim, this->hdr->code,
|
||||
this->hdr->type, this->hdr->subtype, type, data))
|
||||
{
|
||||
attr = malloc(sizeof(attr_t) + data.len);
|
||||
attr->len = data.len;
|
||||
attr->type = type;
|
||||
memcpy(attr->data, data.ptr, data.len);
|
||||
attr = malloc(sizeof(attr_t) + data.len);
|
||||
attr->len = data.len;
|
||||
attr->type = type;
|
||||
memcpy(attr->data, data.ptr, data.len);
|
||||
|
||||
this->attributes->insert_last(this->attributes, attr);
|
||||
}
|
||||
this->attributes->insert_last(this->attributes, attr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -463,6 +459,9 @@ static bool parse_attributes(private_simaka_message_t *this, chunk_t in)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
charon->sim->message_hook(charon->sim, &this->public, TRUE, this->encrypted);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -604,6 +603,8 @@ static eap_payload_t* generate(private_simaka_message_t *this, chunk_t sigdata)
|
||||
u_int16_t len;
|
||||
signer_t *signer;
|
||||
|
||||
charon->sim->message_hook(charon->sim, &this->public, FALSE, TRUE);
|
||||
|
||||
out = chunk_create(out_buf, sizeof(out_buf));
|
||||
encr = chunk_create(encr_buf, sizeof(encr_buf));
|
||||
|
||||
@@ -814,6 +815,9 @@ static eap_payload_t* generate(private_simaka_message_t *this, chunk_t sigdata)
|
||||
data = chunk_cata("cc", out, sigdata);
|
||||
signer->get_signature(signer, data, mac.ptr);
|
||||
}
|
||||
|
||||
charon->sim->message_hook(charon->sim, &this->public, FALSE, FALSE);
|
||||
|
||||
return eap_payload_create_data(out);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
#include "simaka_crypto.h"
|
||||
|
||||
typedef struct simaka_message_t simaka_message_t;
|
||||
typedef enum simaka_attribute_t simaka_attribute_t;
|
||||
typedef enum simaka_subtype_t simaka_subtype_t;
|
||||
typedef enum simaka_notification_t simaka_notification_t;
|
||||
|
||||
Reference in New Issue
Block a user