aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/keypairs_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-05 17:27:24 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-05 17:27:24 +0000
commit094529b9cd48a56f1cbd154bb626795ac865388e (patch)
tree7311e83271f17a6f3b6f9c327be183e00ab5231c /src/libcryptobox/keypairs_cache.c
parent40d7391a2a7a2568ddf5c9fb526a39616b75ecee (diff)
downloadrspamd-094529b9cd48a56f1cbd154bb626795ac865388e.tar.gz
rspamd-094529b9cd48a56f1cbd154bb626795ac865388e.zip
Implement keypairs creation
Diffstat (limited to 'src/libcryptobox/keypairs_cache.c')
-rw-r--r--src/libcryptobox/keypairs_cache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcryptobox/keypairs_cache.c b/src/libcryptobox/keypairs_cache.c
index 6e1d056e7..a259c2ac1 100644
--- a/src/libcryptobox/keypairs_cache.c
+++ b/src/libcryptobox/keypairs_cache.c
@@ -95,7 +95,11 @@ rspamd_keypair_cache_process (struct rspamd_keypair_cache *c,
if (new == NULL) {
new = g_slice_alloc0 (sizeof (*new));
- new->nm = g_slice_alloc (sizeof (*new->nm));
+
+ if (posix_memalign ((void **)&new->nm, 32, sizeof (*new->nm)) != 0) {
+ abort ();
+ }
+
REF_INIT_RETAIN (new->nm, rspamd_cryptobox_nm_dtor);
memcpy (new->pair, rk->id, rspamd_cryptobox_HASHBYTES);