aesni: Align all class instances to 16 byte boundaries
While the required members are aligned in the struct as required, on 32-bit platforms the allocator aligns the structures itself to 8 bytes only. This results in non-aligned struct members, and invalid memory accesses.
This commit is contained in:
@@ -623,7 +623,7 @@ METHOD(crypter_t, destroy, void,
|
||||
private_aesni_ctr_t *this)
|
||||
{
|
||||
DESTROY_IF(this->key);
|
||||
free(this);
|
||||
free_align(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -650,7 +650,7 @@ aesni_ctr_t *aesni_ctr_create(encryption_algorithm_t algo, size_t key_size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INIT(this,
|
||||
INIT_ALIGN(this, sizeof(__m128i),
|
||||
.public = {
|
||||
.crypter = {
|
||||
.encrypt = _crypt,
|
||||
|
||||
Reference in New Issue
Block a user