Invoke attribute/key hooks from libsimaka

This commit is contained in:
Martin Willi
2009-11-30 09:27:34 +01:00
parent 8434c88b5e
commit 5a91fd4536
2 changed files with 13 additions and 5 deletions
+4
View File
@@ -124,6 +124,8 @@ static chunk_t derive_keys_full(private_simaka_crypto_t *this,
this->signer->set_key(this->signer, k_auth);
this->crypter->set_key(this->crypter, k_encr);
charon->sim->key_hook(charon->sim, k_encr, k_auth);
this->derived = TRUE;
return chunk_clone(msk);
}
@@ -150,6 +152,8 @@ static void derive_keys_reauth(private_simaka_crypto_t *this, chunk_t mk)
this->signer->set_key(this->signer, k_auth);
this->crypter->set_key(this->crypter, k_encr);
charon->sim->key_hook(charon->sim, k_encr, k_auth);
this->derived = TRUE;
}
+9 -5
View File
@@ -256,12 +256,16 @@ static void add_attribute(private_simaka_message_t *this,
{
attr_t *attr;
attr = malloc(sizeof(attr_t) + data.len);
attr->len = data.len;
attr->type = type;
memcpy(attr->data, data.ptr, data.len);
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);
this->attributes->insert_last(this->attributes, attr);
this->attributes->insert_last(this->attributes, attr);
}
}
/**