Invoke attribute/key hooks from libsimaka
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user