tls-crypto: Move AEAD ownership to the protection layer
This separates key derivation from key switching.
This commit is contained in:
committed by
Tobias Brunner
parent
534a781646
commit
6b23543abd
@@ -123,11 +123,13 @@ METHOD(tls_protection_t, set_cipher, void,
|
||||
{
|
||||
if (inbound)
|
||||
{
|
||||
DESTROY_IF(this->aead_in);
|
||||
this->aead_in = aead;
|
||||
this->seq_in = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DESTROY_IF(this->aead_out);
|
||||
this->aead_out = aead;
|
||||
this->seq_out = 0;
|
||||
}
|
||||
@@ -142,6 +144,8 @@ METHOD(tls_protection_t, set_version, void,
|
||||
METHOD(tls_protection_t, destroy, void,
|
||||
private_tls_protection_t *this)
|
||||
{
|
||||
DESTROY_IF(this->aead_in);
|
||||
DESTROY_IF(this->aead_out);
|
||||
free(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user